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
A unit test for JUnit
public void test03() throws RefactoringException { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("height"); rfr.setNewName("changed"); rfr.run(); // Check things out File check = new File(this.check + "\\ut2\\step13"); FileCompare.assertEquals("RenameFieldTest is incorrect", new File(check, "RenameFieldTest.java"), new File(dest, "RenameFieldTest.java")); FileCompare.assertEquals("UsesFieldTest is incorrect", new File(check, "UsesFieldTest.java"), new File(dest, "UsesFieldTest.java")); FileCompare.assertEquals("InheritFieldTest is incorrect", new File(check, "InheritFieldTest.java"), new File(dest, "InheritFieldTest.java")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic void test(){\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Override\n public void setUp() {\n }", "@Test\n public void testAddACopy() {\n }", "@Test\n public void testCarregarTrimestre() {\n }", "@Test\n public void testCarregarUex() {\n }", "public void testGetBasedata() {\n }", "@Test\n\tvoid test() {\n\t\t\n\t}", "@Test\n\tpublic void testMain() {\n\t}", "@Test\n public void testQuickMapList() {\n//TODO: Test goes here... \n }", "@Override\n public void setUp() throws Exception {}", "@Test\n public void testQueryList(){\n }", "@Test\n public void accuseSuccesTest() throws Exception {\n }", "@Test\n public void testInsertData() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testCreate() {\n\n }", "@Override\n public void runTest() {\n }", "@Test\n public void testQuery(){\n }", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "@Test\n public void searchesTest() {\n // TODO: test searches\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd(){\n }", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "public void testAddEntry(){\n }", "public void test() {\n\tassertTrue(true);\n\t}", "private void test() {\n\n\t}", "protected void setUp() {\n\n }", "public StrandUnitTest()\n {\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Test\n public void testCarregarAno() {\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Test\n public void testingTheTwoPlane2016Order() {\n }", "@Before public void setUp() { }", "@Test\npublic void testFindDtoListBySql() throws Exception { \n//TODO: Test goes here... \n}", "@Test\n public void testSuccess() {\n }", "@Test\r\n public void testRentOut() {\r\n }", "@Test\n public void testStuff() {\n\n assertTrue(true);\n }", "@Before\n\t public void setUp() {\n\t }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Test\n public void test() {\n }", "public void testDummy() {\n }", "protected void setUp() throws Exception {\n \n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "public void testDummy() {\n }", "@Before\n public void setUp () {\n }", "@Test\n public void request() throws Exception {\n\n\n }", "public void testMock(){\n\t}", "protected void setUp() throws Exception {\n }", "@Test\r\n\tpublic void acreditar() {\r\n\t}", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void test(){\n }", "@Test\n public void test(){\n }", "@Test\n\tpublic void getTest() {\n\t}", "@Test\n public void testWalkForPduTarget() throws Exception {\n//TODO: Test goes here... \n }", "@Before\n\tpublic void setUp() {\n\t}", "@Test\n\tvoid searchTest() {\n\t}", "@Test\n public void testPuery(){\n }", "@Test\n public void dummyTest() {\n }", "@Test\n public void testBeer() {\n // TODO: test Beer\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void test() {\n }", "@Test\n public void test() {\n }", "Testcase createTestcase();", "@Test\n public void test(){\n\n\n }", "@Test\n public void testDAM30203001() {\n testDAM30102001();\n }" ]
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878", "0.70721215", "0.70629096", "0.70581967", "0.70570946", "0.70487064", "0.70487064", "0.7042338", "0.7036349", "0.7036349", "0.7030297", "0.70292807", "0.70269907", "0.70218384", "0.70153826", "0.70087796", "0.7000109", "0.6999088", "0.69932306", "0.69927245", "0.69880813", "0.6987441", "0.6981792", "0.6975991", "0.6962431", "0.6961256", "0.69545656", "0.69498664", "0.6946821", "0.6946613", "0.69436896", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.6928297", "0.69265693", "0.692401", "0.6917125", "0.6913771", "0.69128734", "0.69098765", "0.69098765", "0.69098765", "0.69098765", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.68955183", "0.68879676", "0.68879676", "0.68870705", "0.68859893", "0.68812704", "0.6872602", "0.6871005", "0.68704134", "0.6868547", "0.6866817", "0.6866817", "0.6864914", "0.6864914", "0.68599325", "0.6855216", "0.68546236" ]
0.0
-1
A unit test for JUnit
public void test04() throws RefactoringException { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("CODE_ON"); rfr.setNewName("changed"); rfr.run(); // Check things out File check = new File(this.check + "\\ut2\\step14"); FileCompare.assertEquals("RenameFieldTest is incorrect", new File(check, "RenameFieldTest.java"), new File(dest, "RenameFieldTest.java")); FileCompare.assertEquals("UsesFieldTest is incorrect", new File(check, "UsesFieldTest.java"), new File(dest, "UsesFieldTest.java")); FileCompare.assertEquals("InheritFieldTest is incorrect", new File(check, "InheritFieldTest.java"), new File(dest, "InheritFieldTest.java")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic void test(){\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Override\n public void setUp() {\n }", "@Test\n public void testAddACopy() {\n }", "@Test\n public void testCarregarTrimestre() {\n }", "@Test\n public void testCarregarUex() {\n }", "public void testGetBasedata() {\n }", "@Test\n\tvoid test() {\n\t\t\n\t}", "@Test\n\tpublic void testMain() {\n\t}", "@Test\n public void testQuickMapList() {\n//TODO: Test goes here... \n }", "@Override\n public void setUp() throws Exception {}", "@Test\n public void testQueryList(){\n }", "@Test\n public void accuseSuccesTest() throws Exception {\n }", "@Test\n public void testInsertData() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testCreate() {\n\n }", "@Override\n public void runTest() {\n }", "@Test\n public void testQuery(){\n }", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "@Test\n public void searchesTest() {\n // TODO: test searches\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd(){\n }", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "public void testAddEntry(){\n }", "public void test() {\n\tassertTrue(true);\n\t}", "private void test() {\n\n\t}", "protected void setUp() {\n\n }", "public StrandUnitTest()\n {\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Test\n public void testCarregarAno() {\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Test\n public void testingTheTwoPlane2016Order() {\n }", "@Before public void setUp() { }", "@Test\npublic void testFindDtoListBySql() throws Exception { \n//TODO: Test goes here... \n}", "@Test\n public void testSuccess() {\n }", "@Test\r\n public void testRentOut() {\r\n }", "@Test\n public void testStuff() {\n\n assertTrue(true);\n }", "@Before\n\t public void setUp() {\n\t }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Test\n public void test() {\n }", "public void testDummy() {\n }", "protected void setUp() throws Exception {\n \n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "public void testDummy() {\n }", "@Before\n public void setUp () {\n }", "@Test\n public void request() throws Exception {\n\n\n }", "public void testMock(){\n\t}", "protected void setUp() throws Exception {\n }", "@Test\r\n\tpublic void acreditar() {\r\n\t}", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void test(){\n }", "@Test\n public void test(){\n }", "@Test\n\tpublic void getTest() {\n\t}", "@Test\n public void testWalkForPduTarget() throws Exception {\n//TODO: Test goes here... \n }", "@Before\n\tpublic void setUp() {\n\t}", "@Test\n\tvoid searchTest() {\n\t}", "@Test\n public void testPuery(){\n }", "@Test\n public void dummyTest() {\n }", "@Test\n public void testBeer() {\n // TODO: test Beer\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void test() {\n }", "@Test\n public void test() {\n }", "Testcase createTestcase();", "@Test\n public void test(){\n\n\n }", "@Test\n public void testDAM30203001() {\n testDAM30102001();\n }" ]
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878", "0.70721215", "0.70629096", "0.70581967", "0.70570946", "0.70487064", "0.70487064", "0.7042338", "0.7036349", "0.7036349", "0.7030297", "0.70292807", "0.70269907", "0.70218384", "0.70153826", "0.70087796", "0.7000109", "0.6999088", "0.69932306", "0.69927245", "0.69880813", "0.6987441", "0.6981792", "0.6975991", "0.6962431", "0.6961256", "0.69545656", "0.69498664", "0.6946821", "0.6946613", "0.69436896", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.6928297", "0.69265693", "0.692401", "0.6917125", "0.6913771", "0.69128734", "0.69098765", "0.69098765", "0.69098765", "0.69098765", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.68955183", "0.68879676", "0.68879676", "0.68870705", "0.68859893", "0.68812704", "0.6872602", "0.6871005", "0.68704134", "0.6868547", "0.6866817", "0.6866817", "0.6864914", "0.6864914", "0.68599325", "0.6855216", "0.68546236" ]
0.0
-1
A unit test for JUnit
public void test05() { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("crazy"); rfr.setNewName("changed"); boolean exceptionThrown = false; try { rfr.run(); } catch (RefactoringException re) { exceptionThrown = true; assertEquals("Incorrect exception", "No field named crazy is contained in RenameFieldTest", re.getMessage()); } assertTrue("No exception thrown", exceptionThrown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic void test(){\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Override\n public void setUp() {\n }", "@Test\n public void testAddACopy() {\n }", "@Test\n public void testCarregarTrimestre() {\n }", "@Test\n public void testCarregarUex() {\n }", "public void testGetBasedata() {\n }", "@Test\n\tvoid test() {\n\t\t\n\t}", "@Test\n\tpublic void testMain() {\n\t}", "@Test\n public void testQuickMapList() {\n//TODO: Test goes here... \n }", "@Override\n public void setUp() throws Exception {}", "@Test\n public void testQueryList(){\n }", "@Test\n public void accuseSuccesTest() throws Exception {\n }", "@Test\n public void testInsertData() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testCreate() {\n\n }", "@Override\n public void runTest() {\n }", "@Test\n public void testQuery(){\n }", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "@Test\n public void searchesTest() {\n // TODO: test searches\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd(){\n }", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "public void testAddEntry(){\n }", "public void test() {\n\tassertTrue(true);\n\t}", "private void test() {\n\n\t}", "protected void setUp() {\n\n }", "public StrandUnitTest()\n {\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Test\n public void testCarregarAno() {\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Test\n public void testingTheTwoPlane2016Order() {\n }", "@Before public void setUp() { }", "@Test\npublic void testFindDtoListBySql() throws Exception { \n//TODO: Test goes here... \n}", "@Test\n public void testSuccess() {\n }", "@Test\r\n public void testRentOut() {\r\n }", "@Test\n public void testStuff() {\n\n assertTrue(true);\n }", "@Before\n\t public void setUp() {\n\t }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Test\n public void test() {\n }", "public void testDummy() {\n }", "protected void setUp() throws Exception {\n \n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "public void testDummy() {\n }", "@Before\n public void setUp () {\n }", "@Test\n public void request() throws Exception {\n\n\n }", "public void testMock(){\n\t}", "protected void setUp() throws Exception {\n }", "@Test\r\n\tpublic void acreditar() {\r\n\t}", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void test(){\n }", "@Test\n public void test(){\n }", "@Test\n\tpublic void getTest() {\n\t}", "@Test\n public void testWalkForPduTarget() throws Exception {\n//TODO: Test goes here... \n }", "@Before\n\tpublic void setUp() {\n\t}", "@Test\n\tvoid searchTest() {\n\t}", "@Test\n public void testPuery(){\n }", "@Test\n public void dummyTest() {\n }", "@Test\n public void testBeer() {\n // TODO: test Beer\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void test() {\n }", "@Test\n public void test() {\n }", "Testcase createTestcase();", "@Test\n public void test(){\n\n\n }", "@Test\n public void testDAM30203001() {\n testDAM30102001();\n }" ]
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878", "0.70721215", "0.70629096", "0.70581967", "0.70570946", "0.70487064", "0.70487064", "0.7042338", "0.7036349", "0.7036349", "0.7030297", "0.70292807", "0.70269907", "0.70218384", "0.70153826", "0.70087796", "0.7000109", "0.6999088", "0.69932306", "0.69927245", "0.69880813", "0.6987441", "0.6981792", "0.6975991", "0.6962431", "0.6961256", "0.69545656", "0.69498664", "0.6946821", "0.6946613", "0.69436896", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.6928297", "0.69265693", "0.692401", "0.6917125", "0.6913771", "0.69128734", "0.69098765", "0.69098765", "0.69098765", "0.69098765", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.68955183", "0.68879676", "0.68879676", "0.68870705", "0.68859893", "0.68812704", "0.6872602", "0.6871005", "0.68704134", "0.6868547", "0.6866817", "0.6866817", "0.6864914", "0.6864914", "0.68599325", "0.6855216", "0.68546236" ]
0.0
-1
A unit test for JUnit
public void test06() { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("simple"); rfr.setNewName("code"); boolean exceptionThrown = false; try { rfr.run(); } catch (RefactoringException re) { exceptionThrown = true; assertEquals("Incorrect exception", "A field named code already exists in class RenameFieldTest", re.getMessage()); } assertTrue("No exception thrown", exceptionThrown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic void test(){\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Override\n public void setUp() {\n }", "@Test\n public void testAddACopy() {\n }", "@Test\n public void testCarregarTrimestre() {\n }", "@Test\n public void testCarregarUex() {\n }", "public void testGetBasedata() {\n }", "@Test\n\tvoid test() {\n\t\t\n\t}", "@Test\n\tpublic void testMain() {\n\t}", "@Test\n public void testQuickMapList() {\n//TODO: Test goes here... \n }", "@Override\n public void setUp() throws Exception {}", "@Test\n public void testQueryList(){\n }", "@Test\n public void accuseSuccesTest() throws Exception {\n }", "@Test\n public void testInsertData() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testCreate() {\n\n }", "@Override\n public void runTest() {\n }", "@Test\n public void testQuery(){\n }", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "@Test\n public void searchesTest() {\n // TODO: test searches\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd(){\n }", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "public void testAddEntry(){\n }", "public void test() {\n\tassertTrue(true);\n\t}", "private void test() {\n\n\t}", "protected void setUp() {\n\n }", "public StrandUnitTest()\n {\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Test\n public void testCarregarAno() {\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Test\n public void testingTheTwoPlane2016Order() {\n }", "@Before public void setUp() { }", "@Test\npublic void testFindDtoListBySql() throws Exception { \n//TODO: Test goes here... \n}", "@Test\n public void testSuccess() {\n }", "@Test\r\n public void testRentOut() {\r\n }", "@Test\n public void testStuff() {\n\n assertTrue(true);\n }", "@Before\n\t public void setUp() {\n\t }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Test\n public void test() {\n }", "public void testDummy() {\n }", "protected void setUp() throws Exception {\n \n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "public void testDummy() {\n }", "@Before\n public void setUp () {\n }", "@Test\n public void request() throws Exception {\n\n\n }", "public void testMock(){\n\t}", "protected void setUp() throws Exception {\n }", "@Test\r\n\tpublic void acreditar() {\r\n\t}", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void test(){\n }", "@Test\n public void test(){\n }", "@Test\n\tpublic void getTest() {\n\t}", "@Test\n public void testWalkForPduTarget() throws Exception {\n//TODO: Test goes here... \n }", "@Before\n\tpublic void setUp() {\n\t}", "@Test\n\tvoid searchTest() {\n\t}", "@Test\n public void testPuery(){\n }", "@Test\n public void dummyTest() {\n }", "@Test\n public void testBeer() {\n // TODO: test Beer\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void test() {\n }", "@Test\n public void test() {\n }", "Testcase createTestcase();", "@Test\n public void test(){\n\n\n }", "@Test\n public void testDAM30203001() {\n testDAM30102001();\n }" ]
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878", "0.70721215", "0.70629096", "0.70581967", "0.70570946", "0.70487064", "0.70487064", "0.7042338", "0.7036349", "0.7036349", "0.7030297", "0.70292807", "0.70269907", "0.70218384", "0.70153826", "0.70087796", "0.7000109", "0.6999088", "0.69932306", "0.69927245", "0.69880813", "0.6987441", "0.6981792", "0.6975991", "0.6962431", "0.6961256", "0.69545656", "0.69498664", "0.6946821", "0.6946613", "0.69436896", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.6928297", "0.69265693", "0.692401", "0.6917125", "0.6913771", "0.69128734", "0.69098765", "0.69098765", "0.69098765", "0.69098765", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.68955183", "0.68879676", "0.68879676", "0.68870705", "0.68859893", "0.68812704", "0.6872602", "0.6871005", "0.68704134", "0.6868547", "0.6866817", "0.6866817", "0.6864914", "0.6864914", "0.68599325", "0.6855216", "0.68546236" ]
0.0
-1
A unit test for JUnit
public void test07() throws RefactoringException { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("", "XDateChooser"); rfr.setField("_maxDate"); rfr.setNewName("_maximumDate"); rfr.run(); // Check things out File check = new File(this.check + "\\ut2\\step15"); FileCompare.assertEquals("XDateChooser is incorrect", new File(check, "XDateChooser.java"), new File(root + "\\XDateChooser.java")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic void test(){\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Override\n public void setUp() {\n }", "@Test\n public void testAddACopy() {\n }", "@Test\n public void testCarregarTrimestre() {\n }", "@Test\n public void testCarregarUex() {\n }", "public void testGetBasedata() {\n }", "@Test\n\tvoid test() {\n\t\t\n\t}", "@Test\n\tpublic void testMain() {\n\t}", "@Test\n public void testQuickMapList() {\n//TODO: Test goes here... \n }", "@Override\n public void setUp() throws Exception {}", "@Test\n public void testQueryList(){\n }", "@Test\n public void accuseSuccesTest() throws Exception {\n }", "@Test\n public void testInsertData() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testCreate() {\n\n }", "@Override\n public void runTest() {\n }", "@Test\n public void testQuery(){\n }", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "@Test\n public void searchesTest() {\n // TODO: test searches\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd(){\n }", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "public void testAddEntry(){\n }", "public void test() {\n\tassertTrue(true);\n\t}", "private void test() {\n\n\t}", "protected void setUp() {\n\n }", "public StrandUnitTest()\n {\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Test\n public void testCarregarAno() {\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Test\n public void testingTheTwoPlane2016Order() {\n }", "@Before public void setUp() { }", "@Test\npublic void testFindDtoListBySql() throws Exception { \n//TODO: Test goes here... \n}", "@Test\n public void testSuccess() {\n }", "@Test\r\n public void testRentOut() {\r\n }", "@Test\n public void testStuff() {\n\n assertTrue(true);\n }", "@Before\n\t public void setUp() {\n\t }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Test\n public void test() {\n }", "public void testDummy() {\n }", "protected void setUp() throws Exception {\n \n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "public void testDummy() {\n }", "@Before\n public void setUp () {\n }", "@Test\n public void request() throws Exception {\n\n\n }", "public void testMock(){\n\t}", "protected void setUp() throws Exception {\n }", "@Test\r\n\tpublic void acreditar() {\r\n\t}", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void test(){\n }", "@Test\n public void test(){\n }", "@Test\n\tpublic void getTest() {\n\t}", "@Test\n public void testWalkForPduTarget() throws Exception {\n//TODO: Test goes here... \n }", "@Before\n\tpublic void setUp() {\n\t}", "@Test\n\tvoid searchTest() {\n\t}", "@Test\n public void testPuery(){\n }", "@Test\n public void dummyTest() {\n }", "@Test\n public void testBeer() {\n // TODO: test Beer\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void test() {\n }", "@Test\n public void test() {\n }", "Testcase createTestcase();", "@Test\n public void test(){\n\n\n }", "@Test\n public void testDAM30203001() {\n testDAM30102001();\n }" ]
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878", "0.70721215", "0.70629096", "0.70581967", "0.70570946", "0.70487064", "0.70487064", "0.7042338", "0.7036349", "0.7036349", "0.7030297", "0.70292807", "0.70269907", "0.70218384", "0.70153826", "0.70087796", "0.7000109", "0.6999088", "0.69932306", "0.69927245", "0.69880813", "0.6987441", "0.6981792", "0.6975991", "0.6962431", "0.6961256", "0.69545656", "0.69498664", "0.6946821", "0.6946613", "0.69436896", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.6928297", "0.69265693", "0.692401", "0.6917125", "0.6913771", "0.69128734", "0.69098765", "0.69098765", "0.69098765", "0.69098765", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.68955183", "0.68879676", "0.68879676", "0.68870705", "0.68859893", "0.68812704", "0.6872602", "0.6871005", "0.68704134", "0.6868547", "0.6866817", "0.6866817", "0.6864914", "0.6864914", "0.68599325", "0.6855216", "0.68546236" ]
0.0
-1
A unit test for JUnit
public void test08() throws RefactoringException { RenameFieldRefactoring rfr = new RenameFieldRefactoring(); rfr.setClass("field", "RenameFieldTest"); rfr.setField("childObject"); rfr.setNewName("myChild"); rfr.run(); // Check things out File check = new File(this.check + "\\ut2\\step16"); FileCompare.assertEquals("RenameFieldTest is incorrect", new File(check, "RenameFieldTest.java"), new File(dest, "RenameFieldTest.java")); FileCompare.assertEquals("UsesFieldTest is incorrect", new File(check, "UsesFieldTest.java"), new File(dest, "UsesFieldTest.java")); FileCompare.assertEquals("InheritFieldTest is incorrect", new File(check, "InheritFieldTest.java"), new File(dest, "InheritFieldTest.java")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void testDumbJUnit() {\n }", "@Test\n\tpublic void test(){\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Override\n public void setUp() {\n }", "@Test\n public void testAddACopy() {\n }", "@Test\n public void testCarregarTrimestre() {\n }", "@Test\n public void testCarregarUex() {\n }", "public void testGetBasedata() {\n }", "@Test\n\tvoid test() {\n\t\t\n\t}", "@Test\n\tpublic void testMain() {\n\t}", "@Test\n public void testQuickMapList() {\n//TODO: Test goes here... \n }", "@Override\n public void setUp() throws Exception {}", "@Test\n public void testQueryList(){\n }", "@Test\n public void accuseSuccesTest() throws Exception {\n }", "@Test\n public void testInsertData() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testCreate() {\n\n }", "@Override\n public void runTest() {\n }", "@Test\n public void testQuery(){\n }", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "@Test\n public void searchesTest() {\n // TODO: test searches\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd() {\n }", "@Test\n public void testAdd(){\n }", "@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }", "public void testAddEntry(){\n }", "public void test() {\n\tassertTrue(true);\n\t}", "private void test() {\n\n\t}", "protected void setUp() {\n\n }", "public StrandUnitTest()\n {\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Test\n public void testCarregarAno() {\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Test\n public void testingTheTwoPlane2016Order() {\n }", "@Before public void setUp() { }", "@Test\npublic void testFindDtoListBySql() throws Exception { \n//TODO: Test goes here... \n}", "@Test\n public void testSuccess() {\n }", "@Test\r\n public void testRentOut() {\r\n }", "@Test\n public void testStuff() {\n\n assertTrue(true);\n }", "@Before\n\t public void setUp() {\n\t }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Test\n public void test() {\n }", "public void testDummy() {\n }", "protected void setUp() throws Exception {\n \n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "public void testDummy() {\n }", "@Before\n public void setUp () {\n }", "@Test\n public void request() throws Exception {\n\n\n }", "public void testMock(){\n\t}", "protected void setUp() throws Exception {\n }", "@Test\r\n\tpublic void acreditar() {\r\n\t}", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Test\n\tpublic void testTotalPuzzleGenerated() {\n\t}", "@Test\n public void test(){\n }", "@Test\n public void test(){\n }", "@Test\n\tpublic void getTest() {\n\t}", "@Test\n public void testWalkForPduTarget() throws Exception {\n//TODO: Test goes here... \n }", "@Before\n\tpublic void setUp() {\n\t}", "@Test\n\tvoid searchTest() {\n\t}", "@Test\n public void testPuery(){\n }", "@Test\n public void dummyTest() {\n }", "@Test\n public void testBeer() {\n // TODO: test Beer\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void sourceTest() {\n // TODO: test source\n }", "@Test\n public void test() {\n }", "@Test\n public void test() {\n }", "Testcase createTestcase();", "@Test\n public void test(){\n\n\n }", "@Test\n public void testDAM30203001() {\n testDAM30102001();\n }" ]
[ "0.75710434", "0.74449277", "0.73627865", "0.731134", "0.7304504", "0.7222832", "0.7215483", "0.72147363", "0.72147363", "0.7214447", "0.72114563", "0.72114515", "0.7207631", "0.7183441", "0.71810764", "0.716787", "0.7122575", "0.71210265", "0.709407", "0.7086396", "0.7084878", "0.70721215", "0.70629096", "0.70581967", "0.70570946", "0.70487064", "0.70487064", "0.7042338", "0.7036349", "0.7036349", "0.7030297", "0.70292807", "0.70269907", "0.70218384", "0.70153826", "0.70087796", "0.7000109", "0.6999088", "0.69932306", "0.69927245", "0.69880813", "0.6987441", "0.6981792", "0.6975991", "0.6962431", "0.6961256", "0.69545656", "0.69498664", "0.6946821", "0.6946613", "0.69436896", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.69366735", "0.6928297", "0.69265693", "0.692401", "0.6917125", "0.6913771", "0.69128734", "0.69098765", "0.69098765", "0.69098765", "0.69098765", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.6906769", "0.68955183", "0.68879676", "0.68879676", "0.68870705", "0.68859893", "0.68812704", "0.6872602", "0.6871005", "0.68704134", "0.6868547", "0.6866817", "0.6866817", "0.6864914", "0.6864914", "0.68599325", "0.6855216", "0.68546236" ]
0.0
-1
The JUnit setup method
protected void setUp() { File cleanDir = new File(this.clean); dest = new File(root + "\\field"); if (!dest.exists()) { dest.mkdirs(); } (new FileCopy( new File(cleanDir, "field_RenameFieldTest.java"), new File(dest, "RenameFieldTest.java"), false)).run(); (new FileCopy( new File(cleanDir, "field_UsesFieldTest.java"), new File(dest, "UsesFieldTest.java"), false)).run(); (new FileCopy( new File(cleanDir, "field_InheritFieldTest.java"), new File(dest, "InheritFieldTest.java"), false)).run(); (new FileCopy( new File(cleanDir, "XDateChooser.java"), new File(root + "\\XDateChooser.java"), false)).run(); (new SummaryTraversal(root)).run(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@BeforeClass\n\tpublic static void setup() {\n\n\t}", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "protected void setUp() {\n\t}", "@Before\r\n\tpublic void setup() {\r\n\t}", "protected void setUp() {\n\n }", "public void setUp() {\n\n\t}", "@Before\n\tpublic void setup() {\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Before public void setUp() { }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@BeforeClass\n\t public void setUp() {\n\t }", "@Override\n public void setUp() {\n }", "public void setUp()\r\n {\r\n //empty on purpose\r\n }", "@Before\n\t public void setUp() {\n\t }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Before\n public void setup() {\n }", "protected void setUp() throws Exception {\n }", "protected void setUp()\n {\n /* Add any necessary initialization code here (e.g., open a socket). */\n }", "@Before\n\tpublic void setup() \n\t{\n\t\tsuper.setup();\n\t\t\n }", "@BeforeEach\n public void setup() {\n }", "protected void setUp()\r\n {\r\n /* Add any necessary initialization code here (e.g., open a socket). */\r\n }", "protected void setUp() throws Exception {\n \n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before\n\tpublic void setUp() {\n\t}", "@Before\r\n\t public void setUp(){\n\t }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@BeforeClass\n\tpublic static void setup() {\n\t\tgetLogManager().init();\n\t}", "@Before\r\n\tpublic void setUp() {\n\t}", "@BeforeClass\n public static void setup() {\n System.out.println(\"*** Before Class ***\");\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp () {\n }", "@BeforeClass\n\tpublic void TestSetup() {\n\t}", "protected void setUp() throws Exception {\n }", "@BeforeClass\n public static void setUp() {\n }", "@BeforeClass\n public void setUp() {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Override\n public void setUp() throws Exception {}", "@Before\n\tpublic void setupTeste()\n\t{\n\t\tSystem.out.println(\"ESTOU FAZENDO O SETUP\");\n\t}", "@Before\n public void setUp() {\n }", "@BeforeClass\n\tpublic static void setupTestes()\n\t{\n\t\t\n\t\tSystem.out.println(\"ESTOU FAZENDO O SETUP GERAL\");\n\t}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t}", "protected void setup() {\r\n }", "@Before\n public void setUp() throws Exception {\n }", "@Before\n public void setUp() throws Exception {\n }", "@BeforeClass\n public static void setUpClass() {\n }", "@BeforeClass\n public static void setUpClass() {\n }", "@BeforeEach\n\tvoid setup(){\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\t\n\t}", "@BeforeEach\n public void setup() {\n testTaskList = new TaskList();\n testUi = new Ui();\n\n Event testEvent = new Event(\"Daily Work\", \"CS2113T\", Parser.parseDate(\"31/01/20 0800\"),\n Parser.parseDate(\"31/01/20 1200\"), \"testing\");\n Assignment testAssign = new Assignment(\"Daily Work\", \"CS2113T\", Parser.parseDate(\"20/03/20 0000\"),\n \"testing\");\n testTaskList.addTask(testEvent);\n testTaskList.addTask(testAssign);\n }", "protected void setUp() {\n //Clear all namespace in the ConfigManager\n TestHelper.resetConfig();\n }", "@Before\n\tpublic void setUp() throws Exception\n\t{\n\t}", "@Before\n public void setUp() throws Exception {\n\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t}", "@BeforeClass\n\tpublic static void setup() {\n\t\tmatrixAdditionCalculator = new MatrixAdditionCalculator();\n\n\t}", "@Before\n public void setUp() {\n }", "@Before\n\tpublic void testEachSetup() {\n\t\ttestGrid = new Grid(50,50);\n\t\tundoRedo_TestStack = new UndoRedo();\n\t\tSystem.out.println(\"Setting up test...\");\n\t}", "@Before\n public void setUp() throws Exception {\n\n }", "protected void setUp() throws Exception {\n super.setUp();\n }", "@Before\n\t\t public void setUp() throws Exception {\n\t\t\t testHelper.setUp();\n\t\t }", "protected void setUp() {\n config = new ContestConfig();\n }", "@BeforeClass\n\tpublic static void testSetup() {\n\t\t// do something before all tests\n\t}", "@Before\n public final void setUp() throws Exception\n {\n // Empty\n }", "@BeforeClass\n\tpublic void setup() {\n\t\tSystem.out.println(\"Before Class Annotation\");\n\t}", "@BeforeClass\n\tpublic static void setup() {\n\t\tdataMunger = new DataMunger();\n\n\t}", "@Before\n public void setUp()\n throws Exception\n {\n super.setUp();\n }", "@BeforeClass\n\tpublic static void setupClass() throws JsonParseException, JsonMappingException, IOException, URISyntaxException {\n\t\tTEST_ENVIRONMENT.setupConfiguration();\n\t\tTEST_ENVIRONMENT.setupDbConnection();\n\t\tTEST_ENVIRONMENT.migrateDb();\n\t\tTEST_ENVIRONMENT.setupServer();\n\t}", "public void setup() {\n }" ]
[ "0.8439523", "0.8341067", "0.8341067", "0.83352935", "0.8317363", "0.8281777", "0.82574123", "0.82262236", "0.82121086", "0.8211444", "0.8208847", "0.8208847", "0.8208847", "0.8160784", "0.8146338", "0.81424946", "0.8133781", "0.8092053", "0.8063123", "0.80401844", "0.8022731", "0.8019458", "0.8013234", "0.8009329", "0.80079323", "0.80017006", "0.80017006", "0.80017006", "0.80017006", "0.80017006", "0.7989203", "0.7987176", "0.79790664", "0.7975875", "0.7959003", "0.7918304", "0.7917266", "0.7917266", "0.7917266", "0.7917266", "0.7912206", "0.7912206", "0.7912206", "0.7912206", "0.7912206", "0.7909378", "0.7908825", "0.79061764", "0.79015815", "0.7892642", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.7884966", "0.78651184", "0.7844814", "0.78182745", "0.7814675", "0.77976894", "0.77976894", "0.7795665", "0.7774483", "0.7774483", "0.7770128", "0.7770128", "0.7769844", "0.7741559", "0.77288246", "0.77259964", "0.77256197", "0.7719348", "0.77185297", "0.77185297", "0.7716373", "0.7711866", "0.7709875", "0.7680728", "0.76744556", "0.7672045", "0.76615673", "0.7628547", "0.7626279", "0.7606394", "0.75823796", "0.75814533", "0.75724167", "0.7550855" ]
0.0
-1
The teardown method for JUnit
protected void tearDown() { (new File(dest, "RenameFieldTest.java")).delete(); (new File(dest, "UsesFieldTest.java")).delete(); (new File(dest, "InheritFieldTest.java")).delete(); (new File(root + "\\XDateChooser.java")).delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void teardown();", "void teardown();", "@Override\n public void teardown() {\n }", "@Override\n\tpublic void teardown() {\n\t}", "@AfterClass\n\tpublic static void teardown() {\n\t\tdataMunger = null;\n\n\t}", "@AfterClass\n\tpublic void teardown(){\n\t}", "protected void tearDown() {\n\t}", "protected void tearDown()\n {\n }", "protected void tearDown()\n {\n }", "public void tearDown() {\n }", "@AfterClass\r\n\tpublic static void testCleanup() {\r\n\t\tConfig.teardown();\r\n\t}", "@After\n\t\t public void tearDown() throws Exception {\n\t\t\t testHelper.tearDown();\n\t\t }", "@AfterClass\n\tpublic static void teardown() {\n\t\tmatrixAdditionCalculator = null;\n\n\t}", "void tearDown();", "void tearDown();", "protected void tearDown() {\n testEnv.close();\n }", "public void tearDown() throws Exception {\n TestHelper.clearTemp();\n super.tearDown();\n }", "protected void tearDown() {\n // empty\n }", "public abstract void tearDown();", "@AfterEach\n public void teardown() {\n mockDAO = null;\n addFlight = null;\n flight = null;\n }", "@After\n public void tearDown() {\n fixture.cleanUp();\n }", "@AfterTest\n\tpublic void teardown()\n\t{\n\t\t\n\t\tdriver.close();\n\t}", "@AfterSuite\n\tpublic void teardown() {\n\t\t\n\t\tdriver.quit();\n\t}", "protected void tearDown() \n\t{\n\t\tif (container != null) \n\t\t{\n\t\t\tcontainer.dispose();\n\t\t}\n\t\tcontainer = null;\n\t}", "@After\n\tpublic void tearDown() {}", "protected void tearDown()\r\n {\r\n /* Add any necessary cleanup code here (e.g., close a socket). */\r\n }", "@Override\n public void tearDown() {\n testEngine = null;\n }", "@AfterEach\r\n public void tearDown() {\r\n SRtest = null;\r\n assertNull(SRtest);\r\n }", "protected void tearDown() {\n config = null;\n }", "public void tearDown() {\n tearDown(true);\n }", "@After\n public void tearDown() {\n fixture = null;\n }", "protected void tearDown()\n {\n /* Add any necessary cleanup code here (e.g., close a socket). */\n }", "@After\r\n public void tearDown() throws Exception {\r\n super.tearDown();\r\n TestHelper.cleanupEnvironment();\r\n instance = null;\r\n }", "@AfterClass\n\tpublic static void testCleanup() {\n\t}", "protected void tearDown() throws Exception {\n }", "@AfterTest\r\n public void tearDown() {\n }", "@After\n public void tearDown()\n {\n mockDependencies.verifyMocks();\n mockDependencies = null;\n assertNull(\"'mockDependencies' should be null at the end of teardown\", mockDependencies);\n\n parser = null;\n assertNull(\"'parser' should be null at the end of teardown\", parser);\n }", "@After\n public void tearDown() throws Exception {\n testInstance = null;\n }", "@AfterEach\n\tprotected void tearDown()\n\t{\n\t\tformatter = null;\n\t}", "@After\r\n\tpublic void tearDown() {\n\t}", "protected void tearDown() {\r\n instance = null;\r\n columnNames = null;\r\n }", "protected void tearDown() throws Exception {\r\n super.tearDown();\r\n TestHelper.clearNamespaces();\r\n }", "@After\n\tpublic void tearDown() {\n\n\t}", "@AfterClass\n public void cleanUp() {\n }", "@Override\n\tpublic void tearDown() {\n\t}", "@After\n public void tearDown()\n {\n example = null;\n example2 = null;\n example3 = null;\n }", "@AfterSuite\n\tpublic void teardown() {\n\t\tlogger.info(\"ALL TESTS COMPLETED: Quiting driver\");\n\t\tgmailPg.quitDriver();\n\t}", "@After\n\tpublic void teardown() {\n\t\tdrv.quit();\n\t}", "@AfterClass\n public static void tearDownClass() {\n }", "@AfterClass\n public static void tearDownClass() {\n }", "@AfterEach\n public void tearDown() {\n }", "@AfterEach\n public void tearDown() {\n }", "@AfterEach\n public void tearDown() {\n }", "@AfterEach\n public void tearDown() {\n }", "@AfterEach\n public void tearDown() {\n }", "@AfterEach\n public void tearDown() {\n }", "@AfterEach\n public void tearDown() {\n }", "@AfterEach\n public void tearDown() {\n }", "@AfterEach\n public void tearDown() {\n }", "@Override\n public void tearDown() {\n generator = null;\n }", "@Override\n protected void tearDown() {\n }", "protected void tearDown() throws Exception {\r\n this.testedInstances = null;\r\n super.tearDown();\r\n }", "protected void tearDown() throws Exception {\r\n this.testedInstances = null;\r\n super.tearDown();\r\n }", "@Override\r\n protected void tearDown()\r\n {\r\n seed = null;\r\n island = null;\r\n position = null;\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@Override\n public void tearDown() {\n }", "@Override\n public void tearDown() {\n }", "@Override\n public void tearDown() {\n }", "@After\n public void tearDown() {\n \n }", "@Override\r\n protected void tearDown() {\r\n // nothing yet\r\n }", "@After\n public void teardown() {\n RoboGuice.Util.reset();\n }", "@AfterEach\n public void tearDown() {\n rrpss = null;\n restaurant = null;\n customerFactory = null;\n staffFactory = null;\n tableFactory = null;\n menuFactory = null;\n setMenuFactory = null;\n reservationFactory = null;\n orderFactory = null;\n }", "public void tearDown() {\n instance = null;\n }", "protected void tearDown() throws Exception {\n TestHelper.clearConfig();\n super.tearDown();\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "protected void tearDown() throws Exception {\n super.tearDown();\n FailureTestHelper.unloadData();\n FailureTestHelper.unloadConfig();\n }", "public void tearDown() {\n this._getOpt = null;\n }", "@AfterEach\n public void tearDown(){\n }", "protected void tearDown() throws Exception {\r\n \t\tarchetype = null;\r\n \t}", "@After\r\n\tpublic void tearDown() {timeslots = null; timetable = null; System.setOut(null);}", "@After\n public void tearDown(){\n choose = null;\n tmp = null;\n }", "@AfterClass\n public static void teardown() {\n consecutiveNumbers= null;\n\n }", "public static void teardown() {\n\t\tdriver.quit();\n\t}", "@After\n public void tearDown () {\n }", "@After\n public final void tearDown() throws Exception\n {\n // Empty\n }", "protected void tearDown() throws Exception {\r\n validator = null;\r\n bundle = null;\r\n TestHelper.clearConfiguration();\r\n }", "@AfterClass\n\tpublic void teardown()\n\t{\n\t\tdriver.close();\n\t}", "protected void tearDown() throws Exception {\r\n super.tearDown();\r\n FailureTestHelper.unloadConfig();\r\n }", "@After\n public void tearDown() {\n }", "@AfterSuite\r\n\tpublic void tearDown() {\r\n\t\tSystem.out.println(\"Driver teared down\");\r\n\t}", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }" ]
[ "0.9063598", "0.9063598", "0.90424395", "0.89785075", "0.8558831", "0.8554747", "0.83391744", "0.82628727", "0.82628727", "0.8227815", "0.8207605", "0.8172145", "0.8172029", "0.81562203", "0.81562203", "0.8143138", "0.8142196", "0.8138874", "0.8118606", "0.81114364", "0.8096554", "0.8090599", "0.80834424", "0.80796546", "0.80684584", "0.8064511", "0.8060429", "0.8050463", "0.80464464", "0.80429584", "0.80340165", "0.8027444", "0.8023923", "0.80108565", "0.7989041", "0.7980176", "0.7960335", "0.7955724", "0.7936231", "0.7927805", "0.792617", "0.79030335", "0.7902012", "0.7901084", "0.7891915", "0.78785264", "0.7865368", "0.78627914", "0.7861979", "0.7861979", "0.78500396", "0.78500396", "0.78500396", "0.78500396", "0.78500396", "0.78500396", "0.78500396", "0.78500396", "0.78500396", "0.7832907", "0.7831062", "0.78185713", "0.78185713", "0.78154564", "0.7806887", "0.7806887", "0.7806887", "0.7806887", "0.7798354", "0.7798354", "0.7798354", "0.77959585", "0.7792538", "0.7786195", "0.7779706", "0.7777147", "0.77711576", "0.7769775", "0.7769775", "0.7769775", "0.7769775", "0.7769775", "0.7761922", "0.77464885", "0.7745417", "0.77443796", "0.77426046", "0.7727368", "0.772736", "0.7722414", "0.7717782", "0.7712543", "0.7711555", "0.77114946", "0.77061003", "0.7705306", "0.7704951", "0.77031875", "0.77031875", "0.77031875", "0.77031875" ]
0.0
-1
This method runs through all the permutations for working with identifiers, and provides examples for their common use.
private void runBiSciColIdentifierTools(EZIDService ezidAccount, Integer naan, Integer who) throws Exception { // Create a minter object to use for all these samples System.out.println("\nCreating a minter object by passing in an existing Dataset Prefix ..."); // Creation method Example #1, no arguments is just the default test case ark:/99999/fk4 // minterBCID minter = new minterBCID(); // Creation method Example #2, provide a NAAN & a user, which automatically creates a new shoulder // minterBCID minter = new minterBCID("87286",1); // Creation method Example #3, pass in an existing prefix and use that elementMinter minter = new elementMinter(87286, "C2", false, true); System.out.println(" prefix=" + minter.prefix); System.out.println(" datasets_id=" + minter.getDatasets_id()); // Create a bcid for localId without Suffix passthrough System.out.println("\nCreate bcids WITHOUT suffix passthrough from test dataset ..."); String datasetIdentifier = minter.mintList(testDatafile); System.out.println(" datasetIdentifier = " + datasetIdentifier); Iterator ezids1It = minter.getIdentifiers(datasetIdentifier).iterator(); while (ezids1It.hasNext()) { System.out.println(" " + ezids1It.next()); } System.out.println(" cleaning up ..."); minter.deleteLoadedSetUUID(datasetIdentifier); // Create a bcid for each localId's with Suffix passthrough System.out.println("\nCreate bcids WITH suffix passthrough from test dataset ..."); System.out.println(" datasetIdentifier = " + datasetIdentifier); datasetIdentifier = minter.mintList(testDatafile); Iterator ezids2It = minter.getIdentifiers(datasetIdentifier).iterator(); while (ezids2It.hasNext()) { System.out.println(" " + ezids2It.next()); } System.out.println(" cleaning up ..."); minter.deleteLoadedSetUUID(datasetIdentifier); // Create a bunch of bcids int num = 10; System.out.println("\nCreate " + num + " bcids (a reserved slot in our database) ..."); datasetIdentifier = minter.createBCIDs(num, new URI("http://purl.org/dc/dcmitype/PhysicalObject")); System.out.println(" datasetIdentifier = " + datasetIdentifier); Iterator guidsIt = minter.getIdentifiers(datasetIdentifier).iterator(); while (guidsIt.hasNext()) { System.out.println(" " + guidsIt.next()); } System.out.println(" cleaning up (deleting these identifiers cause we're just testing here) ..."); minter.deleteLoadedSetUUID(datasetIdentifier); // Create bcids from Given uuids with Suffix Passthrough System.out.println("\nCreate test uuid dataset ..."); String uuidInputStringFromTextBox = "" + UUID.randomUUID() + "\thttp://biocode.berkeley.edu/specimens/MBIO57\n" + UUID.randomUUID() + "\n" + UUID.randomUUID(); ArrayList localUUIDs = new inputFileParser(uuidInputStringFromTextBox, minter).elementArrayList; System.out.println(" Successfully created test uuid dataset"); // Create a bcid for each localId's System.out.println("\nCreating bcids with uuid suffix passthrough from test uuid dataset (FSU case) ..."); datasetIdentifier = minter.mintList(localUUIDs); System.out.println(" datasetIdentifier = " + datasetIdentifier); Iterator uuidsIt = minter.getIdentifiers(datasetIdentifier).iterator(); while (uuidsIt.hasNext()) { System.out.println(" " + uuidsIt.next()); } // Return information about an identifier (resolver service) //ark:/87286/C2 //ark:/87286/C2eee9cd5b-fd7d-40f9-acc6-362770e7bfde //1. Look in the identifiers table and resolve there. //2. Look in the datasets table // Create bcids from Given uuids with Suffix Passthrough System.out.println("\nCreate a second test uuid dataset ..."); String uuidInputStringFromTextBox2 = "" + UUID.randomUUID() + "\thttp://biocode.berkeley.edu/specimens/MBIO57\n" + UUID.randomUUID() + "\n" + UUID.randomUUID(); ArrayList localUUIDs2 = new inputFileParser(uuidInputStringFromTextBox2, minter).elementArrayList; System.out.println(" Successfully created test uuid dataset #2"); // Create a bcid for each localId's System.out.println("\nCreating bcidS WITHOUT uuid suffix passthrough from test uuid dataset #2 ..."); datasetIdentifier = minter.mintList(localUUIDs2); Iterator uuidsIt2 = minter.getIdentifiers(datasetIdentifier).iterator(); while (uuidsIt2.hasNext()) { System.out.println(" " + uuidsIt2.next()); } // TODO: Send URL Link to results // Scan Identifiers table and create ezids where ezidRequest = true && ezidMade = false System.out.println("\nBatch create ezids for Identifiers ..."); System.out.println(" OPTION disabled here for now; we cannot scale for all requests, but we want to maintain them."); //manageEZIDs creator = new manageEZIDs(); //creator.createEZIDs(ezidAccount); // Scan Datasets table and create ezids where ezidRequest = true && ezidMade = false System.out.println("\nBatch create ezids for Datasets ..."); manageEZID creator = new manageEZID(); creator.createDatasetsEZIDs(ezidAccount); System.out.println(" Scanned datasets table and created any dataset ezids"); // Force an update on an individual bcid System.out.println("\nUpdate a single ezid metadata record for id = " + minter.getDatasets_id() + " ..."); creator.updateDatasetsEZID(ezidAccount, minter.getDatasets_id()); // Create a Dataset /* System.out.println("\nCreate a new dataset object:"); dataset dataset = new dataset(false); dataset.mint(naan, who, new ResourceTypes().RESOURCE, null, "http://www.google.com/", "this is a test"); System.out.println(" Created " + dataset.prefix); dataset.close(); */ // Close connection minter.close(); creator.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String... args) {\n List<String> list = Arrays.asList(\"aap\", \"noot\", \"mies\");\n List<List<String>> perms = getPermutations(list);\n perms.forEach(System.out::println);\n }", "@Test\r\n public void PermutationTest() {\r\n System.out.println(\"permutation\");\r\n String prefix = \"\";\r\n String in = \"123\";\r\n Input input = new Input(in);\r\n List<String> expResult = Arrays.asList(\"123\",\"132\",\"213\",\"231\",\"312\",\"321\");\r\n List<String> result = instance.permutation(prefix, input);\r\n instance.sort(result);\r\n assertEquals(expResult, result);\r\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Permutation of 1234 : \");\n\t\tint[] int_array = {1,2,3,4};\n\t\tPermutationOfAnArray.permutationOfIntegers(int_array, 0, 4);\n\t\tSystem.out.println(\"Total permutations : \" + count);\t\t\n\t}", "@Test\r\n public void testCollectIdentifierValues() throws Exception{\r\n System.out.println(\"collectIdentifierValues\");\r\n \r\n char u = 'u';\r\n char h ='h';\r\n char k ='k';\r\n \r\n System.out.println(\"test1\"); \r\n String [] instanceInput = {\"1u\",\"chat.txt\",\"user1\"};\r\n CommandLineArgumentParser instance = new CommandLineArgumentParser(instanceInput);\r\n String [] expResult = {\"user1\"};\r\n String []result = instance.collectIdentifierValues(u,instanceInput);\r\n System.out.println(Arrays.toString(result)+\" expected: \"+Arrays.toString(expResult));\r\n \r\n System.out.println(\"test2\");\r\n String [] instanceInput2 = {\"2u\",\"chat.txt\",\"user1\",\"user2\"};\r\n CommandLineArgumentParser instance2 = new CommandLineArgumentParser(instanceInput2);\r\n String [] expResult2 = {\"user1\",\"user2\"};\r\n String []result2 = instance2.collectIdentifierValues(u,instanceInput2);\r\n System.out.println(Arrays.toString(result2)+\" expected: \"+Arrays.toString(expResult2));\r\n \r\n System.out.println(\"test3\");\r\n String [] instanceInput3 = {\"1k3u\",\"chat.txt\",\"keyWord\",\"user1\",\"user2\",\"user3\"};\r\n CommandLineArgumentParser instance3 = new CommandLineArgumentParser(instanceInput3);\r\n String [] expResult3 = {\"user1\",\"user2\",\"user3\"};\r\n String []result3 = instance3.collectIdentifierValues(u,instanceInput3);\r\n System.out.println(Arrays.toString(result3)+\" expected: \"+Arrays.toString(expResult3));\r\n \r\n System.out.println(\"test4\");\r\n String [] instanceInput4 = {\"2k1u1h\",\"chat.txt\",\"keyWord1\",\"keyWord1\",\"user1\",\"hiddenWord\"};\r\n CommandLineArgumentParser instance4 = new CommandLineArgumentParser(instanceInput4);\r\n String [] expResult4 = {\"user1\"};\r\n String [] result4 = instance4.collectIdentifierValues(u,instanceInput4);\r\n System.out.println(Arrays.toString(result4)+\" expected: \"+Arrays.toString(expResult4));\r\n \r\n System.out.println(\"test5\");\r\n String [] instanceInput5 = {\"2h3k\",\"chat.txt\",\"hiddenWord1\",\"hiddenWord2\",\"keyWord\",\"keyWord\",\"keyword3\"};\r\n CommandLineArgumentParser instance5 = new CommandLineArgumentParser(instanceInput5);\r\n String [] expResult5 = {\"hiddenWord1\",\"hiddenWord2\"};\r\n String [] result5 = instance5.collectIdentifierValues(h,instanceInput5);\r\n System.out.println(Arrays.toString(result5)+\" expected: \"+Arrays.toString(expResult5));\r\n \r\n System.out.println(\"test6\");\r\n String [] instanceInput6 = {\"3k2h\",\"chat.txt\",\"keyWord1\",\"keyWord2\",\"keyWord3\",\"hiddenWord1\",\"hiddenWord2\"};\r\n CommandLineArgumentParser instance6 = new CommandLineArgumentParser(instanceInput6);\r\n String [] expResult6 = {\"keyWord1\",\"keyWord2\",\"keyWord3\"};\r\n String [] result6 = instance6.collectIdentifierValues(k,instanceInput6);\r\n System.out.println(Arrays.toString(result6)+\" expected: \"+Arrays.toString(expResult6));\r\n \r\n System.out.println(\"test7\");\r\n String [] instanceInput7 = {\"1u1k1h\",\"chat.txt\",\"username1\",\"keyWord1\",\"hiddenWord1\"};\r\n CommandLineArgumentParser instance7 = new CommandLineArgumentParser(instanceInput7);\r\n String [] expResult7 = {\"keyWord1\"};\r\n String [] result7 = instance7.collectIdentifierValues(k,instanceInput7);\r\n System.out.println(Arrays.toString(result7)+\" expected: \"+Arrays.toString(expResult7));\r\n \r\n System.out.println(\"test8\");\r\n String [] instanceInput8 = {\"1u\",\"chat.txt\",\"mike\"};\r\n CommandLineArgumentParser instance8 = new CommandLineArgumentParser(instanceInput8);\r\n String [] expResult8 = {\"mike\"};\r\n String [] result8 = instance8.collectIdentifierValues(u,instanceInput8);\r\n System.out.println(Arrays.toString(result8)+\" expected: \"+Arrays.toString(expResult8));\r\n \r\n assertEquals(Arrays.toString(expResult), Arrays.toString(result));\r\n assertEquals(Arrays.toString(expResult2), Arrays.toString(result2));\r\n assertEquals(Arrays.toString(expResult3), Arrays.toString(result3));\r\n assertEquals(Arrays.toString(expResult4), Arrays.toString(result4));\r\n assertEquals(Arrays.toString(expResult5), Arrays.toString(result5));\r\n assertEquals(Arrays.toString(expResult6), Arrays.toString(result6));\r\n assertEquals(Arrays.toString(expResult7), Arrays.toString(result7));\r\n assertEquals(Arrays.toString(expResult8), Arrays.toString(result8));\r\n \r\n }", "public static void main(String[] args) {\n System.out.println(\"Chapter 6 - 6.5. Mapping Optionals\");\n\n\n System.out.println();\n // *** Finding Employees by Ids***\n new Recipe_6_5_Mapping_Optionals().findingEmployeesByIds();\n }", "public static void main(String[] args) {\n\t\tresult = permutation(\"doggie\",\"god\");\r\n\t\tSystem.out.println(result);\r\n\t}", "public static void main(String[] args) {\n\t\tString s = \"123321\";\n\t\tString t = \"123231\";\n\t\t\n\t\tSystem.out.println(permutation(s, t));\n\t}", "public static void main(String[] args) {\n String s1 = \"tweety\";\n String s2 = \"weetty\";\n System.out.println(checkPermutationCountingHashMap(s1, s2));\n System.out.println(checkPermutationSorting(s1, s2));\n System.out.println(checkPermutationCountingArray(s1, s2));\n }", "public static void main(String[] args) {\n /*camelCase(\"Bill is,\\n\" +\n \"in my opinion,\\n\" +\n \"an easier name to spell than William.\\n\" +\n \"Bill is shorter,\\n\" +\n \"and Bill is\\n\" +\n \"first alphabetically.\");*/\n\n String str = \"Bill is,\\n\" +\n \"in my opinion,\\n\" +\n \"an easier name to spell than William.\\n\" +\n \"Bill is shorter,\\n\" +\n \"and Bill is\\n\" +\n \"first alphabetically.\";\n convertToCamelCase(str,str.toCharArray());\n\n String value = \"BillIs,\\n\" +\n \"InMyOpinion,\\n\" +\n \"AnEasierNameToSpellThanWilliam.\\n\" +\n \"BillIsShorter,\\n\" +\n \"AndBillIsFirstAlphabetically.\";\n\n //reverseCamelCase(value,value.toCharArray());\n\n /* Set<Integer> set = new LinkedHashSet<Integer>(\n Arrays.asList(1,2,3,4,5,6));\n\n ArrayList<List<List<Integer>>> results =\n new ArrayList<List<List<Integer>>>();\n compute(set, new ArrayList<List<Integer>>(), results);\n for (List<List<Integer>> result : results)\n {\n System.out.println(result);\n }*/\n\n /*reverseCamelCase(\"BillIsOk\\n\" +\n \"ThisIsGood.\");*/\n\n //System.out.println(\"abc \\r\\n test\");\n\n //permutation(\"abc\");\n\n /*String[] database = {\"a\",\"b\",\"c\"};\n for(int i=1; i<=database.length; i++){\n String[] result = getAllLists(database, i);\n for(int j=0; j<result.length; j++){\n System.out.println(result[j]);\n }\n }*/\n\n /*char[] database = {'a', 'b', 'c'};\n char[] buff = new char[database.length];\n int k = database.length;\n for(int i=1;i<=k;i++) {\n permGen(database,0,i,buff);\n }*/\n\n\n\n }", "public static void main(String[] args) {\n\t\tarticle.add(\"the\");\n\t\tarticle.add(\"a\");\n\t\tarticle.add(\"some\");\n\t\tarticle.add(\"one\");\n\t\tnoun.add(\"boy\");\n\t\tnoun.add(\"girl\");\n\t\tnoun.add(\"dog\");\n\t\tnoun.add(\"town\");\n\t\tnoun.add(\"car\");\n\t\tverb.add(\"drove\");\n\t\tverb.add(\"ran\");\n\t\tverb.add(\"jumped\");\n\t\tverb.add(\"walked\");\n\t\tverb.add(\"skipped\");\n\t\tpreposition.add(\"to\");\n\t\tpreposition.add(\"from\");\n\t\tpreposition.add(\"over\");\n\t\tpreposition.add(\"on\");\n\t\tpreposition.add(\"under\");\n\t\tRandom r= new Random();\n\t\tfor(int i=0;i<15;i++)\n\t\t{\n\t\tint n= r.nextInt(4);\n\t\tint n2= r.nextInt(5);\n\t\tint n3= r.nextInt(5);\n\n\t\tint n4= r.nextInt(5);\n\t\tint n5= r.nextInt(4);\n\t\tint n6= r.nextInt(5);\n\n\t\tSystem.out.println(article.get(n)+ \" \"+ noun.get(n2)+\" \"+ verb.get(n3)+\" \"+ preposition.get(n4)+\" \" + article.get(n5)+\" \"+ noun.get(n6)+\".\");\n\t\t}\n\n\t}", "public static void main(String args[]) {\n\n // aacd(1,1,3,4) amd(1,13,4) kcd(11,3,4)\n // Note : 1,1,34 is not valid as we don't have values corresponding\n // to 34 in alphabet\n int[] arr = {1, 1, 3, 4};\n printAllInterpretations(arr);\n\n // aaa(1,1,1) ak(1,11) ka(11,1)\n int[] arr2 = {1, 1, 1};\n printAllInterpretations(arr2);\n\n // bf(2,6) z(26)\n int[] arr3 = {2, 6};\n printAllInterpretations(arr3);\n\n // ab(1,2), l(12)\n int[] arr4 = {1, 2};\n printAllInterpretations(arr4);\n\n // a(1,0} j(10)\n int[] arr5 = {1, 0};\n printAllInterpretations(arr5);\n\n // \"\" empty string output as array is empty\n int[] arr6 = {};\n printAllInterpretations(arr6);\n\n // abba abu ava lba lu\n int[] arr7 = {1, 2, 2, 1};\n printAllInterpretations(arr7);\n }", "public void testTokenIds() {\n Language<TokenId> language = TestGenLanguage.language();\n Set<TokenId> ids = language.tokenIds();\n assertTrue(\"Invalid ids.size() - expected \" + IDS_SIZE, ids.size() == IDS_SIZE);\n \n TokenId[] idArray = {\n TestGenLanguage.IDENTIFIER_ID,TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.PLUS_MINUS_PLUS_ID,TestGenLanguage.SLASH_ID,TestGenLanguage.STAR_ID,TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.WHITESPACE_ID,TestGenLanguage.SL_COMMENT_ID,TestGenLanguage.ERROR_ID,TestGenLanguage.PUBLIC_ID,TestGenLanguage.PRIVATE_ID,TestGenLanguage.STATIC_ID,\n };\n\n // Check operations with ids\n Collection<TokenId> testIds = Arrays.asList(idArray);\n LexerTestUtilities.assertCollectionsEqual(\"Ids do not match with test ones\",\n ids, testIds);\n \n // Check that ids.iterator() is ordered by ordinal\n int ind = 0;\n for (TokenId id : ids) {\n assertTrue(\"Token ids not sorted by ordinal at index=\" + ind, id == idArray[ind]);\n ind++;\n assertSame(language.tokenId(id.name()), id);\n assertSame(language.tokenId(id.ordinal()), id);\n assertSame(language.validTokenId(id.name()), id);\n assertSame(language.validTokenId(id.ordinal()), id);\n }\n \n try {\n language.validTokenId(\"invalid-name\");\n fail(\"Error: exception not thrown\");\n } catch (IllegalArgumentException e) {\n // OK\n }\n \n try {\n language.validTokenId(-1);\n fail(\"Error: exception not thrown\");\n } catch (IndexOutOfBoundsException e) {\n // OK\n }\n \n try {\n language.validTokenId(20);\n fail(\"Error: exception not thrown\");\n } catch (IndexOutOfBoundsException e) {\n // OK\n }\n \n assertEquals(15, language.maxOrdinal());\n \n // Check token categories\n Set cats = language.tokenCategories();\n Collection testCats = Arrays.asList(new String[] { \"operator\", \"test-category\", \"whitespace\", \"error\", \"comment\", \"keyword\" });\n LexerTestUtilities.assertCollectionsEqual(\"Invalid token categories\",\n cats, testCats);\n \n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.PLUS_MINUS_PLUS_ID,TestGenLanguage.STAR_ID,TestGenLanguage.SLASH_ID,\n }),\n language.tokenCategoryMembers(\"operator\")\n \n );\n \n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.IDENTIFIER_ID,\n }),\n language.tokenCategoryMembers(\"test-category\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.WHITESPACE_ID,\n }),\n language.tokenCategoryMembers(\"whitespace\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.ERROR_ID,\n }),\n language.tokenCategoryMembers(\"error\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.SL_COMMENT_ID,\n }),\n language.tokenCategoryMembers(\"comment\")\n \n );\n \n List<String> testIdCats\n = language.tokenCategories(TestGenLanguage.IDENTIFIER_ID);\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new String[] {\n \"test-category\",\n }),\n testIdCats\n );\n\n List<String> testIdCats2\n = language.tokenCategories(TestGenLanguage.PLUS_ID);\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new String[] {\n \"test-category\",\n \"operator\",\n }),\n testIdCats2\n );\n\n\n // Check Language.merge()\n Collection<TokenId> mergedIds\n = language.merge(\n Arrays.asList(new TokenId[] { TestGenLanguage.IDENTIFIER_ID }),\n language.merge(language.tokenCategoryMembers(\"comment\"),\n language.tokenCategoryMembers(\"error\"))\n \n );\n LexerTestUtilities.assertCollectionsEqual(\"Invalid language.merge()\",Arrays.asList(new TokenId[] {\n TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.SL_COMMENT_ID,TestGenLanguage.ERROR_ID,TestGenLanguage.IDENTIFIER_ID,\n }),\n mergedIds\n \n );\n\n }", "@Test\r\n\tpublic void testTokenizeIdentifiers() {\r\n\r\n\t\t// Enter the code\r\n\r\n\t\tdriver.findElement(By.name(\"code[code]\"))\r\n\t\t\t\t.sendKeys(\"the_best_cat = \\\"Noogie Cat\\\"\\nputs \\\"The best cat is: \\\" + the_best_cat\");\r\n\r\n\t\t// Look for the \"Tokenize\" button and click\r\n\r\n\t\tdriver.findElements(By.name(\"commit\")).get(0).click();\r\n\r\n\t\t// Check that there is corresponding quantity of the word \":on_ident\"\r\n\r\n\t\ttry {\r\n\t\t\tWebElement code = driver.findElement(By.tagName(\"code\"));\r\n\t\t\tString res = code.getText();\r\n\t\t\tint count = 0;\r\n\t\t\tfor (int i = 0; i <= res.length() - 9; i++) {\r\n\t\t\t\tString sub = res.substring(i, i + 9);\r\n\t\t\t\tif (sub.equals(\":on_ident\"))\r\n\t\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tassertEquals(count, 3);\r\n\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint[] num = {1,1,5};\r\n\t\tnextPermutation(num);\r\n\t\tfor(int n : num)\r\n\t\t\tSystem.out.print(n + \" \");\r\n\t}", "@Test\n public void testDAM31901001() {\n // in this case, there are different querirs used to generate the ids.\n // the database id is specified in the selectKey element\n testDAM30602001();\n }", "public static void main(String[] args) {\n\t\tint[] nums = {1,2,3};\n\t\tnew NextPermutation().nextPermutation(nums);\n\t\tint[] nums1 = {3,2,1};\n\t\tnew NextPermutation().nextPermutation(nums1);\n\t\tint[] nums2 = {1,3,2};\n\t\t//Arrays.sort(nums2, 1, nums.length);\n\t\t//for(int i=0;i<nums2.length;i++)System.out.println(nums2[i]);\n\t\tnew NextPermutation().nextPermutation(nums2);\n\n\t}", "@Test\n\tpublic void testPermutation() {permutation(\"abcd\");\n\t\t//0 1 0 0 9\n\t//\tpermute(\"aaab\");\n\t\t//\n\t\tpermutation(\"aaabc\");\n\t\tpermuteWithDups(\"aaabc\");\n\t}", "public static void main(String[] args)\n\t{\n\t\tString test = \"ABCDEFGHIJ\";\n\t\tPermutationGeneratorCoveyouSullivan p = new PermutationGeneratorCoveyouSullivan(test);\n\t\t\n\t\tint[] counters = new int[test.length()+1]; //array used to add to counters\n\t\t\n\t\t//using the h function to display how many permutations there are with test.length() elements and ZERO fixed - comparing to this.\n\t\tlong testH = h(test.length());\n\t\tSystem.out.println(\"Using the h function:\\nThe number of permutations with \" + test.length() + \" elements and ZERO fixed elements is: [\" + testH +\"]\\n\");\n\t\t\n\t\t//using the g function to display how many permutations there are with test.length() elements and \"i\" fixed elements - comparing to this\n\t\tSystem.out.println(\"Using the g function:\");\n\t\tfor (int i = 0; i < test.length()+1; i++)\n\t\t{\n\t\t\tlong gTest = g(test.length(), i);\n\t\t\tSystem.out.println(\"The number of permutations with \" + test.length() + \" elements and \" + i + \" fixed elements is: [\" + gTest + \"]\");\n\t\t}\n\t\t\n\t\t//now we are going to be using the brute force way of how to do counting - manually and then compare\n\t\tSystem.out.println(\"\\nUsing my brute force technique to figure out the number of permutations:\");\n\t\tfor (String s : p)\n\t\t{\n\t\t\tint controller = 0; //controller variable that will reset for every loop - for each seperate index\n\t\t\t\n\t\t\tfor (int i = 0; i < test.length(); i++) //this is the tester to compare the characters at each index\n\t\t\t{\n\t\t\t\tif (s.charAt(i) == test.charAt(i))\n\t\t\t\t\tcontroller++;\n\t\t\t}\n\t\t\t\n\t\t\tcounters[controller]++; //I'm still not understanding how these counters are working: I know it works, but how does it know what index to be in?\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < counters.length; i++)\n\t\t\tSystem.out.println(\"With \" + i + \" fixed elements, there are: [\" + counters[i] + \"] permutations\");\n\t\t\n\t\t/**********************************\n\t\t * Finally, my methods and brute force technique are correct do to the equality of the different functions/parameters as well as my brute force technique!\n\t\t * I also checked different test strings including my name, etc and they are also equal.\n\t\t * \n\t\t * Questions: One thing I noticed in the sequence is that g(test.length(), 0) and g(test.length(), 1) are somehow related b/c there is a difference of ONE?? \n\t\t * Is this true for all strings?\n\t\t *********************************/\n\t}", "public static void main (String args []) {\n\r\n String str = \"\\\"क\\\", \\\"का\\\", \\\"कि\\\", \\\"की\\\", \\\"कु\\\", \\\"कू\\\", \\\"के\\\", \\\"कै\\\", \\\"को\\\", \\\"कौ\\\", \\\"कं\\\", \\\"क:\\\"\" ;\r\n String strEng = \"\\\"ka\\\", \\\"kā\\\", \\\"ki\\\", \\\"kī\\\", \\\"ku\\\", \\\"kū\\\", \\\"kē\\\", \\\"kai\\\", \\\"ko\\\", \\\"kau\\\", \\\"kṁ\\\", \\\"ka:\\\"\" ;\r\n\r\n String additionalConsonants = \"\\\"क़\\\", \\\"क़ा\\\", \\\"क़ि\\\", \\\"क़ी\\\", \\\"क़ु\\\", \\\"क़ू\\\", \\\"क़े\\\", \\\"क़ै\\\", \\\"क़ो\\\", \\\"क़ौ\\\", \\\"क़ं\\\", \\\"क़:\\\"\"; \r\n String additionalConsonantsEng = \"\\\"qa\\\", \\\"qā\\\", \\\"qi\\\", \\\"qī\\\", \\\"qu\\\", \\\"qū\\\", \\\"qē\\\", \\\"qai\\\", \\\"qo\\\", \\\"qau\\\", \\\"qṁ\\\", \\\"qa:\\\"\" ;\r\n\r\n //String str = \"क, का, कि, की, कु, कू, के, कै, को, कौ, कं, क:\" ;\r\n \r\n \r\n \r\n //generateNP(str);\r\n //generateEN(strEng);\r\n //System.out.println();\r\n generateNPAdditionalConsonants(additionalConsonants);\r\n generateENAdditionalConsonants(additionalConsonantsEng);\r\n\r\n\r\n\r\n }", "public static void main(String[] args) {\n String[] strs = new String[]{\"eat\",\"tea\",\"tan\",\"ate\",\"nat\",\"bat\"};\n for(List<String> list : groupAnagrams(strs)) {\n System.out.print(\"[\");\n for (String s : list)\n System.out.print(s + \", \");\n System.out.println(\"]\");\n }\n }", "public static void main(String[] args) {\n\t\tString str1 =\"fxstvf\";\n\t\tString str2 =\"fxstvf\";\n\t\tSystem.out.println(isPermutation(str1, str2));\n\t\n\n\n\t}", "public static void main(String[] args) {\n Identification identification1 = new IdentificationGermany(\"ABC.203948ASFJH\");\n Identification identification2 = new IdentificationGermany(\"XYA-LKJASD\");\n Identification identification3 = new IdentificationGermany(\"12345678\");\n\n Identification identification4 = new IdentificationNetherlands(\"12345678\");\n Identification identification5 = new IdentificationNetherlands(\"123409\");\n Identification identification6 = new IdentificationNetherlands(\"ASBCLKJS\");\n\n validate(identification1);\n validate(identification2);\n validate(identification3);\n validate(identification4);\n validate(identification5);\n validate(identification6);\n }", "public static void main(String[] args) {\n LetterCasePermutation permutation = new LetterCasePermutation();\n List<String> strings = permutation.letterCasePermutation(\"a1B2\");\n System.out.println(strings);\n }", "public static void main(String[] args) {\n\t\tString[] sA1 = {\"old\", \"cold\", \"new\", \"cool\", \"scary\", \"scared\", \"worrisome\", \"very big\", \"small\", \"powerful\", \"imaginative\", \"hungry\", \"sleepy\", \"tired\", \"aggresive\", \"handsome\", \"ambitious\", \"brave\", \"calm\", \"eager\", \"clean\", \"chubby\", \"colossal\", \"gigantic\", \"little\", \"gentle\", \"religious\", \"grumpy\", \"embarrassed\", \"bewildered\"};\n\t\tString[] sA2 = {\"catarpillar\", \"basketball player\", \"police man\", \"doctor\", \"waiter\", \"ducky\", \"puppy\", \"psychic\", \"kitty cat\", \"badger\", \"otter\", \"basilisk\", \"platypus\", \"martian\", \"italian man\", \"chef\", \"veterinarian\", \"student\", \"qa tester\", \"sysadmin\", \"project manager\", \"soccer player\", \"vegitarian\", \"eel\", \"fish\", \"baby\", \"water chestnut\", \"apple tree\", \"president\", \"mechanic\", \"salesman\", \"twitch streamer\", \"quarterback\", \"halfback\", \"coach\", \"jealous\"};\n\t\tString[] sA3 = {\"favorite\", \"epic\", \"awesome\", \"amazing\", \"gorgeous\", \"worst\", \"unique\", \"weird\", \"funny\", \"magic\", \"itchy\", \"silly\", \"wonderful\", \"magnificent\", \"nice\", \"jolly\", \"unsightly\", \"miniature\", \"microscopic\", \"massive\", \"best\", \"loltyler1.com discount code alpha\"};\n\t\tString[] sA4 = {\"bodyguard\", \"plates\", \"game\", \"stuffed animal\", \"stopwatch\", \"pillow\", \"victory royale\", \"xbox controller\", \"wallet\", \"chair\", \"racecar bed\", \"rocket\", \"water bed\", \"closet\", \"water bottle\", \"jetski\", \"headset\", \"printer\", \"hard drive\", \"cologne\", \"deoderant\", \"robe\", \"diamond pickaxe\", \"iron sword\", \"stone shovel\", \"usb flash drive\"};\n\t\tArrayList<Book> bookArr = new ArrayList<Book>();\n\t\tRandom r = new Random();\n\t\tBookTableGateway btg = new BookTableGateway();\n\t\tPublisherTableGateway ptg = new PublisherTableGateway();\n\t\tAuditTableGateway atg = new AuditTableGateway();\n\t\tbtg.setPTGate(ptg);\n\t\tbtg.setATGate(atg);\n\t\tString isbn;\n\t\tint isbnInt = 501242;\n\t\tfor(int i = 0; i < 100;i++) {\n\t\t\tbookArr.clear();\n\t\tfor(int j = 0; j < 1100;j++) {\n\t\t\tString name = \"The \" + sA1[r.nextInt(sA1.length)] + \" \" + sA2[r.nextInt(sA2.length)] + \" and his \" + sA3[r.nextInt(sA3.length)] + \" \" + sA4[r.nextInt(sA4.length)];\n\t\t\tint yearPublished = r.nextInt(1900) + 117;\n\t\t\tString summary = \"A book that exists\";\n\t\t\tint pSwitch = r.nextInt(7);\n\t\t\tint publisherID;\n\t\t\tswitch(pSwitch) {\n\t\t\tcase 0:\n\t\t\t\tpublisherID = 123;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tpublisherID = 124;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpublisherID = 125;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tpublisherID = 126;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tpublisherID = 128;\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tpublisherID = 129;\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tpublisherID = 127;\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\tpublisherID = 123;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tisbn = String.valueOf(isbnInt);\n\t\t\tisbnInt++;\n\t\t\tbookArr.add(new Book(0, yearPublished, name, summary, isbn, null, null, new Publisher(publisherID, null)));\n\t\t\tlogger.info(\"generated \" + name);\n\t\t}\n\t\tbtg.insertBookArray(bookArr);\n\t\t}\n\t\t\n\t}", "@Test\n public void testLetterCasePermutation() {\n System.out.println(\"testLetterCasePermutation\");\n LetterCasePermutation instance = new LetterCasePermutation();\n\n List<String> result1 = instance.letterCasePermutation(\"a1b2\");\n List<String> expect1 = ListUtil.buildList(new String[]{\"a1b2\", \"a1B2\", \"A1b2\", \"A1B2\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect1, result1));\n\n List<String> result2 = instance.letterCasePermutation(\"3z4\");\n List<String> expect2 = ListUtil.buildList(new String[]{\"3z4\", \"3Z4\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect2, result2));\n\n List<String> result3 = instance.letterCasePermutation(\"12345\");\n List<String> expect3 = ListUtil.buildList(new String[]{\"12345\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect3, result3));\n }", "static ArrayList<Integer> generateQuestion(ArrayList<Integer> remainingSongsIds)\n {\n //shuffle the ids\n Collections.shuffle(remainingSongsIds);\n\n ArrayList<Integer> options = new ArrayList<>();\n\n //pick the random first fours sample ids\n for(int i=0;i<NUM_OPTIONS;i++)\n {\n if(i<remainingSongsIds.size())\n {\n options.add(remainingSongsIds.get(i));\n }\n }\n return options;\n }", "public static void main(String[] args) {\n String s = \"12345\";\n System.out.println(letterCasePermutation(s));\n }", "public static void main(String[] args) {\n\t\tString str = \"66. All Valid Permutations Of Parentheses I\";\n//\t\tString str = \"Determine If One String Is Another's Substring\";\n//\t\tSystem.out.println(\"\"+connByUnderscore(str));\n\t\tSystem.out.println(leet(str));\n//\t\tSystem.out.println(\"\"+connByUnderscore(str));\n\t}", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tPermutation p = new Permutation();\r\n\t\t//p.permutation(\"abc\");\r\n\t\tp.permutation2(\"abc\");\r\n\t}", "public static void main(String[] args) {\n\t\tPermutationSequence test = new PermutationSequence();\n\t\ttest.getPermutation(1, 1);\n\t}", "public static void main(String[] args) {\n\t\tPermuatation2 p2 = new Permuatation2();\n\t\tSystem.out.println(p2.combinations(\"abc\"));\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(checkPermutation(\"abcab\", \"aabbc\"));\n\t\tSystem.out.println(checkPermutation(\"aaaa\", \"aaaa\"));\n\n\t}", "public static void main(String [] args)\n\t{\n\t\tMap<String, Set<String>> ptrMap = getPotionToReagentsTestCaseMap();\n\t\tMap<String, Set<String>> rtpMap = getReagentToPotionsTestCaseMap();\n\n\t\t// Set up list of reagents on hand.\n\t\tSet<String> reagents = new HashSet<>();\n\t\treagents.add(\"Icethorn\");\n\t\treagents.add(\"12-ounce Can of Root Beer\");\n\t\treagents.add(\"Vial of Unicorn Tears\");\n\t\treagents.add(\"Raven Feather\");\n\t\treagents.add(\"Frost Lotus\");\n\t\treagents.add(\"Phoenix Song\");\n\t\treagents.add(\"Rain from a Category 4 Hurricane\");\n\t\treagents.add(\"Wax from a Partially Burned Candle\");\n\t\treagents.add(\"Black Lotus\");\n\n\t\t// Check which potions are brewable.\n\t\tSet<String> set = PotionMaster.allPossiblePotions(ptrMap, rtpMap, reagents);\n\t\tboolean result = checkSet(set);\n\n\t\tif (result)\n\t\t{\n\t\t\tSystem.out.println(\"Hooray!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"oh no :(\");\n\t\t\tPotionInfo.printSet(set);\n\t\t}\n\t}", "public static void main(String[] args) {\n for (FamilyType type : FamilyType.values()) {\n System.out.println(\"Current Type: \" + type);\n ArrayList<String> names = RunXilinxTools.getPartNames(type.toString().toLowerCase(), false);\n if (names == null) continue;\n for (String name : names) {\n System.out.println(\" \" + name + \" \" + getExactFamilyTypeFromPart(name));\n }\n }\n\n String[] testPartNames = {\"xs6slx4ltqg144\", \"xs6slx4tqg144\",\n \"xc7v285tffg484\", \"xc7vh290tffg1155\", \"xc7k30tsbg324\", \"xc7a20cpg236\", \"xc7a175tcsg324\",\n \"xq7v285tffg484\", \"xq7vh290tffg1155\", \"xq7k30tsbg324\", \"xq7a20cpg236\", \"xq7a175tcsg324\",\n \"xqr7v285tffg484\", \"xqr7vh290tffg1155\"};\n for (String name : testPartNames) {\n System.out.println(\" \" + name + \" \" + getExactFamilyTypeFromPart(name));\n }\n }", "public static void main(String[] args) {\n NameGenerator n = new NameGenerator(true);\n // System.out.println(\"Random Names:\");\n // for (int i = 0; i < 10; i++) {\n // System.out.println(n.newName());\n // }\n // System.out.println();\n // System.out.println(\"Planet Names:\");\n // for (int i = 0; i < 10; i++) {\n // System.out.println(n.newPlanetName());\n // }\n for (int i = 0; i < 10; i++) {\n System.out.println();\n String system = n.newName();\n System.out.printf(\"System: %s, Planets:%n\", system);\n for (String p: n.planetNames(5, system)) {\n System.out.println(p);\n }\n }\n // System.out.println();\n // System.out.println(\"Human Names:\");\n // for (int i = 0; i < 10; i++) {\n // System.out.println(n.newHumanName());\n // }\n\n }", "public static void main(String[] args) {\n int[] t1 = getIDs();\n String[] t2 = getIcons();\n String[] t3 = getNames();\n for (int i = 0; i < t1.length; i++) {\n System.out.println(t1[i] + \", \" + t2[i] + \", \" + t3[i]);\n }\n }", "public static void main(String[] args) {\n\t\tString a = \"abc\";\n\t\tString b = \"cbb\";\n\t\tPermutationString p = new PermutationString();\n\t\tSystem.out.println(p.permutationStrin(a,b));\n\n\t}", "public static void main(String[] args) {\n Set<String> list = new TreeSet<>();\n list.add(\"Song\");\n list.add(\"Album\");\n list.add(\"Artist\");\n list.add(\"Year\");\n list.add(\"Genre\");\n list.add(\"Song\");\n list.add(\"Song\");\n\n System.out.println();\n for(String x : list){\n System.out.println(x);\n }\n\n //NO REPITTED VALUES AND ASCENDED ORDER WHIT COMPARABLE, HASHCODE AND EQUALS\n Set<Persona> list2 = new TreeSet<>();\n list2.add(new Persona(1, \"Rayman\"));\n list2.add(new Persona(2, \"Castlevania\"));\n list2.add(new Persona(3, \"Silent Hill\"));\n list2.add(new Persona(4, \"Silent Hill\"));\n list2.add(new Persona(1, \"Rayman\"));\n\n System.out.println();\n for(Persona x : list2){\n System.out.println(x.getId() + \" - \" + x.getName());\n }\n }", "@Test\n public void testSetValue() throws Exception {\n\n Map<String, IMetaData<SampleMark>> name2MetaData;\n name2MetaData = factory.class2MetaDataByFullPath(Person.class);\n\n for (Person p : persons) {\n\n float weight = SampleDataGenerator.getSampleWeight(random, p.weight);\n int age = p.getAge();\n String lastName = p.getLastname();\n\n IMetaData<SampleMark> metaData =\n name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|weight\");\n metaData.setValue(p, weight);\n Person.assertPerson(p, lastName, weight, age);\n }\n\n for (Person p : persons) {\n\n float weight = p.weight;\n int age = p.getAge();\n String lastName =\n SampleDataGenerator.getSampleLastName(random, p.getLastname());\n IMetaData<SampleMark> metaData =\n name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|lastname\");\n metaData.setValue(p, lastName);\n Person.assertPerson(p, lastName, weight, age);\n }\n\n name2MetaData = factory.class2MetaDataByFullPath(Car.class);\n for (Car c : cars) {\n\n Driver driver = c.getDriver();\n String lastName = driver.getLastname();\n float weight = SampleDataGenerator.getSampleWeight(random, driver.weight);\n int age = driver.getAge();\n boolean hasDrivingLicense = driver.hasDrivingLicense;\n\n Engine engine = c.getEngine();\n String productName =\n SampleDataGenerator.getSampleProductName(random, engine.productName);\n\n Oil oil = engine.oil;\n String producentName = oil.producentName;\n String vendorName = oil.vendorName;\n\n IMetaData<SampleMark> metaData =\n name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|weight\");\n\n metaData.setValue(c, weight);\n\n metaData =\n name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|productName\");\n\n metaData.setValue(c, productName);\n\n Driver.assertDriver(driver, lastName, weight, age,\n hasDrivingLicense);\n\n Engine.assertEngine(engine, productName);\n\n Oil.assertOil(oil, vendorName, producentName);\n\n }\n\n }", "public static void main(String[] args) {\n\n\t\tList<De> d = new ArrayList<De>();\n\n\t\td.add(new De(1, \"A\", 10.2f));\n\t\td.add(new De(2, \"B\", 33.2f));\n\t\td.add(new De(3, \"C\", 55.2f));\n\t\td.add(new De(4, \"D\", 166.2f));\n\t\td.add(new De(5, \"E\", 18.2f));\n\n\t\td.forEach(k -> System.out.println(k.id));\n\n\t\tMap<Integer, String> m = d.stream().collect(Collectors.toMap(i -> i.id, v -> v.name));\n\t\tSystem.out.println(m);\n\t}", "@Test\r\n public void testTallyIdentifiers() throws Exception {\r\n System.out.println(\"tallyIdentifiers\");\r\n String identifiers = \"1k2h3u\";\r\n String [] args= {\"1k2h3u\",\"test\"};\r\n CommandLineArgumentParser instance = new CommandLineArgumentParser(args);\r\n int expResult = 6;\r\n int result = instance.tallyIdentifiers(identifiers);\r\n assertEquals(expResult, result);\r\n }", "@Test\n\tpublic void testAllExampleGenerations() {\n\t\ttry {\n\t\t\tOdfHelper.main(null);\n\t\t} catch (Exception ex) {\n\t\t\tLOG.log(Level.SEVERE, null, ex);\n\t\t\tAssert.fail(ex.toString());\n\t\t}\n\t}", "public static void main(String[] args) {\n String S = \"C\";\n List<String> list = letterCasePermutation(S);\n\n for(String str : list){\n System.out.println(str);\n }\n }", "public static void main(String[] args) {\n\n\t\tSet<String> nature = new HashSet<>();\n\t\tSet<String> devine = new HashSet<>();\n\n\t\tString[] natureWords = { \"all\", \"nature\", \"is\", \"but\", \"art\", \"unknown\", \"to\", \"thee\" };\n\t\tString[] devineWords = { \"to\", \"err\", \"is\", \"human\", \"to\", \"forgive\", \"devine\" };\n\n\t\tnature.addAll(Arrays.asList(natureWords));\n\t\tdevine.addAll(Arrays.asList(devineWords));\n\n\t\tSystem.out.println(\"/*--- Nature ---*/\");\n\t\tprintSet(nature);\n\n\t\tSystem.out.println(\"/*--- Devine ---*/\");\n\t\tprintSet(devine);\n\n\t\tSystem.out.println(\"/*--- Union ---*/\");\n\t\tSet<String> union = new HashSet<>(nature);\n\t\tunion.addAll(devine);\n\t\tprintSet(union);\n\n\t\tSystem.out.println(\"/*--- Intersection ---*/\");\n\t\tSet<String> intersection = new HashSet<>(nature);\n\t\tintersection.retainAll(devine);\n\t\tprintSet(intersection);\n\t}", "public static void main(String[] args) {\n\t\tGroupAnagrams res = new GroupAnagrams();\n\t\tString[] strs = {\"eat\", \"tea\", \"tan\", \"ate\", \"nat\", \"bat\"};\n\t\tSystem.out.println(res.groupAnagrams(strs));\n\t\tSystem.out.println(res.groupAnagramsI(strs));\n\t}", "private static void test4() {\n int[] numbers = {4, 5, 1, 6, 2, 7, 2, 8};\n int[] expected = {1, 2};\n\n test(\"Test4\", numbers, expected);\n }", "public static void main(String[] args) {\n\t\tisPermutation(\"Dfhruviul\",\"rDhuflviu\");\r\n\t}", "public static void main(String[] args) {\n //\n // define set of fruits\n Set<String> fruits = \n ImmutableSet.<String>builder()\n .add(\"apple\")\n .add(\"orange\")\n .add(\"banana\")\n .add(\"guava\")\n .build();\n\n // all combinations\n Set<Set<String>> fruitsPowerSet = Sets.powerSet(fruits);\n\n // print combinations\n for (Set<String> fruit : fruitsPowerSet) {\n System.out.println(fruit);\n }\n }", "public static void main(String[] args) {\n String[] parts = new String[]{\"1S01\", \"1S01\", \"1S01\", \"1S01\", \"1S01\", \"1S02\", \"1S02\", \"1S02\", \"1H01\", \"1H01\", \"1S02\", \"1S01\", \"1S01\", \"1H01\", \"1H01\", \"1H01\", \"1S02\", \"1S02\", \"1M02\", \"1M02\", \"1M02\"};\n\n // Create Product Name Part Number map\n Map<String, String> productNames = new TreeMap<>();\n productNames.put(\"Blue Polo Shirt \", \"1S01\");\n productNames.put(\"Black Polo Shirt\", \"1S02\");\n productNames.put(\"Red Ball Cap \", \"1H01\");\n productNames.put(\"Duke Mug \", \"1M02\");\n\n // Create Product Counter Object and process data\n ProductCounter counter = new ProductCounter(productNames);\n counter.processList(parts);\n counter.printReport();\n }", "@Test\n\tpublic void generateTest(){\n\t\tSemanticActions actions = new SemanticActions();\n\t\tQuadruples quads = actions.getQuads();\n\t\tactions.generate(\"hello\");\n\t\tassertTrue(quads.getNextQuad() == 1);\n\t\tassertArrayEquals(new String[] {\"hello\"}, quads.getQuad(0));\n\t\t\n\t\tVariableEntry varE = new VariableEntry(\"A\", TokenType.IDENTIFIER);\n\t\tvarE.setAddress(1);\n\t\tactions.generate(\"move\", new ConstantEntry(\"100\"), varE);\n\t\tassertTrue(quads.getNextQuad()==3);\n\t\tassertArrayEquals(new String[] {\"move\", \"100\", \"_0\"}, quads.getQuad(1));\n\t\tassertArrayEquals(new String[]{\"move\", \"_0\", \"_1\"}, quads.getQuad(2));\n\t\t\n\t\tactions.generate(\"PROCBEGIN\", new ProcedureEntry(\"MAIN\"));\n\t\tassertTrue(quads.getNextQuad() == 4);\n\t\tassertArrayEquals(new String[] {\"PROCBEGIN\", \"main\"}, quads.getQuad(3));\n\t}", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "private void mutation() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tint num = (int) (Math.random() * GENE * ChrNum + 1);\n\t\t\tint chromosomeNum = (int) (num / GENE) + 1;\n\n\t\t\tint mutationNum = num - (chromosomeNum - 1) * GENE; \n\t\t\tif (mutationNum == 0) \n\t\t\t\tmutationNum = 1;\n\t\t\tchromosomeNum = chromosomeNum - 1;\n\t\t\tif (chromosomeNum >= ChrNum)\n\t\t\t\tchromosomeNum = 9;\n\t\t\tString temp;\n\t\t\tString a; \n\t\t\tif (ipop[chromosomeNum].charAt(mutationNum - 1) == '0') { \n a = \"1\";\n\t\t\t} else { \n\t\t\t\ta = \"0\";\n\t\t\t}\n\t\t\t\n\t\t\tif (mutationNum == 1) {\n\t\t\t\ttemp = a + ipop[chromosomeNum].substring(mutationNum);\n\t\t\t} else {\n\t\t\t\tif (mutationNum != GENE) {\n\t\t\t\t\ttemp = ipop[chromosomeNum].substring(0, mutationNum -1) + a \n\t\t\t\t\t\t\t+ ipop[chromosomeNum].substring(mutationNum);\n\t\t\t\t} else {\n\t\t\t\t\ttemp = ipop[chromosomeNum].substring(0, mutationNum - 1) + a;\n\t\t\t\t}\n\t\t\t}\n \tipop[chromosomeNum] = temp;\n\t\t}\n\t}", "@Test\n public void subSequencesTest1() {\n String text = \"crypt\"\n + \"ograp\"\n + \"hyand\"\n + \"crypt\"\n + \"analy\"\n + \"sis\";\n\n String[] expected = new String[5];\n expected[0] = \"cohcas\";\n expected[1] = \"rgyrni\";\n expected[2] = \"yrayas\";\n expected[3] = \"panpl\";\n expected[4] = \"tpdty\";\n String[] owns = this.ic.subSequences(text, 5);\n for (int i = 0; i < expected.length; i++) {\n assertEquals(expected[i], owns[i]);\n }\n }", "public static void main(String[] args) {\n new LC22_GenerateParenthesis().generateParenthesis(3).forEach(k-> System.out.println(k));\n }", "public static void main(String[] args) {\n Permutation p = new Permutation(3, 3);\n p.print();\n }", "public static void main(String[] args) {\n\t\tScanner keyboard= new Scanner(System.in);\r\nSystem.out.print(\"Enter a number:\");\r\nString word1,word2 = null,word3 = null,word4; //Create four string for four outputs\r\nint number = keyboard.nextInt();\r\nif(number%15==0){ word1=\"special\";}//check weather it is special\r\nelse { word1=\"not special\";}\r\nif( number>999){word3=\"big\";}//check weather it is big\r\nelse{word3=\"not big\";}\r\nif(number%5==0&&number%6==0&&number%18!=0){word2=\"weird\";} //check weather it is weird\r\nelse{word2=\"not weird\";}\r\nif(word3==\"big\"||word2==\"weird\"){word4=\"scary\";}//check weather it is scary\r\nelse{word4=\"not scary\";}\r\n \r\n// strings ae compared in oder to check the all possible outcome combinations\r\n//Then outcomes are printed as given in the sample test cases\r\n\r\nif(word1==\"special\" && word4!=\"scary\"){\r\n\tSystem.out.println(number+\" is \"+\" \"+word1+\", but \"+word4+\".\");\r\n}\r\nif(word1==\"special\" && word3!=\"big\"&& word2==\"weird\"){\r\n\tSystem.out.println(number+\" is \"+word1+\", \"+word2+\", \"+word4+\", but \"+word3+\".\");\r\n}\r\nif(word1==\"special\" && word3==\"big\" && word2!=\"weird\"){\r\n\tSystem.out.println(number+\" is \"+word1+\" , \"+word3+\", \"+word4+\", but \"+word2+\".\");\r\n}\r\nif(word1!=\"special\" && word3==\"big\" && word2!=\"weird\"){\r\n\tSystem.out.println(number+\" is \"+word3+\", \"+word4+\", but \"+word2+\".\");\r\n}\r\nif(word1!=\"special\" && word3!=\"big\" && word2==\"weird\"){\r\n\tSystem.out.println(number+\" is \"+word2+\", \"+word4+\", but \"+word3+\".\");\r\n}\r\nif(word1!=\"special\" && word3!=\"big\" && word2!=\"weird\"){\r\n\tSystem.out.println(number+\" is \"+word4+\".\");\r\n}\r\nif(word1==\"special\" && word3==\"big\" && word2==\"weird\"){\r\n\tSystem.out.println(number+\" is \"+word1+\", \"+word3+\", \"+word2+\", \"+word4+\".\");\r\n}\r\n\r\n\r\nkeyboard.close();\r\n\t}", "@Test\r\n public void testGetDiseasesByMgiGeneId() {\r\n String mgiGeneId = \"MGI:95523\";\r\n\r\n Set<Disease> result = instance.getDiseasesByMgiGeneId(mgiGeneId);\r\n// System.out.println(\"Human ortholog diseases for mouse gene \" + mgiGeneId);\r\n// for (Disease disease : result) {\r\n// System.out.println(disease.getDiseaseId() + \" - \" + disease.getTerm());\r\n// }\r\n assertTrue(result.size() >= 14);\r\n\r\n }", "public static void main(String[] args) {\r\n\r\n\tAlternation a = new Alternation();\r\n\t\r\n\ta.add(new Literal(\"steaming\"));\r\n\ta.add(new Literal(\"hot\"));\r\n\r\n\tRepetition adjectives = new Repetition(a);\r\n\r\n\tTokenAssembly ta = \r\n\t\tnew TokenAssembly(\"hot hot steaming hot coffee\");\r\n\t\r\n\tSystem.out.println(adjectives.bestMatch(ta));\r\n}", "public static void main(String[] args) {\n\n// Random randomizer = new Random();\n// //grab a random noun and adj\n// int randInt = randomizer.nextInt(11);\n// System.out.println(\" random adjective is : \" + adj[randInt]);\n// System.out.println( \" random noun is : \" + noun[randInt]);\n// String randAdj = adj[randInt];\n// String randNoun = noun[randInt];\n// System.out.println();\n// System.out.println(\"Here is your server name: \" + randAdj + \"-\" + randNoun);\n\n //another method\n String nouns = getRandomWord(noun);\n String adjs = getRandomWord(adj);\n System.out.println(adjs + \"-\" + nouns);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Input Testing: anargram and margana\");\n\t\tSystem.out.println(\"Expercted output: Anagrams\");\n\t\tif (isAnagram(\"anagram\", \"margana\") ) \n\t\t\tSystem.out.println(\"Your output: Anagrams\");\n\t\telse\n\t\t\tSystem.out.println(\"Your output: Not Anagrams\");\n\t\t\n\t\t//Test Case 2\n\t\tSystem.out.println(\"\\nInput Testing: anagramm and marganaa\");\n\t\tSystem.out.println(\"Expercted output: Not Anagrams\");\n\t\tif (isAnagram(\"anagramm\", \"marganaa\") ) \n\t\t\tSystem.out.println(\"Your output: Anagrams\");\n\t\telse\n\t\t\tSystem.out.println(\"Your output: Not Anagrams\");\n\t\t\n\t\t//Test Case 3\n\t\tSystem.out.println(\"\\nInput Testing: Hello and hello\");\n\t\tSystem.out.println(\"Expercted output: Anagrams\");\n\t\tif (isAnagram(\"Hello\", \"hello\") ) \n\t\t\tSystem.out.println(\"Your output: Anagrams\");\n\t\telse\n\t\t\tSystem.out.println(\"Your output: Not Anagrams\");\n\t}", "public static void main(String[] args) {\n\t\tWords_possible sn = new Words_possible();\n\t\tList<String> list = sn.letterCombinations(\"2\");\n\t\tfor(String s:list)\n\t\t{\n\t\t\tSystem.out.println(s);\n\t\t}\n\t}", "@Test\n public void subSequencesTest2() {\n String text = \"hashco\"\n + \"llisio\"\n + \"nsarep\"\n + \"ractic\"\n + \"allyun\"\n + \"avoida\"\n + \"blewhe\"\n + \"nhashi\"\n + \"ngaran\"\n + \"domsub\"\n + \"setofa\"\n + \"larges\"\n + \"etofpo\"\n + \"ssible\"\n + \"keys\";\n\n String[] expected = new String[6];\n expected[0] = \"hlnraabnndslesk\";\n expected[1] = \"alsalvlhgoeatse\";\n expected[2] = \"siacloeaamtroiy\";\n expected[3] = \"hsrtyiwsrsogfbs\";\n expected[4] = \"cieiudhhaufepl\";\n expected[5] = \"oopcnaeinbasoe\";\n String[] owns = this.ic.subSequences(text, 6);\n for (int i = 0; i < expected.length; i++) {\n assertEquals(expected[i], owns[i]);\n }\n }", "void permutateObjects()\n {\n for (int i = 0; i < sampleObjects.length; i++)\n {\n for (int i1 = 0; i1 < (r.nextInt() % 7); i1++)\n {\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleStrings[r.nextInt(5)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleNumbers[r.nextInt(5)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n specialValues[r.nextInt(2)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleArrays[r.nextInt(5)]);\n }\n }\n }", "public static String randomIdentifier() {\r\n\t\tfinal String lexicon = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\t\tfinal java.util.Random rand = new java.util.Random();\r\n\t\t// consider using a Map<String,Boolean> to say whether the identifier is\r\n\t\t// being used or not\r\n\t\tfinal Set<String> identifiers = new HashSet<String>();\r\n\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\twhile (builder.toString().length() == 0) {\r\n\t\t\tint length = rand.nextInt(5) + 5;\r\n\t\t\tfor (int i = 0; i < length; i++)\r\n\t\t\t\tbuilder.append(lexicon.charAt(rand.nextInt(lexicon.length())));\r\n\t\t\tif (identifiers.contains(builder.toString()))\r\n\t\t\t\tbuilder = new StringBuilder();\r\n\t\t}\r\n\t\treturn builder.toString();\r\n\t}", "public void testStringID() {\n String testID = generator.generatePrefixedIdentifier(\"test\");\n assertNotNull(testID);\n assertTrue(testID.matches(\"test\" + ID_REGEX));\n }", "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\t PermuteString prm=new PermuteString();\n\t System.out.println(\"enter the string for permutation\");\n\t String s1=Utility.getString();\n\t \n\t int len=s1.length();\n\t //initialize the stating index\n\t int start=0;\n\t //calling function to print permutation\n\t prm.getPermutation(s1,start, len);\n\t \n\t \n }", "@SuppressWarnings(\"checkstyle:avoidinlineconditionals\")\n private static void setUpNameList() {\n List<String> names = new ArrayList<>();\n String verb;\n String noun;\n for (int i = 0; i < NUMBER_OF_NAMES; i++) {\n verb = GenerationHelper.randomElement(verbs);\n noun = GenerationHelper.randomElement(nouns);\n String taskName = verb;\n taskName += \"aeiou\".contains(noun.subSequence(0, 1)) ? \" an \" : \" a \";\n taskName += noun;\n names.add(Character.toUpperCase(taskName.charAt(0)) + taskName.substring(1));\n }\n taskNames = new String[names.size()];\n names.toArray(taskNames);\n }", "public static void main(String[] args) throws Exception {\n List<Integer> numberList = IntStream\n .generate(() -> ThreadLocalRandom.current().nextInt(10))\n .limit(100)\n .boxed()\n .collect(Collectors.toList());\n\n // collecting the stream to a set\n Set<Integer> numberSet = IntStream\n .generate(() -> ThreadLocalRandom.current().nextInt(10))\n .limit(100)\n .boxed()\n .collect(Collectors.toSet());\n\n // String concatenation again\n String s = Arrays.asList(\"John\", \"Jack\", \"Mary\", \"Nancy\")\n .stream()\n .collect(Collectors.joining(\",\"));\n\n // create a map; keys are names; values are length of names\n Map<String, Integer> m1 =\n Arrays.asList(\"Jack\", \"John\", \"Jeremy\", \"Mary\", \"Nancy\")\n .stream()\n .collect(Collectors.toMap(e -> e, e -> e.length()));\n\n // create a map; keys are length of names; values are list of names\n Map<Integer, List<String>> m2 =\n Arrays.asList(\"Jack\", \"John\", \"Jeremy\", \"Mary\", \"Nancy\")\n .stream()\n .collect(Collectors.groupingBy(\n name -> name.length(),\n Collectors.toList()\n ));\n }", "public static void main(String[] args) {\n\n String[] strings = {\"eat\", \"tea\", \"tan\", \"ate\", \"nat\", \"bat\"};\n List<List<String>> lists = new GroupAnagrams().groupAnagrams(strings);\n System.out.println(\"lists = \" + lists);\n }", "public static void main(String[] args) {\n\t\tPeptide peptide = new Peptide(\"P41220\", \"MQSAMFLAVQHDCRPMDKSAGSGHKSEEKREKMKRTLLKDWKTRLSYFLQNSSTPGKPKTGKKSKQQAFIKPSPEEAQLWSEAFDELLASKYGLAAFRAFLKSEFCEENIEFWLACEDFKKTKSPQKLSSKARKIYTDFIEKEAPKEINIDFQTKTLIAQNIQEATSGCFTTAQKRVYSLMENNSYPRFLESEFYQDLCKKPQITTEPHAT\");\n\t\tpeptide.addPositive(106 - 1, 'C');\n\t\tpeptide.addPositive(116 - 1, 'C');\t\t\n\t\tpeptide.addPositive(199 - 1, 'C');\n\t\tpeptide.generateNegativePositions('C');\n\t\tSystem.out.println(peptide.generateSites(20, 20));\n\t}", "public static void printGeneratedCombinationInferredSafety() {\n\t\tfinal int random_distance = randomizer(LARGE_DISTANCE * 3);\n\t\tfinal int random_duration = randomizer(LARGE_DURATION * 3);\n\t\tfinal int random_exhalation = randomizer(LARGE_EXHALATION_LEVEL * 3);\n\t\t\n\t\tfinal boolean isSafe = isInferredSafe(random_distance, random_duration, random_exhalation);\n\t\t\n\t\tSystem.out.println(\"\" + random_distance + COMMA + random_duration + COMMA + random_exhalation + COMMA + isSafe + \"\");\n\t}", "public static void main(String[] args) {\r\n\t\t P187RepeatedDNASequences p = new P187RepeatedDNASequences();\r\n\t\t List<String> r = p.findRepeatedDnaSequences(\"AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT\"); //\r\n\t\t for(String t : r) {\r\n\t\t\t System.out.println(t);\t\t\t \r\n\t\t }\r\n\t }", "public static void main(String[] args) {\n\t\n\t\n\t\tSet<String> ids=new TreeSet<String>();\n\t\tAccount a=new Account();\n\t\tids.add(\"one\");\n\t\tids.add(\"two\");\n\t\tids.add(\"three\");\n\t\tids.add(\"one\");\n\t\n\t\t//System.out.println(ids);\n\t\t\n\t\tfor(String value:ids){\n\t\t\tSystem.out.println(value);\n\t\t}\n}", "public interface IDs {\n\n static final String SERIES_STANDARD_ID = \"c7fb8441-d5db-4113-8af0-e4ba0c3f51fd\";\n static final String EPISODE_STANDARD_ID = \"a99a8588-93df-4811-8403-fe22c70fa00a\";\n static final String FILE_STANDARD_ID = \"c5919cbf-fbf3-4250-96e6-3fefae51ffc5\";\n static final String RECORDING_STANDARD_ID = \"4a40811d-c067-467f-8ff6-89f37eddb933\";\n static final String ZAP2IT_STANDARD_ID = \"545c4b00-5409-4d92-9cda-59a44f0ec7a9\";\n}", "private void processIdentificator() {\r\n\t\tString identificator = generateString();\r\n\r\n\t\tif (identificator.equals(Constants.AND_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.AND_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.XOR_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.XOR_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.OR_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.OR_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.NOT_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.NOT_STRING);\r\n\r\n\t\t} else if (identificator.equals(trueString)) {\r\n\t\t\ttoken = new Token(TokenType.CONSTANT, true);\r\n\r\n\t\t} else if (identificator.equals(falseString)) {\r\n\t\t\ttoken = new Token(TokenType.CONSTANT, false);\r\n\r\n\t\t} else {\r\n\t\t\ttoken = new Token(TokenType.VARIABLE, identificator.toUpperCase());\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\r\n \t\r\n \tfor (int i = 0; i < 20; ++i)\r\n System.out.println(i + \" - Unique Ways DP : \" + countUniqueCombinationsDP(i)\r\n\t\t\t \t\t + \", Unique Ways Recursive : \" + countUniqueCombinationsR(i));\r\n }", "public void testGenomeIds() {\n assertThat(CoreUtilities.genomeOf(\"fig|12345.6.peg.10\"), equalTo(\"12345.6\"));\n assertThat(CoreUtilities.genomeOf(\"fig|23456.789.202.10\"), equalTo(\"23456.789\"));\n assertThat(CoreUtilities.genomeOf(\"patric|123.45.peg.10\"), equalTo(null));\n }", "@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\t@DisplayName(\"SP800-73-4.55 test\")\n\tvoid sp800_73_4_Test_55 (String oid, TestReporter reporter) {\n\t\t\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tList<BerTag> tagList = o.getTagList();\n\t\t\n\t\tBerTag cardAppAIDTag = new BerTag(TagConstants.PIV_CARD_APPLICATION_AID_TAG);\n\t\t\n\t\tint tagIndex = tagList.indexOf(cardAppAIDTag);\n\t\t\n\t\t//Confirm (0x4F, 0x5F2F) tag order\n\t\tassertTrue(Arrays.equals(tagList.get(tagIndex).bytes,TagConstants.PIV_CARD_APPLICATION_AID_TAG));\n\t\tassertTrue(Arrays.equals(tagList.get(tagIndex+1).bytes,TagConstants.PIN_USAGE_POLICY_TAG));\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString p = \"cato catt\";\n\t\tSystem.out.print(isPalPerm(p));\n\n\t}", "public static void main(String args[]) {\n// \t/**\n// \t *test getLongId\n// \t */\n// \tfor (int i=0;i<100;i++){\n// \t\tSystem.out.println(i+\" getLongId=\" + getLongId()); \n// \t}\n// \t/**\n// \t * test uuid generate\n// \t */\n// for (int i=0; i< 100; i++) {\n// \tUUIDGenerator UUIDgenerator = UUIDGenerator.getInstance();\n// \tUUID uuid = UUIDgenerator.generateRandomBasedUUID();\n// \tString result = uuid.toString().replaceAll(\"-\", \"\");\n// \tSystem.out.println(i+\" UUID=\" + uuid.toString()); \t\n// \t System.out.println(i+\" resu=\" + result);\n// \t System.out.println(i+\" size=\" + result.length());\n// }\n \tSystem.out.println(UuidGenerator.getRandomPwd(8));\n }", "@Test\r\n public void genePageIntegrationTest() {\n PhenoDigmDao diseaseDao = instance;\r\n\r\n String mgiGeneId = \"MGI:95523\";\r\n System.out.println(String.format(\"\\n\\nGene: %s\", mgiGeneId));\r\n System.out.println(\"Known Disease Associations:\");\r\n Map<Disease, Set<DiseaseAssociation>> knownDiseases = diseaseDao.getKnownDiseaseAssociationsForMgiGeneId(mgiGeneId);\r\n Map<Disease, Set<DiseaseAssociation>> predictedDiseases = diseaseDao.getPredictedDiseaseAssociationsForMgiGeneId(mgiGeneId);\r\n\r\n if (knownDiseases.keySet().isEmpty()) {\r\n System.out.println(\" No known disease associations for \" + mgiGeneId);\r\n }\r\n for (Disease disease : knownDiseases.keySet()) {\r\n System.out.println(disease.getTerm());\r\n System.out.println(disease);\r\n System.out.println(String.format(\"%n Mouse Disease Models with Phenotypic Similarity to %s - via Literature:\", disease.getTerm()));\r\n Set<DiseaseAssociation> literatureDiseaseAssociations = knownDiseases.get(disease);\r\n System.out.print(formatDiseaseAssociations(literatureDiseaseAssociations));\r\n\r\n System.out.println(String.format(\"%n Phenotypic Matches to Mouse Models of %s:\", disease.getTerm()));\r\n Set<DiseaseAssociation> phenotypicDiseaseAssociations = predictedDiseases.get(disease);\r\n if (phenotypicDiseaseAssociations == null) {\r\n phenotypicDiseaseAssociations = new TreeSet<DiseaseAssociation>();\r\n }\r\n System.out.print(formatDiseaseAssociations(phenotypicDiseaseAssociations));\r\n }\r\n\r\n System.out.println(\"\\nPredicted Disease Associations: (first 10 only)\");\r\n if (knownDiseases.keySet().isEmpty()) {\r\n System.out.println(\" No predicted disease associations for \" + mgiGeneId);\r\n }\r\n \r\n Iterator<Disease> predictedDiseaseIterator = predictedDiseases.keySet().iterator();\r\n for (int i = 0; i < 10; i++) {\r\n if (predictedDiseaseIterator.hasNext()) {\r\n Disease disease = predictedDiseaseIterator.next();\r\n System.out.println(String.format(\" %s %s\", disease.getTerm(), disease.getDiseaseId()));\r\n System.out.print(formatDiseaseAssociations(predictedDiseases.get(disease))); \r\n } \r\n }\r\n \r\n System.out.println(\"--------------------------------------------------------------------------------------------------\\n\");\r\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 }", "public static void main(String[] args) {\r\n\r\n\t\tSystem.out.println(\"string=\\\"ppqp\\\", pattern=\\\"pq\\\" output:[1,2] got : \" + findStringAnagrams(\"ppqp\", \"pq\"));\r\n\t\tSystem.out.println(\r\n\t\t\t\t\"string=\\\"abbcabc\\\", pattern=\\\"abc\\\" output:[2,3,4] got : \" + findStringAnagrams(\"abbcabc\", \"abc\"));\r\n\t}", "public static void sampling(String[][][] god){\n Scanner myScanner = new Scanner(System.in);\n String letters = \"AA\";\n String numbers = \"0000\";\n \n System.out.print(\"Enter a 2 characters:\");\n letters = myScanner.nextLine();\n String uppercase = letters.toUpperCase();\n System.out.print(\"Enter a 4 integer sequence:\");\n numbers = myScanner.nextLine();\n \n String code = uppercase + numbers;\n System.out.print(code);\n \n int findCount = 0;\n \n for(int i = 0; i < god.length; i++){\n for(int j = 0; j < god[i].length; j++){\n for(int k = 0; k < god[i][j].length; k++){\n if(god[i][j][k].equals(code)){\n System.out.print(\"The code was found at position (\" + i + \",\" + j + \",\" + k + \")\");\n findCount++; \n }\n }\n }\n }\n \n if (findCount == 0){\n System.out.print(\"Code not found.\");\n }\n \n }", "@Test\n\tpublic void test() {\n\t\tlong firstID = UIDGen.getInstance().getNextId();\n\t\tint n = 100;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tUIDGen.getInstance().getNextId();\n\t\t}\n\t\tlong currentID = UIDGen.getInstance().getNextId();\n\t\tassertEquals(currentID, firstID + n + 1);\n\n\t\t// expect a IDInvalidException exception for using and\n\t\t// external id that has already been used\n\t\tlong exteranlId = currentID;\n\t\tThrowable caught = null;\n\t\ttry {\n\t\t\tUIDGen.getInstance().considerExternalId(exteranlId);\n\t\t} catch (Throwable t) {\n\t\t\tcaught = t;\n\t\t}\n\t\tassertNotNull(caught);\n\t\tassertSame(IDInvalidException.class, caught.getClass());\n\n\t\t// push an external id that is not used and expect no exception\n\t\texteranlId = currentID + 2;\n\t\ttry {\n\t\t\tUIDGen.getInstance().considerExternalId(exteranlId);\n\t\t} catch (Throwable t) {\n\t\t\tfail();\n\t\t}\n\n\t\t// expect an exception as we put the same id again\n\t\texteranlId = currentID;\n\t\tcaught = null;\n\t\ttry {\n\t\t\tUIDGen.getInstance().considerExternalId(exteranlId);\n\t\t} catch (Throwable t) {\n\t\t\tcaught = t;\n\t\t}\n\t\tassertNotNull(caught);\n\t\tassertSame(IDInvalidException.class, caught.getClass());\n\n\t\t// must skip currentID + 2 as it was defined as an external id\n\t\tassertEquals(UIDGen.getInstance().getNextId(), currentID + 1);\n\t\tassertEquals(UIDGen.getInstance().getNextId(), currentID + 3);\n\t}", "public static void main(String[] args) {\n Character wildCard = '*';\n List<Character> chars = new ArrayList<>(Arrays.asList('d', 'o', 'r', wildCard));\n String testWord = \"door\";\n System.out.println(isWordCreatable(chars, testWord, wildCard));\n }", "public static void main(String[] args) {\n Solution app = new Solution();\n System.out.println(app.getPermutation(4, 5));\n }", "public static void main(String[] args) {\n\t\tList<String> femaleFirstNames = CSVReader.getFemaleFirstNames();\r\n\t\tList<String> maleFirstNames = CSVReader.getMaleFirstNames();\r\n\t\tList<String> lastNames = CSVReader.getLastNames();\r\n\r\n\t\t// Instantiating a NameService object\r\n\t\tNameService ns = new NameService(maleFirstNames, femaleFirstNames, lastNames);\r\n\r\n\t\tList<Person> persons = new ArrayList<>();\r\n\t\t// Creating 500 random persons and adding them to a list\r\n\t\tfor (int i = 0; i < 500; i++) {\r\n\t\t\tpersons.add(ns.getNewRandomPerson());\r\n\t\t}\r\n\r\n\t\tLab theLab = new Lab(persons);\r\n\r\n\t\t// Run your exercises here\r\n\t\tboolean running = true;\r\n\t\twhile (running) {\r\n\t\t\tSystem.out.println(\"\\nRun witch one?(1-11)(0-Quit)\");\r\n\t\t\tswitch (getIntFromLimit(11, 0)) {\r\n\t\t\tcase 1:\r\n\t\t\t\ttheLab.exercise1();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\ttheLab.exercise2();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\ttheLab.exercise3();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\ttheLab.exercise4();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\ttheLab.exercise5();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 6:\r\n\t\t\t\ttheLab.exercise6();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\ttheLab.exercise7();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 8:\r\n\t\t\t\ttheLab.exercise8();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 9:\r\n\t\t\t\ttheLab.exercise9();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10:\r\n\t\t\t\ttheLab.exercise10();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 11:\r\n\t\t\t\ttheLab.exercise11();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 0:\r\n\t\t\tdefault:\r\n\t\t\t\trunning = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Goodbye!\");\r\n\t\t\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 }", "public static void main(String[] args) {\n String exclamation1 = \"Ouch!\";\n String exclamation2 = \"Hoorah!\";\n String exclamation3 = \"Amazing!\";\n String adverb1 = \"stupidly\";\n String adverb2 = \"happily\";\n String adverb3 = \"shamefully\";\n String noun1 = \"car\";\n String noun2 = \"book\";\n String noun3 = \"bird\";\n String adjective1 = \"tall\";\n String adjective2 = \"smart\";\n String adjective3 = \"funny\";\n System.out.println( exclamation1+ \" he said \" + adverb1 +\n \" as he jumped into his convertible \" + noun1 +\n \" and drove off with his \" + adjective1 + \" wife.\");\n\n\n\n\n }", "public static void main(String[] args) {\n// System.out.println(anagram1());\n// System.out.println(anagram2());\n// System.out.println(anagram3());\n System.out.println(anagram4());\n\n }", "public static void main(String[] args) {\n String [][]table1 = new String[][]{{\"Real World Mathematics\", \"ECM0002\"}, {\"Programming\", \"ECM1400\"}, {\"Data Structures\", \"ECM1406\"}, {\"Object-Oriented Programming\", \"ECM1410\"}, {\"Information Systems\", \"BEM2027\"}, {\"Thermal Physics\", \"PHY2023\"}};\n \n double [][]table1Doubles = new double[][]{{0.1, 0.3, 0.6},{0.25, 0.25, 0.25, 0.25},{0.25, 0.25, 0.5},{0.2, 0.3, 0.5},{0.1, 0.3, 0.3, 0.3},{0.4, 0.6}}; \n \n ModuleDescriptor ECM0002 = new ModuleDescriptor(table1[0][0], table1[0][1], table1Doubles[0]);\n ModuleDescriptor ECM1400 = new ModuleDescriptor(table1[1][0], table1[1][1], table1Doubles[1]);\n ModuleDescriptor ECM1406 = new ModuleDescriptor(table1[2][0], table1[2][1], table1Doubles[2]);\n ModuleDescriptor ECM1410 = new ModuleDescriptor(table1[3][0], table1[3][1], table1Doubles[3]);\n ModuleDescriptor BEM2027 = new ModuleDescriptor(table1[4][0], table1[4][1], table1Doubles[4]);\n ModuleDescriptor PHY2023 = new ModuleDescriptor(table1[5][0], table1[5][1], table1Doubles[5]);\n \n //%%%%%%%%%%maing student objects%%%%%%%%%%%%%%%%%%%%%%%%\n int []IDs = new int[]{1000,1001,1002,1003,1004,1005,1006,1007,1008,1009};\n String []names = new String[]{\"Ana\", \"Oliver\", \"Mary\", \"John\", \"Noah\", \"Chico\", \"Maria\", \"Mark\", \"Lia\", \"Rachel\"};\n char []genders = new char[]{'F', 'M', 'F', 'M', 'M', 'M', 'F', 'X', 'F', 'F'};\n \n Student []students_ = new Student[10];\n for (int i=0;i<10;i++){\n students_[i] = new Student(IDs[i], names[i], genders[i]);\n //System.out.println(students_[i]);\n }\n \n //%%%%%%%%%%%%making the module object%%%%%%%%%%%%%%%%%%%%%%%\n Module ECM0002Module = new Module(2020, (byte) 2, ECM0002);\n Module ECM1400Module = new Module(2019, (byte) 2, ECM1400);\n Module ECM1406Module = new Module(2020, (byte) 1, ECM1406);\n Module ECM1410Module = new Module(2020, (byte) 1, ECM1410);\n Module BEM2027Module = new Module(2019, (byte) 2, BEM2027);\n Module PHY2023Module = new Module(2019, (byte) 1, PHY2023);\n \n //%%%%%%%%%%%%%%%making module student and marks objects%%%%%%%%%%%%%%%%%%%%%%%%%%\n double [][]Marks = new double[][]{{9, 10, 10, 10}, {8, 8, 8, 9}, {5, 5, 6, 5}, {6, 4, 7, 9}, {10, 9, 10, 9}, {9, 9}, {6, 9}, {5, 6}, {9, 7}, {8, 5}, {10, 10, 9.5, 10}, {7, 8.5, 8.2, 8}, {6.5, 7.0, 5.5, 8.5}, {5.5, 5, 6.5, 7}, {7, 5, 8, 6}, {9, 10, 10, 10}, {8, 8, 8, 9}, {5, 5, 6, 5}, {6, 4, 7, 9}, {10, 9, 8, 9}, {10, 10, 10}, {8, 7.5, 7.5}, {9, 7, 7}, {9, 8, 7}, {2, 7, 7}, {10, 10, 10}, {8, 7.5, 7.5}, {10, 10, 10}, {9, 8, 7}, {8, 9, 10}, {10, 9, 10}, {8.5, 9, 7.5}, {10, 10, 5.5}, {7, 7, 7}, {5, 6, 10}, {8, 9, 8}, {6.5, 9, 9.5}, {8.5, 10, 8.5}, {7.5, 8, 10}, {10, 6, 10}};\n \n byte []term_ = new byte[]{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};\n \n int []years_ = new int[]{2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020};\n \n Module []Modules_ = new Module[]{ECM1400Module, ECM1400Module, ECM1400Module, ECM1400Module, ECM1400Module, PHY2023Module, PHY2023Module, PHY2023Module, PHY2023Module, PHY2023Module, BEM2027Module, BEM2027Module, BEM2027Module, BEM2027Module, BEM2027Module, ECM1400Module, ECM1400Module, ECM1400Module, ECM1400Module, ECM1400Module, ECM1406Module, ECM1406Module, ECM1406Module, ECM1406Module, ECM1406Module, ECM1406Module, ECM1406Module, ECM1406Module, ECM1406Module, ECM1406Module, ECM1410Module, ECM1410Module, ECM1410Module, ECM1410Module, ECM1410Module, ECM0002Module, ECM0002Module, ECM0002Module, ECM0002Module, ECM0002Module};\n \n Student []Students = new Student[]{students_[0], students_[1], students_[2], students_[3], students_[4], students_[5], students_[6], students_[7], students_[8], students_[9], students_[0], students_[1], students_[2], students_[3], students_[4], students_[5], students_[6], students_[7], students_[8], students_[9], students_[0], students_[1], students_[2], students_[3], students_[4], students_[5], students_[6], students_[7], students_[8], students_[9], students_[0], students_[1], students_[2], students_[3], students_[4], students_[5], students_[6], students_[7], students_[8], students_[9]};\n \n \n //%%%%%%%%%%%making the student record object%%%%%%%%%%%%%%%%%%\n StudentRecord []studentRecords_ = new StudentRecord[40];\n double []finalmark = new double[40];\n for (int i=0;i<40;i++){\n for (int j=0;j<Marks[i].length;j++){\n double []weights = Modules_[i].getCAweightsm();\n finalmark[i] = finalmark[i] + (Marks[i][j] * weights[j] * 10);\n }\n studentRecords_[i] = new StudentRecord(Students[i], Modules_[i], Marks[i], finalmark[i]);\n }\n \n double []gpa = new double[10];\n int j=0;\n for (int i=0;i<10;j=j+10){\n gpa[i] = gpa[i] + studentRecords_[j].getfinalScore();\n if (j>=30){\n gpa[i] = gpa[i]/4;\n i++;\n j=i;\n }\n }\n \n Student []CompleteStudents_ = new Student[10];\n for (int i=0;i<10;i++){\n StudentRecord []studentsrecords_ = new StudentRecord[4];\n int p = 0;\n for (j=0;j<40;j++){\n if (studentRecords_[j].getStudent() == students_[i]){\n studentsrecords_[p] = studentRecords_[j];\n p++;\n }\n }\n CompleteStudents_[i] = new Student(IDs[i], names[i], genders[i], studentsrecords_, gpa[i]);\n }\n //%%%%%%%%%%%%%%%Creating new module objects with the student records and average scores%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n \n ModuleDescriptor []modulestoadd = new ModuleDescriptor[]{ECM0002, ECM1400, ECM1406, ECM1410, BEM2027, PHY2023};\n StudentRecord [][]moduleStudents = new StudentRecord[6][10];\n double []averageScore = new double[]{0,0,0,0,0,0};\n for (j=0;j<6;j++){\n int p=0;\n for (int i=0;i<40;i++){\n if (studentRecords_[i].getModule().getmoduled().getcode() == modulestoadd[j].getcode()){\n moduleStudents[j][p] = studentRecords_[i];\n averageScore[j] = averageScore[j] + studentRecords_[i].getfinalScore();\n p++;\n }\n }\n averageScore[j] = averageScore[j]/p;\n }\n Module ECM0002ModuleNew = new Module(2020, (byte) 2, ECM0002, moduleStudents[0], averageScore[0]);\n Module ECM1400ModuleNew = new Module(2019, (byte) 2, ECM1400, moduleStudents[1], averageScore[1]);\n Module ECM1406ModuleNew = new Module(2020, (byte) 1, ECM1406, moduleStudents[2], averageScore[2]);\n Module ECM1410ModuleNew = new Module(2020, (byte) 1, ECM1410, moduleStudents[3], averageScore[3]);\n Module BEM2027ModuleNew = new Module(2019, (byte) 2, BEM2027, moduleStudents[4], averageScore[4]);\n Module PHY2023ModuleNew = new Module(2019, (byte) 1, PHY2023, moduleStudents[5], averageScore[5]);\n \n //%%%%%%%%%%%%creating the university object%%%%%%%%%%%%%%%%%%%%%%%%\n \n ModuleDescriptor []moduledescriptors = new ModuleDescriptor[]{ECM0002, ECM1400, ECM1406, ECM1410, BEM2027, PHY2023};\n \n Module []modules_ = new Module[]{ECM0002ModuleNew, ECM1400ModuleNew, ECM1406ModuleNew, ECM1410ModuleNew, BEM2027ModuleNew, PHY2023ModuleNew};\n \n University university = new University(moduledescriptors, CompleteStudents_, modules_);\n \n // You need to create and instantiate university object\n // this can be done in several ways, for instance, you can create an \"empty\" university and add\n // module descriptors, students, and modules, or you can create a university object already \"complete\".\n \n // These decisions about how and where to implement each functionality is part of your OO design.\n // Regardless of your choice, in the end you need to have the university object loaded with the given\n // input data.\n \n // TODO create and initialise the university\n \n // Print Reports \n System.out.println();\n System.out.println(\"The UoK has \" + university.getTotalNumberStudents() + \" students.\");\n\n // best module\n System.out.println(\"\\nThe best module is:\");\n System.out.println(university.getBestModule());\n\n // best student\n System.out.println(\"\\nThe best student is:\");\n System.out.println(university.getBestStudent().printTranscript());\n System.out.println();\n\t}", "public void testRandomStrings() throws Exception {\n final int numIters = atLeast(3);\n for (int i = 0; i < numIters; i++) {\n SynonymMap.Builder b = new SynonymMap.Builder(random().nextBoolean());\n final int numEntries = atLeast(10);\n for (int j = 0; j < numEntries; j++) {\n add(b, randomNonEmptyString(), randomNonEmptyString(), random().nextBoolean());\n }\n final SynonymMap map = b.build();\n final boolean ignoreCase = random().nextBoolean();\n\n final Analyzer analyzer =\n new Analyzer() {\n @Override\n protected TokenStreamComponents createComponents(String fieldName) {\n Tokenizer tokenizer = new MockTokenizer(MockTokenizer.SIMPLE, true);\n TokenStream stream = new SynonymGraphFilter(tokenizer, map, ignoreCase);\n return new TokenStreamComponents(tokenizer, new RemoveDuplicatesTokenFilter(stream));\n }\n };\n\n checkRandomData(random(), analyzer, 200);\n analyzer.close();\n }\n }", "public static void main(String[] args) {\n\t\tList<Card> kaardipakk = Kaardipakk.AnnaKaardid();\n\n\t\tint[] suvalised = new int[5];\n\t\tfor (int i = 0; i < suvalised.length; i++) {\n\t\t\tsuvalised[i] = (int) (Math.random() * kaardipakk.size());\n\t\t}\n\n\t\tfor (int suvaline : suvalised) {\n\t\t\tCard card = kaardipakk.get(suvaline);\n\t\t\tSystem.out.println(card.mast + \" \" + card.suurus);\n\t\t}\n\t\tSystem.out.println(Sarnased(suvalised, kaardipakk));\n\t}", "public static void main(String[] args) {\n Part2_2 part2_2 = new Part2_2();\n part2_2.testHowMany();\n Part2_3 part_23 = new Part2_3();\n part_23.testHowManyGenes();\n Part3_1 part3_1 = new Part3_1();\n part3_1.testCgRatio();\n }", "@Test\r\n\tpublic void testParseIdentifier() {\r\n\r\n\t\t// Enter the code\r\n\r\n\t\tdriver.findElement(By.name(\"code[code]\"))\r\n\t\t\t\t.sendKeys(\"the_best_cat = \\\"Noogie Cat\\\"\\nputs \\\"The best cat is: \\\" + the_best_cat\");\r\n\r\n\t\t// Look for the \"Parse\" button and click\r\n\r\n\t\tdriver.findElements(By.name(\"commit\")).get(1).click();\r\n\r\n\t\t// Check that there contains corresponding quantity of \"assign\"\r\n\r\n\t\ttry {\r\n\t\t\tWebElement code = driver.findElement(By.tagName(\"code\"));\r\n\t\t\tString res = code.getText();\r\n\t\t\tint count = 0;\r\n\t\t\tfor (int i = 0; i <= res.length() - 6; i++) {\r\n\t\t\t\tString sub = res.substring(i, i + 6);\r\n\t\t\t\tif (sub.equals(\"assign\"))\r\n\t\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tassertEquals(count, 1);\r\n\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "public static String run() {\r\n\t\t// Initialize\r\n\t\tint[] array = new int[10];\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tarray[i] = i;\r\n\r\n\t\t// Permute\r\n\t\tfor (int i = 0; i < 999999; i++) {\r\n\t\t\tif (!nextPermutation(array))\r\n\t\t\t\tthrow new AssertionError();\r\n\t\t}\r\n\r\n\t\t// Format output\r\n\t\tString ans = \"\";\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tans += array[i];\r\n\t\treturn ans;\r\n\t}", "public FaceRecognitionTests(){\n for(int i = 0; i < 25; i++){\n idsToTest.add(new Long(i + 15));\n }\n }", "public static void main(String[] args) {\n\t\tEmployee[] staff = new Employee[3];\n\t\tstaff[0] = new Employee(\"Jim\",50000);\n\t\tstaff[1] = new Employee(\"Tony\",60000);\n\t\tstaff[2] = new Employee(\"Sarach\",65000);\n\t\t\n\t\t//print out information about all Employee objects\n\t\tfor(Employee e:staff) {\n\t\t\te.setId();\n\t\t\tSystem.out.println(\"name=\"+e.getName()+\",id=\" +e.getId()+\",salsry=\"\n\t\t\t\t\t+e.getSalary());\n\t\tint n = Employee.getNextId();\n\t\tSystem.out.println(\"Next available id=\"+n);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tRandom rndm = new Random();\r\n\t\tchar c1 = (char)(rndm.nextInt(26) + 'a');\r\n\t\tchar c2 = (char)(rndm.nextInt(26) + 'a');\r\n\t\tchar c3 = (char)(rndm.nextInt(26) + 'a');\r\n\t\tchar[] chars = {c1,c2,c3};\r\n\t\tString s = new String(chars);\r\n\t\tint num1 = rndm.nextInt(10);\r\n\t\tint num2 = rndm.nextInt(10);\r\n\t\tint num3 = rndm.nextInt(10);\r\n\t\tint num4 = rndm.nextInt(10);\r\n\t\tString lp = \"Your License Plate Number is \" + s.toUpperCase() + num1 + num2 + num3 + num4;\r\n\t\tSystem.out.println(lp);\r\n\r\n\t}" ]
[ "0.5906901", "0.57167023", "0.5708114", "0.5687999", "0.56448257", "0.5643547", "0.559214", "0.55879056", "0.55553144", "0.5548575", "0.55419624", "0.55335855", "0.55065554", "0.5479537", "0.54782", "0.54719734", "0.54532206", "0.5431698", "0.5430522", "0.5417556", "0.5386533", "0.53846824", "0.53554946", "0.533317", "0.53230184", "0.53173023", "0.5308765", "0.5307407", "0.5304334", "0.52752876", "0.5248092", "0.5233824", "0.52095175", "0.5197074", "0.51922125", "0.5192181", "0.5184282", "0.5168545", "0.5164069", "0.5162891", "0.5151835", "0.5124224", "0.5124069", "0.51167524", "0.51117104", "0.5089561", "0.5087643", "0.50776047", "0.5076347", "0.5065254", "0.5033907", "0.50337386", "0.5025718", "0.5021125", "0.50149673", "0.500794", "0.500339", "0.5002137", "0.50002223", "0.49997836", "0.49934775", "0.49922556", "0.4977483", "0.4974915", "0.49747166", "0.49738196", "0.4968944", "0.4960465", "0.49578708", "0.4957608", "0.49573106", "0.49536422", "0.49498472", "0.49482775", "0.4946761", "0.49453098", "0.4938904", "0.49309513", "0.4929751", "0.4927487", "0.49213028", "0.49185264", "0.49174348", "0.491588", "0.49093333", "0.4907971", "0.48992237", "0.48958516", "0.48914373", "0.4890115", "0.4887479", "0.4886768", "0.48845288", "0.48785684", "0.48762026", "0.48745272", "0.48714638", "0.48672602", "0.486638", "0.48654714", "0.48637414" ]
0.0
-1
Test the Resolution Services
public static void resolver(EZIDService ezidService) { resolverResults(ezidService, "ark:/87286/C2/AOkI"); resolverResults(ezidService, "ark:/87286/C2/64c82d19-6562-4174-a5ea-e342eae353e8"); resolverResults(ezidService, "ark:/87286/C2/Foo"); resolverResults(ezidService, "ark:/87286/Cddfdf2"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @Ignore\n public void testRegistration() {\n ROIAwareWarpDescriptor.register();\n ScaleDescriptor.register();\n AffineDescriptor.register();\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkResolution() {\n\t\tboolean flag = oTest.checkResolution();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "@Test\n public void testActualPropertiesValues() { // wipe everything other\n testEnv = null;\n resolver = null;\n // use the default ctor to grab discoveryenvironment.properties\n // resolver = new DefaultServiceCallResolver();\n resolver = new ServiceCallResolver();\n resolver.setAppProperties(createFromExpected());\n // ensure it was set\n assertNotNull(resolver);\n verifyExpectedValues(EXPECTED);\n\n }", "public void testGetResource2() throws Exception {\n if(DEBUG_FLAG) System.out.println(\"entered testGetResource2\"); \n Ivorn ivorn = new Ivorn(\"ivo://org.test/org.astrogrid.registry.RegistryService\");\n Document doc = rs.getResourceByIdentifier(ivorn);\n assertNotNull(doc);\n if(DEBUG_FLAG) System.out.println(\"received in junit test = \" + XMLUtils.DocumentToString(doc));\n System.out.println(\"exiting testGetResource2\");\n }", "@Test\n public void serviceCandidateTest() {\n // TODO: test serviceCandidate\n }", "ResolutionResult getResolutionCandidates();", "@Test\n void testinjectionPointResolversFor() {\n PicoServices picoServices = PicoServices.picoServices().orElseThrow();\n DefaultServices services = (DefaultServices) PicoServices.realizedServices();\n services.bind(picoServices, new FakeModuleComponent(), true);\n\n ServiceInfoCriteria criteria = ServiceInfoCriteriaDefault.builder()\n .addQualifier(createNamed(\"whatever\"))\n .addContractImplemented(Closeable.class.getName())\n .build();\n List<String> result = injectionPointProvidersFor(services, criteria).stream()\n .map(ServiceProvider::description).toList();\n assertThat(result,\n contains(sp1.description()));\n }", "public void testGetResource() throws Exception {\n if(DEBUG_FLAG) System.out.println(\"entered testGetResource\");\n String ident = \"ivo://org.test/org.astrogrid.registry.RegistryService\"; \n Document doc = rs.getResourceByIdentifier(ident);\n assertNotNull(doc);\n if(DEBUG_FLAG) System.out.println(\"received in junit test = \" + XMLUtils.DocumentToString(doc));\n System.out.println(\"exiting testGetResource\");\n }", "@Test\n public void testResolveUrl() {\n System.out.println(\"resolveUrl\");\n String svcia = SVCID;\n String expResult = \"http://localhost:4848/reliablemessaging/intermediary\";\n String result = instance.resolveUrl(svcia);\n assertEquals(expResult, result);\n }", "@Test\n public void resourceCandidateTest() {\n // TODO: test resourceCandidate\n }", "public void testDynamicServices() throws Exception\n {\n int freq = 65432198;\n int prognum = 10;\n int modformat = 16;\n ServiceHandle handle = sidb.getServiceByProgramNumber(freq, modformat, prognum);\n ServiceExt service = sidb.createService(handle);\n OcapLocator loc = (OcapLocator) service.getLocator();\n assertEquals(\"Frequency does not match\", freq, loc.getFrequency());\n assertEquals(\"Program Number does not match\", prognum, loc.getProgramNumber());\n assertEquals(\"Modulation Format does not match\", modformat, loc.getModulationFormat());\n assertEquals(\"SourceID is incorrect\", -1, loc.getSourceID());\n dumpService(service);\n log(\"*********************************************************\");\n\n // Now we're going to try to get an existing service using it's\n // freq/prog/mod.\n ServiceList sl = serviceSetup();\n if (sl.size() > 0)\n {\n // Just grab the first one off the list\n service = (ServiceExt) sl.getService(0);\n tune(service);\n ServiceDetailsHandle[] handles = null;\n try\n {\n handles = sidb.getServiceDetailsByService(service.getServiceHandle());\n }\n catch (SINotAvailableYetException ex)\n {\n synchronized (sial)\n {\n // Wait for the SIAcquiredEvent\n sial.wait();\n // Try again.. if it fails, it will jump out to the outer\n // catch\n handles = sidb.getServiceDetailsByService(service.getServiceHandle());\n }\n }\n assertNotNull(\"No ServiceDetails available\", handles);\n assertTrue(\"Handles array has no data\", handles.length > 0);\n ServiceDetailsExt details = sidb.createServiceDetails(handles[0]);\n assertEquals(\"ServiceDetails' Service does not match expected value\", service, details.getService());\n TransportStreamExt ts = (TransportStreamExt) details.getTransportStream();\n freq = ts.getFrequency();\n prognum = details.getProgramNumber();\n modformat = ts.getModulationFormat();\n handle = sidb.getServiceByProgramNumber(freq, prognum, modformat);\n service = sidb.createService(handle);\n loc = (OcapLocator) service.getLocator();\n assertEquals(\"Frequency does not match\", freq, loc.getFrequency());\n assertEquals(\"Program Number does not match\", prognum, loc.getProgramNumber());\n assertEquals(\"Modulation Format does not match\", modformat, loc.getModulationFormat());\n assertEquals(\"SourceID is incorrect\", -1, loc.getSourceID());\n dumpService(service);\n }\n else\n {\n log(\"No Services available to test for dynamic service creation\");\n }\n log(\"*********************************************************\");\n\n // Try to get a service using an outrageous frequency\n freq = 1;\n prognum = 2;\n modformat = 8;\n try\n {\n sidb.getServiceByProgramNumber(freq, prognum, modformat);\n fail(\"Expected SIRequestInvalidException using 1 as frequency\");\n }\n catch (SIDatabaseException e)\n {\n // Expected\n }\n }", "public void testService() {\n\n\t\ttry {\n\t\t\tString nextAction = \"next action\";\n\t\t\trequest.setAttribute(\"NEXT_ACTION\", nextAction);\n\t\t\tString nextPublisher = \"next publisher\";\n\t\t\trequest.setAttribute(\"NEXT_PUBLISHER\", nextPublisher);\n\t\t\tString expertQueryDisplayed = \"expert query displayed\";\n\t\t\trequest.setAttribute(\"expertDisplayedForUpdate\", expertQueryDisplayed);\n\t\t\tupdateFieldsForResumeAction.service(request, response);\n\t\t\tassertEquals(nextAction, response.getAttribute(\"NEXT_ACTION\"));\t\t\n\t\t\tassertEquals(nextPublisher, response.getAttribute(\"NEXT_PUBLISHER\"));\n\t\t\tassertEquals(expertQueryDisplayed, singleDataMartWizardObj.getExpertQueryDisplayed());\n\t\t\t\n\t\t} catch (SourceBeanException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Unaspected exception occurred!\");\n\t\t}\n\t\t\n\t}", "private void setUpLocalServices() {\n tearDownLocalServices();\n\n // UriGrantsManagerInternal\n final UriGrantsManagerInternal ugmi = mock(UriGrantsManagerInternal.class);\n LocalServices.addService(UriGrantsManagerInternal.class, ugmi);\n\n // AppOpsManager\n final AppOpsManager aom = mock(AppOpsManager.class);\n doReturn(aom).when(mContext).getSystemService(eq(Context.APP_OPS_SERVICE));\n\n // DeviceStateManager\n final DeviceStateManager dsm = mock(DeviceStateManager.class);\n doReturn(dsm).when(mContext).getSystemService(eq(Context.DEVICE_STATE_SERVICE));\n\n // Prevent \"WakeLock finalized while still held: SCREEN_FROZEN\".\n final PowerManager pm = mock(PowerManager.class);\n doReturn(pm).when(mContext).getSystemService(eq(Context.POWER_SERVICE));\n mStubbedWakeLock = createStubbedWakeLock(false /* needVerification */);\n doReturn(mStubbedWakeLock).when(pm).newWakeLock(anyInt(), anyString());\n doReturn(mStubbedWakeLock).when(pm).newWakeLock(anyInt(), anyString(), anyInt());\n\n // DisplayManagerInternal\n final DisplayManagerInternal dmi = mock(DisplayManagerInternal.class);\n doReturn(dmi).when(() -> LocalServices.getService(eq(DisplayManagerInternal.class)));\n\n // ColorDisplayServiceInternal\n final ColorDisplayService.ColorDisplayServiceInternal cds =\n mock(ColorDisplayService.ColorDisplayServiceInternal.class);\n doReturn(cds).when(() -> LocalServices.getService(\n eq(ColorDisplayService.ColorDisplayServiceInternal.class)));\n\n final UsageStatsManagerInternal usmi = mock(UsageStatsManagerInternal.class);\n LocalServices.addService(UsageStatsManagerInternal.class, usmi);\n\n // PackageManagerInternal\n final PackageManagerInternal packageManagerInternal = mock(PackageManagerInternal.class);\n LocalServices.addService(PackageManagerInternal.class, packageManagerInternal);\n doReturn(false).when(packageManagerInternal).isPermissionsReviewRequired(\n anyString(), anyInt());\n doReturn(null).when(packageManagerInternal).getDefaultHomeActivity(anyInt());\n\n ComponentName systemServiceComponent = new ComponentName(\"android.test.system.service\", \"\");\n doReturn(systemServiceComponent).when(packageManagerInternal).getSystemUiServiceComponent();\n\n // PowerManagerInternal\n final PowerManagerInternal pmi = mock(PowerManagerInternal.class);\n final PowerSaveState state = new PowerSaveState.Builder().build();\n doReturn(state).when(pmi).getLowPowerState(anyInt());\n doReturn(pmi).when(() -> LocalServices.getService(eq(PowerManagerInternal.class)));\n\n // PermissionPolicyInternal\n final PermissionPolicyInternal ppi = mock(PermissionPolicyInternal.class);\n LocalServices.addService(PermissionPolicyInternal.class, ppi);\n doReturn(true).when(ppi).checkStartActivity(any(), anyInt(), any());\n\n // InputManagerService\n mImService = mock(InputManagerService.class);\n // InputChannel cannot be mocked because it may pass to InputEventReceiver.\n final InputChannel[] inputChannels = InputChannel.openInputChannelPair(TAG);\n inputChannels[0].dispose();\n mInputChannel = inputChannels[1];\n doReturn(mInputChannel).when(mImService).monitorInput(anyString(), anyInt());\n doReturn(mInputChannel).when(mImService).createInputChannel(anyString());\n\n // StatusBarManagerInternal\n final StatusBarManagerInternal sbmi = mock(StatusBarManagerInternal.class);\n doReturn(sbmi).when(() -> LocalServices.getService(eq(StatusBarManagerInternal.class)));\n }", "@Test\n public void testExecution() {\n Choice page=Choice.createSingleton(importPage(\"MapSourcesToSections.xml\"));\n\n // Create a federated result\n Query query=new Query();\n Result result=new Result(query);\n result.hits().add(createHits(\"source1\",3));\n result.hits().add(createHits(\"source2\",4));\n result.hits().add(createHits(\"source3\",5));\n result.hits().add(createHits(\"source4\",6));\n result.hits().add(createHits(\"source5\",7));\n\n // Resolve\n Resolver resolver=new DeterministicResolverAssertingMethod();\n Resolution resolution=resolver.resolve(page,query,result);\n Map<String, List<PageElement>> mapping=\n resolution.getResolution((MapChoice)((PageTemplate)page.get(0).get(0)).getSection().elements().get(2));\n assertNotNull(mapping);\n assertEquals(\"source1\",((Source)mapping.get(\"box1source\").get(0)).getName());\n assertEquals(\"source2\",((Source)mapping.get(\"box2source\").get(0)).getName());\n assertEquals(\"source3\",((Source)mapping.get(\"box3source\").get(0)).getName());\n assertEquals(\"source4\",((Source)mapping.get(\"box4source\").get(0)).getName());\n\n // Execute\n Organizer organizer =new Organizer();\n organizer.organize(page,resolution,result);\n\n // Check execution:\n // Two subsections, each containing two sub-subsections with one source each\n assertEquals(2,result.hits().size());\n HitGroup row1=(HitGroup)result.hits().get(0);\n HitGroup column11=(HitGroup)row1.get(0);\n HitGroup column12=(HitGroup)row1.get(1);\n HitGroup row2=(HitGroup)result.hits().get(1);\n HitGroup column21=(HitGroup)row2.get(0);\n HitGroup column22=(HitGroup)row2.get(1);\n assertEqualHitGroups(createHits(\"source1\",3),column11);\n assertEqualHitGroups(createHits(\"source2\",4),column12);\n assertEqualHitGroups(createHits(\"source3\",5),column21);\n assertEqualHitGroups(createHits(\"source4\",6),column22);\n\n // Check rendering\n assertRendered(result,\"MapSourcesToSectionsResult.xml\");\n }", "public GameServiceTest() {\r\n\t\tsetupRequestContext();\r\n\t}", "public void testServiceList()\n {\n ServiceList services = serviceSetup();\n\n ServiceIterator it = services.createServiceIterator();\n int i = 0;\n try\n {\n while (it.hasNext())\n {\n // Increment the service counter\n i++;\n // Get our next service\n ServiceExt service = (ServiceExt) it.nextService();\n log(\"******************************************************************\");\n log(\"* Services - Counter: (\" + i + \")\");\n dumpService(service);\n\n ServiceDetailsHandle[] handles = sidb.getServiceDetailsByService(service.getServiceHandle());\n\n ServiceDetailsExt[] details = new ServiceDetailsExt[handles.length];\n for (int j = 0; j < handles.length; j++)\n {\n details[j] = sidb.createServiceDetails(handles[j]);\n dumpServiceDetails(details[j]);\n assertEquals(\"ServiceDetails' Service does not match expected value\", service,\n details[j].getService());\n assertEquals(\"ServiceType does not match\", service.getServiceType(), details[j].getServiceType());\n }\n log(\"******************************************************************\");\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "@Test\n public void testReservationFactory() {\n assertNotNull(reservationFactory);\n }", "public void testGetEndPoint() throws Exception {\n if(DEBUG_FLAG) System.out.println(\"entered testGetEndPoint\");\n String ident = \"ivo://org.test/org.astrogrid.registry.RegistryService\"; \n String url = rs.getEndPointByIdentifier(ident);\n assertNotNull(url);\n assertTrue(url.startsWith(\"http\"));\n if(DEBUG_FLAG) System.out.println(\"url = \" + url);\n System.out.println(\"exiting testGetEndPoint\");\n }", "@Before\n\tpublic void setup() throws Exception {\n\n\t\tsearchPathOptions = new SearchPathOptions();\n\t\tresolver = Mockito.spy(context.resourceResolver());\n\t\tMockito.when(resolver.getSearchPath()).thenAnswer( invocation -> {\n\t\t\treturn searchPathOptions.getSearchPath();\n\t\t});\n\t\t\n resourceType = \"foo:bar\";\n resourceTypePath = ResourceUtil.resourceTypeToPath(resourceType);\n\n resourcePath = \"/content/page\";\n context.build().resource(\"/content\",Collections.emptyMap()).commit();\n Resource parent = resolver.getResource(\"/content\");\n resource = resolver.create(parent, \"page\",\n Collections.singletonMap(ResourceResolver.PROPERTY_RESOURCE_TYPE, resourceType));\n\n request = new MockSlingHttpServletRequest(resourcePath, \"print.A4\", \"html\", null, null);\n request.setMethod(\"GET\");\n request.setResourceResolver(resolver);\n request.setResource(resource);\n\t\t\n\t}", "@Test\n\tpublic void injectionTest() {\n\t\tAssert.assertNotNull(service1);\n\t\tAssert.assertNotNull(service2);\n\t}", "@Override\n public void serviceResolved(ServiceEvent serviceEvent) {\n // Test service info is resolved.\n String[] serviceUrls = serviceEvent.getInfo().getURLs();\n\n logger.info(\"Found kinect service \" + serviceEvent.getInfo().getURLs()[0].toString());\n\n if (serviceUrls.length > 0) {\n logger.info(\"Connecting to kinect service 2\");\n\n try {\n final URL url = new URL(serviceUrls[0]);\n logger.info(\"Connecting to kinect service \" + url.getHost() + \":\" + url.getPort());\n final KinectConnector connector = new KinectConnector(url.getHost(), url.getPort());\n connector.setDeviceListCallback(new DeviceCallback() {\n @Override\n public void onItemsChanged(List<KinectItem> devices) {\n logger.info(\"Found kinect objects\");\n for (KinectItem item : devices) {\n createDevice(url.getHost(), url.getPort(), item.getName().replace(\" \", \"\"));\n }\n connector.stop();\n }\n });\n connector.start();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n\n }\n }", "public void testGetEndPoint2() throws Exception {\n if(DEBUG_FLAG) System.out.println(\"entered testGetEndPoint2\");\n Ivorn ivorn = new Ivorn(\"ivo://org.test/org.astrogrid.registry.RegistryService\");\n String url = rs.getEndPointByIdentifier(ivorn);\n assertNotNull(url);\n assertTrue(url.startsWith(\"http\")); \n if(DEBUG_FLAG) System.out.println(\"url = \" + url);\n System.out.println(\"exiting testGetEndPoint2\");\n }", "@Test\n\tpublic void testSearch_7()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\t\tString portletId = \"\";\n\t\tlong groupId = 1L;\n\t\tlong userId = 1L;\n\t\tlong[] repositoryIds = new long[] {};\n\t\tString keywords = \"\";\n\t\tint start = 1;\n\t\tint end = 1;\n\n\t\tHits result = fixture.search(companyId, portletId, groupId, userId, repositoryIds, keywords, start, end);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t\tassertNotNull(result);\n\t}", "@Test\n\tpublic void testLoadService() {\n\t\tLogUnit logunit = LogUnit.get();\n\t\tAssert.assertNotNull(logunit);\n\t\tAssert.assertEquals(LogUnitForJUnit.class, logunit.getClass());\n\t}", "public void testGetSystem()\n\t{\n\t\t((TypeDefinitionImpl) fTypeDefinition).setSystem(fTypeSystem);\n\t\tassertEquals(\"The TypeDefinition type system URI differs from that set-\", fTypeSystem, fTypeDefinition.getSystem());\n\t}", "@Before\n public void setUp() {\n searchMap = SearchMap.getInstance();\n }", "@Test\n\tpublic void testSearch_2()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\t\tString portletId = \"\";\n\t\tlong groupId = 0L;\n\t\tlong userId = 1L;\n\t\tlong[] repositoryIds = new long[] {0L};\n\t\tString keywords = \"\";\n\t\tint start = 1;\n\t\tint end = 1;\n\n\t\tHits result = fixture.search(companyId, portletId, groupId, userId, repositoryIds, keywords, start, end);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t\tassertNotNull(result);\n\t}", "@Test \r\n\tpublic void testSingleRegTransform() throws Exception {\r\n\t\t//String id = \"pt2d7\"; //live api example\r\n\t\tString id = \"h48cy\";\r\n\t\tString[] args = {\"osf_registration\",\"-id\",id, \"-o\", \"testOneReg/\"};\r\n\t\tRMapTransformerCLI.main(args);\r\n\t\t//check output files\r\n\t\tInteger numfiles = new File(\"testOneReg\").list().length;\r\n\t\tassertTrue(numfiles.equals(1)); //one root Public Project, one partial\r\n\t}", "@Test\n public void testGetRunnableServiceAndExecuteIt() throws NuxeoFraSCAtiException { \n \tRunnable r = frascatiService.getService(fcomponent.getComponent(), \"r\", Runnable.class);\n \t assertNotNull(r);\n \t r.run(); \t\n }", "@Test\n public void nameserversTest() {\n // TODO: test nameservers\n }", "public interface SpecimenService\r\n{\r\n static void setInstance(SpecimenService serviceImpl)\r\n {\r\n ServiceRegistry.get().registerService(SpecimenService.class, serviceImpl);\r\n }\r\n\r\n static SpecimenService get()\r\n {\r\n return ServiceRegistry.get().getService(SpecimenService.class);\r\n }\r\n\r\n /** Does a search for matching GlobalUniqueIds */\r\n ParticipantVisit getSampleInfo(Container studyContainer, User user, String globalUniqueId) throws SQLException;\r\n\r\n Set<ParticipantVisit> getSampleInfo(Container studyContainer, User user, String participantId, Date date) throws SQLException;\r\n\r\n Set<ParticipantVisit> getSampleInfo(Container studyContainer, User user, String participantId, Double visit) throws SQLException;\r\n\r\n String getCompletionURLBase(Container studyContainer, CompletionType type);\r\n\r\n Set<Pair<String, Date>> getSampleInfo(Container studyContainer, User user, boolean truncateTime) throws SQLException;\r\n\r\n Set<Pair<String, Double>> getSampleInfo(Container studyContainer, User user) throws SQLException;\r\n\r\n Lsid getSpecimenMaterialLsid(@NotNull Container studyContainer, @NotNull String id);\r\n\r\n void importSpecimens(User user, Container container, List<Map<String, Object>> rows, boolean merge) throws SQLException, IOException, ValidationException;\r\n\r\n void registerSpecimenImportStrategyFactory(SpecimenImportStrategyFactory factory);\r\n\r\n Collection<SpecimenImportStrategyFactory> getSpecimenImportStrategyFactories();\r\n\r\n void registerSpecimenTransform(SpecimenTransform transform);\r\n\r\n Collection<SpecimenTransform> getSpecimenTransforms(Container container);\r\n\r\n @Nullable\r\n SpecimenTransform getSpecimenTransform(String name);\r\n\r\n PipelineJob createSpecimenReloadJob(Container container, User user, SpecimenTransform transform, @Nullable ActionURL url) throws SQLException, IOException, ValidationException;\r\n\r\n void registerSpecimenChangeListener(SpecimenChangeListener listener);\r\n\r\n @Nullable\r\n TableInfo getTableInfoVial(Container container);\r\n\r\n @Nullable\r\n TableInfo getTableInfoSpecimen(Container container);\r\n\r\n @Nullable\r\n TableInfo getTableInfoSpecimenEvent(Container container);\r\n\r\n SpecimenTablesTemplate getSpecimenTablesTemplate();\r\n\r\n Domain getSpecimenVialDomain(Container container, User user);\r\n\r\n Domain getSpecimenEventDomain(Container container, User user);\r\n\r\n Map<String, String> getSpecimenImporterTsvColumnMap();\r\n\r\n SpecimenRequestCustomizer getRequestCustomizer();\r\n\r\n void registerRequestCustomizer(SpecimenRequestCustomizer customizer);\r\n\r\n /** Hooks to allow other modules to control a few items about how specimens are treated */\r\n interface SpecimenRequestCustomizer\r\n {\r\n /** @return whether or not a specimen request must include at least one vial */\r\n boolean allowEmptyRequests();\r\n\r\n /** @return null if users should always supply a destination site for a given request, or the site's id if they should all be the same */\r\n Integer getDefaultDestinationSiteId();\r\n\r\n /** @return true if reports shouldn't give the option to group based on primary, additive, or derivative types */\r\n boolean omitTypeGroupingsWhenReporting();\r\n\r\n /** @return whether the current user can make changes to the status of the request */\r\n boolean canChangeStatus(User user);\r\n\r\n /** @return true if a variety of warning types including vial status, the inclusion of vials spanning multiple locations, and more should be suppressed in the UI */\r\n boolean hideRequestWarnings();\r\n\r\n /** @return a message to show the user after a request has been submitted */\r\n HtmlString getSubmittedMessage(Container c, int requestId);\r\n }\r\n\r\n interface SampleInfo\r\n {\r\n String getParticipantId();\r\n Double getSequenceNum();\r\n String getSampleId();\r\n }\r\n\r\n enum CompletionType\r\n {\r\n SpecimenGlobalUniqueId,\r\n ParticipantId,\r\n VisitId,\r\n LabId\r\n }\r\n}", "@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 testSearch_4()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\t\tString portletId = \"\";\n\t\tlong groupId = 0L;\n\t\tlong userId = 1L;\n\t\tlong[] repositoryIds = new long[] {0L};\n\t\tString keywords = \"\";\n\t\tint start = 1;\n\t\tint end = 1;\n\n\t\tHits result = fixture.search(companyId, portletId, groupId, userId, repositoryIds, keywords, start, end);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t\tassertNotNull(result);\n\t}", "@Test\n @DisplayName(\"Get Service Provider\")\n void getServiceProvider() {\n\n try {\n ServiceProvider serviceProviderInfo = serviceProviderService.getServiceProvider();\n\n LOGGER.info(\"{}\", serviceProviderInfo);\n\n assertNotNull(serviceProviderInfo);\n assertNotNull(serviceProviderInfo.getClientId());\n\n } catch (ServiceException e) {\n LOGGER.info(\"Get Service Provider API call failed with error msg {}\", e.getServiceErrors());\n Assertions.fail(e.getMessage());\n }\n\n }", "@Override\n\tpublic void onStart(ITestContext result) {\n\t\t\n\t}", "@Test\n\tpublic void testSearch_1()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\t\tString portletId = \"\";\n\t\tlong groupId = 1L;\n\t\tlong userId = 1L;\n\t\tlong[] repositoryIds = new long[] {0L};\n\t\tString keywords = \"\";\n\t\tint start = 1;\n\t\tint end = 1;\n\n\t\tHits result = fixture.search(companyId, portletId, groupId, userId, repositoryIds, keywords, start, end);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t\tassertNotNull(result);\n\t}", "protected void setUp() {\n Collection<? extends ModuleInfo> infos = Lookup.getDefault().<ModuleInfo>lookupAll(ModuleInfo.class);\n }", "@Test\n\tpublic void testSearch_6()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\t\tString portletId = \"\";\n\t\tlong groupId = 0L;\n\t\tlong userId = 1L;\n\t\tlong[] repositoryIds = new long[] {};\n\t\tString keywords = \"\";\n\t\tint start = 1;\n\t\tint end = 1;\n\n\t\tHits result = fixture.search(companyId, portletId, groupId, userId, repositoryIds, keywords, start, end);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t\tassertNotNull(result);\n\t}", "@Test \n public void GetTrustInfoFromWizardTest(){\n\tlogger.info(\"--------------------start--GetTrustInfoFromWizardTest---------------------------------------------------------------------------------------------------\");\n// \tList<District> list=districtService.GetCityListByProvinceCode(\"110000\");\n\tList<TrustInfo> list=trustManagementService.GetTrustInfoFromWizard(\"9\");\n\tfor (TrustInfo trustInfo : list) {\n\t\tlogger.info(\"查找结果getItemValue:\" + trustInfo.getItemValue()); \n\t\tlogger.info(\"查找结果getItemAliasValue:\" + trustInfo.getItemAliasValue()); \n\t}\n logger.info(\"--------------------end----GetTrustInfoFromWizardTest-------------------------------------------------------------------------------------------------\");\n }", "@Test\n public void test_all() throws Exception {\n matchInvoke(serviceURL, \"PWDDIC_testSearch_all_req.xml\",\n \"PWDDIC_testSearch_all_res.xml\");\n }", "@Test\r\n\tpublic void testGetGetResolutionCodeString() {\r\n\t\tCommand investigate = new Command(Command.CommandValue.INVESTIGATE, \"owner\", null, null, null, \"note\");\r\n\t\tCommand resolvePermanent = new Command(Command.CommandValue.RESOLVE, \"owner\", null, ResolutionCode.PERMANENTLY_SOLVED, null, \"note\");\r\n\t\tCommand resolveCaller = new Command(Command.CommandValue.RESOLVE, \"owner\", null, ResolutionCode.CALLER_CLOSED, null, \"note\");\r\n\t\tCommand resolveNotSolved = new Command(Command.CommandValue.RESOLVE, \"owner\", null, ResolutionCode.NOT_SOLVED, null, \"note\");\r\n\t\tCommand resolveWorkAround = new Command(Command.CommandValue.RESOLVE, \"owner\", null, ResolutionCode.WORKAROUND, null, \"note\");\r\n\t\t\r\n\t\tManagedIncident incident = new ManagedIncident(\"jsmith\", Category.NETWORK, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tincident.update(investigate);\r\n\t\tincident.update(resolveCaller);\r\n\t\tassertEquals(\"Caller Closed\", incident.getResolutionCodeString());\r\n\t\t\r\n\t\tManagedIncident incident2 = new ManagedIncident(\"jsmith\", Category.NETWORK, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tincident2.update(investigate);\r\n\t\tincident2.update(resolvePermanent);\r\n\t\tassertEquals(\"Permanently Solved\", incident2.getResolutionCodeString());\r\n\r\n\t\tManagedIncident incident3 = new ManagedIncident(\"jsmith\", Category.NETWORK, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tincident3.update(investigate);\r\n\t\tincident3.update(resolveNotSolved);\r\n\t\tassertEquals(\"Not Solved\", incident3.getResolutionCodeString());\r\n\t\t\r\n\t\tManagedIncident incident4 = new ManagedIncident(\"jsmith\", Category.NETWORK, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tincident4.update(investigate);\r\n\t\tincident4.update(resolveWorkAround);\r\n\t\tassertEquals(\"Workaround\", incident4.getResolutionCodeString());\r\n\t}", "protected void setUp()\n {\n typeResolver = new TypeResolver();\n }", "@Test\n\tvoid testSingleNamespaceTwoServicesPresent() {\n\t\tLister<V1Endpoints> endpointsLister = setupEndpointsLister(\"\");\n\n\t\tboolean allNamespaces = false;\n\t\tV1Service serviceA = new V1Service().metadata(new V1ObjectMeta().name(\"service-a\").namespace(\"namespace-a\"));\n\t\tV1Service serviceB = new V1Service().metadata(new V1ObjectMeta().name(\"service-b\").namespace(\"namespace-b\"));\n\t\tserviceCache.add(serviceA);\n\t\tserviceCache.add(serviceB);\n\n\t\tLister<V1Service> serviceLister = new Lister<>(serviceCache).namespace(\"namespace-a\");\n\t\tKubernetesDiscoveryProperties kubernetesDiscoveryProperties = new KubernetesDiscoveryProperties(true,\n\t\t\t\tallNamespaces, Set.of(), true, 60, false, null, Set.of(), Map.of(), null, null, 0, false);\n\n\t\tKubernetesInformerReactiveDiscoveryClient discoveryClient = new KubernetesInformerReactiveDiscoveryClient(\n\t\t\t\tnew KubernetesInformerDiscoveryClient(sharedInformerFactory, serviceLister, endpointsLister, null, null,\n\t\t\t\t\t\tkubernetesDiscoveryProperties));\n\n\t\tList<String> result = discoveryClient.getServices().collectList().block();\n\t\tAssertions.assertEquals(result.size(), 1);\n\t\tAssertions.assertTrue(result.contains(\"service-a\"));\n\t\tAssertions.assertFalse(result.contains(\"service-b\"));\n\t}", "@Test\n public void getStuff() {\n \n Assert.assertEquals(wService.work(), \"Parker\");\n Assert.assertEquals(aService.age(), 25);\n }", "@Test\n public void testGetName() {\n String result = service.getName();\n assertEquals(\"Servis\", result);\n \n }", "@Test\n\tvoid testAllNamespacesTwoServicesPresent() {\n\t\tLister<V1Endpoints> endpointsLister = setupEndpointsLister(\"\");\n\n\t\tboolean allNamespaces = true;\n\t\tV1Service serviceA = new V1Service().metadata(new V1ObjectMeta().name(\"service-a\").namespace(\"namespace-a\"));\n\t\tV1Service serviceB = new V1Service().metadata(new V1ObjectMeta().name(\"service-b\").namespace(\"namespace-b\"));\n\t\tserviceCache.add(serviceA);\n\t\tserviceCache.add(serviceB);\n\n\t\tLister<V1Service> serviceLister = new Lister<>(serviceCache).namespace(NAMESPACE_ALL);\n\t\tKubernetesDiscoveryProperties kubernetesDiscoveryProperties = new KubernetesDiscoveryProperties(true,\n\t\t\t\tallNamespaces, Set.of(), true, 60, false, null, Set.of(), Map.of(), null, null, 0, false);\n\n\t\tKubernetesInformerReactiveDiscoveryClient discoveryClient = new KubernetesInformerReactiveDiscoveryClient(\n\t\t\t\tnew KubernetesInformerDiscoveryClient(sharedInformerFactory, serviceLister, endpointsLister, null, null,\n\t\t\t\t\t\tkubernetesDiscoveryProperties));\n\n\t\tList<String> result = discoveryClient.getServices().collectList().block();\n\t\tAssertions.assertEquals(result.size(), 2);\n\t\tAssertions.assertTrue(result.contains(\"service-a\"));\n\t\tAssertions.assertTrue(result.contains(\"service-b\"));\n\t}", "@Test\n public void searchesTest() {\n // TODO: test searches\n }", "@Test\n public void testGetAccessibilityServiceList() throws Exception {\n List<AccessibilityServiceInfo> expectedServices = new ArrayList<>();\n AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();\n accessibilityServiceInfo.packageNames = new String[] { \"foo.bar\" };\n expectedServices.add(accessibilityServiceInfo);\n\n // configure the mock service behavior\n when(mMockService.getInstalledAccessibilityServiceList(anyInt()))\n .thenReturn(expectedServices);\n\n // invoke the method under test\n AccessibilityManager manager = createManager(true);\n List<AccessibilityServiceInfo> receivedServices =\n manager.getInstalledAccessibilityServiceList();\n\n verify(mMockService).getInstalledAccessibilityServiceList(UserHandle.USER_CURRENT);\n // check expected result (list equals() compares it contents as well)\n assertEquals(\"All expected services must be returned\", expectedServices, receivedServices);\n }", "public void testGetInsDyn() {\n }", "@Before\n public void setupService() {\n }", "@Test\n public void testGetProductInfo() throws Exception {\n }", "@Test\n\tpublic void testSearch_3()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\t\tString portletId = \"\";\n\t\tlong groupId = 0L;\n\t\tlong userId = 1L;\n\t\tlong[] repositoryIds = new long[] {0L};\n\t\tString keywords = \"\";\n\t\tint start = 1;\n\t\tint end = 1;\n\n\t\tHits result = fixture.search(companyId, portletId, groupId, userId, repositoryIds, keywords, start, end);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t\tassertNotNull(result);\n\t}", "@Override\n public void onTestStart(ITestResult result) {\n\n }", "@Override\npublic void onStart(ITestContext context) {\n\t\n}", "@Override\r\n\tpublic void onStart(ITestContext Result) {\n\t\t\r\n\t}", "@Test\n public void shouldInjectInstances() {\n Assert.assertNotNull(notificationServiceComposite);\n Assert.assertNotNull(notificationService);\n }", "@Test\n public void testLocateManager() {\n System.out.println(\"locateManager\");\n int x = 0;\n int y = 0; \n //instance.locateManager(x, y);\n \n }", "public void testServiceAvailable() throws Exception {\r\n\t\tServiceReference serviceReference = \r\n\t\t\tgetContext().getServiceReference(\"org.osgi.service.jndi.JNDIProviderAdmin\");\r\n\t\tassertNotNull(\"JNDIProviderAdmin service was not published as expected\", serviceReference);\r\n\t\t\r\n\t\tJNDIProviderAdmin contextAdmin = \r\n\t\t\t(JNDIProviderAdmin) getContext().getService(serviceReference);\r\n\t\tassertNotNull(\"JNDIProviderAdmin service not available via factory\", contextAdmin);\r\n\t}", "public void testGetServiceByName() {\n System.out.println(\"getServiceByName\");\n EntityManager em = emf.createEntityManager();\n ServiceDaoImpl sdao = new ServiceDaoImpl(em);\n Service s = getService(\"low-cost-one\", new Long(99),\n // 1 day\n new Duration(24 * 60 * 60 * 1000));\n\n em.getTransaction().begin();\n em.persist(s);\n em.getTransaction().commit();\n\n assertNotNull(sdao.getServiceByName(\"low-cost-one\").get(0));\n assertEquals(s, sdao.getServiceByName(\"low-cost-one\").get(0));\n }", "@Test\n @DisplayName(\"Get added test organization\")\n void getAddedOrganization(VertxTestContext testContext) {\n registrationService\n .listOrganization(testContext.succeeding(response -> testContext.verify(() -> {\n assertEquals(SUCC_TITLE_ORG_READ, response.getString(\"title\"));\n assertEquals(URN_SUCCESS, response.getString(\"type\"));\n\n @SuppressWarnings(\"unchecked\")\n List<JsonObject> list = response.getJsonArray(\"results\").getList();\n\n Boolean exists = list.stream().anyMatch(obj -> {\n return (obj.getString(\"name\").equals(name)\n && obj.getString(\"id\").equals(orgIdFut.result().toString())\n && obj.getString(\"url\").equals(url));\n });\n\n assertTrue(exists);\n testContext.completeNow();\n })));\n }", "public void setResolution(java.lang.Object resolution) {\n this.resolution = resolution;\n }", "public void setResolution(Resolution resolution) {\n this.resolution = resolution;\n }", "@Override\npublic void onTestStart(ITestResult result) {\n\t\n}", "@Test\n\tvoid searchTest() {\n\t}", "@Test\n\tpublic void testSearch_5()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\t\tString portletId = \"\";\n\t\tlong groupId = 0L;\n\t\tlong userId = 1L;\n\t\tlong[] repositoryIds = new long[] {0L};\n\t\tString keywords = \"\";\n\t\tint start = 1;\n\t\tint end = 1;\n\n\t\tHits result = fixture.search(companyId, portletId, groupId, userId, repositoryIds, keywords, start, end);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t\tassertNotNull(result);\n\t}", "@Before\n public void setup() {\n endpoint = new Endpoint();\n endpoint.setKey(1);\n endpoint.setUrl(URI.create(\"http://localhost/nmr\"));\n\n // Installation, synchronized against\n installation = new Installation();\n installation.setType(InstallationType.TAPIR_INSTALLATION);\n installation.addEndpoint(endpoint);\n\n // Populated Dataset\n dataset = prepareDataset();\n\n // RegistryUpdater, using mocked web service client implementation\n updater = new RegistryUpdater(datasetService, metasyncHistoryService);\n }", "@Test\n public void dspNamesTest() {\n // TODO: test dspNames\n }", "@Override\n public void onStart(ITestContext context) {\n\n }", "@Test\n\tpublic void testInterventionRepository() {\n\t\t// Get the singleton instance of the repository.\n\t\tInterventions target = Interventions.getInstance();\n\n\t\t// Add an intervention to the repository.\n\t\tIntervention intervention = new Intervention();\n\t\ttarget.addIntervention(intervention);\n\t}", "@Test\n\tpublic void bodyUseService() {\n\t\tLOG.info(\"[#759] bodyUseService part 1\");\n\n\t\tFuture<List<Service>> asyncServices = null;\n\t\tList<Service> services = new ArrayList<Service>();\n\n\t\ttry {\n\t\t\t// Start the service\n\t\t\tLOG.info(\"[#759] Calculator service starting\");\n\t\t\tFuture<ServiceControlResult> asyncStartResult = TestCase759.serviceControl.startService(calculatorServiceId);\n\t\t\tServiceControlResult startResult = asyncStartResult.get();\n\t\t\t// Service can't be started\n\t\t\tif (!startResult.getMessage().equals(ResultMessage.SUCCESS)) {\n\t\t\t\tthrow new Exception(\"Can't start the service. Returned value: \"+startResult.getMessage());\n\t\t\t}\n\t\t\tLOG.info(\"[#759] Calculator service started\");\n\n\t\t\t// -- Test case is now ready to consume the service\n\t\t\t// The injection of ICalc will launch the UpperTester\n\t\t}\n\t\tcatch (ServiceDiscoveryException e) {\n\t\t\tLOG.info(\"[#759] ServiceDiscoveryException\", e);\n\t\t\tfail(\"[#759] ServiceDiscoveryException: \"+e.getMessage());\n\t\t\treturn;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tLOG.info(\"[#759] Preamble installService: Unknown Exception\", e);\n\t\t\tfail(\"[#759] Preamble installService: Unknown Exception: \"+e.getMessage());\n\t\t\treturn;\n\t\t}\n\t}", "public void testGetHost() {\n }", "@Override\r\npublic void onTestStart(ITestResult arg0) {\n\t\r\n}", "public void onTestStart(ITestResult arg0) {\n\t\n}", "public void testSetService() throws Exception {\n }", "@Test \r\n\tpublic void testOSFRegApiTransform() throws Exception{\r\n\t\tString[] args = {\"osf_registration\",\"-src\", \"api\",\"-n\",\"12\", \"-o\", \"testregosf/\"};\r\n\t\tRMapTransformerCLI.main(args);\r\n\t\t//check output files\r\n\t\tInteger numfiles = new File(\"testregosf\").list().length;\r\n\t\tassertTrue(numfiles.equals(12)); //only 2 are roots of Registrations\r\n\t\tassertTrue(numfiles>0);\r\n\t}", "void resolve();", "@Override\n\tpublic void onTestStart(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestStart(ITestResult result) {\n\t\t\n\t}", "@Test(groups ={Slingshot,Regression,CsaAgent})\t\n\t\tpublic void verifyPartnerServiceAgentLookUpUserFunctionality() throws Exception {\n\t\t\tReport.createTestLogHeader(\"CSA\", \"To verify whether the account status of broker is successfully changed by agent\");\n\t\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"PSABroker\");\n\t\t\t\t/*deregisterinBgbonline(userProfile); \n\t\t\t\t//Register a user \n\t\t\t\tnew PartnerServiceAgentAction()\n\t\t\t\t.navigateToPSARegistration()\n\t\t\t\t.clickRegisteraUser(userProfile);*/\n\t\t\t\t\n\t\t\t\t//verify Lookup User functionality\n\t\t\t\tnew PartnerServiceAgentAction()\n\t\t\t\t\t.navigateToPSARegistration()\n\t\t\t\t\t.verifyFindUser(userProfile)\n\t\t\t\t\t.updateAndVerifyStatus(userProfile);\n\t\t}", "@Test(groups ={Slingshot,Regression,CsaAgent})\t\n\t\tpublic void verifyPartnerServiceAgentLookUpUser() throws Exception {\n\t\t\tReport.createTestLogHeader(\"CSA\", \"To verify updated user details page through Look up user navigation\");\n\t\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"PSABroker\");\n\t\t\t\t//deregisterinBgbonline(userProfile); \n\t\t\t\t//Register a user \n\t\t\t\t/*new PartnerServiceAgentAction()\n\t\t\t\t.navigateToPSARegistration()\n\t\t\t\t.clickRegisteraUser(userProfile);\n\t\t\t\tnew RegistrationAction()\n\t\t\t\t.openEncryptURL(userProfile)\n\t\t\t\t.fillRegistrationDetails(userProfile)\n\t\t\t\t.verifyThankYouPage()\n\t\t\t\t.clickLoginLink()\n\t\t\t\t.verifyAuditEntry(userProfile)\n\t\t\t\t.verifyEmailIdInDb(userProfile);\n\t\t\t\t//verify Lookup User functionality\n*/\t\t\t\tnew PartnerServiceAgentAction()\n\t\t\t\t\t.navigateToPSARegistration()\n\t\t\t\t\t.verifyFindUser(userProfile)\n\t\t\t\t\t.verifyUpdateUserDetailsPage()\n\t\t\t\t\t.verifyUserAccountInformation(userProfile);\t\t\n\t\t\t\t\t}", "@Test\n public void getLocationById() throws Exception {\n }", "public void tests() {\n this.testStartBaseLocationsDraw();\n }", "@Override\n\tpublic void onTestStart(ITestResult result) {\n\n\t}", "public void testResolveTargetLocation() throws Exception {\n System.out.println(\"resolveTargetLocation\");\n \n instance.resolveTargetLocation();\n \n }", "@Override\n\tpublic void onTestStart(ITestResult arg0) {\n\t\t\n\t}", "@Before\r\n public void setUp() throws Exception {\r\n config = FailureTestHelper.getConfig(\"PhaseEndTimeBasedResolutionDateDetector\");\r\n\r\n instance = new PhaseEndTimeBasedResolutionDateDetector();\r\n instance.configure(config);\r\n }", "@Test\n public void testThatResultsAppearForAReturnJourney(){\n JourneyDetails journeyDetails = new JourneyDetailsBuilder().isOneWay(false).\n withOrigin(\"Bangalore\").withDestination(\"Delhi\").\n withDepartureDate(tomorrow()).withReturnDate(dayAfterTomorrow()).build();\n\n user.searchesForAReturnJourneyWith(journeyDetails);\n user.hasJourneyOptionsAvailableForTheReturnJourney();\n\n\n }", "protected void setup() {\n\t\t\t\t\tDFAgentDescription dfd = new DFAgentDescription();\n\t\t\t\t\tdfd.setName(getAID());\n\t\t\t\t\tServiceDescription sd = new ServiceDescription();\n\t\t\t\t\tsd.setType(\"wHOST\");\n\t\t\t\t\tsd.setName(\"wumpus-host-\" + Math.random());\n\t\t\t\t\tdfd.addServices(sd);\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tDFService.register(this, dfd);\n\t\t\t\t\t\thostMap = new WumpusMapHost();\n\t\t\t\t\t\tSystem.out.println(\"Registered as a host in the DF Service.\");\n\t\t\t\t\t\tlogic = new WumpusLogic();\n\t\t\t\t\t\tlogic.setHostMap(hostMap.getMap());\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\tcatch (FIPAException fe) {\n\t\t\t\t\t\tfe.printStackTrace();\n\t\t\t\t\t}\n\t\t\n\t\t// Printing out a message stating that the agent is ready for service.\n\t\tSystem.out.println(\"Wumpus host \"+getAID().getName()+\" is ready.\");\n\t\t\n\t\taddBehaviour(new TickerBehaviour(this, 1000) {\n\t\t\tprotected void onTick() {\n\t\t\t\tmyAgent.addBehaviour(new HandleRequest());\n\t\t\t}\n\t\t});\n\t \t\n\t\t\n\t}", "public void setResolution(String resolution) {\n this.resolution = resolution;\n }", "@Override\r\n\tpublic void sssDoLwTestInit() {\n\r\n\t}", "public TeamServiceTest() {\r\n\t\tsetupRequestContext();\r\n\t}", "@Override\n\tpublic void testEngine() {\n\t\t\n\t}", "void onTestStart(ITestResult result);", "public int resolution()\r\n\t{\r\n\t\treturn resolution;\r\n\t}", "@Test\n public void get() {\n ResolveAndGet();\n }", "private ServiceList serviceSetup()\n {\n SIManager simgr = sm.createSIManager();\n ServiceList services = simgr.filterServices(new ServiceFilter()\n {\n public boolean accept(Service service)\n {\n return !(service instanceof AbstractService);\n }\n });\n try\n {\n services = services.sortByNumber();\n }\n catch (SortNotAvailableException ex)\n {\n // don't sort then\n }\n\n // Check to see if there are arguments\n // If length of one, then sourceID was specified\n // If length of three, then freq/prognum/modformat was specified\n if (args.length == 1)\n {\n String sid = args[0];\n if (args[0].startsWith(\"0x\")) sid = sid.substring(2, sid.length());\n try\n {\n int sourceID = Integer.parseInt(sid, 16);\n OcapLocator[] locs = { new OcapLocator(sourceID) };\n LocatorFilter filter = new LocatorFilter(locs);\n services = simgr.filterServices(filter);\n }\n catch (NumberFormatException ex)\n {\n log(\"SourceID is not in the correct format\");\n log(\"Proceeding with normal SIDump process\");\n }\n catch (Exception ex)\n {\n log(\"Exception while getting specified service: \" + ex.getMessage());\n log(\"Proceeding with normal SIDump process\");\n }\n }\n if (args.length == 3)\n {\n try\n {\n int freq = Integer.parseInt(args[0]);\n int prog = Integer.parseInt(args[1]);\n int mod = Integer.parseInt(args[2]);\n OcapLocator[] locs = { new OcapLocator(freq, prog, mod) };\n LocatorFilter filter = new LocatorFilter(locs);\n services = simgr.filterServices(filter);\n }\n catch (NumberFormatException ex)\n {\n log(\"Freq/prognum/modformat values are not valid\");\n log(\"Proceeding with normal SIDump process\");\n }\n catch (Exception ex)\n {\n log(\"Exception while getting specified service: \" + ex.getMessage());\n log(\"Proceeding with normal SIDump process\");\n }\n }\n\n return services;\n }", "@Test\n public void testService()\n {\n final JsonSchemaValidator jsonValidator =\n JsonSchemaValidator.matchesJsonSchemaInClasspath(\"costcenters-schema.json\");\n\n // HTTP GET response OK, JSON header and valid schema\n given().get(\"/costcenters\").then().assertThat().statusCode(200).contentType(ContentType.JSON).body(\n jsonValidator);\n }", "public void onTestStart(ITestResult result) {\n\t\t\r\n\t}", "public void onTestStart(ITestResult result) {\n\t\t\r\n\t}", "public void testRunning()\n\t\t{\n\t\t\tInvestigate._invData.clearStores();\n\n\t\t\tfinal WorldLocation topLeft = SupportTesting.createLocation(0, 10000);\n\t\t\ttopLeft.setDepth(-1000);\n\t\t\tfinal WorldLocation bottomRight = SupportTesting.createLocation(10000, 0);\n\t\t\tbottomRight.setDepth(1000);\n\t\t\tfinal WorldArea theArea = new WorldArea(topLeft, bottomRight);\n\t\t\tfinal RectangleWander heloWander = new RectangleWander(theArea,\n\t\t\t\t\t\"rect wander\");\n\t\t\theloWander.setSpeed(new WorldSpeed(20, WorldSpeed.Kts));\n\t\t\tfinal RectangleWander fishWander = new RectangleWander(theArea,\n\t\t\t\t\t\"rect wander 2\");\n\n\t\t\tRandomGenerator.seed(12);\n\n\t\t\tWaterfall searchPattern = new Waterfall();\n\t\t\tsearchPattern.setName(\"Searching\");\n\n\t\t\tTargetType theTarget = new TargetType(Category.Force.RED);\n\t\t\tInvestigate investigate = new Investigate(\"investigating red targets\",\n\t\t\t\t\ttheTarget, DetectionEvent.IDENTIFIED, null);\n\t\t\tsearchPattern.insertAtHead(investigate);\n\t\t\tsearchPattern.insertAtFoot(heloWander);\n\n\t\t\tfinal Status heloStat = new Status(1, 0);\n\t\t\theloStat.setLocation(SupportTesting.createLocation(2000, 4000));\n\t\t\theloStat.getLocation().setDepth(-200);\n\t\t\theloStat.setCourse(270);\n\t\t\theloStat.setSpeed(new WorldSpeed(100, WorldSpeed.Kts));\n\n\t\t\tfinal Status fisherStat = new Status(1, 0);\n\t\t\tfisherStat.setLocation(SupportTesting.createLocation(4000, 2000));\n\t\t\tfisherStat.setCourse(155);\n\t\t\tfisherStat.setSpeed(new WorldSpeed(12, WorldSpeed.Kts));\n\n\t\t\tfinal DemandedStatus dem = null;\n\n\t\t\tfinal SimpleDemandedStatus ds = (SimpleDemandedStatus) heloWander.decide(\n\t\t\t\t\theloStat, null, dem, null, null, 100);\n\n\t\t\tassertNotNull(\"dem returned\", ds);\n\n\t\t\t// ok. the radar first\n\t\t\tASSET.Models.Sensor.Lookup.RadarLookupSensor radar = new RadarLookupSensor(\n\t\t\t\t\t12, \"radar\", 0.04, 11000, 1.2, 0, new Duration(0, Duration.SECONDS),\n\t\t\t\t\t0, new Duration(0, Duration.SECONDS), 9200);\n\n\t\t\tASSET.Models.Sensor.Lookup.OpticLookupSensor optic = new OpticLookupSensor(\n\t\t\t\t\t333, \"optic\", 0.05, 10000, 1.05, 0.8, new Duration(20,\n\t\t\t\t\t\t\tDuration.SECONDS), 0.2, new Duration(30, Duration.SECONDS));\n\n\t\t\tHelo helo = new Helo(23);\n\t\t\thelo.setName(\"Merlin\");\n\t\t\thelo.setCategory(new Category(Category.Force.BLUE,\n\t\t\t\t\tCategory.Environment.AIRBORNE, Category.Type.HELO));\n\t\t\thelo.setStatus(heloStat);\n\t\t\thelo.setDecisionModel(searchPattern);\n\t\t\thelo.setMovementChars(HeloMovementCharacteristics.getSampleChars());\n\t\t\thelo.getSensorFit().add(radar);\n\t\t\thelo.getSensorFit().add(optic);\n\n\t\t\tSurface fisher2 = new Surface(25);\n\t\t\tfisher2.setName(\"Fisher2\");\n\t\t\tfisher2.setCategory(new Category(Category.Force.RED,\n\t\t\t\t\tCategory.Environment.SURFACE, Category.Type.FISHING_VESSEL));\n\t\t\tfisher2.setStatus(fisherStat);\n\t\t\tfisher2.setDecisionModel(fishWander);\n\t\t\tfisher2.setMovementChars(SurfaceMovementCharacteristics.getSampleChars());\n\n\t\t\tCoreScenario cs = new CoreScenario();\n\t\t\tcs.setScenarioStepTime(5000);\n\t\t\tcs.addParticipant(helo.getId(), helo);\n\t\t\tcs.addParticipant(fisher2.getId(), fisher2);\n\n\t\t\t// ok. just do a couple of steps, to check how things pan out.\n\t\t\tcs.step();\n\n\t\t\tSystem.out.println(\"started at:\" + cs.getTime());\n\n\t\t\tDebriefReplayObserver dro = new DebriefReplayObserver(\"./test_reports/\",\n\t\t\t\t\t\"investigate_search.rep\", false, true, true, null, \"plotter\", true);\n\t\t\tTrackPlotObserver tpo = new TrackPlotObserver(\"./test_reports/\", 300,\n\t\t\t\t\t300, \"investigate_search.png\", null, false, true, false, \"tester\",\n\t\t\t\t\ttrue);\n\t\t\tdro.setup(cs);\n\t\t\ttpo.setup(cs);\n\t\t\t//\n\t\t\tdro.outputThisArea(theArea);\n\n\t\t\tInvestigateStore theStore = Investigate._invData.firstStore();\n\n\t\t\t// now run through to completion\n\t\t\tint counter = 0;\n\t\t\twhile ((cs.getTime() < 12000000)\n\t\t\t\t\t&& (theStore.getCurrentTarget(23) == null))\n\t\t\t{\n\t\t\t\tcs.step();\n\t\t\t\tcounter++;\n\t\t\t}\n\n\t\t\t// so, we should have found our tartget\n\t\t\tassertNotNull(\"found target\", theStore.getCurrentTarget(23));\n\n\t\t\t// ok. we've found it. check that we do transition to detected\n\t\t\tcounter = 0;\n\t\t\twhile ((counter++ < 100) && (theStore.getCurrentTarget(23) != null))\n\t\t\t{\n\t\t\t\tcs.step();\n\t\t\t}\n\n\t\t\tdro.tearDown(cs);\n\t\t\ttpo.tearDown(cs);\n\n\t\t\t// so, we should have cleared our tartget\n\t\t\tassertNull(\"found target\", theStore.getCurrentTarget(23));\n\t\t\tassertEquals(\"remembered contact\", 1, theStore.countDoneTargets());\n\n\t\t}", "@Test(groups = \"wso2.ds.dashboard\", description = \"Check registry resource for customized dashboard\",\n dependsOnMethods = \"testCustomizeButtonDashboard\")\n public void checkRegistrySourceForCustomizeDashboard() {\n Boolean isResourceExist = isResourceExist(\n DSIntegrationTestConstants.DASHBOARD_REGISTRY_PATH_CUSTOM_DASHBOARD_PERUSER + \"/\" + USERNAME_VIEWER\n + \"/\" + DS_DASHBOARDS_CONTEXT + \"/\" + dashboardTitle.toLowerCase());\n assertTrue(isResourceExist,\n \"Registry resource could not be created for personalize dashboard per user due to some errors\");\n }" ]
[ "0.66147965", "0.6570242", "0.6087589", "0.60358775", "0.5967375", "0.5941697", "0.5935311", "0.59269524", "0.5742929", "0.5720801", "0.56878126", "0.56279796", "0.55685174", "0.555759", "0.55398536", "0.55193704", "0.55174136", "0.55152404", "0.54846364", "0.5475874", "0.54724365", "0.5468152", "0.54633594", "0.54613256", "0.545966", "0.54559433", "0.5442144", "0.5433465", "0.54226977", "0.5417818", "0.5408337", "0.54077", "0.5383084", "0.5379431", "0.53613657", "0.53608835", "0.5349769", "0.53473675", "0.53375846", "0.53346395", "0.5333275", "0.5332072", "0.532617", "0.5325549", "0.5305219", "0.52936614", "0.5291018", "0.52793837", "0.5276979", "0.52726513", "0.52552587", "0.5254108", "0.5245493", "0.5238054", "0.5234817", "0.523004", "0.5226405", "0.52185035", "0.5218162", "0.5208552", "0.5205997", "0.52051914", "0.5204602", "0.51977664", "0.51923394", "0.5190257", "0.5188917", "0.5185883", "0.51832175", "0.51806223", "0.5178786", "0.5175599", "0.5174072", "0.5172986", "0.5172506", "0.5165714", "0.5164882", "0.5164882", "0.51560444", "0.5153154", "0.5151976", "0.5151231", "0.5145769", "0.514575", "0.5141942", "0.51369107", "0.5133522", "0.51245105", "0.5123136", "0.5121152", "0.51208866", "0.5120099", "0.5119655", "0.5113824", "0.5111722", "0.5106441", "0.5104241", "0.50987613", "0.50987613", "0.5093653", "0.50919753" ]
0.0
-1
Test creating a bunch of BCIDs as if it were being called from a REST service
private void runBCIDCreatorService(){ // Initialize variables dataGroupMinter dataset = null; SettingsManager sm = SettingsManager.getInstance(); sm.loadProperties(); EZIDService ezidAccount = new EZIDService(); Integer user_id = 1; Integer NAAN = new Integer(sm.retrieveValue("bcidNAAN")); Integer ResourceType = ResourceTypes.PRESERVEDSPECIMEN; String doi = null; String webaddress = null; String title = "TEST Load from Java"; // Create a new dataset System.out.println("\nCreating a new dataset"); dataset = new dataGroupMinter(true, true); dataset.mint(NAAN, user_id, new ResourceTypes().get(ResourceType).uri, doi, webaddress, null,title); dataset.close(); /* // Create test data by using input file String path = Thread.currentThread().getContextClassLoader().getResource("bigfile.txt").getFile(); System.out.println("\nReading input file = " + path + " ..."); try { testDatafile = new inputFileParser(readFile(path), dataset).elementArrayList; } catch (IOException e) { e.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } // Create an elementMinter object by using a dataset elementMinter minter = new elementMinter(dataset.getDatasets_id()); // Mint a list of identifiers System.out.println("\nPreparing to mint " + testDatafile.size()+ " identifiers"); String datasetUUID = minter.mintList(testDatafile); // Return the list of identifiers that were made here System.out.println(JSONArray.fromObject(minter.getIdentifiers(datasetUUID)).toString()); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void createComaPatients() {\n \n Assert.assertEquals(service.createComa().get(0).getBedNumber(), \"45\");\n }", "@Test\n public void createObject() {\n\n for (int i = 1; i < 20; i++) {\n\n /**\n * Get the current array\n */\n RequestSpecification request = RestAssured.given();\n BankTransacctionPojo pojoEndpoint = new BankTransacctionPojo();\n\n /**\n * Change the json to pojo\n */\n Response responseGet = getEndPoint(Endpoint.URL);\n List<BankTransacctionPojo> bankTransacctionPojoList = new Gson().fromJson(responseGet.asString(), new TypeToken<List<BankTransacctionPojo>>() {\n }.getType());\n\n\n /**\n * validate the email with current data\n */\n for (BankTransacctionPojo bankTransacctionPojo : bankTransacctionPojoList) {\n Assert.assertFalse(bankTransacctionPojo.getEmail().equals(pojoEndpoint.getEmail()));\n\n }\n\n request.body(new Gson().toJson(pojoEndpoint));\n /**\n * result\n */\n Response responsePost = request.post(Endpoint.URL);\n responsePost.then()\n .assertThat()\n .statusCode(HttpStatus.SC_CREATED);\n\n }\n\n }", "@Test\r\n\tpublic void testCreateTickets() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tJsonObject[] result = roc.createTickets(1, true);\t\t\t\t\r\n\t\t\t\tcollector.checkThat(result[0], notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tresult = roc.createTickets(1, false);\t\t\t\t\r\n\t\t\t\tcollector.checkThat(result[0], notNullValue());\r\n\t\t\t\t\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void getAllCustomer() {\n Customer customer1 = new Customer();\n customer1.setFirstName(\"Dominick\");\n customer1.setLastName(\"DeChristofaro\");\n customer1.setEmail(\"[email protected]\");\n customer1.setCompany(\"Omni\");\n customer1.setPhone(\"999-999-9999\");\n customer1 = service.saveCustomer(customer1);\n\n // Add a second Customer to the mock database (customer2)\n Customer customer2 = new Customer();\n customer2.setFirstName(\"Michael\");\n customer2.setLastName(\"Stuckey\");\n customer2.setEmail(\"[email protected]\");\n customer2.setCompany(\"NuclearFuelServices\");\n customer2.setPhone(\"222-222-2222\");\n customer2 = service.saveCustomer(customer2);\n\n // Collect all the customers into a list using the Customer API\n List<Customer> customerList = service.findAllCustomers();\n\n // Test the getAllCustomer() API method\n TestCase.assertEquals(2,customerList.size());\n TestCase.assertEquals(customer1, customerList.get(0));\n TestCase.assertEquals(customer2, customerList.get(1));\n }", "@SuppressWarnings(\"unused\")\n\t@Test(dataProvider = \"boostandblockdata\", dataProviderClass=com.bestbuy.searchplatform.integrationtests.commons.TestDataProvider.class,dependsOnMethods = {\"testFetchSkuId\"})\n\tpublic void testCreate(BoostsAndBlock boostAndBlock) throws Exception{\n\t\tfor (Entry<String, BoostsAndBlock> entry : getBoostSkuId().entrySet()) {\n\t\t\tBoostsAndBlock mapBoostAndBlock = entry.getValue();\n\t\t\tif (boostAndBlock.getSearchTerm().equals(mapBoostAndBlock.getSearchTerm())) {\n\t\t\t\tboostAndBlock.setBoostProduct(mapBoostAndBlock.getBoostProduct());\n\t\t\t}\n\t\t}\n\t\tString url = getProperty(BT_REST_URL)+BOOSTBLOCK_CREATE;\n\t\tString searchUrl = getProperty(BT_REST_URL)+ BOOSTBLOCK_SEARCH;\n\t\tlog.info(\"create boost resturi = \"+url);\n\t\tHttpEntity<BoostsAndBlock> createEntity = new HttpEntity<BoostsAndBlock>(boostAndBlock,getHeaders());\n\t\tResponseEntity<String> createResponse = getRestTemplate().exchange(url, HttpMethod.POST, createEntity, String.class);\n\t\tassertNotNull(createResponse);\n\t\tString boostResponseString1 = createResponse.getBody();\n\t\tJSONObject boostResponse = new JSONObject(boostResponseString1);\n\t\tString searchJSON = \"{\\\"pageIndex\\\":1,\\\"rowsPerPage\\\":50,\\\"sortColumn\\\":\\\"modifiedDate\\\",\\\"sortOrder\\\":\\\"desc\\\"\" +\n\t\t\",\\\"searchColumnValues\\\":[{\\\"key\\\":\\\"searchTerm\\\",\\\"value\\\":\\\"\" + boostAndBlock.getSearchTerm()+ \"\\\"}],\\\"searchOper\\\":\\\"AND\\\"}\";\n\t\tHttpEntity<String> searchEntity = new HttpEntity<String>(searchJSON,getHeaders());\n\t\tResponseEntity<String> searchResponse = getRestTemplate().exchange(searchUrl, HttpMethod.POST, searchEntity, String.class);\n\t\tJSONObject boostSearchResponse = new JSONObject(searchResponse.getBody());\n\t\tlog.info(\"Boost search response : \"+boostSearchResponse);\n\t\tassertTrue(boostSearchResponse.has(\"rows\"));\n\t\tJSONArray boostDataArray = (JSONArray)boostSearchResponse.get(\"rows\");\n\t\tassertNotNull(boostDataArray);\n\t\tJSONObject boostData = (JSONObject)boostDataArray.get(0);\n\t\tassertTrue(boostData.has(\"boostBlockId\"));\n\t\tInteger boostBlockId = (Integer)boostData.get(\"boostBlockId\");\n\t\tlog.info(\"boostBlockId : \"+boostBlockId);\n\t\tassertNotNull(boostBlockId);\n\t\tgetBoostAndBlocksMap().put(boostBlockId, boostAndBlock);\n\t}", "@Test\r\n\tpublic void testPositiveGenerateBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString[] response = roc.generateBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tidentifier);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tString[] response2 = roc.generateBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tidentifier);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t\t\r\n\t\t\t\tresponse = roc.generateBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tdate);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tresponse2 = roc.generateBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tdate);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testGetAllCompaniesApi() {\n\t\tCompany company = new Company(\"DataSolutions1\", \"Marthahalli1\",\n\t\t\t\t\"Bangalore\", \"India\", \"9880440671\");\n\t\tcompany = companyRepository.save(company);\n\n\t\tCompany company1 = new Company(\"DataSolutions2\", \"Marthahalli2\",\n\t\t\t\t\"Chennai\", \"India\", \"9882440671\");\n\t\tcompany1 = companyRepository.save(company1);\n\n\t\t// Invoke the API\n\t\tCompany[] apiResponse = restTemplate.getForObject(\n\t\t\t\t\"http://localhost:8888/companies/\", Company[].class);\n\n\t\tassertEquals(2, apiResponse.length);\n\n\t\t// Delete the test data created\n\t\tcompanyRepository.delete(company.getCompanyId());\n\t\tcompanyRepository.delete(company1.getCompanyId());\n\t}", "@Test\n\t\tpublic void listBeers() {\n\t\t\tCollection<Beer> allBeers = beerSvc.getAll();\n\t\t\tAssert.assertNotNull(allBeers);\n\t\t}", "@Test\n @DisplayName(\"Should return 200 when adding multiple existing users not part of Bill in Invite Registered Person to Bill\")\n void shouldReturn200ForNormalCaseInviteRegisteredGivenPost() throws Exception {\n final var inviteRegisteredResource = InviteRegisteredResourceFixture.getDefault();\n final var user = UserFixture.getDefaultWithEmailAndPassword(\"[email protected]\", \"notEncrypted\");\n final var accountNotInBill = \"[email protected]\";\n final var secondAccountNotInBill = \"[email protected]\";\n final var existentBillId = 1000L;\n inviteRegisteredResource.setAccounts(List.of(accountNotInBill, secondAccountNotInBill));\n final var path = String.format(BILL_BILLID_ACCOUNTS_ENDPOINT, existentBillId);\n final var authorities = new ArrayList<GrantedAuthority>();\n authorities.add(new SimpleGrantedAuthority(\"RESPONSIBLE_\" + existentBillId));\n\n //When\n final var mvcResult = performMvcPostRequestWithoutBearer(path, inviteRegisteredResource, 200, user.getUsername(), authorities);\n final String content = mvcResult.getResponse().getContentAsString();\n final BillSplitResource response = mapper.readValue(content, BillSplitResource.class);\n\n //Then\n assertThat((int) response.getInformationPerAccount().stream().map(ItemAssociationSplitResource::getAccount).map(AccountResource::getEmail)\n .filter(acc -> acc.equals(accountNotInBill) || acc.equals(secondAccountNotInBill)).count())\n .isEqualTo(2);\n }", "@Test\r\n\tpublic void testCRUDOperations() {\r\n\t\t\r\n\t\tfinal String DESCRIPTION = \"Test Backlog Task\";\r\n\t\tfinal int STATUS_ID = 1;\r\n\t\t\r\n\t\tRestTemplate restTemplate = new RestTemplate();\r\n\t\t//TODO Externalize URL??\r\n\t\tString postURL = \"http://localhost:8080/api/v1/backlog-tasks\";\r\n\t\t\r\n\t\tBacklogTask backlogTask = new BacklogTask();\r\n\t\tbacklogTask.setId(0);\r\n\t\tbacklogTask.setDescription(DESCRIPTION);\r\n\t\tbacklogTask.setStatusId(STATUS_ID);\r\n\t\t\r\n\t\tResponseEntity<BacklogTask> response = restTemplate.postForEntity(postURL, backlogTask, BacklogTask.class);\r\n\t\tBacklogTask postTask = response.getBody();\r\n\t\tassertThat(postTask.getId(), greaterThan(0));\r\n\t\t\r\n\t\tString getURL = String.format(\"http://localhost:8080/api/v1/backlog-tasks\", postTask.getId());\r\n\t\tResponseEntity<List<BacklogTask>> getResponse = restTemplate.exchange(\r\n\t\t\t\tgetURL,\r\n\t\t\t\tHttpMethod.GET,\r\n\t\t\t\tnull,\r\n\t\t\t\tnew ParameterizedTypeReference<List<BacklogTask>>() {});\r\n\t\tList<BacklogTask> getTasks = getResponse.getBody();\r\n\t\t\r\n\t\tassertThat(getTasks, hasItem(hasProperty(\"description\", equalTo(DESCRIPTION))));\r\n\t\tassertThat(getTasks, hasItem(hasProperty(\"id\", equalTo(postTask.getId()))));\r\n\t\t\r\n\t\tString deleteURL = String.format(\"http://localhost:8080/api/v1/backlog-task/%s\", postTask.getId());\r\n\t\trestTemplate.delete(deleteURL);\r\n\r\n\r\n\t\t\r\n\t}", "@Before\n public void setUp() throws Exception {\n billingService = new CustomBillingService();\n\n // prepare fake patient\n Patient patient1 = new Patient(1, \"Connor\", \"MacLeod\", 498, false);\n Patient patient2 = new Patient(2, \"Benjamin\", \"Button\", 4, true);\n Patient patient3 = new Patient(3, \"Leon\", \"Reno\", 68, false);\n\n // prepare fake services\n List<Integer> services1 = new ArrayList<>();\n services1.add(ServiceEnum.DIAGNOSIS.id);\n services1.add(ServiceEnum.XRAY.id);\n services1.add(ServiceEnum.ECG.id);\n\n List<Integer> services2 = new ArrayList<>();\n services2.add(ServiceEnum.BLOODTEST.id);\n services2.add(ServiceEnum.VACCINE.id);\n\n List<Integer> services3 = new ArrayList<>();\n services3.add(ServiceEnum.BLOODTEST.id);\n services3.add(ServiceEnum.ECG.id);\n\n // add the bills\n Bill bill1 = new Bill(1, patient1, services1, 0);\n billingService.addBill(bill1);\n\n Bill bill2 = new Bill(2, patient2, services2, 2);\n billingService.addBill(bill2);\n\n Bill bill3 = new Bill(3, patient3, services3, 1);\n billingService.addBill(bill3);\n }", "@Test\n @Transactional\n public void getAllContactsWithInMultiAddressBookUnique() throws Exception {\n restAddressBookMockMvc.perform(\n get(\"/api/address-books/{id}/contacts\", \"1,2\").param(\"unique\", \"true\"))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$.[3]\").exists())\n .andExpect(jsonPath(\"$.[4]\").doesNotExist())\n ;\n }", "@Test\n public void sendBatchTest() {\n Batch batch = null;\n // List<BatchReturn> response = api.sendBatch(batch);\n\n // TODO: test validations\n }", "@Test\n public void testRobustnessRegisterKyc(){\n for (int i = 0; i < 100; i++){\n UserRegisterKYC userRegisterKyc = new UserRegisterKYC(RandomInput.randomString(), RandomInput.randomString(), RandomInput.randomString(), RandomInput.randomString());\n int requestResponse = userRegisterKyc.sendRegisterRequest();\n assertFalse(requestResponse==200);\n }\n }", "@Test\r\n\tpublic void testPositiveGenerateBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tcollector.checkThat(roc.generateBlobs(10, 16), notNullValue());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void getUsers() throws URISyntaxException {\n List<CreateUserCommand> usersToCreate = Arrays.asList(\n new CreateUserCommand(22,\"Victor\",\"Varnier\"),\n new CreateUserCommand(23,\"Pierre\",\"Bouillon\"),\n new CreateUserCommand(42,\"Obi-Wan\",\"Kenobi\"));\n\n URI createUserUri = getUrlForRoute(\"/api/users\");\n\n List<UserDto> createdUsers = usersToCreate.stream()\n .map(userToCreate\n -> restTemplate\n .postForEntity(createUserUri, userToCreate, UserDto.class)\n .getBody())\n .collect(Collectors.toList());\n\n // Retrieve a list of users\n URI uri = getUrlForRoute(\"/api/users\");\n\n // Perform the HTTP call\n ResponseEntity<List<UserDto>> createdResponse\n = restTemplate.exchange(uri, HttpMethod.GET, null, new ParameterizedTypeReference<>() { });\n\n // Ensure that the list of users is retrieved\n assertEquals(createdResponse.getStatusCode(), HttpStatus.OK);\n List<UserDto> retrievedUsers = extractPayload(createdResponse);\n\n // Ensure that we retrieved a list containing all the users\n retrievedUsers.containsAll(createdUsers);\n }", "@Test\r\n public void testCreateMethod() {\r\n DailyBudget budget = new DailyBudget();\r\n\r\n budget.setName(\"Test budget\");\r\n RequestBuilder requestBuilder = MockMvcRequestBuilders\r\n .post(\"/api/budget\")\r\n .characterEncoding(\"utf-8\")\r\n .accept(MediaType.APPLICATION_JSON)\r\n .contentType(MediaType.APPLICATION_JSON)\r\n .header(\"authorization\", authUtils.generateToken(testUser.getEmail()))\r\n .content(String.format(\"{%s: %s}\",\r\n getEnclosedString(\"id\"),\r\n getEnclosedString(testUser.getId().toString())));\r\n\r\n try {\r\n MvcResult result = mockMvc.perform(requestBuilder).andReturn();\r\n MockHttpServletResponse response = result.getResponse();\r\n BudgetRole createdRole;\r\n\r\n assertEquals(HttpStatus.CREATED.value(), response.getStatus());\r\n assertEquals(1, testRoles.size()); // make sure only one instance was created\r\n\r\n createdRole = testRoles.get(0);\r\n assertEquals(testUser, createdRole.getUser());\r\n assertEquals(BudgetRoleType.CREATOR.rank, createdRole.getRoleType().rank);\r\n }\r\n catch (Exception ex) {\r\n log.error(ex.getMessage());\r\n }\r\n }", "@Test\r\n\tpublic void testPositiveGenerateUUIDs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tUUID[] response = roc.generateUUIDs(10, identifier);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tUUID[] response2 = roc.generateUUIDs(10, identifier);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t\t\r\n\t\t\t\tresponse = roc.generateUUIDs(10, date);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tresponse2 = roc.generateUUIDs(10, date);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void getBatchTest() {\n String token = null;\n // List<BatchReturn> response = api.getBatch(token);\n\n // TODO: test validations\n }", "@Test\n public void shouldCreateEpiDataGathering() {\n assertThat(DatabaseHelper.getEpiDataGatheringDao().queryForAll().size(), is(0));\n\n Case caze = TestEntityCreator.createCase();\n TestEntityCreator.createEpiDataGathering(caze);\n\n // Assure that the burial has been successfully created\n assertThat(DatabaseHelper.getEpiDataGatheringDao().queryForAll().size(), is(1));\n }", "@Test\r\n\tpublic void testPositiveGenerateBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tcollector.checkThat(roc.generateBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX), \r\n\t\t\t\t\t\tnotNullValue());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void test02SendEvents() throws Exception{\n Event event1 = restService.registerEvent(createEvent(\"ACCOUNTS\", createMap(Object.class, \"date\", \"Yesterday\")));\n assertNotNull(event1.getId());\n Event event2 = restService.registerEvent(createEvent(\"TRANSACTIONS\", createMap(Object.class, \"date\", \"Yesterday\")));\n assertNotNull(event2.getId());\n Event event3 = restService.registerEvent(createEvent(\"PRODUCTS\", createMap(Object.class, \"date\", \"Yesterday\")));\n assertNotNull(event3.getId());\n Event event4 = restService.registerEvent(createEvent(\"ACCOUNTS\", createMap(Object.class, \"date\", \"Today\")));\n assertNotNull(event4.getId());\n Event event5 = restService.registerEvent(createEvent(\"TRANSACTIONS\", createMap(Object.class, \"date\", \"Today\")));\n assertNotNull(event5.getId());\n Event event6 = restService.registerEvent(createEvent(\"PRODUCTS\", createMap(Object.class, \"date\", \"Today\")));\n assertNotNull(event6.getId());\n Event event7 = restService.registerEvent(createEvent(\"ACCOUNTS\", createMap(Object.class, \"date\", \"Tomorrow\", \"premise\", \"PC2\")));\n assertNotNull(event7.getId());\n Event event8 = restService.registerEvent(createEvent(\"TRANSACTIONS\", createMap(Object.class, \"date\", \"Tomorrow\", \"premise\", \"PC2\")));\n assertNotNull(event8.getId());\n Event event9 = restService.registerEvent(createEvent(\"PRODUCTS\", createMap(Object.class, \"date\", \"Tomorrow\", \"premise\", \"PC2\")));\n assertNotNull(event9.getId());\n delay(10);\n\n //yesterday events\n List<CallbackData> list = restService.findCallbackInstancesBy(event1.getId(), null, null, null, 0, 0);\n// assertEquals(5, list.size());\n assertEquals(4, list.size());\n list = restService.findCallbackInstancesBy(event2.getId(), null, null, null, 0, 0);\n assertEquals(1, list.size());\n list = restService.findCallbackInstancesBy(event3.getId(), null, null, null, 0, 0);\n assertEquals(4, list.size());\n //today\n list = restService.findCallbackInstancesBy(event4.getId(), null, null, null, 0, 0);\n assertEquals(4, list.size());\n list = restService.findCallbackInstancesBy(event5.getId(), null, null, null, 0, 0);\n assertEquals(1, list.size());\n list = restService.findCallbackInstancesBy(event6.getId(), null, null, null, 0, 0);\n assertEquals(4, list.size());\n //premise\n list = restService.findCallbackInstancesBy(event7.getId(), null, null, null, 0, 0);\n assertEquals(5, list.size());\n list = restService.findCallbackInstancesBy(event8.getId(), null, null, null, 0, 0);\n assertEquals(2, list.size());\n list = restService.findCallbackInstancesBy(event9.getId(), null, null, null, 0, 0);\n assertEquals(5, list.size());\n\n //Event status check\n EventEntity evt = eventRepo.eventById(Long.parseLong(event1.getId()));\n assertEquals(evt.getStatus(), Constants.EVENT_INSTANCE_STATUS_PROCESSED);\n assertEquals(evt.getId(), Long.parseLong(event1.getId()));\n\n }", "@Test\n @InSequence(1)\n public void testRegister(){\n Customer customer = createCustomerInstance(\"Jane Doe\", \"[email protected]\", \"07744754955\");\n //Customer customer = storeCustomer(customer0);\n Taxi taxi0 = createTaxiInstance(\"JK66AKB\",6);\n Taxi taxi = storeTaxi(taxi0);\n //create a GuestBooking with a future date.\n GuestBooking guestBooking = createGuestBookingInstance(customer, taxi.getId(), futureDate1);\n Response response = guestBookingRestService.createBooking(guestBooking);\n\n assertEquals(\"Unexpected response status\", 201, response.getStatus());\n log.info(\" New booking via GuestBookingService.createBooking was persisted and returned status \" + response.getStatus());\n }", "@Test\n\tpublic void testSuccessfulGetBookings() throws ParseException {\n\t\t// Preparing booking data\n\t\tBooking booking1 = getExpectedBookingEntity();\n\t\tbooking1.setId(1);\n\t\tBooking booking2 = getExpectedBookingEntity();\n\t\tbooking2.setId(2);\n\t\tList<Booking> persistedBookings = new ArrayList<>();\n\t\tpersistedBookings.add(booking1);\n\t\tpersistedBookings.add(booking2);\n\t\t\n\t\tcom.paypal.bfs.test.bookingserv.service.model.Booking bookingServiceLayer1 \n\t\t = getServiceLayerBooking();\n\t\tbookingServiceLayer1.setId(1);\n\t\tcom.paypal.bfs.test.bookingserv.service.model.Booking bookingServiceLayer2 \n = getServiceLayerBooking();\n\t\tbookingServiceLayer2.setId(2);\n\n\t\tMockito.when(bookingRepository.findAll()).thenReturn(persistedBookings);\n\t\tList<com.paypal.bfs.test.bookingserv.service.model.Booking> createdBookings = bookingClient\n\t\t\t\t.getAllBookings();\n\t\tAssert.assertNotNull(createdBookings);\n\t\tAssert.assertEquals(2, createdBookings.size());\n\t\tcom.paypal.bfs.test.bookingserv.service.model.Booking bookingWithId1 = null;\n\t\tcom.paypal.bfs.test.bookingserv.service.model.Booking bookingWithId2 = null;\n\t\tfor(com.paypal.bfs.test.bookingserv.service.model.Booking createdBooking : createdBookings) {\n\t\t\tif(createdBooking.getId() == 1) {\n\t\t\t\tbookingWithId1 = createdBooking;\n\t\t\t}\n\t\t\tif(createdBooking.getId() == 2) {\n\t\t\t\tbookingWithId2 = createdBooking;\n\t\t\t}\n\t\t}\n\t\tAssert.assertNotNull(bookingWithId1);\n\t\tAssert.assertNotNull(bookingWithId2);\n\t\tAssert.assertEquals(new Integer(1), bookingWithId1.getId());\n\t\tAssert.assertEquals(new Integer(2), bookingWithId2.getId());\n\t\tassertBookingObject(bookingWithId1, bookingServiceLayer1);\n\t\tassertBookingObject(bookingWithId2, bookingServiceLayer2);\n\t}", "@Test\n public void testCIL11() throws Exception {\n User user = newUser();\n\n for (int i = 0; i < count; i++) {\n assert responseOk(getDBSClient().getUser(user.getIdentifier()));\n }\n String rString = getRandomString();\n user.setEmail(\"name\" + rString + \"@foo.bar\");\n user.setFirstName(\"firstName-\" + rString);\n user.setLastName(\"lastName-\" + rString);\n user.setIDPName(\"idpName-\" + rString);\n getArchivedUserStore().archiveUser(user.getIdentifier());\n getUserStore().update(user);\n for (int i = 0; i < count; i++) {\n assert responseOk(getDBSClient().getUser(user.getUserMultiKey(), user.getIdP()));\n }\n }", "@Test\n public void tests(TestContext context) {\n async = context.async();\n logger.info(\"Codex mock Test starting\");\n\n // Simple GET request to see the module is running and we can talk to it.\n given()\n .get(\"/admin/health\")\n .then()\n .log().all()\n .statusCode(200);\n\n // Simple GET request without a tenant\n given()\n .get(\"/codex-instances\")\n .then()\n .log().ifValidationFails()\n .statusCode(400)\n .body(containsString(\"Tenant\"));\n\n // Simple GET request before the tenant init\n given()\n .header(TEN)\n .get(\"/codex-instances\")\n .then()\n .log().ifValidationFails()\n .statusCode(400)\n .body(containsString(\"supertenant_mod_codex_mock.codex_mock_data\"));\n\n // Call the tenant interface to initialize the database\n String tenants = \"{\\\"module_to\\\":\\\"\" + moduleId + \"\\\"}\";\n logger.info(\"About to call the tenant interface \" + tenants);\n given()\n .header(TEN).header(JSON)\n .body(tenants)\n .post(\"/_/tenant\")\n .then()\n .log().ifValidationFails()\n .statusCode(201);\n\n // get all\n given()\n .header(TEN)\n .get(\"/codex-instances\")\n .then()\n .log().all() // .ifValidationFails()\n .body(containsString(\"\\\"totalRecords\\\" : 4\"))\n .body(containsString(\"resultInfo\"))\n .statusCode(200);\n\n // get one\n given()\n .header(TEN)\n .get(\"/codex-instances/11111111-1111-1111-1111-111111111111\")\n .then()\n .log().ifValidationFails()\n .statusCode(200)\n .body(containsString(\"alt title for 111111111111\"))\n .body(containsString(\"unitTest\"));\n\n // unknown id\n given()\n .header(TEN)\n .get(\"/codex-instances/99999999-9999-9999-9999-987654321111\")\n .then()\n .log().ifValidationFails()\n .statusCode(404);\n\n // query\n given()\n .header(TEN)\n .get(\"/codex-instances?query=title=000000000001\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"Title of 000000000001\"))\n .statusCode(200);\n given()\n .header(TEN)\n .get(\"/codex-instances?query=publisher=beta\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"Title of 111111111112\"))\n .body(containsString(\"unitTest\"))\n .statusCode(200);\n given()\n .header(TEN)\n .get(\"/codex-instances?query=contributor=Contributor of 111111111111\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"Title of 111111111111\"))\n .statusCode(200);\n given()\n .header(TEN)\n .get(\"/codex-instances?query=contributor=*111111111111*\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"Title of 111111111111\"))\n .statusCode(200);\n\n // ServerChoice\n given()\n .header(TEN)\n .get(\"/codex-instances?query=Title\")\n .then()\n .log().ifValidationFails()\n .statusCode(200);\n\n // bad query - the query validation ought to catch this\n // But it does not. Logs the \"unable to load schema\" message, and accepts all...\n given()\n .header(TEN)\n .get(\"/codex-instances?query=UNKNOWNFIELD=foo\")\n .then()\n .log().ifValidationFails()\n .statusCode(200);\n //.statusCode(422);\n\n // limit\n given()\n .header(TEN)\n .get(\"/codex-instances?offset=1&limit=2\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"111111111111\"))\n .body(containsString(\"111111111112\"))\n .statusCode(200);\n\n // sort\n given()\n .header(TEN)\n .get(\"/codex-instances?offset=0&limit=1&query=publisher=for sortBy publisher\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"alpha publisher\"))\n .statusCode(200);\n\n // Query manipulations: resourceType -> type\n given()\n .header(TEN)\n .get(\"/codex-instances?query=resourceType=books\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"\\\"totalRecords\\\" : 4\"))\n .statusCode(200);\n\n // Query manipulations: isbn\n given()\n .header(TEN)\n .get(\"/codex-instances?query=identifier/type=isbn=1111111111\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"\\\"totalRecords\\\" : 1\"))\n .body(containsString(\"111111111112\"))\n .statusCode(200);\n\n // Query manipulations: issn\n given()\n .header(TEN)\n .get(\"/codex-instances?query=identifier /type=issn = 1111111111\")\n .then()\n .log().ifValidationFails()\n .body(containsString(\"\\\"totalRecords\\\" : 1\"))\n .body(containsString(\"000000000001\"))\n .statusCode(200);\n\n // All done\n logger.info(\"codex Mock Test done\");\n async.complete();\n }", "@Test\n public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\"));\n addCharges(charges, amountPlusInterestPercentageDisbursementCharge, \"1\", null);\n\n Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper\n .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n clientID.toString(), collateralId);\n Assertions.assertNotNull(collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"126.04\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"126.06\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"157.57\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"31.51\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"126.06\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3309.06\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"94.53\", \"31.51\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"157.57\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"157.57\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID,\n (Integer) getloanCharge(amountPlusInterestPercentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"63.02\", \"31.51\", \"31.51\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3277.55\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.0\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2791.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"157.57\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3303\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3149.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3241.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3121.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3121.19\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT));\n }", "@Test\n\tpublic void requestAccountsForCustomer12212_checkListOfAccountsIDs_expectContains12345() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "@Test\n\tpublic void createAccTest() {\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tbc.createAccount(cus, 1);\n\t\tassertEquals(1, cus.getAccList().size());\n\t}", "@Override\n public void executeTest() {\n res = CommonApi.getLoadBalancersByVPC(headers, httpClient, vpcId);\n resJson = JSONObject.parseObject(res.getHtml());\n result = JSONArray.parseArray(resJson.getString(\"result\"));\n assertEquals(result.size(), 0, \"The result size should be true with mismatched tenantId and vpcId\");\n // testing if getting empty result with mismatched vpcId and tenantId\n\n headers.put(\"X-Product-Id\", tenantId);\n for(Map.Entry<String, LoadBalancer> entry : ingInstances.entrySet()) {\n ingInstance = entry.getValue();\n instanceId = ingInstance.getInstanceId();\n logger.info(\"=================================================================\");\n logger.info(\"=== adding instance: \" + instanceId);\n logger.info(\"=================================================================\");\n LBs.put(instanceId, 0);\n if (ingInstance.getType().equals(\"mix\")){\n LBs.put(instanceId, 1);\n }\n }\n\n res = CommonApi.getLoadBalancersByVPC(headers, httpClient, vpcId);\n resJson = JSONObject.parseObject(res.getHtml());\n result = JSONArray.parseArray(resJson.getString(\"result\"));\n logger.info(\"=================================================================\");\n logger.info(\"=== Api response result part: \" + resJson.getString(\"result\"));\n logger.info(\"=================================================================\");\n Iterator resultItr = result.iterator();\n String instanceId;\n\n // checking if result has any duplicated instance info or not while marking checked instance.\n while(resultItr.hasNext()){\n JSONObject lb = (JSONObject) resultItr.next();\n instanceId = namespace + \"@\" + lb.getString(\"instanceName\");\n logger.info(\"=================================================================\");\n logger.info(\"=== checking instance: \" + instanceId);\n logger.info(\"=================================================================\");\n assertTrue(LBs.containsKey(instanceId), \"getting unexpected instance\");\n assertTrue(LBs.get(instanceId).equals(0), \"getting duplicated instances in result\");\n LBs.put(instanceId, 1);\n }\n // checking if it missed any instance under the VPC with given vpcId\n for(Map.Entry<String, Integer> entry : LBs.entrySet()) {\n assertTrue(entry.getValue() == 1, \"missed instance with instanceId: \" + entry.getKey());\n }\n\n\n }", "@Test\n public void shouldRetrieveACollectionOfPayments() throws Exception {\n for (int i = 0; i < 10; i++) {\n postTestPaymentAndGetResponse();\n }\n\n //when: the collection of payments is fetched:\n ResponseEntity response = restTemplate.exchange(paymentsUrl, HttpMethod.GET, null, new ParameterizedTypeReference<PagedResources<Payment>>() {\n });\n //then: there should be at least 10 payments in the collection ( remember there may be more there from a previous test ):\n Collection<Payment> payments = ((PagedResources) response.getBody()).getContent();\n assertTrue(payments.size() >= 10);\n //and: the response status code should be OK:\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "public static void runAllTests() {\n\t\trunClientCode(SimpleRESTClientUtils.getCToFServiceURL());\n\t\trunClientCode(SimpleRESTClientUtils.getCToFServiceURL(new String [] {\"100\"}));\n\t}", "@Test\n @Transactional\n public void getAllContactsWithInAddressBook() throws Exception {\n restAddressBookMockMvc.perform(\n get(\"/api/address-books/{id}/contacts\", \"1\").param(\"unique\", \"false\"))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$.[2]\").exists())\n .andExpect(jsonPath(\"$.[3]\").doesNotExist())\n ;\n }", "@Test\n @Category(FastTest.class)\n public void canImportValidBooks() throws Exception {\n for (int i = 0; i < 6; i++) {\n stubFor(get(urlPathMatching(\"/download/\" + i + \"/.*\"))\n .willReturn(aResponse()\n .withStatus(200)\n .withHeader(\"Content-Type\", \"application/force-download\")\n .withBodyFile(i + \"/binary\")));\n }\n\n // post our JSON to the REST service under test\n migrator.migrate(getClass().getResource(TESTFILE_VALID_BOOKS));\n\n // verify that our logic downloads books\n\n verify(getRequestedFor(urlEqualTo(\n \"/download/0/?token=abcdef\")));\n verify(getRequestedFor(urlEqualTo(\n \"/download/1/?token=bcdefa\")));\n verify(getRequestedFor(urlEqualTo(\n \"/download/2/?token=cdefab\")));\n verify(getRequestedFor(urlEqualTo(\n \"/download/3/?token=defabc\")));\n verify(getRequestedFor(urlEqualTo(\n \"/download/4/?token=efabcd\")));\n verify(getRequestedFor(urlEqualTo(\n \"/download/5/?token=fabcde\")));\n }", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Before\n\tpublic void setUp() {\n\t\tcompteTest = FactoryCompte.getCompteVide();\n\t\tcompteTest.setIdClient(3630);\n\t\tcompteTest.setBalance(89.8);\n\t\tcompteTest.setNegativeBalanceAllowed(false);\n\t\t\n\t\tinstance.createWithId(compteTest);\t\t\n\t}", "@Test\n public void checkCreateCampaignTest() {\n ObjectIdentityData buyer = ObjectIdentityData.getAnyObjectFromList(buyers);\n // create request data with campaign test data\n RequestData requestData = new CampaignRequestData(buyer);\n // check create post request\n GrantsVerification.checkCreateRequest(requestData, isAdmin());\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values = {\"all\",\"dept-update\"})\n public void _2_4_2__addBCtoDept() throws Exception {\n Department d = d_1;\n d.addBusinessCategory(bc_1);\n this.mockMvc.perform(put(\"/api/v1.0/companies/\"+\n d.getCompany()+\n \"/departments/\"+\n d.getId())\n .contentType(CONTENT_TYPE)\n .header(AUTHORIZATION, ACCESS_TOKEN)\n .content(json(d)))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.id\",is(d.getId().toString())))\n .andExpect(jsonPath(\"$.description\",is(d.getDescription())))\n .andExpect(jsonPath(\"$.businessCategories\",hasSize(1)))\n .andExpect(jsonPath(\"$.businessCategories[0].product\",is(bc_1.getProduct())))\n .andExpect(jsonPath(\"$.businessCategories[0].locality\",is(bc_1.getLocality())));\n }", "@Test\n @DisplayName(\"Should return 200 when adding one existing user not part of Bill in Invite Registered Person to Bill\")\n void shouldReturn200ForNormalCaseOneUserInviteRegisteredGivenPost() throws Exception {\n final var inviteRegisteredResource = InviteRegisteredResourceFixture.getDefault();\n final var user = UserFixture.getDefaultWithEmailAndPassword(\"[email protected]\", \"notEncrypted\");\n final var accountNotInBill = \"[email protected]\";\n final var existentBillId = 1000L;\n inviteRegisteredResource.setAccounts(List.of(accountNotInBill));\n final var path = String.format(BILL_BILLID_ACCOUNTS_ENDPOINT, existentBillId);\n final var authorities = new ArrayList<GrantedAuthority>();\n authorities.add(new SimpleGrantedAuthority(\"RESPONSIBLE_\" + existentBillId));\n\n //When\n final var mvcResult = performMvcPostRequestWithoutBearer(path, inviteRegisteredResource, 200, user.getUsername(), authorities);\n final String content = mvcResult.getResponse().getContentAsString();\n final BillSplitResource response = mapper.readValue(content, BillSplitResource.class);\n\n //Then\n assertThat((int) response.getInformationPerAccount().stream().map(ItemAssociationSplitResource::getAccount).map(AccountResource::getEmail)\n .filter(acc -> acc.equals(accountNotInBill)).count())\n .isEqualTo(1);\n }", "@Test\n public void listAll_200() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n List<Workflow> wfList = new ArrayList<>();\n wfList.add(addMOToDb(1));\n wfList.add(addMOToDb(2));\n wfList.add(addMOToDb(3));\n\n // PREPARE THE TEST\n // Fill in the workflow db\n\n // DO THE TEST\n Response response = callAPI(VERB.GET, \"/mo/\", null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(200, status);\n\n List<Workflow> readWorkflowList = response.readEntity(new GenericType<List<Workflow>>() {\n });\n assertEquals(wfList.size(), readWorkflowList.size());\n for (int i = 0; i < wfList.size(); i++) {\n assertEquals(wfList.get(i).getId(), readWorkflowList.get(i).getId());\n assertEquals(wfList.get(i).getName(), readWorkflowList.get(i).getName());\n assertEquals(wfList.get(i).getDescription(), readWorkflowList.get(i).getDescription());\n }\n\n\n }", "@Test\n public void loanWithCahargesOfTypeAmountPercentageAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer percentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\"));\n addCharges(charges, percentageDisbursementCharge, \"1\", null);\n\n Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer percentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n clientID.toString(), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"120.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"149.11\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"29.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"120.00\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3300.60\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"120.00\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"90.89\", \"29.11\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"149.11\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"149.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"61.19\", \"29.11\", \"29.70\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3271.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2791.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"149.11\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.78\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3149.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"30.29\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3240.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3120.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3120.58\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"30.90\"), JournalEntry.TransactionType.CREDIT));\n }", "@Test\n public void getClients_retrievesALlClientsFromDatabase_clientsList() {\n Stylist myStylist = new Stylist(\"Ann\");\n myStylist.save();\n Client firstClient = new Client(\"Rose\", myStylist.getId());\n firstClient.save();\n Client secondClient = new Client(\"Mary\", myStylist.getId());\n secondClient.save();\n Client[] clients = new Client[] { firstClient, secondClient };\n assertTrue(myStylist.getClients().containsAll(Arrays.asList(clients)));\n }", "@Test\n @Order(1)\n public void testGetAllContacts() {\n List<Contact> contacts = Arrays.asList(\n createContact(\"A Smith\"),\n createContact(\"B Smith\"),\n createContact(\"C Smith\"),\n createContact(\"D Smith\")\n );\n\n final ResponseEntity<Contact[]> response = template.getForEntity(\"/api/v1/contact\", Contact[].class);\n final List<Contact> foundContacts = Arrays.asList(response.getBody());\n\n Assertions.assertThat(foundContacts.size()).isEqualTo(contacts.size());\n\n for (int i = 0; i < contacts.size(); i++) {\n Assertions.assertThat(foundContacts.get(i).getName()).isEqualTo(contacts.get(i).getName());\n }\n }", "@Test\r\n\tpublic void testRetrieveAllChromebook() {\n\t\tassertNotNull(\"Test if there is valid Chromebook arraylist to add to\", chromebookList);\r\n\r\n\t\tString allChromebook = ResourceCentre.retrieveAllChromebook(chromebookList);\r\n\t\tString testOutput = \"\";\r\n\t\tassertEquals(\"Check that ViewAllChromebooklist\", testOutput, allChromebook);\r\n\r\n\t\t// No.2\r\n\t\tResourceCentre.addChromebook(chromebookList, cb1);\r\n\t\tResourceCentre.addChromebook(chromebookList, cb2);\r\n\t\tassertEquals(\"Test if that Chromebook arraylist size is 2?\", 2, chromebookList.size());\r\n\r\n\t\t// No.3\r\n\t\tallChromebook = ResourceCentre.retrieveAllChromebook(chromebookList);\r\n\r\n\t\ttestOutput = String.format(\"%-10s %-30s %-10s %-10s %-20s\\n\", \"CB0011\", \"My Google Chromebook 1st\", \"Yes\", \"\",\r\n\t\t\t\t\"Mac OS\");\r\n\t\ttestOutput += String.format(\"%-10s %-30s %-10s %-10s %-20s\\n\", \"CB0012\", \"SAMSUNG Chromebook 4+\", \"Yes\", \"\",\r\n\t\t\t\t\"Win 10\");\r\n\r\n\t\tassertEquals(\"Check that ViewAllChromebooklist\", testOutput, allChromebook);\r\n\n\t}", "@Test\n public void testInsertSharedService () {\n\n ArrayList<SharedService> sharedServicesBefore =\n given().\n header(\"AJP_eppn\", userEPPN).\n expect().\n statusCode(200).\n when().\n get(SHARED_SERVICE_ENDPOINT).\n as(ArrayList.class);\n\n int serviceId = 1;\n int userId = 102;\n int idSharedService = addSharedService(serviceId, userId);\n assertTrue(idSharedService != -1);\n ServiceLogger.log(logTag, \"inserted shared servie, id =\" + idSharedService);\n\n ArrayList<SharedService> sharedServicesAfter =\n given().\n header(\"AJP_eppn\", userEPPN).\n expect().\n statusCode(200).\n when().\n get(SHARED_SERVICE_ENDPOINT).\n as(ArrayList.class);\n\n int numBefore = (sharedServicesBefore != null) ? sharedServicesBefore.size() : 0;\n int numAfter = (sharedServicesAfter != null) ? sharedServicesAfter.size() : 0;\n int numExpected = numBefore + 1;\n assertTrue (numAfter == numExpected);\n\n ArrayList<SharedService> sharedServiceLookup =\n given().\n header(\"AJP_eppn\", userEPPN).\n expect().\n statusCode(200).\n when().\n get(SHARED_SERVICE_GET_BY_ID, idSharedService).\n as(ArrayList.class);\n int numLookup = (sharedServiceLookup != null) ? sharedServiceLookup.size() : 0;\n ServiceLogger.log(logTag, \"get shared service by id returns list of size =\" + numLookup);\n assertTrue (numLookup == 1);\n\n }", "public void testServiceList()\n {\n ServiceList services = serviceSetup();\n\n ServiceIterator it = services.createServiceIterator();\n int i = 0;\n try\n {\n while (it.hasNext())\n {\n // Increment the service counter\n i++;\n // Get our next service\n ServiceExt service = (ServiceExt) it.nextService();\n log(\"******************************************************************\");\n log(\"* Services - Counter: (\" + i + \")\");\n dumpService(service);\n\n ServiceDetailsHandle[] handles = sidb.getServiceDetailsByService(service.getServiceHandle());\n\n ServiceDetailsExt[] details = new ServiceDetailsExt[handles.length];\n for (int j = 0; j < handles.length; j++)\n {\n details[j] = sidb.createServiceDetails(handles[j]);\n dumpServiceDetails(details[j]);\n assertEquals(\"ServiceDetails' Service does not match expected value\", service,\n details[j].getService());\n assertEquals(\"ServiceType does not match\", service.getServiceType(), details[j].getServiceType());\n }\n log(\"******************************************************************\");\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "@Test\n public void testCustomerFactoryCreate() {\n CustomerController customerController = customerFactory.getCustomerController();\n customerController.addCustomer(CUSTOMER_NAME, CUSTOMER_CONTACT, false);\n assertEquals(1, customerController.getCustomerList().size());\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedUUIDs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedUUIDs(10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, UUID[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void testMultiRequestQuiesce() throws Exception {\n\t \n System.out.println(\"In testMultiRequestQuiesce\");\n\tObject obj = context().getService(TestBean.class);\n\t\n\tif (obj != null)\n\t{ \n\t\tQuiesceParticipant participant = getParticipant(\"org.apache.aries.blueprint.core\");\n\t\t\n\t\tif (participant != null)\n\t\t{\n\t\t\tTestQuiesceCallback callback = new TestQuiesceCallback();\n\t\t\tTestBeanClient client = new TestBeanClient((TestBean)obj, 1500);\n\t\t \n\n\t //quiesce bundle will sleep for a second so will quiesce after that\n\t\t Bundle bundle = getBundle(\"org.apache.aries.blueprint.testquiescebundle\");\n\t\t \n\t\t System.out.println(\"Got the bundle\");\n\t\t \n\t\t List<Bundle> bundles = new ArrayList<Bundle>();\n\t\t bundles.add(bundle);\n\t\t \n\t\t Thread t = new Thread(client);\n\t\t t.start();\n\t \n\t\t\tparticipant.quiesce(callback, bundles);\n\t\t\t\n\t\t System.out.println(\"Called Quiesce, putting in a new request\");\n\t\t \n\t\t Thread t2 = new Thread(client);\n\t\t t2.start();\n\t\t \n\t\t Thread.sleep(5000);\n\t\t \n\t\t Assert.assertTrue(\"Quiesce callback should have occurred once; calls should be 1, but it is \"+callback.getCalls(), callback.getCalls()==1);\n\t\t \n \n\t\t}else{\n\t\t\tthrow new Exception(\"No Quiesce Participant found for the blueprint service\");\n\t\t}\n\t}else{\n\t\tthrow new Exception(\"No Service returned for \" + TestBean.class);\n\t}\n }", "@Test\n public void createBaasClientUsingPostTest() throws ApiException {\n CreateBaasClientCO baasClientCO = null;\n BaasClientVO response = api.createBaasClientUsingPost(baasClientCO);\n\n // TODO: test validations\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedUUIDs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedUUIDs(10, userData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, UUID[].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testGetAllPatient() {\n\t\tfor (int i =0; i<10;i++){\n\t\t assertEquals(wraRestServer.listPatient().get(i).getId(),patientDao.getAll().get(i).getId());\n\t}\n\t}", "@Test\n public void testCreateCars() throws Exception {\n Car car = carService.generateACarObject();\n testCreateCars(new ElectricCar(car)); // Test to see if electric cars are saved right!\n testCreateCars(new GasCar(car)); // Test to see if gas cars are saved right!\n testCreateCars(new DieselCar(car)); // Test to see if diesel cars are saved right!\n }", "@Test\n public void testCreate() {\n\n List<JDBCDataObject> classList = new ArrayList<>();\n classList.add(new EnrollmentDTO(0, 5, 1, null));\n\n List<Integer> ids = manageClass.create(classList);\n assertEquals(1, ids.size());\n\n }", "@Test(priority=1)\r\n\tpublic void createStudentSeraliztion() {\r\n\t\t//for seralization i used java object student.\r\n\t\t\r\n\t\tStudent student = new Student();\r\n\t\t//information look at book tutorial-9.\r\n\t\tstudent .setId(102);\r\n\t\tstudent .setFirstName(\"Mango\");\r\n\t\tstudent .setLastName(\"Rasalu\");\r\n\t\tstudent .setEmail(\"[email protected]\");\r\n\t\tstudent .setProgramme(\"King\");\r\n\t\t//Courses have two courses.wer using ArrayList To hold different courses.\r\n\t\tArrayList<String> courseList = new ArrayList<String>();\r\n\t\tcourseList.add(\"java\");\r\n\t\tcourseList.add(\"Selenium\");\r\n\t\tstudent.setCourses(courseList);\r\n\t\tgiven()\r\n\t\t\t.contentType(ContentType.JSON)\r\n\t\t\t.body(student)\r\n\t\t.when()\r\n\t\t\t.post(\"http://localhost:8085/student\")\r\n\t\t.then()\r\n\t\t\t.statusCode(201)\r\n\t\t\t.assertThat()\r\n\t\t\t.body(\"msg\",equalTo(\"student added\"));\r\n\t\t\r\n\t\t\r\n\t}", "@Test\n public void testMultiJCPCalls() throws Exception {\n \n Topology topology = newTopology(\"testMultiJCPCalls\");\n \n for (int i = 0 ; i < 10; i++)\n topology.addJobControlPlane();\n \n submitAndCheckJCPIsThere(topology); \n }", "private void runBiSciColIdentifierTools(EZIDService ezidAccount, Integer naan, Integer who) throws Exception {\n\n\n // Create a minter object to use for all these samples\n System.out.println(\"\\nCreating a minter object by passing in an existing Dataset Prefix ...\");\n // Creation method Example #1, no arguments is just the default test case ark:/99999/fk4\n // minterBCID minter = new minterBCID();\n // Creation method Example #2, provide a NAAN & a user, which automatically creates a new shoulder\n // minterBCID minter = new minterBCID(\"87286\",1);\n // Creation method Example #3, pass in an existing prefix and use that\n elementMinter minter = new elementMinter(87286, \"C2\", false, true);\n System.out.println(\" prefix=\" + minter.prefix);\n System.out.println(\" datasets_id=\" + minter.getDatasets_id());\n\n // Create a bcid for localId without Suffix passthrough\n System.out.println(\"\\nCreate bcids WITHOUT suffix passthrough from test dataset ...\");\n String datasetIdentifier = minter.mintList(testDatafile);\n System.out.println(\" datasetIdentifier = \" + datasetIdentifier);\n Iterator ezids1It = minter.getIdentifiers(datasetIdentifier).iterator();\n while (ezids1It.hasNext()) {\n System.out.println(\" \" + ezids1It.next());\n }\n System.out.println(\" cleaning up ...\");\n minter.deleteLoadedSetUUID(datasetIdentifier);\n\n // Create a bcid for each localId's with Suffix passthrough\n System.out.println(\"\\nCreate bcids WITH suffix passthrough from test dataset ...\");\n System.out.println(\" datasetIdentifier = \" + datasetIdentifier);\n datasetIdentifier = minter.mintList(testDatafile);\n Iterator ezids2It = minter.getIdentifiers(datasetIdentifier).iterator();\n while (ezids2It.hasNext()) {\n System.out.println(\" \" + ezids2It.next());\n }\n System.out.println(\" cleaning up ...\");\n minter.deleteLoadedSetUUID(datasetIdentifier);\n\n // Create a bunch of bcids\n int num = 10;\n System.out.println(\"\\nCreate \" + num + \" bcids (a reserved slot in our database) ...\");\n datasetIdentifier = minter.createBCIDs(num, new URI(\"http://purl.org/dc/dcmitype/PhysicalObject\"));\n System.out.println(\" datasetIdentifier = \" + datasetIdentifier);\n Iterator guidsIt = minter.getIdentifiers(datasetIdentifier).iterator();\n while (guidsIt.hasNext()) {\n System.out.println(\" \" + guidsIt.next());\n }\n System.out.println(\" cleaning up (deleting these identifiers cause we're just testing here) ...\");\n minter.deleteLoadedSetUUID(datasetIdentifier);\n\n // Create bcids from Given uuids with Suffix Passthrough\n System.out.println(\"\\nCreate test uuid dataset ...\");\n String uuidInputStringFromTextBox = \"\" +\n UUID.randomUUID() + \"\\thttp://biocode.berkeley.edu/specimens/MBIO57\\n\" +\n UUID.randomUUID() + \"\\n\" +\n UUID.randomUUID();\n ArrayList localUUIDs = new inputFileParser(uuidInputStringFromTextBox, minter).elementArrayList;\n System.out.println(\" Successfully created test uuid dataset\");\n\n // Create a bcid for each localId's\n System.out.println(\"\\nCreating bcids with uuid suffix passthrough from test uuid dataset (FSU case) ...\");\n datasetIdentifier = minter.mintList(localUUIDs);\n System.out.println(\" datasetIdentifier = \" + datasetIdentifier);\n Iterator uuidsIt = minter.getIdentifiers(datasetIdentifier).iterator();\n while (uuidsIt.hasNext()) {\n System.out.println(\" \" + uuidsIt.next());\n }\n\n // Return information about an identifier (resolver service)\n //ark:/87286/C2\n //ark:/87286/C2eee9cd5b-fd7d-40f9-acc6-362770e7bfde\n //1. Look in the identifiers table and resolve there.\n //2. Look in the datasets table\n\n // Create bcids from Given uuids with Suffix Passthrough\n System.out.println(\"\\nCreate a second test uuid dataset ...\");\n String uuidInputStringFromTextBox2 = \"\" +\n UUID.randomUUID() + \"\\thttp://biocode.berkeley.edu/specimens/MBIO57\\n\" +\n UUID.randomUUID() + \"\\n\" +\n UUID.randomUUID();\n ArrayList localUUIDs2 = new inputFileParser(uuidInputStringFromTextBox2, minter).elementArrayList;\n System.out.println(\" Successfully created test uuid dataset #2\");\n\n // Create a bcid for each localId's\n System.out.println(\"\\nCreating bcidS WITHOUT uuid suffix passthrough from test uuid dataset #2 ...\");\n datasetIdentifier = minter.mintList(localUUIDs2);\n Iterator uuidsIt2 = minter.getIdentifiers(datasetIdentifier).iterator();\n while (uuidsIt2.hasNext()) {\n System.out.println(\" \" + uuidsIt2.next());\n }\n\n // TODO: Send URL Link to results\n // Scan Identifiers table and create ezids where ezidRequest = true && ezidMade = false\n System.out.println(\"\\nBatch create ezids for Identifiers ...\");\n System.out.println(\" OPTION disabled here for now; we cannot scale for all requests, but we want to maintain them.\");\n //manageEZIDs creator = new manageEZIDs();\n //creator.createEZIDs(ezidAccount);\n\n // Scan Datasets table and create ezids where ezidRequest = true && ezidMade = false\n System.out.println(\"\\nBatch create ezids for Datasets ...\");\n manageEZID creator = new manageEZID();\n creator.createDatasetsEZIDs(ezidAccount);\n System.out.println(\" Scanned datasets table and created any dataset ezids\");\n\n // Force an update on an individual bcid\n System.out.println(\"\\nUpdate a single ezid metadata record for id = \" + minter.getDatasets_id() + \" ...\");\n creator.updateDatasetsEZID(ezidAccount, minter.getDatasets_id());\n\n // Create a Dataset\n /* System.out.println(\"\\nCreate a new dataset object:\");\n dataset dataset = new dataset(false);\n dataset.mint(naan, who, new ResourceTypes().RESOURCE, null, \"http://www.google.com/\", \"this is a test\");\n System.out.println(\" Created \" + dataset.prefix);\n dataset.close();\n */\n\n // Close connection\n minter.close();\n creator.close();\n }", "@Test\n public void consentsTest() {\n // TODO: test consents\n }", "@Test\n public void getAllItem() {\n Item item1 = new Item();\n item1.setName(\"Drill\");\n item1.setDescription(\"Power Tool\");\n item1.setDaily_rate(new BigDecimal(\"24.99\"));\n item1 = service.saveItem(item1);\n\n // Add an Item to the mock database using the Item API method (item2)\n Item item2 = new Item();\n item2.setName(\"Screwdriver\");\n item2.setDescription(\"Hand Tool\");\n item2.setDaily_rate(new BigDecimal(\"4.99\"));\n item2 = service.saveItem(item2);\n\n // Add all the Item's in the mock database to a list of Items using the Item API method\n List<Item> itemList = service.findAllItems();\n\n // Test the getAllItem() API method\n TestCase.assertEquals(2, itemList.size());\n TestCase.assertEquals(item1, itemList.get(0));\n TestCase.assertEquals(item2, itemList.get(1));\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\r\n public void testListRegistrations1() throws Throwable {\r\n // Parameters for the API call\r\n Double limit = 10d;\r\n Double offset = 20d;\r\n Options8Enum options = null;\r\n\r\n // Set callback and perform API call\r\n List<ListRegistrationsResponse> result = null;\r\n controller.setHttpCallBack(httpResponse);\r\n try {\r\n result = controller.listRegistrations(limit, offset, options);\r\n } catch(APIException e) {};\r\n\r\n // Test whether the response is null\r\n assertNotNull(\"Response is null\", \r\n httpResponse.getResponse());\r\n // Test response code\r\n assertEquals(\"Status is not 200\", \r\n 200, httpResponse.getResponse().getStatusCode());\r\n\r\n // Test whether the captured response is as we expected\r\n assertNotNull(\"Result does not exist\", \r\n result);\r\n assertTrue(\"Response body does not match in keys\", TestHelper.isArrayOfJsonObjectsProperSubsetOf(\r\n \"[ { \\\"id\\\": \\\"abcdefg\\\", \\\"description\\\": \\\"Example Context Source\\\", \\\"dataProvided\\\": { \\\"entities\\\": [ { \\\"id\\\": \\\"Bcn_Welt\\\", \\\"type\\\": \\\"Room\\\" } ], \\\"attrs\\\": [ \\\"temperature\\\" ] }, \\\"provider\\\": { \\\"http\\\": { \\\"url\\\": \\\"http://contextsource.example.org\\\" }, \\\"supportedForwardingMode\\\": \\\"all\\\" }, \\\"expires\\\": \\\"2017-10-31T12:00:00\\\", \\\"status\\\": \\\"active\\\", \\\"forwardingInformation\\\": { \\\"timesSent\\\": 12, \\\"lastForwarding\\\": \\\"2017-10-06T16:00:00.00Z\\\", \\\"lastSuccess\\\": \\\"2017-10-06T16:00:00.00Z\\\", \\\"lastFailure\\\": \\\"2017-10-05T16:00:00.00Z\\\" } }]\", \r\n TestHelper.convertStreamToString(httpResponse.getResponse().getRawBody()), \r\n false, true, false));\r\n }", "@Test\n void simpleBddTest(){\n given()\n .baseUri(\"https://reqres.in/api\")\n .basePath(\"/users?page=2\")\n\n //когда система\n .when().get()\n\n .then().statusCode(200)\n .and().header(\"Content-Type\", \"application/json; charset=utf-8\");\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_4() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void testDoReturnChromebook() {\n\r\n\t\tResourceCentre.addChromebook(chromebookList, cb1);\r\n\t\tResourceCentre.addChromebook(chromebookList, cb2);\r\n\r\n\t\t// Item list is not null, newly added item cannot be returned successfully.\r\n\t\tassertNotNull(\"Test that list is not null\", chromebookList);\r\n\t\tassertFalse(\"Test that item cannot be returned if not loaned\",\r\n\t\t\t\tResourceCentre.doReturnChromebook(chromebookList, \"CB0011\"));\r\n\r\n\t\t// Item can be returned successfully, when loaned out.\r\n\t\tResourceCentre.doLoanChromebook(chromebookList, \"CB0011\", \"01/01/2010\");\r\n\t\tassertTrue(\"Test that item can be returned when loaned out.\",\r\n\t\t\t\tResourceCentre.doReturnChromebook(chromebookList, \"CB0011\"));\r\n\r\n\t\t// Item can be loaned again and returned successfully\r\n\t\tassertTrue(\"Test that item can be loaned again when returned.\",\r\n\t\t\t\tResourceCentre.doLoanChromebook(chromebookList, \"CB0011\", \"01/01/2010\"));\r\n\t\tassertTrue(\"Test that item can be returned when reloaned.\",\r\n\t\t\t\tResourceCentre.doReturnChromebook(chromebookList, \"CB0011\"));\r\n\r\n\t\t// Another item loaned out, can be returned successfully.\r\n\t\tResourceCentre.doLoanChromebook(chromebookList, \"CB0012\", \"01/01/2010\");\r\n\t\tassertTrue(\"Test that other loaned items can be returned.\",\r\n\t\t\t\tResourceCentre.doReturnChromebook(chromebookList, \"CB0012\"));\r\n\r\n\t}", "@Test\n public void testGetAll() {\n List<Allocation> cc = allocationCollection.getAll();\n assertNotNull(cc);\n assertFalse(cc.isEmpty());\n }", "@Test(priority=31)\n\tpublic void campaign_user_with_valid_filter_for_camp_created() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_valid_filter_for_camp_created\", \"To validate whether user is able to get campaign through campaign/user api with valid filter for campaign_created\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\tString camp_created = campaign_created;\n\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\tlist.add(new BasicNameValuePair(\"filter\", \"campaign_created%3d\"+ DateUtils.getDateFromDateTime(camp_created)));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, list);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid filter for campaign_created\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t \n\t\t JSONArray array = (JSONArray)json.get(\"data\");\n\t\t // Check whether campaign/user returns at least 1 record when valid campaign_created is passed for filter\n\t\t Assert.assertTrue(array.size()>=1, \"Campaign list does not return records when valid campaign_created is passed for filter.\");\n\t\t for(int i=0; i<array.size(); i++){\n\t\t\t // Get the campaign from the campaign list\n\t\t\t JSONObject campaign = (JSONObject)array.get(i);\n\t\t\t Assert.assertEquals(campaign.get(\"campaign_created\").toString(), DateUtils.getDateTimeFromDate(DateUtils.getDateFromDateTime(camp_created)), \"campaign/list api does not return campaigns according to passed campaign_created for filter.\");\n\t\t }\n\t\t}\n\t}", "@Before\n public void setUp() throws Exception {\n hc.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS, Boolean.FALSE);\n hc.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BEST_MATCH);\n \n logout = reqFactory.createLogoutRequest().asHttpGet();\n adminLogin = reqFactory.createLoginRequest(adminUser).asHttpPost();\n basicUserLogin = reqFactory.createLoginRequest(basicUser).asHttpPost();\n authorizedUserLogin = reqFactory.createLoginRequest(authorizedUser).asHttpPost();\n \n if (!areObjectsSeeded) {\n \n // Login as the administrator and create a project. Assign the\n // basic user as the Pi and logout.\n project = new Project();\n \n project.setDescription(\"A seeded project for use with ITs\");\n project.setEndDate(DateTime.now());\n project.setFundingEntity(\"NSF\");\n project.setStartDate(DateTime.now());\n project.setName(\"Seeded Project\");\n project.addNumber(\"1234\");\n project.setFundingEntity(\"Cash Money\");\n project.addPi(basicUser.getId());\n \n HttpAssert.assertStatus(hc, adminLogin, 300, 399, \"Unable to login admin user!\");\n \n project = reqFactory.createProjectApiAddRequest(project).execute(hc);\n \n HttpAssert.assertStatus(hc, new HttpGet(urlConfig.getProjectUrl(project.getId()).toURI()), 200,\n \"Unable to retrieve project \" + project);\n HttpAssert.assertStatus(hc, logout, 300, 399, \"Unable to logout admin user!\");\n \n // Login as the basic user, create the collection, and logout.\n collection = new Collection();\n collection.setId(reqFactory.createIdApiRequest(Types.COLLECTION).execute(hc));\n collection.setTitle(\"Seeded Collection\");\n collection.setSummary(\"A seeded collection for use with ITs\");\n List<PersonName> creators = new ArrayList<PersonName>();\n creators.add(new PersonName(\"Mr.\", \"John\", \"Jack\", \"Doe\", \"II\"));\n collection.setCreators(creators);\n \n HttpAssert.assertStatus(hc, basicUserLogin, 300, 399, \"Unable to login as basic user!\");\n HttpAssert.assertStatus(hc, reqFactory.createCollectionRequest(collection, project).asHttpPost(), 300, 399,\n \"Unable to create collection \" + collection);\n HttpAssert.assertStatus(hc, new HttpGet(urlConfig.getViewCollectionUrl(collection.getId()).toURI()), 200,\n \"Unable to view collection \" + collection);\n HttpAssert.assertStatus(hc, logout, 300, 399, \"Unable to logout basic user!\");\n \n assertNotNull(\"Expected a Collection to be created in the archive!\",\n archiveSupport.pollAndQueryArchiveForCollectionDu(collection.getId()));\n \n // Load sample datafile\n sampleDataFile = createSampleDataFile(\"DepositStatusIT\", \".txt\");\n sampleDataFile.deleteOnExit();\n areObjectsSeeded = true;\n }\n }", "@Test\n public void makeAndRetrievePbaPaymentsByProbateForSuccessLiberataValidation() {\n String accountNumber = testProps.existingAccountNumber;\n CreditAccountPaymentRequest accountPaymentRequest = PaymentFixture\n .aPbaPaymentRequestForProbateForSuccessLiberataValidation(\"215.00\", \"PROBATE\");\n accountPaymentRequest.setAccountNumber(accountNumber);\n PaymentDto paymentDto = paymentTestService.postPbaPayment(USER_TOKEN, SERVICE_TOKEN, accountPaymentRequest).then()\n .statusCode(CREATED.value()).body(\"status\", equalTo(\"Success\")).extract().as(PaymentDto.class);\n\n // Get pba payment by reference\n PaymentDto paymentsResponse =\n paymentTestService.getPbaPayment(USER_TOKEN, SERVICE_TOKEN, paymentDto.getReference()).then()\n .statusCode(OK.value()).extract().as(PaymentDto.class);\n\n assertThat(paymentsResponse.getAccountNumber()).isEqualTo(accountNumber);\n\n // Get pba payments by ccdCaseNumber\n PaymentsResponse liberataResponse = paymentTestService\n .getPbaPaymentsByCCDCaseNumber(SERVICE_TOKEN, accountPaymentRequest.getCcdCaseNumber()).then()\n .statusCode(OK.value()).extract().as(PaymentsResponse.class);\n assertThat(liberataResponse.getPayments().size()).isGreaterThanOrEqualTo(1);\n PaymentDto retrievedPaymentDto = liberataResponse.getPayments().stream()\n .filter(o -> o.getPaymentReference().equals(paymentDto.getReference())).findFirst().get();\n assertThat(retrievedPaymentDto.getAccountNumber()).isEqualTo(accountNumber);\n assertThat(retrievedPaymentDto.getFees().get(0).getApportionedPayment()).isEqualTo(\"215.00\");\n assertThat(retrievedPaymentDto.getFees().get(0).getCalculatedAmount()).isEqualTo(\"215.00\");\n assertThat(retrievedPaymentDto.getFees().get(0).getMemoLine())\n .isEqualTo(\"Personal Application for grant of Probate\");\n assertThat(retrievedPaymentDto.getFees().get(0).getNaturalAccountCode())\n .isEqualTo(\"4481102158\");\n assertThat(retrievedPaymentDto.getFees().get(0).getJurisdiction1()).isEqualTo(\"family\");\n assertThat(retrievedPaymentDto.getFees().get(0).getJurisdiction2())\n .isEqualTo(\"probate registry\");\n\n // delete payment record\n paymentTestService.deletePayment(USER_TOKEN, SERVICE_TOKEN, paymentDto.getReference()).then().statusCode(NO_CONTENT.value());\n\n }", "@Test\n public void testSuccessfulMultipleParByMultipleClients() throws Exception {\n // create client dynamically\n String clientId = createClientDynamically(generateSuffixedName(CLIENT_NAME), (OIDCClientRepresentation clientRep) -> {\n clientRep.setRequirePushedAuthorizationRequests(Boolean.FALSE);\n clientRep.setRedirectUris(new ArrayList<String>(Arrays.asList(CLIENT_REDIRECT_URI)));\n });\n OIDCClientRepresentation oidcCRep = getClientDynamically(clientId);\n String clientSecret = oidcCRep.getClientSecret();\n assertEquals(Boolean.FALSE, oidcCRep.getRequirePushedAuthorizationRequests());\n assertTrue(oidcCRep.getRedirectUris().contains(CLIENT_REDIRECT_URI));\n assertEquals(OIDCLoginProtocol.CLIENT_SECRET_BASIC, oidcCRep.getTokenEndpointAuthMethod());\n\n authManageClients(); // call it when several clients are created consecutively.\n\n String client2Id = createClientDynamically(generateSuffixedName(CLIENT_NAME), (OIDCClientRepresentation clientRep) -> {\n clientRep.setRequirePushedAuthorizationRequests(Boolean.TRUE);\n clientRep.setRedirectUris(new ArrayList<String>(Arrays.asList(CLIENT_REDIRECT_URI)));\n });\n OIDCClientRepresentation oidcC2Rep = getClientDynamically(client2Id);\n String client2Secret = oidcC2Rep.getClientSecret();\n assertEquals(Boolean.TRUE, oidcC2Rep.getRequirePushedAuthorizationRequests());\n assertTrue(oidcC2Rep.getRedirectUris().contains(CLIENT_REDIRECT_URI));\n assertEquals(OIDCLoginProtocol.CLIENT_SECRET_BASIC, oidcC2Rep.getTokenEndpointAuthMethod());\n\n // Pushed Authorization Request #1\n oauth.clientId(clientId);\n oauth.redirectUri(CLIENT_REDIRECT_URI);\n ParResponse pResp = oauth.doPushedAuthorizationRequest(clientId, clientSecret);\n assertEquals(201, pResp.getStatusCode());\n String requestUriOne = pResp.getRequestUri();\n\n // Pushed Authorization Request #2\n oauth.clientId(client2Id);\n oauth.scope(\"microprofile-jwt\" + \" \" + \"profile\");\n oauth.redirectUri(CLIENT_REDIRECT_URI);\n pResp = oauth.doPushedAuthorizationRequest(client2Id, client2Secret);\n assertEquals(201, pResp.getStatusCode());\n String requestUriTwo = pResp.getRequestUri();\n\n // Authorization Request with request_uri of PAR #2\n // remove parameters as query strings of uri\n oauth.redirectUri(null);\n oauth.scope(null);\n oauth.responseType(null);\n oauth.requestUri(requestUriTwo);\n String state = oauth.stateParamRandom().getState();\n oauth.stateParamHardcoded(state);\n OAuthClient.AuthorizationEndpointResponse loginResponse = oauth.doLogin(TEST_USER2_NAME, TEST_USER2_PASSWORD);\n assertEquals(state, loginResponse.getState());\n String code = loginResponse.getCode();\n String sessionId =loginResponse.getSessionState();\n\n // Token Request #2\n oauth.redirectUri(CLIENT_REDIRECT_URI); // get tokens, it needed. https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3\n OAuthClient.AccessTokenResponse res = oauth.doAccessTokenRequest(code, client2Secret);\n assertEquals(200, res.getStatusCode());\n\n AccessToken token = oauth.verifyToken(res.getAccessToken());\n String userId = findUserByUsername(adminClient.realm(REALM_NAME), TEST_USER2_NAME).getId();\n assertEquals(userId, token.getSubject());\n assertEquals(sessionId, token.getSessionState());\n // The following check is not valid anymore since file store does have the same ID, and is redundant due to the previous line\n // Assert.assertNotEquals(TEST_USER_NAME, token.getSubject());\n assertEquals(client2Id, token.getIssuedFor());\n assertTrue(token.getScope().contains(\"openid\"));\n assertTrue(token.getScope().contains(\"microprofile-jwt\"));\n assertTrue(token.getScope().contains(\"profile\"));\n\n // Logout\n oauth.doLogout(res.getRefreshToken(), client2Secret); // same oauth instance is used so that this logout is needed to send authz request consecutively.\n\n // Authorization Request with request_uri of PAR #1\n // remove parameters as query strings of uri\n oauth.clientId(clientId);\n oauth.redirectUri(null);\n oauth.scope(null);\n oauth.responseType(null);\n oauth.requestUri(requestUriOne);\n state = oauth.stateParamRandom().getState();\n oauth.stateParamHardcoded(state);\n loginResponse = oauth.doLogin(TEST_USER_NAME, TEST_USER_PASSWORD);\n assertEquals(state, loginResponse.getState());\n code = loginResponse.getCode();\n sessionId =loginResponse.getSessionState();\n\n // Token Request #1\n oauth.redirectUri(CLIENT_REDIRECT_URI); // get tokens, it needed. https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3\n res = oauth.doAccessTokenRequest(code, clientSecret);\n assertEquals(200, res.getStatusCode());\n\n token = oauth.verifyToken(res.getAccessToken());\n userId = findUserByUsername(adminClient.realm(REALM_NAME), TEST_USER_NAME).getId();\n assertEquals(userId, token.getSubject());\n assertEquals(sessionId, token.getSessionState());\n // The following check is not valid anymore since file store does have the same ID, and is redundant due to the previous line\n // Assert.assertNotEquals(TEST_USER_NAME, token.getSubject());\n assertEquals(clientId, token.getIssuedFor());\n assertFalse(token.getScope().contains(\"microprofile-jwt\"));\n assertTrue(token.getScope().contains(\"openid\"));\n }", "@Test(priority=50)\t\n\tpublic void campaign_user_with_valid_filter_for_ct_user_id() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_valid_filter_for_ct_user_id\", \"To validate whether user is able to get campaign and its users through campaign/user api with valid filter for ct_user_id\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\ttest_data = HelperClass.readTestData(class_name, \"campaign_user_with_valid_filter_for_ct_user_id\");\n\t\tString ct_user_id = campaign_owner_user_id;\n\t\tString[] operators = {\"=\"};\n\t\tString encoded_operator = \"\";\n\t\tfor(String operator:operators){\n\t\t\tencoded_operator = java.net.URLEncoder.encode(operator, \"UTF-8\");\n\t\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\t\tlist.add(new BasicNameValuePair(\"filter\", \"ct_user_id\"+encoded_operator+ct_user_id));\n\t\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, list);\n\t\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid filter for ct_user_id\");\n\t\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = rd.readLine()) != null) {\n\t\t\t // Convert response to JSON object\t\n\t\t\t JSONParser parser = new JSONParser();\n\t\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t\t JSONArray array = (JSONArray)json.get(\"data\");\n\t\t\t // Check whether campaign list returns at least 1 record when valid ct_user_id is passed for filter\n\t\t\t Assert.assertTrue(array.size()>=1, \"campaign/user does not return records when valid ct_user_id is passed for filter.\");\n\t\t\t for(int i=0; i<array.size(); i++){\n\t\t\t\t // Get the campaign from the campaign list\n\t\t\t\t JSONObject campaign = (JSONObject)array.get(i);\n\t\t\t\t JSONArray users_data = (JSONArray) campaign.get(\"users\");\n\t\t\t\t Boolean user_exist = false;\n\t\t\t\t for(int j=0; j<users_data.size(); j++){\n\t\t\t\t\t JSONObject user = (JSONObject)users_data.get(j);\n\t\t\t\t\t String user_id = user.get(\"ct_user_id\").toString();\n\t\t\t\t\t if(user_id.equals(ct_user_id)){\n\t\t\t\t\t\t user_exist = true;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t Assert.assertTrue(user_exist, \"Passed user_id does not exist in campaign/user response.\");\n\t\t\t }\n\t\t\t}\t\n\t\t}\n\t}", "public void testListClaim(){\n\t}", "@Test\n public void getInvoiceByCustomer() {\n Customer customer = new Customer();\n customer.setFirstName(\"Dominick\");\n customer.setLastName(\"DeChristofaro\");\n customer.setEmail(\"[email protected]\");\n customer.setCompany(\"Omni\");\n customer.setPhone(\"999-999-9999\");\n customer = service.saveCustomer(customer);\n\n // Verify it was added to the database\n Customer customerCopy = service.findCustomer(customer.getCustomerId());\n TestCase.assertEquals(customerCopy, customer);\n\n // Add an Item to the database\n Item item = new Item();\n item.setName(\"Drill\");\n item.setDescription(\"Power Tool\");\n item.setDaily_rate(new BigDecimal(\"24.99\"));\n item = service.saveItem(item);\n\n // Verify it was added\n Item itemCopy = service.findItem(item.getItem_id());\n TestCase.assertEquals(itemCopy, item);\n\n // Add an InvoiceItem to the database\n Invoice_Item invoiceItem = new Invoice_Item();\n invoiceItem.setItem_id(item.getItem_id());\n invoiceItem.setQuantity(42);\n invoiceItem.setUnit_rate(new BigDecimal(\"4.99\"));\n invoiceItem.setDiscount(new BigDecimal(\"0.99\"));\n\n // Collect all the InvoiceItems into a list\n List<Invoice_Item> invoiceItemList = new ArrayList<>();\n invoiceItemList.add(invoiceItem);\n\n // Create an InvoiceViewModel\n InvoiceViewModel invoiceViewModel = new InvoiceViewModel();\n invoiceViewModel.setCustomer_id(customer.getCustomerId());\n invoiceViewModel.setOrder_date(LocalDate.of(2000,1,1));\n invoiceViewModel.setPickup_date(LocalDate.of(2000,2,2));\n invoiceViewModel.setReturn_date(LocalDate.of(2000,3,3));\n invoiceViewModel.setLate_fee(new BigDecimal(\"4.99\"));\n invoiceViewModel.setInvoice_items(invoiceItemList);\n invoiceViewModel = service.createInvoiceViewModel(invoiceViewModel);\n\n // Get Invoice By Customer\n service.getInvoiceByCustomer(customer.getCustomerId());\n }", "@Test\n public void shouldCreateEpiDataTravel() {\n assertThat(DatabaseHelper.getEpiDataTravelDao().queryForAll().size(), is(0));\n\n Case caze = TestEntityCreator.createCase();\n TestEntityCreator.createEpiDataTravel(caze);\n\n // Assure that the burial has been successfully created\n assertThat(DatabaseHelper.getEpiDataTravelDao().queryForAll().size(), is(1));\n }", "@Test\r\n\tpublic void testAddChromebook() {\n\t\tassertNotNull(\"Test if there is valid Chromebook arraylist to add to\", chromebookList);\r\n\r\n\t\t// No.2 - size 1\r\n\t\tResourceCentre.addChromebook(chromebookList, cb1);\r\n\t\tassertEquals(\"Test if that Chromebook arraylist size is 1?\", 1, chromebookList.size());\r\n\r\n\t\t// No.2 - same item added, size 1\r\n\t\tassertSame(\"Test that Chromebook is added same as 1st item of the list?\", cb1, chromebookList.get(0));\r\n\r\n\t\t// No.3 - size 2\r\n\t\tResourceCentre.addChromebook(chromebookList, cb2);\r\n\t\tassertEquals(\"Test that Chromebook arraylist size is 2?\", 2, chromebookList.size());\r\n\r\n\t\t// No.3 - same item added, size 2\r\n\t\tassertSame(\"Test that Chromebook is added same as 2nd item of the list?\", cb2, chromebookList.get(1));\r\n\t\t\n\t}", "@Test\n public void addContacts() {\n }", "@Test\n public void testPostCartsIdCouponsAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postCartsIdCouponsAction(\"{id}\", \"{code}\", \"{customerId}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Cart\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testCRE_B() {\n CuteNetlibCase.doTest(\"CRE-B.SIF\", \"1234567890\", \"1234567890\", NumberContext.of(7, 4));\n }", "@Test(dependsOnMethods = \"testCreate\")\n\tpublic void testApprove() throws Exception{\n\t\tString url = getProperty(BT_REST_URL)+BOOSTBLOCK_APPROVE+\"/\";\n\t\tlog.info(\"approve boostandblock resturi = \"+url);\n\t\tfor (Integer boostBlockId : getBoostAndBlocksMap().keySet()) {\n\t\t\tHttpEntity<Integer> entity = new HttpEntity<Integer>(getHeaders());\n\t\t\tResponseEntity<String> response = getRestTemplate().exchange(url+boostBlockId, HttpMethod.PUT, entity, String.class);\n\t\t\tassertNotNull(response);\n\t\t\tString boostResponseString = response.getBody();\n\t\t\tlog.info(\"approve boost response = \"+boostResponseString);\n\t\t\tJSONObject boostResponse = new JSONObject(boostResponseString);\n\t\t\tassertTrue(boostResponse.has(\"data\"));\n\t\t\tJSONObject data = (JSONObject)boostResponse.get(\"data\");\n\t\t\tassertTrue(data.has(\"status\"));\n\t\t\tString status = (String)data.get(\"status\");\n\t\t\tlog.info(\"approve boost status = \"+boostBlockId+\" status = \"+status);\n\t\t\tassertNotNull(status);\n\t\t\tassertEquals(status,\"Approved\");\n\t\t}\n\t}", "@Test public void testObjectsList() throws Exception {\n \t\tdeleteAll();\n \t\tStorage ss=makeServicesStorage(base+\"/cspace-services/\");\n \t\tString p1=ss.autocreateJSON(\"collection-object/\",getJSON(\"obj3.json\"));\n \t\tString p2=ss.autocreateJSON(\"collection-object/\",getJSON(\"obj4.json\"));\n \t\tString p3=ss.autocreateJSON(\"collection-object/\",getJSON(\"obj4.json\"));\n \t\tString[] names=ss.getPaths(\"collection-object\",null);\n \t\tassertArrayContainsString(names,p1);\n \t\tassertArrayContainsString(names,p2);\n \t\tassertArrayContainsString(names,p3);\n \t}", "@Test\n @Order(1)\n void create_client() {\n client = new Client();\n client.setName(\"Test Client\");\n Client c = service.createClient(client);\n Assertions.assertEquals(client.getName(), c.getName());\n Assertions.assertNotEquals(0, c.getId());\n client = c;\n }", "@Test\n public void testAllAccountsGET() {\n HttpAuthenticationFeature feature = \n HttpAuthenticationFeature.basic(\"admin\", \"admin\");\n Client client = ClientBuilder.newClient();\n URI uri = UriBuilder\n .fromUri(APPLICATION_NAME + APPLICATION_API_VERSION)\n .scheme(\"http\")\n .host(\"localhost\")\n .port(8080)\n .build();\n WebTarget webTarget = client\n .register(feature)\n .target(uri)\n .path(\"account\");\n Response response = webTarget\n .request(APPLICATION_JSON)\n .get();\n assertThat(response.getStatus(), is(200));\n }", "public void testBidOnTask() {\n\n Context context = this.getInstrumentation().getTargetContext().getApplicationContext();\n ArrayList<String> queryList = new ArrayList<>();\n\n // Delete the test requester if their account already exists\n DataManager.deleteUsers delRequester = new DataManager.deleteUsers(context);\n queryList.clear();\n queryList = findUserID(\"bidTestRequester\");\n delRequester.execute(queryList);\n\n // Delete the first test provider if their account already exists\n DataManager.deleteUsers delProvider1 = new DataManager.deleteUsers(context);\n queryList.clear();\n queryList = findUserID(\"bitTestProvider1\");\n delProvider1.execute(queryList);\n\n // Delete the second test provider if their account already exists\n DataManager.deleteUsers delProvider2 = new DataManager.deleteUsers(context);\n queryList.clear();\n queryList = findUserID(\"bitTestProvider2\");\n delProvider2.execute(queryList);\n\n // Delete test task 1 if it already exists\n DataManager.deleteTasks delTask1 = new DataManager.deleteTasks(context);\n queryList.clear();\n queryList = findTaskID(\"Mow My Lawn (Bid Test)\");\n Log.e(\"Mow My Lawn ID2\", queryList.get(0).toString());\n delTask1.execute(queryList);\n\n // Create an account for the test requester\n // NOTE: Creating accounts is covered in another use case\n DataManager.addUsers addRequester = new DataManager.addUsers(context);\n User requester = new User(\"bidTestRequester\", \"test\", \"[email protected]\", \"7809396963\", \"Zach\", \"Redfern\");\n addRequester.execute(requester);\n\n // Create an account for the first test provider\n // NOTE: Creating accounts is covered in another use case\n DataManager.addUsers addProvider1 = new DataManager.addUsers(context);\n User provider1 = new User(\"bidTestProvider1\", \"test\",\"[email protected]\", \"5875551234\", \"Bobbi\", \"Pandachuck\");\n addProvider1.execute(provider1);\n\n // Create an account for the second test provider\n // NOTE: Creating accounts is covered in another use case\n DataManager.addUsers addProvider2 = new DataManager.addUsers(context);\n User provider2 = new User(\"bidTestProvider2\", \"test\",\"[email protected]\", \"9805567812\", \"Rebecca\", \"Black\");\n addProvider2.execute(provider2);\n\n // Create sample tests to bid on\n // NOTE: Adding tasks is covered in another use case)\n DataManager.addTasks addTask1 = new DataManager.addTasks(context);\n Task task1 = new Task(\"bidTestRequester\", \"Mow my lawn.\", \"Mow My Lawn (Bid Test)\", 60.00, Task.TaskStatus.REQUESTED);\n addTask1.execute(task1);\n\n\n\n\n\n\n // Login as the first test provider\n solo.assertCurrentActivity(\"Wrong Activity\", LoginActivity.class);\n solo.enterText((EditText) solo.getView(R.id.login_etUsername), \"bidTestProvider1\");\n solo.enterText((EditText) solo.getView(R.id.login_etPassword), \"test\");\n solo.sleep(2000);\n solo.clickOnButton(\"Sign In\");\n\n // Assert that we have entered the recent listings activity\n solo.sleep(2000);\n solo.assertCurrentActivity(\"Wrong Activity\", RecentListingsActivity.class);\n RecentListingsActivity recentListingsActivity = (RecentListingsActivity) solo.getCurrentActivity();\n ArrayList<Task> taskList1 = recentListingsActivity.getTaskList();\n\n // Get the position of the test tasks in the task list\n int posTask1 = -1;\n for (int i = 0; i < taskList1.size(); ++i) {\n Log.e(\"Task\", taskList1.get(i).getTitle());\n if (taskList1.get(i).getTitle().equals(\"Mow My Lawn (Bid Test)\")) {\n posTask1 = i;\n }\n }\n\n // If the test task was not found, fail the test\n if (posTask1 == -1) {\n assertTrue(Boolean.FALSE);\n }\n\n // Click the first test task and place an initial bid on it\n solo.sleep(2000);\n solo.scrollDownRecyclerView(posTask1);\n solo.clickInRecyclerView(posTask1);\n solo.assertCurrentActivity(\"Wrong Activity\", PlaceBidActivity.class);\n TextView title1 = (TextView) solo.getView(R.id.details_task_title);\n assertTrue(title1.getText().toString().equals(\"Mow My Lawn (Bid Test)\"));\n FrameLayout frameLayout1 = (FrameLayout) solo.getView(R.id.details_frame_layout);\n solo.enterText((EditText) frameLayout1.findViewById(R.id.my_bid_amount), \"59.99\");\n solo.enterText((EditText) frameLayout1.findViewById(R.id.my_bid_description), \"I will do it!\");\n solo.sleep(2000);\n solo.clickOnButton(\"Bid\");\n solo.assertCurrentActivity(\"Wrong Activity\", RecentListingsActivity.class);\n\n // View the tasks the provider has bid on\n solo.clickOnImageButton(0);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER);\n solo.assertCurrentActivity(\"Wrong Activity\", ListTaskActivity.class);\n solo.sleep(2000);\n\n\n\n\n\n // Logout and login as the second task provider\n solo.goBack();\n solo.clickOnImageButton(0);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER);\n solo.sleep(2000);\n solo.assertCurrentActivity(\"Wrong Activity\", LoginActivity.class);\n solo.enterText((EditText) solo.getView(R.id.login_etUsername), \"bidTestProvider2\");\n solo.enterText((EditText) solo.getView(R.id.login_etPassword), \"test\");\n solo.sleep(2000);\n solo.clickOnButton(\"Sign In\");\n\n // Assert that we have entered the recent listings activity\n solo.sleep(2000);\n solo.assertCurrentActivity(\"Wrong Activity\", RecentListingsActivity.class);\n RecentListingsActivity recentListingsActivity2 = (RecentListingsActivity) solo.getCurrentActivity();\n ArrayList<Task> taskList2 = recentListingsActivity2.getTaskList();\n\n // Get the position of the test tasks in the task list\n int posTask2 = -1;\n for (int i = 0; i < taskList2.size(); ++i) {\n Log.e(\"Task\", taskList2.get(i).getTitle());\n if (taskList2.get(i).getTitle().equals(\"Mow My Lawn (Bid Test)\")) {\n posTask2 = i;\n }\n }\n\n // If the test task was not found, fail the test\n if (posTask2 == -1) {\n assertTrue(Boolean.FALSE);\n }\n\n // Click the first test task and place an initial bid on it\n solo.sleep(2000);\n solo.scrollDownRecyclerView(posTask2);\n solo.clickInRecyclerView(posTask2);\n solo.assertCurrentActivity(\"Wrong Activity\", PlaceBidActivity.class);\n TextView title2 = (TextView) solo.getView(R.id.details_task_title);\n assertTrue(title1.getText().toString().equals(\"Mow My Lawn (Bid Test)\"));\n FrameLayout frameLayout2 = (FrameLayout) solo.getView(R.id.details_frame_layout);\n solo.enterText((EditText) frameLayout2.findViewById(R.id.my_bid_amount), \"40.00\");\n solo.enterText((EditText) frameLayout2.findViewById(R.id.my_bid_description), \"I have a GrassMaster6000!\");\n solo.sleep(2000);\n solo.clickOnButton(\"Bid\");\n solo.assertCurrentActivity(\"Wrong Activity\", RecentListingsActivity.class);\n\n // View the tasks the provider has bid on\n solo.clickOnImageButton(0);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER);\n solo.assertCurrentActivity(\"Wrong Activity\", ListTaskActivity.class);\n solo.sleep(2000);\n\n\n\n // Logout and log in as the requester\n solo.goBack();\n solo.clickOnImageButton(0);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER);\n solo.sleep(2000);\n solo.assertCurrentActivity(\"Wrong Activity\", LoginActivity.class);\n solo.enterText((EditText) solo.getView(R.id.login_etUsername), \"bidTestRequester\");\n solo.enterText((EditText) solo.getView(R.id.login_etPassword), \"test\");\n solo.sleep(2000);\n solo.clickOnButton(\"Sign In\");\n\n // View the tasks that the requester has bids on\n solo.assertCurrentActivity(\"WrongActivity\", RecentListingsActivity.class);\n solo.clickOnImageButton(0);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER);\n solo.assertCurrentActivity(\"WrongActivity\", ListTaskActivity.class);\n solo.clickOnImageButton(1);\n solo.sleep(3000);\n\n // Get the position of the test task in the task list\n ListTaskActivity taskListActivity = (ListTaskActivity) solo.getCurrentActivity();\n ArrayList<Task> taskList3 = taskListActivity.getTaskList();\n int pos = -1;\n for (int i = 0; i < taskList3.size(); ++i) {\n Log.e(\"Task\", taskList3.get(i).getTitle());\n if (taskList3.get(i).getTitle().equals(\"Mow My Lawn (Bid Test)\")) {\n pos = i;\n }\n }\n\n // Click the test task in the recycler view to view the bids made on the test\n solo.sleep(2000);\n solo.scrollDownRecyclerView(pos);\n solo.clickInRecyclerView(pos);\n solo.assertCurrentActivity(\"Wrong Activity\", AddEditTaskActivity.class);\n solo.sleep(2000);\n\n // Decline one of the bids, show it is no longer in the list of bids on that task\n solo.scrollDownRecyclerView(0);\n solo.clickInRecyclerView(0);\n solo.sleep(2000);\n solo.clickOnButton(\"Decline\");\n\n // Accept one bid and show it as accepted\n solo.scrollDownRecyclerView(0);\n solo.clickInRecyclerView(0);\n solo.sleep(2000);\n solo.clickOnButton(\"Accept\");\n solo.clickOnImageButton(1);\n solo.sleep(2000);\n\n\n\n\n // Logout and login as the second task provider\n solo.goBack();\n solo.clickOnImageButton(0);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER);\n solo.sleep(2000);\n solo.assertCurrentActivity(\"Wrong Activity\", LoginActivity.class);\n solo.enterText((EditText) solo.getView(R.id.login_etUsername), \"bidTestProvider2\");\n solo.enterText((EditText) solo.getView(R.id.login_etPassword), \"test\");\n solo.sleep(2000);\n solo.clickOnButton(\"Sign In\");\n\n // View the tasks the provider has bid on\n solo.clickOnImageButton(0);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);\n solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER);\n solo.assertCurrentActivity(\"Wrong Activity\", ListTaskActivity.class);\n solo.sleep(2000);\n solo.clickOnImageButton(1);\n solo.sleep(3000);\n\n // Delete the test requester if their account already exists\n DataManager.deleteUsers delRequester2 = new DataManager.deleteUsers(context);\n queryList.clear();\n queryList = findUserID(\"bidTestRequester\");\n delRequester2.execute(queryList);\n\n // Delete the first test provider if their account already exists\n DataManager.deleteUsers delProvider3 = new DataManager.deleteUsers(context);\n queryList.clear();\n queryList = findUserID(\"bitTestProvider1\");\n delProvider3.execute(queryList);\n\n // Delete the second test provider if their account already exists\n DataManager.deleteUsers delProvider4 = new DataManager.deleteUsers(context);\n queryList.clear();\n queryList = findUserID(\"bitTestProvider2\");\n delProvider4.execute(queryList);\n\n // Delete test task 1 if it already exists\n DataManager.deleteTasks delTask4 = new DataManager.deleteTasks(context);\n queryList.clear();\n queryList = findTaskID(\"Mow My Lawn (Bid Test)\");\n Log.e(\"Mow My Lawn ID2\", queryList.get(0).toString());\n delTask4.execute(queryList);\n }", "@Test(priority = 5)\n\tpublic void testGetAllClients1() {\n\t\tResponse response = given().header(\"Authorization\", token).when().get(URL).then().extract().response();\n\n\t\tassertTrue(response.getStatusCode() == 200);\n\t\tassertTrue(response.contentType().equals(\"application/json\"));\n\n\t\tgiven().header(\"Authorization\", token).when().get(URL).then().assertThat().body(\"name\",\n\t\t\t\thasSize(clients.size()));\n\t}", "@Test\n @Order(6)\n void get_client_2() {\n Client c = service.getClient(client);\n Assertions.assertEquals(client.getId(), c.getId());\n Assertions.assertEquals(client.getName(), c.getName());\n Assertions.assertEquals(client.getAccounts().size(), c.getAccounts().size());\n for(Account i : client.getAccounts()) {\n Account check = c.getAccountById(i.getId());\n Assertions.assertEquals(i.getAmount(), check.getAmount());\n Assertions.assertEquals(i.getClientId(), check.getClientId());\n }\n }", "@Before(value = \"@createList\", order = 1)\n public void createList() {\n String endpoint = EnvironmentTrello.getInstance().getBaseUrl() + \"/lists/\";\n JSONObject json = new JSONObject();\n json.put(\"name\", \"testList\");\n json.put(\"idBoard\", context.getDataCollection(\"board\").get(\"id\"));\n RequestManager.setRequestSpec(AuthenticationUtils.getLoggedReqSpec());\n Response response = RequestManager.post(endpoint, json.toString());\n context.saveDataCollection(\"list\", response.jsonPath().getMap(\"\"));\n }", "@Test\n public void testPostCartsIdBillingaddressAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postCartsIdBillingaddressAction(\"{id}\", \"{body}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Cart\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@Test\n public void loanWithFlatCahargesAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer flatDisbursement = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper.getLoanDisbursementJSON());\n addCharges(charges, flatDisbursement, \"100\", null);\n Integer flatSpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", false));\n addCharges(charges, flatSpecifiedDueDate, \"100\", \"29 September 2011\");\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"200.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"100.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"150.00\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"50.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3301.49\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"150.00\", \"50.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"150.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), \"29 October 2011\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"150.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"100.00\", \"50.0\", \"50.0\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3251.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"29 September 2011\", \"100\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatPenaltySpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"100\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2811.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"150.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3129.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"50.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"10 January 2012\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"100\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3239.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"100\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3139.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3139.68\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3139.68\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"50.00\"), JournalEntry.TransactionType.CREDIT));\n }", "private void handleListOperation() {\n\n Client client = ClientBuilder.newBuilder().build();\n WebTarget webTarget = client.target(\"http://localhost:8080/pa165/rest/bricks/\");\n webTarget.register(auth);\n Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n Response response = invocationBuilder.get();\n\n if (response.getStatus() == Response.Status.OK.getStatusCode()) {\n List<BrickDto> brickDtoList = response.readEntity(new GenericType<List<BrickDto>>() {\n });\n System.out.println(\"Number of bricks returned: \" + brickDtoList.size());\n\n for (BrickDto b : brickDtoList) {\n System.out.println(b);\n }\n } else {\n System.out.println(\"Error code:\" + response.getStatus());\n }\n }", "@Test\n public void getAllMedicalRecords() {\n List<MedicalRecord> records = service.getAllMedicalRecords();\n\n //Assert\n assertEquals(2, records.size());\n }", "@Test\n @OperateOnDeployment(\"server\")\n public void shouldDeleteResourcesByIds() {\n given().header(\"Authorization\", \"Bearer access_token\").expect().statusCode(200).when().delete(\n getBaseTestUrl() + \"/1/tags/delete/json/ids;1;3;\");\n // Then then the resources should be deleted\n given().header(\"Authorization\", \"Bearer access_token\").expect().body(\"size\", equalTo(1)).and().expect().body(\"items.item.name\",\n hasItem(\"Concept\")).and().expect().body(\"items.item.name\", not(hasItem(\"Task\"))).and().expect().body(\"items.item.name\",\n not(hasItem(\"Reference\"))).when().get(getBaseTestUrl() + \"/1/tags/get/json/all?expand=\" +\n \"{\\\"branches\\\":[{\\\"trunk\\\":{\\\"name\\\":\\\"tags\\\"}}]})\");\n }", "@Test\n public void shouldCreateEpiDataBurial() {\n assertThat(DatabaseHelper.getEpiDataBurialDao().queryForAll().size(), is(0));\n\n Case caze = TestEntityCreator.createCase();\n TestEntityCreator.createEpiDataBurial(caze);\n\n // Assure that the burial has been successfully created\n assertThat(DatabaseHelper.getEpiDataBurialDao().queryForAll().size(), is(1));\n }", "@Test\r\n public void testBuscaClientes() throws Exception {\r\n System.out.println(\"BuscaClientes\");\r\n ReportesController instance = new ReportesController();\r\n ArrayList<Clientes> expResult = null;\r\n ArrayList<Clientes> result = instance.BuscaClientes();\r\n \r\n assertNotNull(result);\r\n \r\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void testGetCourseList() {\n System.out.println(\"getCourseList\");\n\n given()\n .contentType(\"application/json\")\n .when()\n .get(\"/generel/courselist\").then()\n .statusCode(200)\n .assertThat()\n .body(\"description\", hasSize(2), \"courseName\", hasItems(\"Programming\", \"System Development\"));\n\n }", "@Test\n public void addInvoice() {\n // Add a Customer to the database\n Customer customer = new Customer();\n customer.setFirstName(\"Dominick\");\n customer.setLastName(\"DeChristofaro\");\n customer.setEmail(\"[email protected]\");\n customer.setCompany(\"Omni\");\n customer.setPhone(\"999-999-9999\");\n customer = service.saveCustomer(customer);\n\n // Verify it was added to the database\n Customer customerCopy = service.findCustomer(customer.getCustomerId());\n TestCase.assertEquals(customerCopy, customer);\n\n // Add an Item to the database\n Item item = new Item();\n item.setName(\"Drill\");\n item.setDescription(\"Power Tool\");\n item.setDaily_rate(new BigDecimal(\"24.99\"));\n item = service.saveItem(item);\n\n // Verify it was added\n Item itemCopy = service.findItem(item.getItem_id());\n TestCase.assertEquals(itemCopy, item);\n\n // Add an InvoiceItem to the database\n Invoice_Item invoiceItem = new Invoice_Item();\n invoiceItem.setItem_id(item.getItem_id());\n invoiceItem.setQuantity(42);\n invoiceItem.setUnit_rate(new BigDecimal(\"4.99\"));\n invoiceItem.setDiscount(new BigDecimal(\"0.99\"));\n\n // Collect all the InvoiceItems into a list\n List<Invoice_Item> invoiceItemList = new ArrayList<>();\n invoiceItemList.add(invoiceItem);\n\n // Create an InvoiceViewModel\n InvoiceViewModel invoiceViewModel = new InvoiceViewModel();\n invoiceViewModel.setCustomer_id(customer.getCustomerId());\n invoiceViewModel.setOrder_date(LocalDate.of(2000,1,1));\n invoiceViewModel.setPickup_date(LocalDate.of(2000,2,2));\n invoiceViewModel.setReturn_date(LocalDate.of(2000,3,3));\n invoiceViewModel.setLate_fee(new BigDecimal(\"4.99\"));\n invoiceViewModel.setInvoice_items(invoiceItemList);\n invoiceViewModel = service.createInvoiceViewModel(invoiceViewModel);\n\n // Test the addInvoice() method\n InvoiceViewModel invoiceViewModelCopy = service.getInvoiceViewModel(invoiceViewModel.getInvoice_id());\n TestCase.assertEquals(invoiceViewModelCopy, invoiceViewModel);\n\n }", "@Test\n public void createUser() {\n Response response = regressionClient.createUser();\n dbAssist.responseValidation(response);\n }", "@Test\n public void createUserTestTest()\n {\n HashMap<String, Object> values = new HashMap<String, Object>();\n values.put(\"age\", \"22\");\n values.put(\"dob\", new Date());\n values.put(\"firstName\", \"CreateFName\");\n values.put(\"lastName\", \"CreateLName\");\n values.put(\"middleName\", \"CreateMName\");\n values.put(\"pasword\", \"user\");\n values.put(\"address\", \"CreateAddress\");\n values.put(\"areacode\", \"CreateAddressLine\");\n values.put(\"city\", \"CreateCity\");\n values.put(\"country\", \"CreateCountry\");\n values.put(\"road\", \"CreateRoad\");\n values.put(\"suberb\", \"CreateSuberb\");\n values.put(\"cell\", \"CreateCell\");\n values.put(\"email\", \"user\");\n values.put(\"homeTell\", \"CreateHomeTell\");\n values.put(\"workTell\", \"CreateWorkTell\");\n createUser.createNewUser(values);\n\n Useraccount useraccount = useraccountCrudService.findById(ObjectId.getCurrentUserAccountId());\n Assert.assertNotNull(useraccount);\n\n Garage garage = garageCrudService.findById(ObjectId.getCurrentGarageId());\n Assert.assertNotNull(garage);\n\n Saleshistory saleshistory = saleshistoryCrudService.findById(ObjectId.getCurrentSalesHistoryId());\n Assert.assertNotNull(saleshistory);\n }", "@Test\n public void getBonosTest() {\n List<BonoEntity> lista = bonoLogic.getBonos();\n Assert.assertEquals(data.size(), lista.size());\n for (BonoEntity entity : lista) {\n if(!data.contains(entity))\n fail(\"Ambas listas deberían contener los mismos bonos\");\n }\n }", "@Test\n public void storeSecretsRequest() {\n assertThat(this.secretRepository.count()).isEqualTo(2);\n\n final Resource request = new ClassPathResource(\"test-requests/storeSecrets.xml\");\n final Resource expectedResponse = new ClassPathResource(\"test-responses/storeSecrets.xml\");\n try {\n this.mockWebServiceClient.sendRequest(withPayload(request)).andExpect(ResponseMatchers.noFault()).andExpect(\n ResponseMatchers.payload(expectedResponse));\n } catch (final Exception exc) {\n Assertions.fail(\"Error\", exc);\n }\n\n //test the effects by looking in the repositories\n assertThat(this.secretRepository.count()).isEqualTo(4);\n }", "@Test\n\t\tpublic void testGetAllMedicalAct() {\n\t\t\tfor (int i =0; i<10;i++){\n\t\t\t assertEquals(wraRestServer.listMedicalAct().get(i).getId(),medicalActDao.getAll().get(i).getId());\n\t\t}\n\t\t\t\n\t}" ]
[ "0.6677897", "0.6318466", "0.6276133", "0.6152345", "0.6009257", "0.5983575", "0.59329444", "0.5924546", "0.59110683", "0.5865836", "0.5864172", "0.58407426", "0.5835111", "0.5819037", "0.5797531", "0.57493293", "0.5739415", "0.57255274", "0.57182455", "0.56839025", "0.5677431", "0.5672622", "0.5672089", "0.566106", "0.56573313", "0.5643899", "0.56242955", "0.561377", "0.5612543", "0.5599495", "0.55950576", "0.55892754", "0.5585356", "0.55773956", "0.5572886", "0.5571897", "0.5559644", "0.5541572", "0.5528043", "0.55209637", "0.55146706", "0.5510827", "0.55007845", "0.54981256", "0.5484178", "0.5482529", "0.5462898", "0.5452197", "0.5451729", "0.5450601", "0.54452765", "0.5427736", "0.5422703", "0.5417522", "0.54170984", "0.5414887", "0.54006684", "0.5393697", "0.53869975", "0.53817135", "0.5371999", "0.5371775", "0.53683364", "0.53665733", "0.5366413", "0.5360667", "0.5358239", "0.53575927", "0.5356518", "0.5356331", "0.53526115", "0.5352576", "0.5351721", "0.5345514", "0.5341434", "0.53396946", "0.533824", "0.5335946", "0.53249997", "0.5323522", "0.5305597", "0.53049374", "0.52987516", "0.52976847", "0.52958786", "0.5291847", "0.5289076", "0.5287603", "0.52842546", "0.52814704", "0.5277893", "0.527748", "0.52768326", "0.52759165", "0.5271919", "0.5268552", "0.52650416", "0.5260455", "0.52584374", "0.5258397" ]
0.5897153
9
recebe uma string "f4:d4"
public void mover_peca(String comando) { int ii = '7' - comando.charAt(1); //i inicial int ji = comando.charAt(0) - 'a'; //j inicial int id = '7' - comando.charAt(4); //i destino int jd = comando.charAt(3) - 'a'; //j destino if(this.mov_valido(ii, ji, id, jd)) { m[(ii+id)/2][(ji+jd)/2] = null; m[id][jd] = m[ii][ji]; m[ii][ji] = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getS4();", "public final String m2268d(String str) {\n JsonValue a = m2259a(str);\n if (a != null) {\n return a.m2260a();\n }\n throw new IllegalArgumentException(\"Named value not found: \" + str);\n }", "private static String formatTime(String time) {\n\t\treturn String.format(\"%s:%s\", time.substring(0, 2), time.substring(2));\n\t}", "private Uri m2344g(String str) {\n return mo10091b(str, this.f2759a.mo9868F(), true);\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}", "java.lang.String getField1648();", "public static String convertOrarioToFascia(String data) {\n String[] data_splitted = data.split(\" \");\n String orario = data_splitted[1];\n String[] ora_string = orario.split(\":\");\n Integer ora = Integer.parseInt(ora_string[0]);\n if(ora<12){\n return \"prima\";\n }else{\n return \"seconda\";\n }\n }", "public void mo856a(String str) {\n this.f2278h = str;\n }", "@Test\n public void testValueOfStringIPv4() {\n Ip4Address ipAddress;\n\n ipAddress = Ip4Address.valueOf(\"1.2.3.4\");\n assertThat(ipAddress.toString(), is(\"1.2.3.4\"));\n\n ipAddress = Ip4Address.valueOf(\"0.0.0.0\");\n assertThat(ipAddress.toString(), is(\"0.0.0.0\"));\n\n ipAddress = Ip4Address.valueOf(\"255.255.255.255\");\n assertThat(ipAddress.toString(), is(\"255.255.255.255\"));\n }", "private final void m46527f(String str) {\n if (C15333p.m44598e()) {\n if (m46510O() == null) {\n m46509N();\n }\n if (m46510O().booleanValue()) {\n m46523a(str, null);\n return;\n }\n String str2 = \"javascript:\";\n String valueOf = String.valueOf(str);\n m46525c(valueOf.length() != 0 ? str2.concat(valueOf) : new String(str2));\n return;\n }\n String str3 = \"javascript:\";\n String valueOf2 = String.valueOf(str);\n m46525c(valueOf2.length() != 0 ? str3.concat(valueOf2) : new String(str3));\n }", "protected static String expandTimeString(String time) {\n StringBuilder expandedTime = new StringBuilder(13);\n\n expandedTime.append(\"000000\");\n\n switch (time.length()) {\n case 4:\n expandedTime.insert(0, '2').append(time).append(\"00\");\n break;\n case 5:\n expandedTime.insert(0, time.substring(0, 1)).append(time.substring(1)).append(\"00\");\n break;\n case 6:\n expandedTime.insert(0, '2').append(time);\n break;\n case 7:\n expandedTime.insert(0, time.substring(0, 1)).append(time.substring(1));\n break;\n default:\n throw new IllegalArgumentException(\"Given VDEW encoded Time-String must have between 4 to 7 characters, but we got \" + time.length() + \" characters being '\" + time + \"'\");\n }\n\n return expandDateTimeString(expandedTime.toString());\n }", "public static String hexToString(String txtInHex) {\n \tint groupLength = 2;\n StringBuilder sb = new StringBuilder(txtInHex.length() / groupLength);\n \n for (int i = 0; i < txtInHex.length() - groupLength + 1; i += groupLength) {\n String hex = txtInHex.substring(i, i + groupLength);\n sb.append((char) Integer.parseInt(hex, 16));\n }\n \n return sb.toString();\n }", "private static String toWebSafe(String str) {\n final var result = PATTERN_COLON.matcher(str)\n .replaceAll(DASH);\n return result;\n }", "@Test\n public void testTakeNumberFromString224() { // FlairImage: 224\n assertEquals(\"From: FlairImage line: 225\", 123, takeNumberFromString(\"123\")); \n assertEquals(\"From: FlairImage line: 226\", 0, takeNumberFromString(\"123a\")); \n assertEquals(\"From: FlairImage line: 227\", -123, takeNumberFromString(\"-123\")); \n assertEquals(\"From: FlairImage line: 228\", 0, takeNumberFromString(\"--123\")); \n assertEquals(\"From: FlairImage line: 229\", 0, takeNumberFromString(\"pz4\")); \n }", "@Test(timeout = 4000)\n public void test04() throws Throwable {\n String string0 = SQLUtil.normalize(\"b}v&-;$$:Hw1:\", false);\n assertEquals(\"b } v & - ; $ $ : Hw1 :\", string0);\n }", "java.lang.String getUnknown4();", "private static String getValue(String rawValue) {\n\t\trawValue = rawValue.trim();\n\t\tString f1 = \"\";\n\t\tString f2 = \"\";\n\t\tfor (int t = 1; t < rawValue.length() - 1; t++) {\n\t\t\tf1 += rawValue.charAt(t);\n\t\t}\n\t\tfor (int t = 0; t < f1.length() && t < 16; t++) {\n\t\t\tf2 += f1.charAt(t);\n\t\t}\n\t\treturn f2;\n\t}", "private static String zzgr(String string2) {\n int n = string2.length();\n StringBuilder stringBuilder = new StringBuilder(n);\n int n2 = 0;\n while (n2 < n) {\n char c = string2.charAt(n2);\n if (c >= ' ' && c <= '~' && c != '\\\"' && c != '\\'') {\n stringBuilder.append(c);\n } else {\n stringBuilder.append(String.format(\"\\\\u%04x\", c));\n }\n ++n2;\n }\n return stringBuilder.toString();\n }", "private static String m12563a(String str, String str2) {\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 3 + String.valueOf(str2).length());\n sb.append(str);\n sb.append(\"|S|\");\n sb.append(str2);\n return sb.toString();\n }", "public final void mo76424a(String str) {\n C32569u.m150519b(str, C6969H.m41409d(\"G3590D00EF26FF5\"));\n f52018c.setValue(this, f52016a[0], str);\n }", "static String m60358a(String str, String str2) {\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 3 + String.valueOf(str2).length());\n sb.append(str);\n sb.append(\"|S|\");\n sb.append(str2);\n return sb.toString();\n }", "@Override\n public CharSequence filter(CharSequence source, int start, int end,\n Spanned dest, int dstart, int dend) {\n if (end == 0) return null;\n String sou = source.toString().trim();\n String des = dest.toString().replace(\"-\", \"\");\n\n int a = des.length() % 4;\n\n char[] array = sou.toCharArray();\n StringBuilder buff = new StringBuilder();\n\n for (int i = 0; i < array.length; i++) {\n if ((a + i) % 4 == 0 && (i != 0 || des.length() != 0)) {\n buff.append(\"-\");\n }\n buff.append(array[i]);\n }\n\n return buff.toString();\n }", "private static int getHexDigit(String s, int i) {\n char c = s.charAt(i);\n if (c >= '0' && c <= '9') {\n return c - '0';\n } else if (c >= 'a' && c <= 'f') {\n return c - 'a' + 0xa;\n } else if (c >= 'A' && c <= 'F') {\n return c - 'A' + 0xa;\n } else {\n throw new IllegalArgumentException(s);\n }\n }", "private static String m60359b(String str, String str2, String str3) {\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 4 + String.valueOf(str2).length() + String.valueOf(str3).length());\n sb.append(str);\n sb.append(\"|T|\");\n sb.append(str2);\n sb.append(\"|\");\n sb.append(str3);\n return sb.toString();\n }", "java.lang.String getField1624();", "public static String convertCardNumber(String part1, String part4) {\n\n return part1 + \"*\" + part4;\n }", "private static String applyRFC2732(String hostname) {\n if (hostname.indexOf(\":\") != -1) {\n // Assuming an IPv6 literal because of the ':'\n return \"[\" + hostname + \"]\";\n }\n return hostname;\n }", "private String normalizeDiseaseId(String diseaseId) {\n String[] tokens = diseaseId.split(\":\");\n if (\"ORPHANET\".equals(tokens[0])) {\n diseaseId = \"ORPHA:\" + tokens[1];\n }\n return diseaseId;\n }", "static String timeConversion1(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2);\n\n int hour = Integer.parseInt(hours);\n\n int differential = 0;\n if (\"PM\".equals(ampm) && hour != 12) {\n differential = 12;\n }\n\n\n hour += differential;\n hour = hour % 24;\n\n hours = String.format(\"%02d\", hour);\n\n return hours + \":\" + minutes + \":\" + seconds;\n\n }", "public static void main(String[] args) {\n\n String time =\"16:49:40\".substring(0,2);\n System.out.println(time);\n\n }", "String getMacAddress() {\n return String.format(\"%s:%s:%s:%s:%s:%s\", macAddress.substring(0, 2), macAddress.substring(2, 4),\n macAddress.substring(4, 6), macAddress.substring(6, 8), macAddress.substring(8, 10), macAddress.substring(10, 12));\n }", "private String convertStringToUuid(String input) {\n String[] uuid = new String[5];\n uuid[0] = input.substring(0, 8);\n uuid[1] = input.substring(8, 12);\n uuid[2] = input.substring(12, 16);\n uuid[3] = input.substring(16, 20);\n uuid[4] = input.substring(20, 32);\n return String.join(\"-\", uuid);\n }", "java.lang.String getField1636();", "java.lang.String getField1658();", "java.lang.String getIpv4();", "void mo1329d(String str, String str2);", "private String e19BuildStaffGageString(String s) {\n String tmp1 = null;\n if ((s != null) && (s.length() > 0)) {\n tmp1 = String.format(\"%c%s-%c\", SEP_CHAR, s, SEP_CHAR);\n } else {\n tmp1 = String.format(\"%c-----%c\", SEP_CHAR, SEP_CHAR);\n }\n\n return tmp1;\n }", "public void mo40058a(String str) {\n this.f24520b = str;\n }", "public void mo13882d(String str) {\n this.f5082h = str;\n }", "protected static String convertHex( String base )\r\n\t{\r\n\t\treturn \"H\" + HexConvertor.convertHex( base.getBytes() ); \r\n\t}", "public static String fillES(String valueStr) {\n\t\t\r\n\t\tif (!valueStr.contains(\".\")) return valueStr+\"00\";\r\n\t\t\r\n\t\tString[] ps = valueStr.split(\"\\\\.\");\r\n\t\tString p1 = ps[0].trim();\r\n\t\tString p2 = ps[1].trim();\r\n\t\t\r\n\t\tif (p2.length()==0){\r\n\t\t\tp2 =\"00\";\r\n\t\t}else if (p2.equalsIgnoreCase(\"5\")){\r\n\t\t\tp2 =\"50\";\r\n\t\t}\r\n\t\t\r\n\t\tif (p2.trim().equalsIgnoreCase(\"\")) p2=\"00\";\r\n\t\t\r\n\t\t//System.out.println(valueStr+\": \"+p1+p2);\r\n\t\t//return (p1+p2).trim();\r\n\t\treturn (p1+p2).trim();\r\n\t}", "C12000e mo41091f(String str);", "public final void m46a(String str) {\r\n this.f16a = str;\r\n }", "private static String m14296fm(String str) {\n return toHexString(m14295fl(str), \"\");\n }", "java.lang.String getField1324();", "private String format(String s){\n\t\tint len = s.length();\n\t\tfor (int i = 0; i < 6 - len; i++){\n\t\t\ts = \"0\" + s;\n\t\t}\n\t\t\n\t\treturn s;\n\t}", "@Test\n\tpublic void testIPV4WithPort() throws MalformedURIException {\n\t\tURI uri = new URI(\"ssh://192.168.91.1:22\");\n\t\tAssert.assertEquals(\"ssh\", uri.getScheme());\n\t\tAssert.assertEquals(\"192.168.91.1\", uri.getHost());\n\t\tAssert.assertEquals(22, uri.getPort());\n\t\tAssert.assertEquals(null, uri.getUserinfo());\n\t}", "void mo8713dV(String str);", "UUID primaryFormat();", "public abstract String mo24851a(String str);", "private void processInput(String str) {\r\n String[] strs = str.split(\":\")[1].split(\",\");\r\n for (String s : strs) {\r\n color.add(s.trim().toUpperCase());\r\n }\r\n }", "public static byte[] parseIPv6Literal(String s) {\n s = s != null ? s.trim() : \"\";\n if (s.length() > 0 && s.charAt(0) == '[' && s.charAt(s.length() - 1) == ']') {\n s = s.substring(1, s.length() - 1).trim();\n }\n int x = s.lastIndexOf(':');\n int y = s.indexOf('.');\n // Contains a dot! Look for IPv4 literal suffix.\n if (x >= 0 && y > x) {\n byte[] ip4Suffix = parseIPv4Literal(s.substring(x + 1));\n if (ip4Suffix == null) {\n return null;\n }\n s = s.substring(0, x) + \":\" + ip4ToHex(ip4Suffix);\n }\n\n // Check that we only have a single occurence of \"::\".\n x = s.indexOf(\"::\");\n if (x >= 0 && s.indexOf(\"::\", x + 1) >= 0) {\n return null;\n }\n\n // This array helps us expand the \"::\" into the zeroes it represents.\n String[] raw = new String[]{\"0000\", \"0000\", \"0000\", \"0000\", \"0000\", \"0000\", \"0000\", \"0000\"};\n if (s.indexOf(\"::\") >= 0) {\n String[] split = s.split(\"::\", -1);\n String[] prefix = splitOnColon(split[0]);\n String[] suffix = splitOnColon(split[1]);\n\n // Make sure the \"::\" zero-expander has some room to expand!\n if (prefix.length + suffix.length > 7) {\n return null;\n }\n for (int i = 0; i < prefix.length; i++) {\n raw[i] = prependZeroes(prefix[i]);\n }\n int startPos = raw.length - suffix.length;\n for (int i = 0; i < suffix.length; i++) {\n raw[startPos + i] = prependZeroes(suffix[i]);\n }\n } else {\n // Okay, whew, no \"::\" zero-expander, but we still have to make sure\n // each element contains 4 hex characters.\n raw = splitOnColon(s);\n if (raw.length != 8) {\n return null;\n }\n for (int i = 0; i < raw.length; i++) {\n raw[i] = prependZeroes(raw[i]);\n }\n }\n\n byte[] ip6 = new byte[16];\n int i = 0;\n for (String tok : raw) {\n if (tok.length() > 4) {\n return null;\n }\n String prefix = tok.substring(0, 2);\n String suffix = tok.substring(2, 4);\n try {\n ip6[i++] = (byte) Integer.parseInt(prefix, 16);\n ip6[i++] = (byte) Integer.parseInt(suffix, 16);\n } catch (NumberFormatException nfe) {\n return null;\n }\n }\n return ip6;\n }", "java.lang.String getField4();", "private static String fromWebSafe(String webSafe) {\n checkArgument(webSafe.length() > MINUTE_SEPARATOR_INDEX + 2,\n \"The passed string is not in web-safe date/time format: \\\"%s\\\".\",\n webSafe);\n var chars = webSafe.toCharArray();\n chars[HOUR_SEPARATOR_INDEX] = COLON;\n chars[MINUTE_SEPARATOR_INDEX] = COLON;\n return String.valueOf(chars);\n }", "void mo9058ad(String str, int i);", "static void mvi_to_reg(String passed){\n\t\tregisters.put(passed.charAt(4), passed.substring(6));\n\t}", "public void mo13889g(String str) {\n this.f5087m = str;\n }", "java.lang.String getField1660();", "private static String normalizeWWN(String unpaddedWWN) {\n String wwn = StringUtils.leftPad(unpaddedWWN, 16, '0');\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < wwn.length(); i += 2) {\n String slice = StringUtils.substring(wwn, i, i + 2);\n if (sb.length() > 0) {\n sb.append(':');\n }\n sb.append(slice);\n }\n return sb.toString();\n }", "java.lang.String getField1696();", "public static void main(String[] args) {\n\t\tString s = \"12:45:54PM\";\r\n\t\tString temp=\":\";\r\n\t\tString Result=\"\";\r\n\t\t\r\n\t\tif(s.charAt(8)=='P' || s.charAt(8)=='p')\r\n\t\t {\r\n\t\t\tString s1[] = s.split(\":\");\r\n\t int Hour = Integer.parseInt(s1[0]);\r\n\t String Actual_Hour = \"\";\r\n\t if(Hour == 12)\r\n\t {\r\n\t \tActual_Hour = \"12\";\r\n\t }\r\n\t else\r\n\t {\r\n\t \tint data = 12 + Hour;\r\n\t \tActual_Hour = String.valueOf(data);\r\n\t }\r\n\t \r\n\t \r\n\t Result = Actual_Hour +temp+s1[1]+temp+s1[2].substring(0, 2);\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t \tString s1[] = s.split(\":\");\r\n\t\t \tint Hour = Integer.parseInt(s1[0]);\r\n\t\t String Actual_Hour = \"\";\r\n\t\t if(Hour == 12)\r\n\t\t {\r\n\t\t \tActual_Hour = \"00\";\r\n\t\t \tResult = Actual_Hour +temp+s1[1]+temp+s1[2].substring(0, 2); \r\n\t\t }\r\n\t\t else {\r\n\t\t \tString s2[] = s.split(\"AM\");\r\n\t\t\t for(int i=0; i<s2.length; i++)\r\n\t\t\t {\r\n\t\t\t \tResult = s2[i];\r\n\t\t\t }\t\r\n\t\t }\r\n\t\t \t\r\n\t\t }\r\n\t\t\r\n\t\t\t\tSystem.out.println(Result);\r\n}", "private static String format(String value) {\r\n String formattedValue = value.trim();\r\n if (formattedValue.endsWith(\" 00:00:00\")) {\r\n formattedValue = formattedValue.substring(0, formattedValue.length() - 9);\r\n } else {\r\n if (formattedValue.endsWith(\" 00:00:00.0\")) {\r\n formattedValue = formattedValue.substring(0, formattedValue.length() - 11);\r\n }\r\n }\r\n return formattedValue;\r\n }", "java.lang.String getField1248();", "private static String checkFormat(String date){\r\n\t\tif(date.length()==0) return \"\";\r\n\t\tint dateChars=0,timeChars=0;\r\n\t\tchar currenChar;\r\n\t\t\r\n\t\t//check if the first and the last character of the string is a number, it must always be\r\n\t\tif(!Character.isDigit(date.charAt(0))) return \"\";\r\n\t\tif(!Character.isDigit(date.charAt((date.length()-1)))) return \"\";\r\n\t\t\r\n\t\t\r\n\t\tfor(int i=1; i<date.length()-1;i++){\r\n\t\t\tcurrenChar=date.charAt(i);\r\n\t\t\t\r\n\t\t\t//check if every character is / or : or number\t\t\r\n\t\t\tif(!(Character.isDigit(currenChar) || currenChar==':' || currenChar=='/')) return \"\";\r\n\t\t\t//check if there is a number between // or ::, if not it returns false\r\n\t\t\tif((currenChar==':' || currenChar=='/') && (date.charAt(i+1)==':' || date.charAt(i+1)=='/')) return \"\";\r\n\t\t\t\r\n\t\t\t//count the / and :\r\n\t\t\tif(currenChar==':') timeChars++; \r\n\t\t\telse if(currenChar=='/') dateChars++;\r\n\t\t}\r\n\t\t\r\n\t\t//if it is time with one :\r\n\t\tif(timeChars==1 && dateChars==0){\r\n\t\t\t//check if one of the numbers has more than 2 digits, then it is invalid\r\n\t\t\tint index=0;\r\n\t\t\tfor(String s:splitWords(date.replaceAll(\":\", \" \"))){\r\n\t\t\t\tif( index==0 && s.length()!=1 && s.length()!=2) return \"\";\r\n\t\t\t\telse if(index>0 && s.length()!=2 ) return \"\";\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\treturn formats[2];\r\n\t\t}\r\n\t\t\r\n\t\t//if it is time with two :\r\n\t\telse if(timeChars==2 && dateChars==0){\r\n\t\t\t//check if one of the numbers has more than 2 digits, then it is invalid\r\n\t\t\tint index=0;\r\n\t\t\tfor(String s:splitWords(date.replaceAll(\":\", \" \"))){\r\n\t\t\t\tif( index==0 && s.length()!=1 && s.length()!=2) return \"\";\r\n\t\t\t\telse if(index>0 && s.length()!=2 ) return \"\";\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\treturn formats[1];\r\n\t\t}\r\n\t\t\r\n\t\t//if it is a date with two /\r\n\t\telse if(dateChars==2 && timeChars==0){\r\n\t\t\t//check if one of the numbers have the right amount of digits\r\n\t\t\tString[] numbers= splitWords(date.replaceAll(\"/\", \" \"));\r\n\t\t\tif(numbers[0].length()>2) return \"\";\r\n\t\t\tif(numbers[1].length()>2) return \"\";\r\n\t\t\tif(numbers[2].length()>4) return \"\";\r\n\t\t\t\r\n\t\t\treturn formats[0];\r\n\t\t}\r\n\t\t\r\n\t\telse return \"\";\t\t\r\n\t}", "private static String modifyID(final String fifteenid) {\n String eightid = fifteenid.substring(0, 6);\n eightid = eightid + \"19\";\n eightid = eightid + fifteenid.substring(6, 15);\n eightid = eightid + getVerify(eightid);\n return eightid;\n }", "@Test\n public void testToStringIPv4() {\n Ip4Address ipAddress;\n\n ipAddress = Ip4Address.valueOf(\"1.2.3.4\");\n assertThat(ipAddress.toString(), is(\"1.2.3.4\"));\n\n ipAddress = Ip4Address.valueOf(\"0.0.0.0\");\n assertThat(ipAddress.toString(), is(\"0.0.0.0\"));\n\n ipAddress = Ip4Address.valueOf(\"255.255.255.255\");\n assertThat(ipAddress.toString(), is(\"255.255.255.255\"));\n }", "@NonNull\n private String getDpnId(@NonNull String id) {\n String[] nodeNo = id.split(\":\");\n String[] dpnId = nodeNo[1].split(\"]\");\n return dpnId[0];\n }", "public C26741Fb(C26631Eg r2, String str) {\n super(515);\n this.A01 = r2;\n this.A00 = str;\n }", "void mo5871a(String str);", "static String timeConversion(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2, 4);\n\n String newHours;\n if (ampm.equals(\"AM\")) {\n newHours = hours.equals(\"12\") ? \"00\" : hours;\n\n } else {\n newHours = hours.equals(\"12\") ? hours : String.valueOf(Integer.parseInt(hours) + 12);\n }\n\n return newHours + \":\" + minutes + \":\" + seconds;\n\n }", "public static String stupidStringToHex(String s){\n\t\tfinal double div = 96;\n\t\tint length = (int)(s.length() / 3);\n\t\treturn makeHexColor((addString(s.substring(0, length - 1)) % div) / div, (addString(s.substring(length, (2 * length) - 1)) % div) / div, (addString(s.substring((2 * length) - 1, s.length() - 1)) % div) / div);\n\t}", "public static String deMaxim(String value) {\r\n if (value == null)\r\n return null;\r\n if (!value.startsWith(\"­­10\") && !value.startsWith(\"--10\"))\r\n return value; // not a password\r\n try {\r\n byte[] key = \"zP7Qn%9x\".getBytes(\"ISO-8859-1\"); // 8 byte key,\r\n // Giraffchen\r\n Key secretKey = new SecretKeySpec(key, \"DES\");\r\n byte[] input = hexStringToByteArray(value.substring(4));\r\n Cipher cipher = Cipher.getInstance(\"DES/ECB/NoPadding\");\r\n cipher.init(Cipher.DECRYPT_MODE, secretKey);\r\n byte[] result = cipher.doFinal(input);\r\n // find 0 byte\r\n int len = 0;\r\n for (int i = 0; i < result.length; i++) {\r\n if (result[i] == 0) {\r\n len = i;\r\n break;\r\n }\r\n }\r\n if (len == 0)\r\n len = result.length;\r\n byte[] text = new byte[len];\r\n System.arraycopy(result, 0, text, 0, len);\r\n return new String(text, \"ISO-8859-1\");\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n }\r\n }", "private String m20344d(String str) {\n String valueOf = String.valueOf(Math.abs(str.hashCode() % 100));\n return this.f17416e + File.separator + valueOf;\n }", "java.lang.String getField1665();", "String canonHr(String s) {\n List<String> l = StringUtil.breakAt(s, \":\");\n if (l.size() == 2) {\n return l.get(0) + \":\" + l.get(1).toUpperCase();\n }\n return s.toUpperCase();\n }", "java.lang.String getField1672();", "void mo41089d(String str);", "public static\n Color convertStringToColor(String val)\n {\n Color ret_Color;\n\n try\n {\n String workstr1;\n int slen = val.length();\n if (val.startsWith(\"0x\") || val.startsWith(\"0X\"))\n {\n workstr1 = val.substring(2);\n slen -= 2;\n }\n else\n if (val.startsWith(\"#\"))\n {\n workstr1 = val.substring(1);\n slen -= 1;\n }\n else\n { // decimal integer\n return new Color(Integer.parseInt(val));\n }\n\n // process hex string\n if (slen <= 6)\n { // no alpha\n int ival = Integer.parseInt(workstr1, 16);\n ret_Color = new Color(ival);\n }\n else\n { // has alpha of some sort\n String workstr2;\n if (slen == 8)\n {\n workstr2 = workstr1;\n }\n else\n if (slen == 7)\n {\n workstr2 = \"0\" + workstr1;\n }\n else\n {\n workstr2 = workstr1.substring(slen - 8); // get rightmost 8\n }\n\n // System.out.println(\"Color,val=[\" + val + \"],key=[\" + key + \"],slen=\" + slen + \"]\");\n // System.out.println(\" workstr1=[\" + workstr1 + \"],workstr2=[\" + workstr2 + \"]\");\n int a = Integer.parseInt(workstr2.substring(0, 2), 16); // a\n int r = Integer.parseInt(workstr2.substring(2, 4), 16); // r\n int g = Integer.parseInt(workstr2.substring(4, 6), 16); // g\n int b = Integer.parseInt(workstr2.substring(6, 8), 16); // b\n // System.out.println(\" ret_Color1=[\" + r + \":\" + g + \":\" + b +\":\" + a + \"]\");\n // int ival = Integer.parseInt(workstr2, 16);\n // ret_Color = new Color(ival, true);\n // System.out.println(\" ival=\" + ival);\n try {\n ret_Color = new Color(r, g, b, a);\n }\n catch (NoSuchMethodError excp1) {\n System.out.println(\"YutilProperties:convertStringToColor|excp1=[\" + excp1 + \"]\");\n ret_Color = new Color(r, g, b);\n }\n // System.out.println(\" ret_Color1=[\" + ret_Color + \"]\");\n }\n }\n catch(NumberFormatException e)\n {\n ret_Color = Color.black;\n // System.out.println(\"Color,ret_Color3=[\" + ret_Color + \"]\");\n }\n\n return ret_Color;\n }", "public void parseUUIDHexBytes(byte[] serString, int offset) throws HyracksDataException {\n decodeBytesFromHex(serString, offset, uuidBytes, 0, 8);\n offset += 8;\n\n // Skip the hyphen part\n offset += 1;\n\n // Second part - 4 bytes\n decodeBytesFromHex(serString, offset, uuidBytes, 4, 4);\n offset += 4;\n\n // Skip the hyphen part\n offset += 1;\n\n // Third part - 4 bytes\n decodeBytesFromHex(serString, offset, uuidBytes, 6, 4);\n offset += 4;\n\n // Skip the hyphen part\n offset += 1;\n\n // Fourth part - 4 bytes\n decodeBytesFromHex(serString, offset, uuidBytes, 8, 4);\n offset += 4;\n\n // Skip the hyphen part\n offset += 1;\n\n // The last part - 12 bytes\n decodeBytesFromHex(serString, offset, uuidBytes, 10, 12);\n }", "java.lang.String getField1548();", "public static final String m130159a(String str) {\n String str2;\n if (TextUtils.isEmpty(str)) {\n return \"\";\n }\n Uri parse = Uri.parse(str);\n if (parse != null) {\n str2 = parse.getHost();\n } else {\n str2 = null;\n }\n if (TextUtils.equals(str2, C22912d.f60641a)) {\n return \"web_url\";\n }\n return C22912d.f60642b;\n }", "java.lang.String getField1644();", "java.lang.String getField1408();", "public static byte[] parseIPv4Literal(String s) {\n s = s != null ? s.trim() : \"\";\n String[] toks = s.split(\"\\\\.\");\n byte[] ip = new byte[4];\n if (toks.length == 4) {\n for (int i = 0; i < ip.length; i++) {\n try {\n int val = Integer.parseInt(toks[i]);\n if (val < 0 || val > 255) {\n return null;\n }\n ip[i] = (byte) val;\n } catch (NumberFormatException nfe) {\n return null;\n }\n }\n return ip;\n }\n return null;\n }", "public static String a(String string2, float f2) {\n int n2 = Integer.parseInt((String)string2.substring(1), (int)16);\n int n3 = f2 < 0.0f ? 0 : 255;\n float f3 = f2 < 0.0f ? f2 * -1.0f : f2;\n int n4 = n2 >> 16;\n int n5 = 255 & n2 >> 8;\n int n6 = n2 & 255;\n return \"#\" + Integer.toString((int)(16777216 + 65536 * (n4 + Math.round((float)(f3 * (float)(n3 - n4)))) + 256 * (n5 + Math.round((float)(f3 * (float)(n3 - n5)))) + (n6 + Math.round((float)(f3 * (float)(n3 - n6))))), (int)16).substring(1);\n }", "public final void mo34956xd(String str) {\n }", "java.lang.String getField1677();", "static String re_screen(String str) {\n String screened = str.replaceAll(\"([\\\\\\\\\\\\^\\\\$\\\\.\\\\[\\\\]\\\\|\\\\(\\\\)\\\\?\\\\*\\\\+\\\\{\\\\}])\", \"\\\\\\\\$1\");\n //System.err.println(\"screened: \"+screened);\n return screened;\n }", "public static String\n adnStringFieldToString(byte[] data, int offset, int length) {\n if (length == 0) {\n return \"\";\n }\n if (length >= 1) {\n if (data[offset] == (byte) 0x80) {\n int ucslen = (length - 1) / 2;\n String ret = null;\n\n try {\n ret = new String(data, offset + 1, ucslen * 2, \"utf-16be\");\n } catch (UnsupportedEncodingException ex) {\n Rlog.e(LOG_TAG, \"implausible UnsupportedEncodingException\",\n ex);\n }\n\n if (ret != null) {\n // trim off trailing FFFF characters\n\n ucslen = ret.length();\n while (ucslen > 0 && ret.charAt(ucslen - 1) == '\\uFFFF')\n ucslen--;\n\n return ret.substring(0, ucslen);\n }\n }\n }\n\n boolean isucs2 = false;\n char base = '\\0';\n int len = 0;\n\n if (length >= 3 && data[offset] == (byte) 0x81) {\n len = data[offset + 1] & 0xFF;\n if (len > length - 3)\n len = length - 3;\n\n base = (char) ((data[offset + 2] & 0xFF) << 7);\n offset += 3;\n isucs2 = true;\n } else if (length >= 4 && data[offset] == (byte) 0x82) {\n len = data[offset + 1] & 0xFF;\n if (len > length - 4)\n len = length - 4;\n\n base = (char) (((data[offset + 2] & 0xFF) << 8) |\n (data[offset + 3] & 0xFF));\n offset += 4;\n isucs2 = true;\n }\n\n if (isucs2) {\n StringBuilder ret = new StringBuilder();\n\n while (len > 0) {\n // UCS2 subset case\n\n if (data[offset] < 0) {\n ret.append((char) (base + (data[offset] & 0x7F)));\n offset++;\n len--;\n }\n\n // GSM character set case\n\n int count = 0;\n while (count < len && data[offset + count] >= 0)\n count++;\n\n ret.append(GsmAlphabet.gsm8BitUnpackedToString(data,\n offset, count));\n\n offset += count;\n len -= count;\n }\n\n return ret.toString();\n }\n\n Resources resource = Resources.getSystem();\n String defaultCharset = \"\";\n try {\n defaultCharset =\n resource.getString(com.android.internal.R.string.gsm_alphabet_default_charset);\n } catch (NotFoundException e) {\n // Ignore Exception and defaultCharset is set to a empty string.\n }\n return GsmAlphabet.gsm8BitUnpackedToString(data, offset, length, defaultCharset.trim());\n }", "public void mo40060b(String str) {\n this.f24519a = str;\n }", "String dibujar();", "static long m5599a(String str) {\n String[] split = str.split(\"\\\\:\");\n byte[] bArr = new byte[6];\n int i = 0;\n while (i < 6) {\n try {\n bArr[i] = (byte) Integer.parseInt(split[i], 16);\n i++;\n } catch (NumberFormatException unused) {\n return 0;\n }\n }\n return ((((long) bArr[0]) & 255) << 40) | ((((long) bArr[3]) & 255) << 16) | (((long) bArr[5]) & 255) | ((((long) bArr[4]) & 255) << 8) | ((((long) bArr[2]) & 255) << 24) | ((((long) bArr[1]) & 255) << 32);\n }", "public abstract C24343db mo70723f(String str);", "java.lang.String getField1668();", "java.lang.String getField1448();", "void mo85415a(String str);", "java.lang.String getField1148();", "private static String getHost(final String host) {\n final int colonIndex = host.indexOf(':');\n\n if (colonIndex == -1) {\n return host;\n }\n\n return host.substring(0, colonIndex);\n }", "private String m81844c(String str) {\n Uri uri;\n String a = UrlUtil.m84494a(this.f58071c, str);\n return (!TextUtils.isEmpty(a) || (uri = this.f58072d) == null) ? a : UrlUtil.m84494a(uri, str);\n }", "C1111j mo5881f(String str);", "java.lang.String getField1515();" ]
[ "0.54526466", "0.54338354", "0.5422101", "0.52998376", "0.5139481", "0.50970876", "0.50618106", "0.5026911", "0.50207835", "0.5012947", "0.5004422", "0.4985059", "0.4982113", "0.49758172", "0.49734202", "0.49710253", "0.49706072", "0.4959413", "0.49565378", "0.49554208", "0.49472588", "0.494185", "0.49348077", "0.49285597", "0.4927899", "0.4924042", "0.49011707", "0.48953873", "0.4895169", "0.4893873", "0.48866248", "0.4868965", "0.48680416", "0.48644766", "0.4857473", "0.48538777", "0.48505965", "0.4850369", "0.4846983", "0.4839807", "0.48369032", "0.4834236", "0.48339012", "0.48232868", "0.48151323", "0.4814337", "0.4813207", "0.48109302", "0.4805785", "0.48029816", "0.48029256", "0.4796188", "0.47956806", "0.47897094", "0.47887057", "0.47886044", "0.47778463", "0.47764602", "0.47745264", "0.47743315", "0.47741112", "0.47729087", "0.47617108", "0.4760162", "0.4759449", "0.475896", "0.4757617", "0.47574186", "0.47449312", "0.47439718", "0.47434652", "0.47357562", "0.47286686", "0.47278702", "0.4726438", "0.47250032", "0.47249854", "0.47244877", "0.47237784", "0.47234005", "0.4719547", "0.4716123", "0.47115922", "0.4709297", "0.47086015", "0.4707136", "0.47068962", "0.4706451", "0.470011", "0.46976086", "0.4696203", "0.46952468", "0.469216", "0.46868473", "0.46838614", "0.4679468", "0.46790913", "0.46784145", "0.4677669", "0.4677396", "0.46770328" ]
0.0
-1
Get a list of running apps
@Override public void onClick(View view) { List<AndroidAppProcess> runningAppProcessInfo = AndroidProcesses.getRunningAppProcesses(); for (int i = 0; i < runningAppProcessInfo.size(); i++) { Log.i("MainActivity", runningAppProcessInfo.get(i).getPackageName()); // Check for AnkuLua if(runningAppProcessInfo.get(i).getPackageName().equals("com.appautomatic.ankulua.pro2") || runningAppProcessInfo.get(i).getPackageName().equals("com.appautomatic.ankulua.pro") || runningAppProcessInfo.get(i).getPackageName().equals("com.appautomatic.ankulua.trial")){ // AnkuLua package process has been detected! Perma ban account for abusing Terms & Conditions alert(); return; } } Toast.makeText(MainActivity.this,"Not Found",Toast.LENGTH_SHORT).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<String> getAllRunningApp() {\n\t\tArrayList<String> apps = new ArrayList<String>();\n\t\tActivityManager activityManager = (ActivityManager)getSystemService(ACTIVITY_SERVICE);\n\t\tList<RunningAppProcessInfo> runningAppProcesses = activityManager.getRunningAppProcesses();\n\t\t\n\t\tfor (RunningAppProcessInfo runningAppProcessInfo : hgf)\n\t\t{\n\t\t apps.add(runningAppProcessInfo.processName);\n\t\t}\n\t\treturn apps;\n\t}", "public List<PackageInfo> getActiveApps() {\n\n ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);\n List<ActivityManager.RunningAppProcessInfo> tasks = activityManager.getRunningAppProcesses();\n\n List<PackageInfo> installedApps = getInstalledApps(true);\n List<String> runningAppProcesses = new ArrayList<>();\n\n List<PackageInfo> activeApps = new ArrayList<>();\n\n //get the running processes\n for(ActivityManager.RunningAppProcessInfo i : tasks){\n runningAppProcesses.add(i.processName);\n }\n\n //Check which ones of those processes correspond to a process of one installed app\n // is excluded this way all the system processes\n for(PackageInfo app : installedApps){\n String pName = app.applicationInfo.processName;\n\n if(runningAppProcesses.contains(pName)){\n activeApps.add(app);\n }\n }\n return activeApps;\n }", "public List<AppState> getApps()\n {\n return apps;\n }", "public List<User_apps> getUserAppsList() {\n\t\treturn Arrays.asList(conf.getUser_apps());\n\t}", "String getRunningApplications() {\n final StringBuffer sb = new StringBuffer();\n\n final ApplicationManager manager = ApplicationManager\n .getApplicationManager();\n\n final int foregroundProcess = manager.getForegroundProcessId();\n sb.append(Messages.getString(\"1c.70\") + foregroundProcess); //$NON-NLS-1$\n\n sb.append(CR + Messages.getString(\"1c.71\") + CR); //$NON-NLS-1$\n\n // Check to see if application is running.\n final ApplicationDescriptor[] descriptors = manager\n .getVisibleApplications();\n // Retrieve the name of a running application.\n for (int i = 0; i < descriptors.length; i++) {\n final ApplicationDescriptor descriptor = descriptors[i];\n sb.append(descriptor.getName());\n sb.append(\" \"); //$NON-NLS-1$\n sb.append(descriptor.getVersion());\n sb.append(\" \"); //$NON-NLS-1$\n sb.append(descriptor.getFlags());\n sb.append(\" \"); //$NON-NLS-1$\n if (manager.getProcessId(descriptor) == foregroundProcess) {\n sb.append(Messages.getString(\"1c.75\")); //$NON-NLS-1$\n }\n if ((descriptor.getPowerOnBehavior() & ApplicationDescriptor.FLAG_RUN_ON_STARTUP) != 0) {\n sb.append(Messages.getString(\"1c.76\")); //$NON-NLS-1$\n }\n sb.append(CR);\n }\n\n return sb.toString();\n }", "private ArrayList<App> getApps() {\n PackageManager manager = getPackageManager();\n Intent i = new Intent(Intent.ACTION_MAIN, null);\n i.addCategory(Intent.CATEGORY_LAUNCHER);\n\n List<ResolveInfo> availableActivities = manager.queryIntentActivities(\n i, 0);\n ArrayList<App> temp = new ArrayList<App>();\n for (ResolveInfo ri : availableActivities) {\n App app = new App();\n app.packname = ri.activityInfo.packageName;\n app.appName = app.packname\n .substring(app.packname.lastIndexOf(\".\") + 1);\n app.icon = ri.activityInfo.loadIcon(manager);\n temp.add(app);\n }\n return temp;\n }", "public List<Application> getApplications()\n {\n return _apps;\n }", "public Observable<List<AppDetail>> getAllInstalledApps() {\n return ObservableUtils.from(() -> {\n Intent i = new Intent(Intent.ACTION_MAIN, null);\n i.addCategory(Intent.CATEGORY_LAUNCHER);\n Context context = AppPreferences.getApplicationContext();\n PackageManager manager = context.getPackageManager();\n List<ResolveInfo> availableActivities = manager.queryIntentActivities(i, 0);\n List<AppDetail> apps = new ArrayList<>();\n IconFinder finder = new IconFinder(context);\n for (ResolveInfo ri : availableActivities) {\n AppDetail app = getAppDetail(ri, manager, finder);\n apps.add(app);\n }\n Collections.sort(apps, APP_DETAIL_COMPARATOR);\n return apps;\n });\n }", "public int getNumApplications()\n {\n return _apps.size();\n }", "java.util.List<com.google.cloud.talent.v4beta1.Application> getApplicationsList();", "public List<Application> getVisibleApplications() {\n return null;\r\n }", "protected void getApps(){\n DBPermissions db =new DBPermissions();\n this.apps=db.getApps();\n db.close();\n }", "public void loadApplications() {\n PackageManager manager = context.getPackageManager();\n\n Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);\n mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);\n\n final List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);\n Collections.sort(apps, new ResolveInfo.DisplayNameComparator(manager));\n\n if (apps != null) {\n applications.clear();\n\n for (ResolveInfo app : apps) {\n App application = new App();\n\n application.name = app.loadLabel(manager).toString();\n application.setActivity(new ComponentName(\n app.activityInfo.applicationInfo.packageName,\n app.activityInfo.name),\n Intent.FLAG_ACTIVITY_NEW_TASK\n | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);\n application.icon = app.activityInfo.loadIcon(manager);\n\n applications.add(application);\n }\n }\n }", "private void loadApps() {\n\t\tIntent mainIntent = new Intent(Intent.ACTION_MAIN, null);\n\t\tmainIntent.addCategory(Intent.CATEGORY_LAUNCHER);\n\t\tmApps = getPackageManager().queryIntentActivities(mainIntent, 0);\n\t}", "public TreeMap<String, Integer> build_apps_list() {\n return this.ntfcn_items.build_apps_list();\n }", "public static List<ApplicationInfo> getInstalledApplications() {\n final PackageManager manager = PackageUtil.getPackageManager();\n List<ApplicationInfo> infos = manager.getInstalledApplications(PackageManager.GET_META_DATA);\n Collections.sort(infos, new ApplicationInfo.DisplayNameComparator(manager));\n return infos;\n }", "public int getApplications() {\r\n return applications;\r\n }", "@Test\n public void listAppsTest() throws ApiException {\n Boolean _public = null;\n String name = null;\n String executionSystem = null;\n String tags = null;\n String filter = null;\n String naked = null;\n Long limit = null;\n Long offset = null;\n // List<ApplicationSummary> response = api.listApps(_public, name, executionSystem, tags, filter, naked, limit, offset);\n\n // TODO: test validations\n }", "public Observable<List<AppDetail>> getUserPermittedApps() {\n return getAllInstalledApps()\n .zipWith(PolicyManager\n .getCurrentUserPolicyRules(PolicyType.APPLICATION_CONTROL),\n RuleInterpreter::filterApps);\n\n }", "public MauiApplication [] getCachedMauiApplications ()\n\t{\n\t\tMauiApplication [] retVal = new MauiApplication [applications.size ()];\n\t\tEnumeration theApplications = applications.elements ();\n\t\tint i = 0;\n\t\twhile (theApplications.hasMoreElements ())\n\t\t{\n\t\t\tretVal [i++] = (MauiApplication) theApplications.nextElement ();\n\t\t}\n\t\treturn retVal;\n\t}", "public List<String> appNames() {\n PackageManager pm = getPackageManager();\n List<ApplicationInfo> allPackages = pm.getInstalledApplications(PackageManager.GET_META_DATA);\n List<String> bubbles = new ArrayList<>();\n\n for (ApplicationInfo apInfo : allPackages) {\n if (apInfo.className != null) {\n bubbles.add(apInfo.className);\n }\n }\n\n return bubbles;\n }", "public List<PackageInfo> getInstalledApps(boolean includeSystem) {\n\n List<PackageInfo> installedApps = new ArrayList<>();\n\n //Filter the Intent. We want Intents that can be launched. Then, retrieve the list of Activities that\n //correspond to that criteriom.\n final Intent intent = new Intent(Intent.ACTION_MAIN, null);\n intent.addCategory(Intent.CATEGORY_LAUNCHER);\n final List<ResolveInfo> pkgAppsList = context.getPackageManager().queryIntentActivities(intent, 0);\n\n for (ResolveInfo info : pkgAppsList) {\n String pkgName = info.activityInfo.packageName;\n try {\n PackageInfo pkg = packageManager.getPackageInfo(pkgName, PackageManager.GET_SERVICES);\n installedApps.add(pkg);\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n //the package with the specified name has not been found\n //should never happen as we get the package name from the system\n }\n }\n return installedApps;\n }", "@JsonIgnore\n public List<Application> getIncludedApplications()\n {\n List<Application> actual = new ArrayList<Application>();\n\n for (Application app : _apps) {\n if (!app.isSkipped()) {\n actual.add(app);\n }\n }\n\n return actual;\n }", "private void loadApps() {\n\n Intent i = new Intent(Intent.ACTION_MAIN, null);\n i.addCategory(Intent.CATEGORY_LAUNCHER);\n\n switch ((int) tabId) {\n case 1:\n // Tab 1 is a special tab and includes all except for the ones in other tabs\n // Retrieve all installed apps on the device\n List<ResolveInfo> availableActivities = mPacMan.queryIntentActivities(i, 0);\n\n // And only add those that are not in the database\n for (int j = 0; j < availableActivities.size(); j++) {\n ResolveInfo ri = availableActivities.get(j);\n\n if (sqlHelper.containsApp(ri.activityInfo.name))\n continue;\n\n AppDetail app = new AppDetail();\n app.label = ri.loadLabel(mPacMan);\n app.packageName = ri.activityInfo.packageName;\n app.activityName = ri.activityInfo.name;\n\n\n // Load the icon later in an async task.\n app.icon = null;\n\n appsList.add(app);\n }\n break;\n default:\n // All other tabs just query the apps from the database\n List<AppTable> apps = sqlHelper.getAppsForTab(tabId);\n for (AppTable app : apps) {\n\n boolean success = addAppToList(app);\n // If the app could not be added then it was probably uninstalled,\n // so we have to remove it from the database\n if (!success) {\n Log.d(\"DB\", \"Removing app \" + app.getPackageName() + \" from db\");\n sqlHelper.removeAppFromTab(app);\n }\n }\n\n // show the empty category notice if this tab is empty\n if (apps.size() == 0) {\n showEmptyCategoryNotice();\n }\n }\n }", "public GetApplicationListResponse getApplicationList() {\n\n Iterable<ApplicationEntity> result = applicationRepository.findAll();\n\n GetApplicationListResponse response = new GetApplicationListResponse();\n\n for (Iterator<ApplicationEntity> iterator = result.iterator(); iterator.hasNext(); ) {\n ApplicationEntity application = (ApplicationEntity) iterator.next();\n GetApplicationListResponse.Applications app = new GetApplicationListResponse.Applications();\n app.setId(application.getId());\n app.setApplicationName(application.getName());\n response.getApplications().add(app);\n }\n\n return response;\n }", "String getInstalledApplications() {\n final StringBuffer sb = new StringBuffer();\n sb.append(CR + Messages.getString(\"1c.77\") + CR); //$NON-NLS-1$\n\n // Retrieve an array of handles for existing modules on a BlackBerry\n // device\n final int handles[] = CodeModuleManager.getModuleHandles();\n\n final int size = handles.length;\n for (int i = 0; i < size; i++) {\n final int handle = handles[i];\n // CodeModuleManager.getModuleHandle(name)\n // Retrieve specific information about a module.\n final String name = CodeModuleManager.getModuleName(handle);\n final String vendor = CodeModuleManager.getModuleVendor(handle);\n final String description = CodeModuleManager\n .getModuleDescription(handle);\n final String version = CodeModuleManager.getModuleVersion(handle);\n final int moduleSize = CodeModuleManager.getModuleCodeSize(handle);\n final long timestamp = CodeModuleManager.getModuleTimestamp(handle);\n\n final Date date = new Date(timestamp);\n\n sb.append(name);\n sb.append(\" , \"); //$NON-NLS-1$\n sb.append(vendor);\n sb.append(CR);\n }\n\n return sb.toString();\n }", "public List<Device> getRunningDevices();", "com.google.cloud.talent.v4beta1.Application getApplications(int index);", "public Set<String> getApplicationNames() {\n ImmutableSet.Builder<String> names = ImmutableSet.builder();\n File[] files = appsDir.listFiles(File::isDirectory);\n if (files != null) {\n for (File file : files) {\n names.add(file.getName());\n }\n }\n return names.build();\n }", "public static List<String> m57031a(Context context) {\n ArrayList arrayList = new ArrayList();\n if (C17095a.m85219b(C6969H.m41409d(\"G7A97DA0A8031BB39EA07835C\"), false)) {\n return arrayList;\n }\n try {\n for (ApplicationInfo applicationInfo : context.getPackageManager().getInstalledApplications(128)) {\n arrayList.add(applicationInfo.loadLabel(context.getPackageManager()).toString());\n }\n } catch (Exception unused) {\n }\n return arrayList;\n }", "int getApplicationsCount();", "public List<ApplicationRecord> getListRegisteredApplications(String vnfrId) {\n\t\tApplicationRecord[] list = restTemplate.getForObject(serviceProfile.getServiceApiUrl(), ApplicationRecord[].class);\n\t\t return Arrays.asList(list);\n\t}", "private ArrayList<PInfo> getInstalledApps(boolean getSysPackages) {\n\t\tArrayList<PInfo> res = new ArrayList<PInfo>(); \n\t\tList<PackageInfo> packs = getPackageManager().getInstalledPackages(0);\n\t\tfor(int i=0;i<packs.size();i++) {\n\t\t\tPackageInfo p = packs.get(i);\n\t\t\tif ((!getSysPackages) && isSystemPackage(p)) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t\tPInfo newInfo = new PInfo();\n\t\t\tnewInfo.appname = p.applicationInfo.loadLabel(getPackageManager()).toString();\n\t\t\tnewInfo.pname = p.packageName;\n\t\t\tnewInfo.versionName = p.versionName;\n\t\t\tnewInfo.versionCode = p.versionCode;\n\t\t\tnewInfo.icon = p.applicationInfo.loadIcon(getPackageManager());\n\t\t\tnewInfo.toOpen = getPackageManager().getLaunchIntentForPackage(p.packageName);\n\t\t\tres.add(newInfo);\n\t\t\t\n\t\t}\n\t\treturn res; \n\t}", "private List<AppDetails> getAppDetailsFromDatabase() {\r\n SQLiteAccessLayer sqLiteAccessLayer = new SQLiteAccessLayer(this);\r\n List<AppDetails> appDetailsList = new ArrayList<>();\r\n PackageManager packageManager = getPackageManager();\r\n\r\n if (sqLiteAccessLayer.isDatabaseEmpty()) { // database empty\r\n List<PackageInfo> installedApps = RawAppInfo.getAllInstalledApps(this);\r\n List<ResolveInfo> systemApps = RawAppInfo.getSystemApps(this);\r\n\r\n for (PackageInfo packageInfo : installedApps) {\r\n AppDetails appDetails = new AppDetails(\r\n packageInfo.applicationInfo.uid,\r\n packageInfo.applicationInfo.packageName,\r\n String.valueOf(packageInfo.applicationInfo.loadLabel(packageManager)),\r\n RawAppInfo.INSTALLED_APP\r\n );\r\n\r\n SQLiteAccessLayer sqLiteAccessLayerForInsert = new SQLiteAccessLayer(this, appDetails);\r\n sqLiteAccessLayerForInsert.insertIntoAppDetails();\r\n appDetailsList.add(appDetails);\r\n }\r\n for (ResolveInfo resolveInfo : systemApps) {\r\n ApplicationInfo applicationInfo = resolveInfo.activityInfo.applicationInfo;\r\n AppDetails appDetails = new AppDetails(\r\n applicationInfo.uid, //uid\r\n applicationInfo.packageName, //packagename\r\n String.valueOf(applicationInfo.loadLabel(packageManager)), // applicationName\r\n RawAppInfo.SYSTEM_APP //applicationType\r\n );\r\n SQLiteAccessLayer sqLiteAccessLayerForInsert = new SQLiteAccessLayer(this, appDetails);\r\n sqLiteAccessLayerForInsert.insertIntoAppDetails();\r\n appDetailsList.add(appDetails);\r\n }\r\n } else {\r\n appDetailsList = new ArrayList<>(new SQLiteAccessLayer(this).queryAppDetails());\r\n }\r\n sqLiteAccessLayer.closeDatabaseConnection();\r\n return appDetailsList;\r\n }", "private void showOrLoadApplications() {\n //nocache!!\n GetAppList getAppList = new GetAppList();\n if (plsWait == null && (getAppList.getStatus() == AsyncTask.Status.PENDING || getAppList.getStatus() == AsyncTask.Status.FINISHED)) {\n getAppList.setContext(this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n }", "public Map<String, FacebookAppModel> getAppModels()\n {\n return apps;\n }", "@Override\r\n\tpublic JSONArray getAPPList(HttpServletRequest request,HttpServletResponse response) {\n\t\tJSONArray japps = new JSONArray();\r\n\t\t\r\n\t\tJSONObject japp1 = new JSONObject();\r\n\t\tjapp1.put(\"id\", \"1001\");\r\n\t\tjapp1.put(\"name\", \"公文管理\");\r\n\t\t\r\n\t\tJSONObject japp2 = new JSONObject();\r\n\t\tjapp2.put(\"id\", \"1002\");\r\n\t\tjapp2.put(\"name\", \"三项工作\");\r\n\t\t\r\n\t\tJSONObject japp3 = new JSONObject();\r\n\t\tjapp3.put(\"id\", \"1003\");\r\n\t\tjapp3.put(\"name\", \"综合事务\");\r\n\t\t\r\n\t\tjapps.add(japp1);\r\n\t\tjapps.add(japp2);\r\n\t\tjapps.add(japp3);\r\n\t\t\r\n\t\treturn japps;\r\n\t}", "private List<String> getRunningInstances()\n {\n final long maxResults = 500L; // 500 is sadly the max, see below\n\n ArrayList<String> ids = new ArrayList<>();\n try {\n final String project = envConfig.getProjectId();\n final String zone = envConfig.getZoneName();\n final String managedInstanceGroupName = envConfig.getManagedInstanceGroupName();\n\n Compute computeService = createComputeService();\n Compute.InstanceGroupManagers.ListManagedInstances request =\n computeService\n .instanceGroupManagers()\n .listManagedInstances(project, zone, managedInstanceGroupName);\n // Notice that while the doc says otherwise, there is not nextPageToken to page\n // through results and so everything needs to be in the same page\n request.setMaxResults(maxResults);\n InstanceGroupManagersListManagedInstancesResponse response = request.execute();\n for (ManagedInstance mi : response.getManagedInstances()) {\n ids.add(GceUtils.extractNameFromInstance(mi.getInstance()));\n }\n log.debug(\"Found running instances [%s]\", String.join(\",\", ids));\n }\n catch (Exception e) {\n log.error(e, \"Unable to get instances.\");\n }\n return ids;\n }", "public int getCount() {\n\t\t\treturn mApplications.size();\n\t\t}", "public static Set<Integer> getAppids() {\n return APP_IDS.ids;\n }", "@Override\n public Set<Application> getMyApps(EzSecurityToken ezSecurityToken) throws TException {\n checkNotNull(ezSecurityToken);\n validateToken(ezSecurityToken);\n if (ezSecurityToken.getType() != TokenType.USER) {\n logger.error(\"Trying to call getMyApps with a non-User token is not allowed\");\n throw new TException(\"EzSecurityToken must be a User Token for getMyApps\");\n }\n String userName = ezSecurityToken.getTokenPrincipal().getPrincipal();\n logger.trace(\"Getting apps for {}\", userName);\n devModeUnsupported();\n\n return getApplications(getTermQuery(AllowedUsersField, userName), ezSecurityToken);\n }", "public String getAllRunningServices() {\n return \"\";\n }", "private static List<MonitoredApplication> initMonitoredApplications(final Properties props, final Logger logger) throws Exception {\n\n List<MonitoredApplication> monitoredApps = Lists.newArrayListWithExpectedSize(16);\n File monitoredAppDir = getSystemFile(\"monitoredAppDir\", props, false);\n\n if(monitoredAppDir != null) {\n File[] propFiles = monitoredAppDir.listFiles();\n\n if(propFiles != null) {\n for(File propFile : propFiles) {\n if(propFile.isDirectory()) continue;\n Properties endpointProps = new Properties();\n try {\n byte[] propBytes = Files.toByteArray(propFile);\n endpointProps.load(new ByteArrayInputStream(propBytes));\n if(endpointProps.getProperty(\"index\") != null) {\n monitoredApps.add(new MonitoredApplication(endpointProps));\n }\n } catch(IOException ioe) {\n logger.warn(\"Problem loading monitored app '\" + propFile.getAbsolutePath() + \"'\", ioe);\n }\n }\n }\n }\n\n return monitoredApps;\n }", "private void loadApplications(boolean isLaunching) {\n \t\tif (isLaunching && mApplications != null) {\n \t\t\treturn;\n \t\t}\n \n \t\tPackageManager manager = getPackageManager();\n \n \t\tIntent mainIntent = new Intent(Intent.ACTION_MAIN, null);\n \t\tmainIntent.addCategory(Intent.CATEGORY_LAUNCHER);\n \n \t\tfinal List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);\n \t\tCollections.sort(apps, new ResolveInfo.DisplayNameComparator(manager));\n \n \t\tif (apps != null) {\n \t\t\tfinal int count = apps.size();\n \n \t\t\tif (mApplications == null) {\n \t\t\t\tmApplications = new ArrayList<ApplicationInfo>(count);\n \t\t\t}\n \t\t\tmApplications.clear();\n \n \t\t\tfor (int i = 0; i < count; i++) {\n \t\t\t\tApplicationInfo application = new ApplicationInfo();\n \t\t\t\tResolveInfo info = apps.get(i);\n \n \t\t\t\tapplication.title = info.loadLabel(manager);\n \t\t\t\tapplication.setActivity(new ComponentName(\n \t\t\t\t\t\tinfo.activityInfo.applicationInfo.packageName,\n \t\t\t\t\t\tinfo.activityInfo.name),\n \t\t\t\t\t\tIntent.FLAG_ACTIVITY_NEW_TASK\n \t\t\t\t\t\t| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);\n \t\t\t\tapplication.icon = info.activityInfo.loadIcon(manager);\n \n \t\t\t\tmApplications.add(application);\n \t\t\t}\n \t\t}\n \t}", "private final List<ActivityManager.AppTask> m881c() {\n List<ActivityManager.AppTask> appTasks = ((ActivityManager) this.f1350b.getSystemService(\"activity\")).getAppTasks();\n return appTasks == null ? Collections.emptyList() : appTasks;\n }", "public String getAllRunningActivities() {\n return \"\";\n }", "Set<Application> resolve();", "public static java.util.List<de.fraunhofer.fokus.movepla.model.Application> getApplications(\n long pk) throws com.liferay.portal.kernel.exception.SystemException {\n return getPersistence().getApplications(pk);\n }", "public java.util.List<java.lang.String> getRunningsList() {\n return java.util.Collections.unmodifiableList(result.runnings_);\n }", "public int getCount() {\n\t\t\treturn appList.size();\n\t\t}", "public TargetModuleID[] getAllApplications(Boolean running) \n throws Exception {\n TargetModuleID[] ears = getApplications(ModuleType.EAR, running);\n TargetModuleID[] wars = getApplications(ModuleType.WAR, running);\n TargetModuleID[] cars = getApplications(ModuleType.CAR, running);\n TargetModuleID[] ejbs = getApplications(ModuleType.EJB, running);\n TargetModuleID[] rars = getApplications(ModuleType.RAR, running);\n\n List list = new ArrayList();\n for (int i = 0; i < ears.length; i++) { list.add(ears[i]); }\n for (int i = 0; i < wars.length; i++) { list.add(wars[i]); }\n for (int i = 0; i < cars.length; i++) { list.add(cars[i]); }\n for (int i = 0; i < ejbs.length; i++) { list.add(ejbs[i]); }\n for (int i = 0; i < rars.length; i++) { list.add(rars[i]); }\n \n TargetModuleID[] results = new TargetModuleID[list.size()];\n for (int i = 0; i < list.size(); i++) { \n results[i] = (TargetModuleID) list.get(i);\n }\n return results;\n }", "private ArrayList<PInfo> getPackages() {\n\t\tArrayList<PInfo> apps = getInstalledApps(false); /* false = no system packages */\n\t\tfinal int max = apps.size();\n\t\tfor (int i=0; i<max; i++) {\n\t\t\tapps.get(i).getIcon();\n\t\t}\n\t\treturn apps;\n\t}", "List<Program> findAllPrograms(String date, String application, List<String> channels);", "public List<String> getFreeLaunchers() {\n return persistence.getFreeLauncherUrls();\n }", "AppConfiguration getApplicationList()\n throws SAXException, IOException;", "@Override\n public MarathonDeployedAppList get(Application application, Component component, Environment environment) {\n return null;\n }", "public List<LeaveApplication> getAll();", "java.util.concurrent.Future<ListApplicationsResult> listApplicationsAsync(ListApplicationsRequest listApplicationsRequest);", "java.util.List<? extends com.google.cloud.talent.v4beta1.ApplicationOrBuilder>\n getApplicationsOrBuilderList();", "private int getRunningNum() {\n\t\treturn am.getRunningAppProcesses().size();\r\n\t}", "@GET\n\t@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})\n\tpublic Response getApplications(\n\t\t\t@HeaderParam(\"ORSKey\") String orsKey,\n\t\t\t@HeaderParam(\"ShortKey\") String shortKey) {\n\t\tif (!Security.instance.isInternalUser(orsKey, shortKey)) {\n\t\t\tthrow new ForbiddenException(\"User does not have permission\");\n\t\t}\n\t\tList<Application> list = ApplicationsDao.instance.getAll();\n\t\tGenericEntity<List<Application>> returnList = new GenericEntity<List<Application>>(list) {};\n\t\treturn Response.ok(returnList).build();\n\t}", "@RequestMapping(value = \"/discovery-client/instances\", method = RequestMethod.GET)\n public Map<String, Integer> getAllInstances() {\n final Map<String, Integer> response = new HashMap<>();\n\n final Applications applications = discoveryClient.getApplications();\n final List<Application> applicationList = applications.getRegisteredApplications();\n\n //TODO Java 8 Stream\n // Get instances from eureka\n for (final Application app : applicationList) {\n response.put(app.getName(), app.getInstances().size());\n }\n\n return response;\n }", "private List<String> listPolicyExemptAppsUnchecked() {\n String[] core = mContext.getResources().getStringArray(R.array.policy_exempt_apps);\n String[] vendor = mContext.getResources().getStringArray(R.array.vendor_policy_exempt_apps);\n\n int size = core.length + vendor.length;\n Set<String> apps = new ArraySet<>(size);\n for (String app : core) {\n apps.add(app);\n }\n for (String app : vendor) {\n apps.add(app);\n }\n\n return new ArrayList<>(apps);\n }", "public List<UsageStats> getUsedForegroundApp(long interval) {\n\n String context_usage_stats_service = \"usagestats\"; // = Context.USAGE_STATS_SERVICE, but this is not recognize for an unknown reason\n @SuppressWarnings(\"ResourceType\") UsageStatsManager manager = (UsageStatsManager) context.getSystemService(context_usage_stats_service);\n\n List<UsageStats> statistics =\n manager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, System.currentTimeMillis() - interval,\n System.currentTimeMillis());\n\n return statistics;\n }", "public void getRunningInstances() {\n LogContainerResultCallback resultCallback = new LogContainerResultCallback();\n //override method onNext of resultcallback\n dockerClient.logContainerCmd(\"id\").exec(resultCallback);\n dockerClient.attachContainerCmd(\"id\").withStdIn(new ByteArrayInputStream(\"list\\n\".getBytes()));\n }", "public List<String> getApplicationIdentifiers() {\n return applicationIdentifiers;\n }", "@OAMany(toClass = Application.class, reverseName = Application.P_ApplicationType, createMethod = false)\n\tprivate Hub<Application> getApplications() {\n\t\treturn null;\n\t}", "public ListApp getListApp(long id) {\n SQLiteDatabase db = this.getReadableDatabase();\n\n Cursor cursor = db.query(ListApp.TABLE_NAME,\n new String[]{ListApp.COLUMN_ID, ListApp.COLUMN_NAME, ListApp.COLUMN_IMAGE},\n ListApp.COLUMN_ID + \"=?\",\n new String[]{String.valueOf(id)}, null, null, null, null);\n\n if (cursor != null)\n cursor.moveToFirst();\n\n // prepare ListApp object\n ListApp listApp = new ListApp(\n cursor.getInt(cursor.getColumnIndex(ListApp.COLUMN_ID)),\n cursor.getString(cursor.getColumnIndex(ListApp.COLUMN_NAME)),\n cursor.getBlob(cursor.getColumnIndex(ListApp.COLUMN_IMAGE)));\n\n // close the db connection\n cursor.close();\n\n return listApp;\n }", "public PerpApplications getPerpApplications() {\n return perpApplications;\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getApplications(@Context final HttpServletRequest httpServletRequest, @QueryParam(\"serviceId\") String serviceId) {\n logger.debug(\"Get applications. Service ID is \" + serviceId);\n ApplicationManager appManager = ApplicationManagerImpl.getInstance();\n JSONArray jsonArray = new JSONArray();\n try {\n List<Application> applications = appManager.getApplications(serviceId);\n if (applications == null) {\n \treturn RestApiResponseHandler.getResponse(Status.CREATED, jsonArray.toString());\n }\n //\n for (Application app : applications) {\n JSONObject jsonObj = new JSONObject();\n String appId = app.getAppId();\n jsonObj.put(\"appId\", app.getAppId());\n jsonObj.put(\"appName\", CloudFoundryManager.getInstance().getAppNameByAppId(appId));\n jsonArray.put(jsonObj);\n }\n return RestApiResponseHandler.getResponse(Status.CREATED, jsonArray.toString());\n } catch (DataStoreException e) {\n return RestApiResponseHandler.getResponseError(MESSAGE_KEY.RestResponseErrorMsg_database_error, e, httpServletRequest.getLocale());\n } catch (CloudException e) {\n \treturn RestApiResponseHandler.getResponseError(MESSAGE_KEY.RestResponseErrorMsg_cloud_error, e, httpServletRequest.getLocale());\n } catch (Exception e) {\n return RestApiResponseHandler.getResponseError(Response.Status.INTERNAL_SERVER_ERROR, e);\n }\n }", "@RequestMapping(value = \"/rest/application\", method = RequestMethod.GET,\n produces = \"application/json\")\n @Timed\n public List<Application> getAllForCurrentUser() {\n log.debug(\"REST request to get all Application\");\n try {\n User currentLoggedInUser = userRepository.getOne(SecurityUtils.getCurrentLogin());\n return applicationRepository.getAllForUser(currentLoggedInUser);\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n }\n return null;\n }", "void checkForApps();", "@XmlElement(required = true)\n public List<Application> getApplications() {\n return applications;\n }", "@GetMapping(\"getAll\")\n\tpublic Collection<JobApplication> getAll(){\n\t\treturn jobAppRepo.findAll();\n\t}", "public List<AppUser> getAllAppUsers() {\n\t\tList<AppUser> appUserList = new ArrayList<>();\n\t\tappUserRepository.findAll()\n\t\t.forEach(r->appUserList.add(r));\n\t\treturn appUserList;\n\t}", "public static List<Task> findAllRunningTasks() {\r\n List<Task> outTasks = new ArrayList<Task>();\r\n List<ITask> iTasks = findAllTasks(DEFAULT_INDEX, DEFAULT_PAGESIZE, null, SortOrder.ASCENDING, RUNNING_MODE, null);\r\n\r\n for (ITask iTask : iTasks) {\r\n outTasks.add(convertITaskToTask(iTask));\r\n }\r\n return outTasks;\r\n }", "public static File getAppsDirectory() {\n\t\treturn APPS_DIRECTORY;\n\t}", "public List<AppInfo>selectAppInfo(){\n\t\tList<AppInfo> mAppList = new ArrayList<AppInfo>();\n\t\tCursor c = db.rawQuery(\"select mapName,packageName,className from \"+ RECENT_TABLE_NAME,null);\n\t\twhile (c.moveToNext()) {\n\t\t\tAppInfo item =new AppInfo();\n\t\t\tString mapName = c.getString(0);\n\t\t\tString packageName = c.getString(1);\n\t\t\tString className =c.getString(2);\n\n\t\t\t//L.v(mapName+\"&&\"+packageName+\"&&\"+className );\n\t\t\titem.setAppName(mapName);\n\t\t\titem.setClassName(className);\n\t\t\titem.setPackageName(packageName);\n\n\t\t\tmAppList.add(item);\n\t\t}\n\t\treturn mAppList;\n\n\t}", "public List<String> getTotalLaunchers() {\n return persistence.getTotalLauncherUrls();\n }", "public List<EihApps> getListByQuery(SessionFactory factory, String query) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<ApplicationStatus> getApplicationStatuses() {\n\t\treturn entityManager.createQuery(\"from ApplicationStatus\", ApplicationStatus.class).getResultList();\r\n\t}", "@Override\n public Set<ApplicationSummary> getAllApplicationsSummary() throws TException {\n Set<ApplicationSummary> result = new HashSet<>();\n Set<Application> allApps = getApplications(\"*\", getSecurityToken());\n\n for (Application app : allApps) {\n ApplicationSummary summary = new ApplicationSummary().setAppName(app.getAppName()).\n setId(app.getId()).setPoc(app.getPoc()).\n setSponsoringOrganization(app.getSponsoringOrganization());\n\n if (app.isSetWebApp()) {\n summary.setExternalUri(app.getWebApp().getExternalUri());\n }\n\n result.add(summary);\n }\n\n return result;\n }", "void killAllApps();", "Collection<GameEnvironment> getPendingGames();", "public List<FxDropApplication> getDropApplicationsWithContext() {\n final ArrayList<FxDropApplication> apps = Lists.newArrayList(FxSharedUtils.getDropApplications());\n final Iterator<FxDropApplication> iter = apps.iterator();\n while (iter.hasNext()) {\n final FxDropApplication application = iter.next();\n if (!application.isWebContextAvailable()\n // drop flexive backend application form list\n || \"flexive\".equals(application.getName())\n || \"flexive-backend-war\".equals(application.getName())) {\n iter.remove();\n }\n }\n return apps;\n }", "@Override\n public ListApplicationsResult listApplications(ListApplicationsRequest request) {\n request = beforeClientExecution(request);\n return executeListApplications(request);\n }", "public String getApp();", "@Test\n public void listAppHistoryTest() throws ApiException {\n Boolean naked = null;\n String appId = null;\n String status = null;\n String created = null;\n Long limit = null;\n Long offset = null;\n // HistoryEvent response = api.listAppHistory(naked, appId, status, created, limit, offset);\n\n // TODO: test validations\n }", "public int getNumIncludedApplications()\n {\n return getIncludedApplications().size();\n }", "public List<ServiceInstance> getAllInstances();", "@Override\n public Set<WebApplicationLink> getWebAppsForUri(String uri) throws TException {\n logger.trace(\"Getting web apps that can open {}\", uri);\n if (inDevMode) {\n return getTestOutput(\"getWebAppsForUri\", uri.replace(\":\", \"\"),\n new TypeReference<Set<WebApplicationLink>>() {\n });\n }\n\n String uriPrefix = INSUtility.getUriPrefix(uri);\n Set<WebApplicationLink> webApps = Sets.newHashSet();\n Set<Application> apps = getApplications(getExistsQuery(UrnMapField + \".\", uriPrefix), getSecurityToken());\n\n for (Application app : apps) {\n WebApplicationLink link = app.webApp.getUrnMap().get(uriPrefix);\n link.setAppName(app.getAppName());\n if (app.webApp.isSetRequiredGroupName() && !app.webApp.getRequiredGroupName().trim().isEmpty()) {\n link.setRequiredGroupName(app.webApp.getRequiredGroupName());\n }\n webApps.add(link);\n }\n\n return webApps;\n }", "public java.util.List<java.lang.String> getDebugRunningsList() {\n return java.util.Collections.unmodifiableList(result.debugRunnings_);\n }", "public List<String> getRunningESBTaskList() throws Exception {\n return ntaskManager.getRunningTaskList();\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n fetchListOfAppNames();\n// this.appNames = getListOfAllAppNames();\n this.appNames = getListOfInstalledAppNames();\n registerBroadcastReceiver();\n return START_STICKY;\n }", "public HashMap<String, JSONObject> getListPrograms();", "public static void clearAppList() {\n }", "public List<FxDropApplication> getDropApplications() {\n return FxSharedUtils.getDropApplications();\n }", "public static void getExternalApplications(\n\t\t\tfinal ApkListRequestObserver observer) {\n\t\tif (MosesService.getInstance() != null) {\n\t\t\tMosesService.getInstance().executeLoggedIn(\n\t\t\t\t\tHookTypesEnum.POST_LOGIN_SUCCESS,\n\t\t\t\t\tMessageTypesEnum.REQUEST_GET_LIST_APK, new Executable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void execute() {\n\t\t\t\t\t\t\tLog.d(\"MoSeS.APKMETHODS\", \"requesting apk list\");\n\t\t\t\t\t\t\tnew RequestGetListAPK(new RequestApkListExecutor(\n\t\t\t\t\t\t\t\t\tobserver), RequestLogin.getSessionID())\n\t\t\t\t\t\t\t\t\t.send();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\t}", "@Override\n\tpublic List<Appointment> getUpcomingAppointments() {\n\t\treturn mobileDao.getUpcomingAppointments();\n\t}", "public java.lang.String getAppNoListResult() {\r\n return localAppNoListResult;\r\n }", "public java.util.List<ApplicationVersionDescription> getApplicationVersions() {\n if (applicationVersions == null) {\n applicationVersions = new com.amazonaws.internal.ListWithAutoConstructFlag<ApplicationVersionDescription>();\n applicationVersions.setAutoConstruct(true);\n }\n return applicationVersions;\n }" ]
[ "0.8223861", "0.7560645", "0.74182963", "0.7375811", "0.73068374", "0.7271555", "0.72485524", "0.71694696", "0.70207363", "0.6978502", "0.6968055", "0.68746865", "0.681805", "0.6811896", "0.6766585", "0.6713698", "0.6694503", "0.6674112", "0.6542052", "0.64928615", "0.64884186", "0.64426184", "0.6432918", "0.6344128", "0.6243578", "0.62136805", "0.6192372", "0.6190111", "0.61789393", "0.61620265", "0.6123368", "0.61101997", "0.6054848", "0.60428995", "0.60182333", "0.5945449", "0.59397686", "0.59260607", "0.59015584", "0.5884645", "0.5865289", "0.5849462", "0.5839611", "0.5827762", "0.58269596", "0.58052063", "0.5804341", "0.5791971", "0.5783436", "0.57756484", "0.57626337", "0.5759256", "0.5725665", "0.5700615", "0.5690864", "0.566993", "0.5662664", "0.5653403", "0.5653257", "0.5622559", "0.56103516", "0.56061125", "0.5591283", "0.555231", "0.55426836", "0.5540592", "0.55315906", "0.5516315", "0.5515866", "0.5514381", "0.5510521", "0.55060804", "0.54991996", "0.5497019", "0.5491885", "0.5488895", "0.5483644", "0.54814595", "0.54771596", "0.5458912", "0.544866", "0.5442372", "0.5435477", "0.54312587", "0.54087895", "0.54044265", "0.53752", "0.537031", "0.53680164", "0.53658533", "0.53557193", "0.5343807", "0.53426474", "0.5339415", "0.5329356", "0.5326461", "0.53252494", "0.5314014", "0.53134567", "0.5307448", "0.5306896" ]
0.0
-1
Create and return a single reference to be included in the text
public static DocumentFragment getIntextElement(Module m, PIcommand cmd,Reference ref) { DocumentFragment df = m.getDoc().createDocumentFragment(); Element refElt = m.getDoc().createElement("span"); refElt.setAttribute("class", cmd.getCommandStyleName()); Node n_ref = null; String reftext = ""; // set as requested String index = Reference.EMPTY; if (cmd.paramExist(PIcommand.INDEX)) { index = cmd.getValue(PIcommand.INDEX); } // display according to style // display IEE style reftext += " [" + index + "] "; n_ref = m.getDoc().createTextNode(reftext.trim()); refElt.appendChild(n_ref); df.appendChild(refElt); return df; //return refElt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TextWithReferences getTextWithReferences();", "public String toReference(Object text) { String t=toString(text); if(t==null || t.length()==0) {return null;} return \"<<\"+t+\">>\"; }", "String getReference();", "String getReference();", "java.lang.String getRef();", "public String getReference();", "public String getReference();", "ReferenceEmbed createReferenceEmbed();", "ReferenceLink createReferenceLink();", "@Test\n public void sourceTextInReferenceTest() {\n final String transcription = \"This is a test moo\";\n final String expected = \"This is a test <a class=\\\"internal-ref\\\" href=\\\"javascript:;\\\" \" +\n \"data-targetid=\\\"https://example.com/col/book/page/canvas\\\" \" +\n \"data-label=\\\"test\\\" \" +\n \"data-manifestid=\\\"https://example.com/col/book/manifest\\\">moo</a>\";\n\n String result = adapter.addInternalRefs(fakeCollection, transcription, Collections.singletonList(weirdRef()));\n assertEquals(expected, result);\n }", "private Text rel() {\n\t\tText rel = text();\r\n\r\n\t\tif (syntaxError)\r\n\t\t\treturn null;\r\n\r\n\t\treturn rel;\r\n\t}", "private Ref handleRef() throws XMLStreamException{\n String name = reader.getAttributeValue(0);\n nextTag();\n nextTag();\n return new Ref(definedGrammar, name);\n }", "public final String getReference() {\n return reference;\n }", "public String getReference() {\n return reference;\n }", "String getContainmentReference();", "ReferenceTreatment createReferenceTreatment();", "public org.purl.dc.elements.x11.SimpleLiteral addNewReferences()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.purl.dc.elements.x11.SimpleLiteral target = null;\r\n target = (org.purl.dc.elements.x11.SimpleLiteral)get_store().add_element_user(REFERENCES$0);\r\n return target;\r\n }\r\n }", "@View( VIEW_CREATE_REFERENCE )\r\n public String getCreateReference( HttpServletRequest request )\r\n {\r\n _reference = ( _reference != null ) ? _reference : new Reference( );\r\n Map<String, Object> model = getModel( );\r\n model.put( MARK_REFERENCE, _reference );\r\n return getPage( PROPERTY_PAGE_TITLE_CREATE_REFERENCE, TEMPLATE_CREATE_REFERENCE, model );\r\n }", "public java.lang.String getReference() {\n return reference;\n }", "public String getReference() {\n return reference;\n }", "public String getReference() {\n return reference;\n }", "public String getReference() {\n return reference;\n }", "@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}", "Text createText();", "public String getRef() {\n return ref;\n }", "@Test//ExSkip\n public void fieldRef() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n builder.startBookmark(\"MyBookmark\");\n builder.insertFootnote(FootnoteType.FOOTNOTE, \"MyBookmark footnote #1\");\n builder.write(\"Text that will appear in REF field\");\n builder.insertFootnote(FootnoteType.FOOTNOTE, \"MyBookmark footnote #2\");\n builder.endBookmark(\"MyBookmark\");\n builder.moveToDocumentStart();\n\n // We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at.\n builder.getListFormat().applyNumberDefault();\n builder.getListFormat().getListLevel().setNumberFormat(\"> \\u0000\");\n\n // Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes.\n FieldRef field = insertFieldRef(builder, \"MyBookmark\", \"\", \"\\n\");\n field.setIncludeNoteOrComment(true);\n field.setInsertHyperlink(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\f \\\\h\");\n\n // Insert a REF field, and display whether the referenced bookmark is above or below it.\n field = insertFieldRef(builder, \"MyBookmark\", \"The referenced paragraph is \", \" this field.\\n\");\n field.setInsertRelativePosition(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\p\");\n\n // Display the list number of the bookmark as it appears in the document.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's paragraph number is \", \"\\n\");\n field.setInsertParagraphNumber(true);\n\n Assert.assertEquals(\" REF MyBookmark \\\\n\", field.getFieldCode());\n\n // Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's paragraph number, non-delimiters suppressed, is \", \"\\n\");\n field.setInsertParagraphNumber(true);\n field.setSuppressNonDelimiters(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\n \\\\t\");\n\n // Move down one list level.\n builder.getListFormat().setListLevelNumber(builder.getListFormat().getListLevelNumber() + 1)/*Property++*/;\n builder.getListFormat().getListLevel().setNumberFormat(\">> \\u0001\");\n\n // Display the list number of the bookmark and the numbers of all the list levels above it.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's full context paragraph number is \", \"\\n\");\n field.setInsertParagraphNumberInFullContext(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\w\");\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n\n // Display the list level numbers between this REF field, and the bookmark that it is referencing.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's relative paragraph number is \", \"\\n\");\n field.setInsertParagraphNumberInRelativeContext(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\r\");\n\n // At the end of the document, the bookmark will show up as a list item here.\n builder.writeln(\"List level above bookmark\");\n builder.getListFormat().setListLevelNumber(builder.getListFormat().getListLevelNumber() + 1)/*Property++*/;\n builder.getListFormat().getListLevel().setNumberFormat(\">>> \\u0002\");\n\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.REF.docx\");\n testFieldRef(new Document(getArtifactsDir() + \"Field.REF.docx\")); //ExSkip\n }", "MnemonicNameReference createMnemonicNameReference();", "public String getRef(){\n return this.filenameWithoutExtension + \".\" + this.index;\n }", "B documentReference(String documentReference);", "public Content createReferenceContent(int timestart, ArrayList<Point3f> ref){\r\n\t\tContent refcont;\r\n\t\tif (ref.size() == 1)\r\n\t\t\t// reference: single point\r\n\t\t\trefcont = createPointReferenceContent(timestart, ref);\r\n\t\telse\r\n\t\t\t//reference: a bar\r\n\t\t\trefcont = createLineReferenceContent(timestart, ref);\r\n\t\treturn refcont;\r\n\t}", "Symbol getRef();", "private static FieldNoteRef insertFieldNoteRef(DocumentBuilder builder, String bookmarkName, boolean insertHyperlink, boolean insertRelativePosition, boolean insertReferenceMark, String textBefore) throws Exception {\n builder.write(textBefore);\n\n FieldNoteRef field = (FieldNoteRef) builder.insertField(FieldType.FIELD_NOTE_REF, true);\n field.setBookmarkName(bookmarkName);\n field.setInsertHyperlink(insertHyperlink);\n field.setInsertRelativePosition(insertRelativePosition);\n field.setInsertReferenceMark(insertReferenceMark);\n builder.writeln();\n\n return field;\n }", "public String getREFERENCE() {\r\n return REFERENCE;\r\n }", "public ReferenceHelper getReferenceHelper();", "public java.lang.String getReference1() {\n return reference1;\n }", "private FieldRef insertFieldRef(final DocumentBuilder builder, final String bookmarkName,\n final String textBefore, final String textAfter) throws Exception {\n builder.write(textBefore);\n FieldRef field = (FieldRef) builder.insertField(FieldType.FIELD_REF, true);\n field.setBookmarkName(bookmarkName);\n builder.write(textAfter);\n return field;\n }", "FileNameReference createFileNameReference();", "private Reference parseReference(Record record) {\n return new Reference(record.value(CommonTerms.identifierTerm),\n record.value(TermFactory.instance().findTerm(TermURIs.publicationTypeURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.fullReferenceURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.primaryTitleURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.titleURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.pagesURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.pageStartURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.pageEndURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.volumeURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.editionURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.publisherURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.authorsListURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.editorsListURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.createdURI)),\n record.value(CommonTerms.languageTerm),\n record.value(TermFactory.instance().findTerm(TermURIs.uriURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.doiURI)),\n record.value(TermFactory.instance().findTerm(TermURIs.localityOfPublisherURI)));\n }", "ReferenceProperty createReferenceProperty();", "public StrColumn getReference() {\n return delegate.getColumn(\"reference\", DelegatingStrColumn::new);\n }", "public String getReferenceId();", "public String getReferenceNarrativeText() {\n\t\tif ((this.getMdht().getText() != null) && (this.getMdht().getText().getText() != null)) {\n\t\t\treturn this.getMdht().getText().getText();\n\t\t}\n\t\treturn null;\n\t}", "@Nullable\n String getRef();", "private Text href() {\n\t\tText href = text();\r\n\r\n\t\tif (syntaxError)\r\n\t\t\treturn null;\r\n\r\n\t\treturn href;\r\n\t}", "@Test\n public void noteRef() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n builder.write(\"CrossReference: \");\n\n FieldNoteRef field = (FieldNoteRef)builder.insertField(FieldType.FIELD_NOTE_REF, false); // <--- don't update field\n field.setBookmarkName(\"CrossRefBookmark\");\n field.setInsertHyperlink(true);\n field.setInsertReferenceMark(true);\n field.setInsertRelativePosition(false);\n builder.writeln();\n\n builder.startBookmark(\"CrossRefBookmark\");\n builder.write(\"Hello world!\");\n builder.insertFootnote(FootnoteType.FOOTNOTE, \"Cross referenced footnote.\");\n builder.endBookmark(\"CrossRefBookmark\");\n builder.writeln();\n\n doc.updateFields();\n\n // This field works only in older versions of Microsoft Word.\n doc.save(getArtifactsDir() + \"Field.NOTEREF.doc\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.NOTEREF.doc\");\n field = (FieldNoteRef)doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_NOTE_REF, \" NOTEREF CrossRefBookmark \\\\h \\\\f\", \"1\", field);\n TestUtil.verifyFootnote(FootnoteType.FOOTNOTE, true, null, \"Cross referenced footnote.\",\n (Footnote)doc.getChild(NodeType.FOOTNOTE, 0, true));\n }", "public void addRef(String word) {\n addRef(word.toCharArray()); }", "@Override\n\tprotected void setReferenceText(String reference) {\n\t\tgetRoot().setText(CoreDataTypeHelpers.createEDWithReference(reference));\n\t}", "public java.lang.String getReference_Doc() {\r\n return reference_Doc;\r\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getReference1() {\n return (java.lang.String)__getInternalInterface().getFieldValueForCodegen(REFERENCE1_PROP.get());\n }", "public Content createLineReferenceContent(int timestart, ArrayList<Point3f> ref){\r\n\t\tList<Point3f> referenceline = Mesh_Maker.createTube(\r\n\t\t\t\tnew double[]{ref.get(0).x, ref.get(1).x},\r\n\t\t\t\tnew double[]{ref.get(0).y, ref.get(1).y},\r\n\t\t\t\tnew double[]{ref.get(0).z, ref.get(1).z},\r\n\t\t\t\tnew double[]{1, 1},\r\n\t\t\t\t12, false); //true makes cones\r\n\t\tCustomTriangleMesh refmesh = new CustomTriangleMesh(referenceline, new Color3f(1,0,0), 0.0f);\r\n\t\tContent refcont = ContentCreator.createContent(refmesh, \"referenceLine\", timestart);\r\n\t\treturn refcont;\r\n\t}", "LineReferenceType getLineReference();", "protected abstract String getRefName();", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getReference1() {\n return (java.lang.String)__getInternalInterface().getFieldValueForCodegen(REFERENCE1_PROP.get());\n }", "public abstract String linkText();", "void addHadithText(Object newHadithText);", "@Override\n public WikiReference parse(String str)\n {\n str = str.trim();\n String reference = null;\n String label = null;\n if (str.contains(\"|\")) {\n reference = str.substring(0, str.indexOf('|'));\n label = str.substring(str.indexOf('|') + 1);\n } else {\n reference = str;\n }\n \n // special case images ...\n if (reference.matches(PREFIX_IMAGE) || reference.matches(PREFIX_FILE)) {\n reference = reference.substring(reference.indexOf(':') + 1);\n if (label != null) {\n WikiParameters params = this.generateImageParams(label);\n if (params.getParameter(\"alt\") != null) {\n label = params.getParameter(\"alt\").getValue();\n } else {\n label = \"\";\n }\n // copy ALT attribute to TITLE attribute, cause it's more user friendly\n if (params.getParameter(\"title\") == null && \"\".equals(label)) {\n params.addParameter(\"title\", label);\n }\n return new WikiReference(reference, label, params);\n }\n return new WikiReference(reference);\n }\n\n // External link with label\n // Case: [http://mediawiki.org MediaWiki]\n WikiReference wikiReference;\n if (-1 != str.indexOf(' ') && (str.contains(\"://\") || str.matches(PREFIX_MAILTO))) {\n String link = str.substring(0, str.indexOf(' ')).trim();\n label = str.substring(str.indexOf(' ') + 1).trim();\n wikiReference = new WikiReference(link, label);\n } else {\n wikiReference = new WikiReference(reference, label);\n }\n return wikiReference;\n\n }", "public java.lang.String getReference2() {\n return reference2;\n }", "public ASTNode createReference() {\n return new ASTFunctionReference(getName(), getNumParams());\n }", "Publication getPubliRef();", "public String getBibtexEntry(){\n return \"@ARTICLE { REF\" + this.getMyUniqueID() + \",\\n\" +\n \"author = \\\"\" + this.getAuthor() + \"\\\",\\n\" +\n \"title = \\\"\" + this.getTitle() + \"\\\",\\n\" +\n \"journal = \\\"\" + this.getJournal() + \"\\\",\\n\" +\n \"pages = \\\"\" + this.getStartingPage() + \"-\" + this.getEndingPage() + \"\\\",\\n\" +\n \"year = \\\"\" + this.getPublicationYear() + \"\\\"\\n\" +\n \"},\";\n }", "ReferenceRealization createReferenceRealization();", "AlphabetNameReference createAlphabetNameReference();", "protected String createFontReference(Font font)\n {\n String fontName = font.getName();\n\n StringBuffer psFontName = new StringBuffer();\n for (int i = 0; i < fontName.length(); i++)\n {\n char c = fontName.charAt(i);\n if (!Character.isWhitespace(c))\n {\n psFontName.append(c);\n }\n }\n\n boolean hyphen = false;\n if (font.isBold())\n {\n hyphen = true;\n psFontName.append(\"-Bold\");\n }\n if (font.isItalic())\n {\n psFontName.append((hyphen ? \"\" : \"-\") + \"Italic\");\n }\n\n fontName = psFontName.toString();\n fontName = psFontNames.getProperty(fontName, fontName);\n return fontName;\n }", "public String asRelativeReference() {\n return member == null ? name : name + \"$\" + member;\n }", "public com.walgreens.rxit.ch.cda.StrucDocFootnoteRef addNewFootnoteRef()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocFootnoteRef target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocFootnoteRef)get_store().add_element_user(FOOTNOTEREF$10);\n return target;\n }\n }", "public Content createPointReferenceContent(int timestart, ArrayList<Point3f> ref){\r\n\t\tList<Point3f> referencepoint = Mesh_Maker.createSphere(ref.get(0).x, ref.get(0).y, ref.get(0).z, 2, 12, 12);\r\n\t\tCustomTriangleMesh refmesh = new CustomTriangleMesh(referencepoint, new Color3f(1,0,0), 0.0f);\r\n\t\tContent refcont = ContentCreator.createContent(refmesh, \"referencePoint\", 0);\r\n\t\treturn refcont;\r\n\t}", "String getFromText();", "MolecularSequenceReferenceSeq getReferenceSeq();", "public String getReference(){\r\n\t\t\r\n\t\treturn McsElement.getElementByXpath(driver,REFERENCE_INPUT).getAttribute(\"value\");\r\n\t}", "@Override\n public String getReferenceInfo()\n {\n return \"\";\n }", "public void setReference(String reference);", "public String reference(Object obj) {\n return null;\n }", "private String getReferenceValue(String refVal1, String refVal2) {\n logger.info(\"Entered getReferenceValue() method\");\n String refTag = \"\";\n\n\n if ((refVal1.equalsIgnoreCase(\"\")) && (refVal2.equalsIgnoreCase(\"\"))) {\n refTag = \n \"<CustomerReference>\" + \"Ref1# \" + reference1 + \" Ref2# \" + \n reference2 + \"</CustomerReference>\";\n } else if (refVal1.equalsIgnoreCase(\"\")) {\n refTag = getRef2Val(refVal2);\n } else if (refVal2.equalsIgnoreCase(\"\")) {\n refTag = getRef1Val(refVal1);\n } else {\n \n if (refVal1.equalsIgnoreCase(\"PURCHASE ORDER NUMBER\")) {\n refTag = \n \"<PONumber>\" + reference1 + \"</PONumber>\" + \"<CustomerReference>\" + \n reference2 + \"</CustomerReference>\";\n } else if (refVal2.equalsIgnoreCase(\"PURCHASE ORDER NUMBER\")) {\n refTag = \n \"<PONumber>\" + reference2 + \"</PONumber>\" + \"<CustomerReference>\" + \n reference1 + \"</CustomerReference>\";\n } else if ((refVal1.equalsIgnoreCase(\"SALES ORDER NUMBER\")) && \n (refVal2.equalsIgnoreCase(\"DELIVERY NAME\"))) {\n refTag = \n \"<CustomerReference>\" + \"SO# \" + reference1 + \" Del# \" + \n reference2 + \"</CustomerReference>\";\n } else {\n refTag = \n \"<CustomerReference>\" + \"Del# \" + reference1 + \" SO# \" + \n reference2 + \"</CustomerReference>\";\n }\n }\n return refTag;\n\n }", "@Test//ExSkip\n public void fieldNoteRef() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create a bookmark with a footnote that the NOTEREF field will reference.\n insertBookmarkWithFootnote(builder, \"MyBookmark1\", \"Contents of MyBookmark1\", \"Footnote from MyBookmark1\");\n\n // This NOTEREF field will display the number of the footnote inside the referenced bookmark.\n // Setting the InsertHyperlink property lets us jump to the bookmark by Ctrl + clicking the field in Microsoft Word.\n Assert.assertEquals(\" NOTEREF MyBookmark2 \\\\h\",\n insertFieldNoteRef(builder, \"MyBookmark2\", true, false, false, \"Hyperlink to Bookmark2, with footnote number \").getFieldCode());\n\n // When using the \\p flag, after the footnote number, the field also displays the bookmark's position relative to the field.\n // Bookmark1 is above this field and contains footnote number 1, so the result will be \"1 above\" on update.\n Assert.assertEquals(\" NOTEREF MyBookmark1 \\\\h \\\\p\",\n insertFieldNoteRef(builder, \"MyBookmark1\", true, true, false, \"Bookmark1, with footnote number \").getFieldCode());\n\n // Bookmark2 is below this field and contains footnote number 2, so the field will display \"2 below\".\n // The \\f flag makes the number 2 appear in the same format as the footnote number label in the actual text.\n Assert.assertEquals(\" NOTEREF MyBookmark2 \\\\h \\\\p \\\\f\",\n insertFieldNoteRef(builder, \"MyBookmark2\", true, true, true, \"Bookmark2, with footnote number \").getFieldCode());\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n insertBookmarkWithFootnote(builder, \"MyBookmark2\", \"Contents of MyBookmark2\", \"Footnote from MyBookmark2\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.NOTEREF.docx\");\n testNoteRef(new Document(getArtifactsDir() + \"Field.NOTEREF.docx\")); //ExSkip\n }", "protected String usaNote() {\n String testo = VUOTA;\n String tag = \"Note\";\n String ref = \"<references/>\";\n\n testo += LibWiki.setParagrafo(tag);\n testo += A_CAPO;\n testo += ref;\n testo += A_CAPO;\n testo += A_CAPO;\n\n return testo;\n }", "Node getTemplateTextNode();", "public String getADDITIONAL_REFERENCE() {\r\n return ADDITIONAL_REFERENCE;\r\n }", "public String getReferenceId() {\n return refid;\n }", "void setReference(String reference);", "public org.purl.dc.elements.x11.SimpleLiteral getReferences()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.purl.dc.elements.x11.SimpleLiteral target = null;\r\n target = (org.purl.dc.elements.x11.SimpleLiteral)get_store().find_element_user(REFERENCES$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "private FieldPageRef insertFieldPageRef(final DocumentBuilder builder, final String bookmarkName, final boolean insertHyperlink,\n final boolean insertRelativePosition, final String textBefore) throws Exception {\n builder.write(textBefore);\n\n FieldPageRef field = (FieldPageRef) builder.insertField(FieldType.FIELD_PAGE_REF, true);\n field.setBookmarkName(bookmarkName);\n field.setInsertHyperlink(insertHyperlink);\n field.setInsertRelativePosition(insertRelativePosition);\n builder.writeln();\n\n return field;\n }", "@Override\n public String getTag() {\n return this.reference;\n }", "public ScText newIdText()\n {\n return newIdText(\"Id\");\n }", "public ScText newIdText()\n {\n return newIdText(\"Id\");\n }", "public ScText newIdText()\n {\n return newIdText(\"Id\");\n }", "public ScText newIdText()\n {\n return newIdText(\"Id\");\n }", "DataNameReference createDataNameReference();", "public String getRef(){\r\n\t\treturn this.getAttribute(\"ref\").getValue();\r\n\t}", "VariableRef createVariableRef();", "public String generateContents(Collection<Reference> references) {\n String contents = references.stream().map(\n ref -> formatReference(ref)\n ).collect(Collectors.joining(\"\\n\"));\n\n return escapeScandicCharacters(contents);\n }", "String getReferenceType();", "LocalReference createLocalReference();", "public Node getReference() {\n return this.reference;\n }", "public String getRevisionReference();", "public TextBuilder addStaticText(String text){\n if(lastText != null){\n lastText.clear();\n }\n lastText = new TextBuilder(text);\n return lastText;\n }", "public abstract R createReference(T type, Object value);", "private String getRef1Val(String refVal1) {\n logger.info(\"Ref 2 from profile Options is null\");\n String refTag = \"\";\n if (refVal1.equalsIgnoreCase(\"PURCHASE ORDER NUMBER\")) {\n refTag = \n \"<PONumber>\" + reference1 + \"</PONumber>\" + \"<CustomerReference>\" + \n reference2 + \"</CustomerReference>\";\n } else if (refVal1.equalsIgnoreCase(\"SALES ORDER NUMBER\")) {\n refTag = \n \"<CustomerReference>\" + \"Ref# \" + reference2 + \" SO# \" + reference1 + \n \"</CustomerReference>\";\n } else {\n refTag = \n \"<CustomerReference>\" + \"Ref# \" + reference2 + \" Del# \" + reference1 + \n \"</CustomerReference>\";\n }\n return refTag;\n }", "private static void appendAutoTextEntry(GlossaryDocument glossaryDoc, String name, String contents) {\n BuildingBlock buildingBlock = new BuildingBlock(glossaryDoc);\n buildingBlock.setName(name);\n buildingBlock.setGallery(BuildingBlockGallery.AUTO_TEXT);\n buildingBlock.setCategory(\"General\");\n buildingBlock.setBehavior(BuildingBlockBehavior.PARAGRAPH);\n\n Section section = new Section(glossaryDoc);\n section.appendChild(new Body(glossaryDoc));\n section.getBody().appendParagraph(contents);\n buildingBlock.appendChild(section);\n\n glossaryDoc.appendChild(buildingBlock);\n }", "public void setReference(String value, String narrativeText) {\n\t\tthis.getMdht().setText(Util.createReference(value, narrativeText));\n\t}", "VarReference createVarReference();" ]
[ "0.73373723", "0.73362774", "0.695699", "0.695699", "0.6951675", "0.6704501", "0.6704501", "0.6680422", "0.6589227", "0.656188", "0.625201", "0.62219036", "0.6200169", "0.6124568", "0.612287", "0.6113743", "0.6085697", "0.60697925", "0.6025897", "0.60223216", "0.60223216", "0.60223216", "0.6011721", "0.59356624", "0.5905419", "0.58851784", "0.5869966", "0.58439744", "0.58224785", "0.5818532", "0.58083224", "0.5775842", "0.57630515", "0.5746603", "0.57333106", "0.5726624", "0.57156795", "0.5708016", "0.56631577", "0.566129", "0.56605285", "0.564955", "0.5612674", "0.56107646", "0.55920875", "0.55908763", "0.558021", "0.55747336", "0.55726707", "0.55630815", "0.55242693", "0.5502194", "0.54965276", "0.5488982", "0.54749453", "0.54740083", "0.54642856", "0.54593384", "0.5442348", "0.5414914", "0.53959906", "0.5385317", "0.5385012", "0.53778785", "0.5376128", "0.53390414", "0.5333591", "0.5326078", "0.5325799", "0.5325293", "0.53250533", "0.5321102", "0.5321045", "0.5314724", "0.5310582", "0.5308746", "0.52984", "0.5280648", "0.5246716", "0.5243265", "0.5243005", "0.5240171", "0.52383476", "0.52383476", "0.52383476", "0.52383476", "0.5235986", "0.5215599", "0.52138644", "0.5212291", "0.5209516", "0.52057993", "0.51961446", "0.5195371", "0.5195267", "0.5181768", "0.51811314", "0.51747584", "0.5163104", "0.51585996" ]
0.6019516
22
Create and return a lielement for an referencelist The actual fields and which are mandatory for differents styles are implemented here, and no other place
public static DocumentFragment getListElement(Module mod, PIcommand cmd, Reference ref, List<IndexItem> users) { String style = mod.getScriptHandler().getOption(Options.REFERENCE_FORM); DocumentFragment df = mod.getDoc().createDocumentFragment(); Element liElt = mod.getDoc().createElement("li"); liElt.setAttribute("class", "refitem skiptranslate " + style); HashMap<String,String> m_propertMap=ref.m_propertMap; // do IEEE liElt.appendChild(m_propertMap.containsKey(ref.AUTHORS_IN_LIST) ? liElt.appendChild(ref.makePropertyElement(ref.AUTHORS_IN_LIST, mod)) : liElt.appendChild(ref.makePropertyElement("title", mod))); liElt.appendChild(ref.makePropertyElement("year", mod)); if (m_propertMap.containsKey("chaptertitle")) { liElt.appendChild(ref.makePropertyElement("chaptertitle", mod)); } if (m_propertMap.containsKey("journal")) { liElt.appendChild(ref.makePropertyElement("journal", mod)); } if (m_propertMap.containsKey("editor")) { liElt.appendChild(ref.makePropertyElement("editor", mod)); } if (!m_propertMap.containsKey(ref.AUTHORS_IN_LIST)) { liElt.appendChild(ref.makePropertyElement("title", mod)); } if (m_propertMap.containsKey("place")) { liElt.appendChild(ref.makePropertyElement("place", mod)); } if (m_propertMap.containsKey("publisher")) { liElt.appendChild(ref.makePropertyElement("publisher", mod)); } if (m_propertMap.containsKey("pages")) { liElt.appendChild(ref.makePropertyElement("pages", mod)); } if (m_propertMap.containsKey("isbn")) { liElt.appendChild(ref.makePropertyElement("isbn", mod)); } if (m_propertMap.containsKey("text")) { liElt.appendChild(ref.makePropertyElement("text", mod)); } if (m_propertMap.containsKey("uri")) { liElt.appendChild(ref.makeUriElement(m_propertMap.get("uri"), mod)); } if (m_propertMap.containsKey("dateread")) { liElt.appendChild(ref.makePropertyElement("dateread", mod)); } df.appendChild(liElt); return df; //return liElt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LI createLI();", "ListItem createListItem();", "UnorderedListContent createUnorderedListContent();", "ListValue createListValue();", "private void structureListElement() {\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_OPENING_REGEX_MATCHER, \"- \");\n\n // replace closing tag </li> with </br> to separate with other list item\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_CLOSING_REGEX_MATCHER, \"<br>\");\n }", "UL createUL();", "OrderedListContent createOrderedListContent();", "public ListReferenceBased() {\r\n\t numItems = 0; // declares numItems is 0\r\n\t head = null; // declares head is null\r\n }", "@Override\n\tString getTag() {\n\t\treturn \"li\";\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem34() {\n return build_f_AnchorListItem34();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem34() {\n return build_f_AnchorListItem34();\n }", "ListType createListType();", "public MenuListItem(String ref, String rtPic, String sqPic, String head, String desc, String filename) {\n this.ref = ref;\n this.rtPic = rtPic;\n this.sqPic = sqPic;\n this.head = head;\n this.desc = desc;\n this.filename = filename;\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem42() {\n return build_f_AnchorListItem42();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem39() {\n return build_f_AnchorListItem39();\n }", "@Test\n public void fieldStyleRefParagraphNumbers() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create a list based using a Microsoft Word list template.\n List list = doc.getLists().add(com.aspose.words.ListTemplate.NUMBER_DEFAULT);\n\n // This generated list will display \"1.a )\".\n // Space before the bracket is a non-delimiter character, which we can suppress. \n list.getListLevels().get(0).setNumberFormat(\"\\u0000.\");\n list.getListLevels().get(1).setNumberFormat(\"\\u0001 )\");\n\n // Add text and apply paragraph styles that STYLEREF fields will reference.\n builder.getListFormat().setList(list);\n builder.getListFormat().listIndent();\n builder.getParagraphFormat().setStyle(doc.getStyles().get(\"List Paragraph\"));\n builder.writeln(\"Item 1\");\n builder.getParagraphFormat().setStyle(doc.getStyles().get(\"Quote\"));\n builder.writeln(\"Item 2\");\n builder.getParagraphFormat().setStyle(doc.getStyles().get(\"List Paragraph\"));\n builder.writeln(\"Item 3\");\n builder.getListFormat().removeNumbers();\n builder.getParagraphFormat().setStyle(doc.getStyles().get(\"Normal\"));\n\n // Place a STYLEREF field in the header and display the first \"List Paragraph\"-styled text in the document.\n builder.moveToHeaderFooter(HeaderFooterType.HEADER_PRIMARY);\n FieldStyleRef field = (FieldStyleRef) builder.insertField(FieldType.FIELD_STYLE_REF, true);\n field.setStyleName(\"List Paragraph\");\n\n // Place a STYLEREF field in the footer, and have it display the last text.\n builder.moveToHeaderFooter(HeaderFooterType.FOOTER_PRIMARY);\n field = (FieldStyleRef) builder.insertField(FieldType.FIELD_STYLE_REF, true);\n field.setStyleName(\"List Paragraph\");\n field.setSearchFromBottom(true);\n\n builder.moveToDocumentEnd();\n\n // We can also use STYLEREF fields to reference the list numbers of lists.\n builder.write(\"\\nParagraph number: \");\n field = (FieldStyleRef) builder.insertField(FieldType.FIELD_STYLE_REF, true);\n field.setStyleName(\"Quote\");\n field.setInsertParagraphNumber(true);\n\n builder.write(\"\\nParagraph number, relative context: \");\n field = (FieldStyleRef) builder.insertField(FieldType.FIELD_STYLE_REF, true);\n field.setStyleName(\"Quote\");\n field.setInsertParagraphNumberInRelativeContext(true);\n\n builder.write(\"\\nParagraph number, full context: \");\n field = (FieldStyleRef) builder.insertField(FieldType.FIELD_STYLE_REF, true);\n field.setStyleName(\"Quote\");\n field.setInsertParagraphNumberInFullContext(true);\n\n builder.write(\"\\nParagraph number, full context, non-delimiter chars suppressed: \");\n field = (FieldStyleRef) builder.insertField(FieldType.FIELD_STYLE_REF, true);\n field.setStyleName(\"Quote\");\n field.setInsertParagraphNumberInFullContext(true);\n field.setSuppressNonDelimiters(true);\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.STYLEREF.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.STYLEREF.docx\");\n\n field = (FieldStyleRef) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_STYLE_REF, \" STYLEREF \\\"List Paragraph\\\"\", \"Item 1\", field);\n Assert.assertEquals(\"List Paragraph\", field.getStyleName());\n\n field = (FieldStyleRef) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_STYLE_REF, \" STYLEREF \\\"List Paragraph\\\" \\\\l\", \"Item 3\", field);\n Assert.assertEquals(\"List Paragraph\", field.getStyleName());\n Assert.assertTrue(field.getSearchFromBottom());\n\n field = (FieldStyleRef) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_STYLE_REF, \" STYLEREF Quote \\\\n\", \"b )\", field);\n Assert.assertEquals(\"Quote\", field.getStyleName());\n Assert.assertTrue(field.getInsertParagraphNumber());\n\n field = (FieldStyleRef) doc.getRange().getFields().get(3);\n\n TestUtil.verifyField(FieldType.FIELD_STYLE_REF, \" STYLEREF Quote \\\\r\", \"b )\", field);\n Assert.assertEquals(\"Quote\", field.getStyleName());\n Assert.assertTrue(field.getInsertParagraphNumberInRelativeContext());\n\n field = (FieldStyleRef) doc.getRange().getFields().get(4);\n\n TestUtil.verifyField(FieldType.FIELD_STYLE_REF, \" STYLEREF Quote \\\\w\", \"1.b )\", field);\n Assert.assertEquals(\"Quote\", field.getStyleName());\n Assert.assertTrue(field.getInsertParagraphNumberInFullContext());\n\n field = (FieldStyleRef) doc.getRange().getFields().get(5);\n\n TestUtil.verifyField(FieldType.FIELD_STYLE_REF, \" STYLEREF Quote \\\\w \\\\t\", \"1.b)\", field);\n Assert.assertEquals(\"Quote\", field.getStyleName());\n Assert.assertTrue(field.getInsertParagraphNumberInFullContext());\n Assert.assertTrue(field.getSuppressNonDelimiters());\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem18() {\n return build_f_AnchorListItem18();\n }", "@Override\n public void definitionListItem_()\n {\n }", "String createListItem(String list, int accountId);", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem23() {\n return build_f_AnchorListItem23();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem23() {\n return build_f_AnchorListItem23();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem19() {\n return build_f_AnchorListItem19();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem29() {\n return build_f_AnchorListItem29();\n }", "private void createNewListTextField() {\n\t\tjpIntroduceNameList = new JPanel();\n\t\tjpIntroduceNameList.setOpaque(false);\n\t\tjertfTextList = new JERoundTextField(15,15,200);\n\t\tjertfTextList.setVisible(true);\n\t\tjpIntroduceNameList.setVisible(false);\n\t\tjpIntroduceNameList.add(jertfTextList);\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem22() {\n return build_f_AnchorListItem22();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem28() {\n return build_f_AnchorListItem28();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem21() {\n return build_f_AnchorListItem21();\n }", "private Listitem constructListItem(final String name,String label, String imageSrc, final String locationUri) {\n\t\tListitem tb = new Listitem();\n\t\t\n\t\ttb.setImage(imageSrc);\n\t\ttb.setLabel(label);\n\t\ttb.setStyle(\"padding: 2px; border-spacing: 0\");\n\n\t\t\n\t\t//new and register listener for events\n\t\tEventListener<Event> onActionListener = new SerializableEventListener<Event>(){\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic void onEvent(Event event) throws Exception {\n\t\t\t\t//redirect current url to new location\n\t\t\t\tif(locationUri.startsWith(\"http\")){\n\t\t\t\t\t//open a new browser tab\n\t\t\t\t\tExecutions.getCurrent().sendRedirect(locationUri);\n\t\t\t\t}else{\n\t\t\t\t\t//use iterable to find the first include only\n\t\t\t\t\tInclude include = (Include)Selectors.iterable(eastSideBarTabbox.getPage(), \"#mainInclude\").iterator().next();\n\t\t\t\t\tinclude.setSrc(locationUri);\n\t\t\t\t\tSessions.getCurrent().setAttribute(\"CURRENT_PAGE\", name);\n\t\t\t\t\t\n\t\t\t\t\t//advance bookmark control, \n\t\t\t\t\t//bookmark with a prefix\n\t\t\t\t\tif(name!=null){\n\n\t\t\t\t\t\tgetPage().getDesktop().setBookmark(Context.BOOKMARK_SEPARATOR + name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\t\t\n\t\ttb.addEventListener(Events.ON_CLICK, onActionListener);\n\n\t\treturn tb;\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem74() {\n return build_f_AnchorListItem74();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem58() {\n return build_f_AnchorListItem58();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem58() {\n return build_f_AnchorListItem58();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem27() {\n return build_f_AnchorListItem27();\n }", "List<PsdReferenceObligationPair> wrapReferenceObligPair(CDSReferenceObligationPairs refObPairsXmlObject, List<PsdReferenceEntity> listReferenceEntity);", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem15() {\n return build_f_AnchorListItem15();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem32() {\n return build_f_AnchorListItem32();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem45() {\n return build_f_AnchorListItem45();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem44() {\n return build_f_AnchorListItem44();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem43() {\n return build_f_AnchorListItem43();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem43() {\n return build_f_AnchorListItem43();\n }", "@Override\n public void definitionListItem()\n {\n }", "Rule ListType() {\n // Push 1 ListTypeNode onto the value stack\n return Sequence(\n \"list \",\n \"<\",\n FieldType(),\n \"> \",\n Optional(CppType()),\n actions.pushListTypeNode());\n }", "public ReferenceList getRefList( )\n {\n return _refList;\n }", "@Override\n\tpublic void createHtml(ModelItemList list) {\n\t\t\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem69() {\n return build_f_AnchorListItem69();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem69() {\n return build_f_AnchorListItem69();\n }", "public DList()\r\n {\r\n startTag=\"DL\";\r\n endTag=\"/DL\"; \r\n }", "public RDFList createRDFList(List<Expression> list, int arobase) {\r\n RDFList rlist = new RDFList(newBlankNode(), list); \r\n if (arobase == L_DEFAULT){\r\n arobase = listType;\r\n }\r\n switch (arobase){\r\n \r\n case L_LIST: \r\n rlist = complete(rlist);\r\n break;\r\n \r\n case L_PATH:\r\n rlist = path(rlist);\r\n break;\r\n }\r\n return rlist;\r\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem35() {\n return build_f_AnchorListItem35();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem35() {\n return build_f_AnchorListItem35();\n }", "List<PsdReferenceEntity> wrapReferenceEntity(List<CDSReferenceEntity> xmlReferEntitiesList);", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem13() {\n return build_f_AnchorListItem13();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem13() {\n return build_f_AnchorListItem13();\n }", "ListItem(Element[] elements) {\n\t\tsuper(elements);\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem14() {\n return build_f_AnchorListItem14();\n }", "private NodeList createListWrap(NodeList head, FixData fixedList) {\n if (head == null) {\n head = new NodeList(fixedList);\n head.connectNext(null);\n return head;\n }\n head.connectNext(createListWrap(head.returnNext(), fixedList));\n return head;\n }", "public Content createReferenceContent(int timestart, ArrayList<Point3f> ref){\r\n\t\tContent refcont;\r\n\t\tif (ref.size() == 1)\r\n\t\t\t// reference: single point\r\n\t\t\trefcont = createPointReferenceContent(timestart, ref);\r\n\t\telse\r\n\t\t\t//reference: a bar\r\n\t\t\trefcont = createLineReferenceContent(timestart, ref);\r\n\t\treturn refcont;\r\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem76() {\n return build_f_AnchorListItem76();\n }", "public String getElement()\n\t{\n\t\treturn \"list\";\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem82() {\n return build_f_AnchorListItem82();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem33() {\n return build_f_AnchorListItem33();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem33() {\n return build_f_AnchorListItem33();\n }", "SectionList createSectionList();", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem10() {\n return build_f_AnchorListItem10();\n }", "public void createlist(String name,String description){\r\n\t\tString lstname = getValue(name);\r\n\t\tString lstdescription = getValue(description);\r\n\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Link should be created with name and description\");\r\n\t\ttry{\r\n\r\n\t\t\twaitForElement(locator_split(\"lnkcreatlist\"));\r\n\t\t\tclick(locator_split(\"lnkcreatlist\")); \r\n\r\n\t\t\tsleep(1000);\r\n\t\t\twaitForElement(locator_split(\"txtlistname\"));\r\n\t\t\tsendKeys(locator_split(\"txtlistname\"), lstname);\r\n\r\n\t\t\twaitForElement(locator_split(\"txtlistdesc\"));\r\n\t\t\tsendKeys(locator_split(\"txtlistdesc\"), lstdescription);\r\n\r\n\t\t\twaitForElement(locator_split(\"rdemailremainder\"));\r\n\t\t\tclick(locator_split(\"rdemailremainder\")); \r\n\r\n\t\t\twaitForElement(locator_split(\"clksavelist\"));\r\n\t\t\tclick(locator_split(\"clksavelist\")); \r\n\r\n\t\t\tSystem.out.println(\"List is created\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Favorities Link is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Favorities is not clicked \"+elementProperties.getProperty(\"lnkFavorities\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkFavorities\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\t\r\n\r\n\r\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem17() {\n return build_f_AnchorListItem17();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem40() {\n return build_f_AnchorListItem40();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem57() {\n return build_f_AnchorListItem57();\n }", "ListString createListString();", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem30() {\n return build_f_AnchorListItem30();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem65() {\n return build_f_AnchorListItem65();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem65() {\n return build_f_AnchorListItem65();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem80() {\n return build_f_AnchorListItem80();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem68() {\n return build_f_AnchorListItem68();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem9() {\n return build_f_AnchorListItem9();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem66() {\n return build_f_AnchorListItem66();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem11() {\n return build_f_AnchorListItem11();\n }", "protected void setRefList( ReferenceList refList )\n {\n _refList = refList;\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem24() {\n return build_f_AnchorListItem24();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem24() {\n return build_f_AnchorListItem24();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem54() {\n return build_f_AnchorListItem54();\n }", "@Test//ExSkip\n public void fieldRef() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n builder.startBookmark(\"MyBookmark\");\n builder.insertFootnote(FootnoteType.FOOTNOTE, \"MyBookmark footnote #1\");\n builder.write(\"Text that will appear in REF field\");\n builder.insertFootnote(FootnoteType.FOOTNOTE, \"MyBookmark footnote #2\");\n builder.endBookmark(\"MyBookmark\");\n builder.moveToDocumentStart();\n\n // We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at.\n builder.getListFormat().applyNumberDefault();\n builder.getListFormat().getListLevel().setNumberFormat(\"> \\u0000\");\n\n // Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes.\n FieldRef field = insertFieldRef(builder, \"MyBookmark\", \"\", \"\\n\");\n field.setIncludeNoteOrComment(true);\n field.setInsertHyperlink(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\f \\\\h\");\n\n // Insert a REF field, and display whether the referenced bookmark is above or below it.\n field = insertFieldRef(builder, \"MyBookmark\", \"The referenced paragraph is \", \" this field.\\n\");\n field.setInsertRelativePosition(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\p\");\n\n // Display the list number of the bookmark as it appears in the document.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's paragraph number is \", \"\\n\");\n field.setInsertParagraphNumber(true);\n\n Assert.assertEquals(\" REF MyBookmark \\\\n\", field.getFieldCode());\n\n // Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's paragraph number, non-delimiters suppressed, is \", \"\\n\");\n field.setInsertParagraphNumber(true);\n field.setSuppressNonDelimiters(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\n \\\\t\");\n\n // Move down one list level.\n builder.getListFormat().setListLevelNumber(builder.getListFormat().getListLevelNumber() + 1)/*Property++*/;\n builder.getListFormat().getListLevel().setNumberFormat(\">> \\u0001\");\n\n // Display the list number of the bookmark and the numbers of all the list levels above it.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's full context paragraph number is \", \"\\n\");\n field.setInsertParagraphNumberInFullContext(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\w\");\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n\n // Display the list level numbers between this REF field, and the bookmark that it is referencing.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's relative paragraph number is \", \"\\n\");\n field.setInsertParagraphNumberInRelativeContext(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\r\");\n\n // At the end of the document, the bookmark will show up as a list item here.\n builder.writeln(\"List level above bookmark\");\n builder.getListFormat().setListLevelNumber(builder.getListFormat().getListLevelNumber() + 1)/*Property++*/;\n builder.getListFormat().getListLevel().setNumberFormat(\">>> \\u0002\");\n\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.REF.docx\");\n testFieldRef(new Document(getArtifactsDir() + \"Field.REF.docx\")); //ExSkip\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem81() {\n return build_f_AnchorListItem81();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem71() {\n return build_f_AnchorListItem71();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem41() {\n return build_f_AnchorListItem41();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem56() {\n return build_f_AnchorListItem56();\n }", "public ListElement()\n\t{\n\t\tthis(null, null, null); //invokes constructor with 3 arguments\n\t}", "int createList(int listData) {\n\t\tint list = newList_();\n\t\t// m_lists.set_field(list, 0, null_node());//head\n\t\t// m_lists.set_field(list, 1, null_node());//tail\n\t\t// m_lists.set_field(list, 2, null_node());//prev list\n\t\tm_lists.setField(list, 3, m_list_of_lists); // next list\n\t\tm_lists.setField(list, 4, 0);// node count in the list\n\t\tm_lists.setField(list, 5, listData);\n\t\tif (m_list_of_lists != nullNode())\n\t\t\tsetPrevList_(m_list_of_lists, list);\n\n\t\tm_list_of_lists = list;\n\t\treturn list;\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem59() {\n return build_f_AnchorListItem59();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem59() {\n return build_f_AnchorListItem59();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem16() {\n return build_f_AnchorListItem16();\n }", "public static List<ReferenceDocModel> buildTestReferenceDocModelList()\n {\n List<ReferenceDocModel> referenceDocModelList = new ArrayList<>();\n\n referenceDocModelList.add( buildTestReferenceDocModel( \"ref doc model A\" ) );\n referenceDocModelList.add( buildTestReferenceDocModel( \"ref doc model B\" ) );\n referenceDocModelList.add( buildTestReferenceDocModel( \"ref doc model C\" ) );\n return referenceDocModelList;\n }", "public static ElementInsertionList create()\n {\n return new ElementInsertionList();\n }", "public TDListElement(long id, LEType type, Date date){\n\t\tthis.id = id;\n\t\tthis.elemType = type;\n\t\tthis.date = date;\n\t}", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem8() {\n return build_f_AnchorListItem8();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem64() {\n return build_f_AnchorListItem64();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem64() {\n return build_f_AnchorListItem64();\n }", "public Content createLineReferenceContent(int timestart, ArrayList<Point3f> ref){\r\n\t\tList<Point3f> referenceline = Mesh_Maker.createTube(\r\n\t\t\t\tnew double[]{ref.get(0).x, ref.get(1).x},\r\n\t\t\t\tnew double[]{ref.get(0).y, ref.get(1).y},\r\n\t\t\t\tnew double[]{ref.get(0).z, ref.get(1).z},\r\n\t\t\t\tnew double[]{1, 1},\r\n\t\t\t\t12, false); //true makes cones\r\n\t\tCustomTriangleMesh refmesh = new CustomTriangleMesh(referenceline, new Color3f(1,0,0), 0.0f);\r\n\t\tContent refcont = ContentCreator.createContent(refmesh, \"referenceLine\", timestart);\r\n\t\treturn refcont;\r\n\t}", "@Override\n public Writable formatEntity(Entity entity) {\n /* Create HTML list. */\n HtmlElem list = new HtmlElem(\"ul\");\n /* Get the class. */\n Class _Class = (Class) entity;\n /* Fill the list that will represent the class with its values. */\n list.with(li(text(\"Class ID: \" + _Class.getId())))\n .with(li(text(\"Course Name: \" + _Class.getcName())))\n .with(li(text(\"Academic Year: \" + _Class.getaYear())))\n .with(li(text(\"Academic Semester: \" + _Class.getaSemester())));\n return list;\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem25() {\n return build_f_AnchorListItem25();\n }", "private org.gwtbootstrap3.client.ui.AnchorListItem get_f_AnchorListItem25() {\n return build_f_AnchorListItem25();\n }" ]
[ "0.7131844", "0.6506517", "0.6251373", "0.62225455", "0.62191707", "0.6172313", "0.60193235", "0.59873205", "0.5941725", "0.5938451", "0.5938451", "0.5927676", "0.58994865", "0.5839678", "0.5832849", "0.5820074", "0.5809365", "0.5789927", "0.57352", "0.5734606", "0.5734606", "0.57168776", "0.5713274", "0.5696588", "0.566239", "0.56443125", "0.5632987", "0.5630976", "0.56168836", "0.55848616", "0.55848616", "0.5574282", "0.55581105", "0.5557012", "0.55510134", "0.5549464", "0.55476177", "0.5547003", "0.5547003", "0.5543164", "0.55421495", "0.55402625", "0.5528746", "0.55263203", "0.55263203", "0.55213237", "0.5519201", "0.55121416", "0.55121416", "0.54877234", "0.5475136", "0.5475136", "0.54688305", "0.54669696", "0.5464394", "0.54617274", "0.5438623", "0.542471", "0.5419933", "0.54122365", "0.54122365", "0.5405863", "0.5396098", "0.53927505", "0.53920406", "0.5385592", "0.53801256", "0.53757024", "0.53720444", "0.5372028", "0.5372028", "0.5365426", "0.5364614", "0.535695", "0.5356751", "0.53521603", "0.534432", "0.53405195", "0.53405195", "0.532625", "0.5319699", "0.53131086", "0.5308835", "0.5305377", "0.5296557", "0.5285597", "0.52830356", "0.5280972", "0.5280972", "0.52708614", "0.5270845", "0.52687204", "0.5267796", "0.52491814", "0.5247476", "0.5247476", "0.5247368", "0.5242143", "0.52352047", "0.52352047" ]
0.63150555
2
/ To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. Observer interface to be notified when sensor values have changed or an error occured.
public interface ISpO2Observer { /** * Different error states * */ public enum ErrorState { /** sensor ok*/ OK, /** sensor disconnected*/ SensorDisconnect, /** finger is out*/ FingerOut, /** perfusion is low*/ LowPerfusion, /** selftest was not completeted successfully*/ SelftestError} /** * Is called when a new sensor value was received. * @param pulse the current pulse value * @param spo2 the spo2 value */ void onNewPulse(int pulse, int spo2 ); /** * Is called when a error occured * @param oxiError the error */ void onErrorState(ErrorState oxiError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface OnSensorValueChangeListener {\n public void onSensorValueChanged(int newVal);\n}", "public interface Observer {\n public void update(float temperature , float pressure , float humdity);\n}", "public void onSensorChanged() {\n\t\tsensorChanged();\n\t}", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\n\t}", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\n\t}", "public interface Observer {\n\n void update(float temperature,float humidity,float pressure);\n\n}", "public interface Observer {\n\n /**\n * This is the function that gets ccalled when the temperature gets updated.\n *\n * @param temperature A double that contains the temperature in kelvin.\n * @param maxTemperature A double that contains the maximum temperature in kelvin.\n * @param minTemperature A double that conatins the minimum temperature in kelvin.\n */\n void update(double temperature, double maxTemperature, double minTemperature, int humidity);\n}", "public interface Observer {\n public void update(float temp, float humidity, float pressure);\n}", "public interface Observer {\n public void update(float temp, float humidity, float pressure);\n}", "@Override\n public void onSensorChanged(SensorEvent event) {\n long now = SystemClock.elapsedRealtime();\n\n long deltaMs = 0;\n if (mLastUpdateTS != 0) {\n deltaMs = now - mLastUpdateTS;\n if (mUpdateTargetMs > 0 && deltaMs < mUpdateTargetMs) {\n // New sample is arriving too fast. Discard it.\n return;\n }\n }\n\n // Format and post message for the emulator.\n float[] values = event.values;\n final int len = values.length;\n\n mChangeMsg.order(getEndian());\n mChangeMsg.position(0);\n mChangeMsg.putInt(getType());\n mChangeMsg.putFloat(values[0]);\n if (len > 1) {\n mChangeMsg.putFloat(values[1]);\n if (len > 2) {\n mChangeMsg.putFloat(values[2]);\n }\n }\n postMessage(ProtocolConstants.SENSORS_SENSOR_EVENT, mChangeMsg);\n\n // Computes average update time for this sensor and average globally.\n if (mLastUpdateTS != 0) {\n if (mGlobalAvgUpdateMs != 0) {\n mGlobalAvgUpdateMs = (mGlobalAvgUpdateMs + deltaMs) / 2;\n } else {\n mGlobalAvgUpdateMs = deltaMs;\n }\n }\n mLastUpdateTS = now;\n\n // Update the UI for the sensor, with a static throttling of 10 fps max.\n if (hasUiHandler()) {\n if (mLastDisplayTS != 0) {\n long uiDeltaMs = now - mLastDisplayTS;\n if (uiDeltaMs < 1000 / 4 /* 4fps in ms */) {\n // Skip this UI update\n return;\n }\n }\n mLastDisplayTS = now;\n\n mValues[0] = values[0];\n if (len > 1) {\n mValues[1] = values[1];\n if (len > 2) {\n mValues[2] = values[2];\n }\n }\n mValue = null;\n\n Message msg = Message.obtain();\n msg.what = SENSOR_DISPLAY_MODIFIED;\n msg.obj = MonitoredSensor.this;\n notifyUiHandlers(msg);\n }\n\n if (DEBUG) {\n long now2 = SystemClock.elapsedRealtime();\n long processingTimeMs = now2 - now;\n Log.d(TAG, String.format(\"glob %d - local %d > target %d - processing %d -- %s\",\n mGlobalAvgUpdateMs, deltaMs, mUpdateTargetMs, processingTimeMs,\n mSensor.getName()));\n }\n }", "@Override\n public void OnSensorChanged(SsensorEvent event) {\n Ssensor sIr = event.sensor;\n StringBuffer sb = new StringBuffer();\n sb.append(\"==== Sensor Information ====\\n\")\n .append(\"Name : \" + sIr.getName() + \"\\n\")\n .append(\"Vendor : \" + sIr.getVendor() + \"\\n\")\n .append(\"Type : \" + sIr.getType() + \"\\n\")\n .append(\"SDK Version : \"\n + mSsensorExtension.getVersionName() + \"\\n\")\n .append(\"MaxRange : \" + sIr.getMaxRange() + \"\\n\")\n .append(\"Resolution : \" + sIr.getResolution() + \"\\n\")\n .append(\"FifoMaxEventCount : \" + sIr.getFifoMaxEventCount()\n + \"\\n\")\n .append(\"Power : \" + sIr.getPower() + \"\\n\")\n .append(\"----------------------------\\n\")\n .append(\"RED LED RAW DATA(HRM) : \" + event.values[0] + \"\\n\");\n tRED.setText(sb.toString());\n }", "@Override\r\n\t\t\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\t\ttemp_m[0] = event.values[0];\r\n\t\t\t\ttemp_m[1] = event.values[1];\r\n\t\t\t\ttemp_m[2] = event.values[2];\r\n\t\t\t}", "public void handleSensorEvents(){\n\t}", "@Override\n public void OnSensorChanged(SsensorEvent event) {\n Ssensor sIr = event.sensor;\n StringBuffer sb = new StringBuffer();\n sb.append(\"==== Sensor Information ====\\n\")\n .append(\"Name : \" + sIr.getName() + \"\\n\")\n .append(\"Vendor : \" + sIr.getVendor() + \"\\n\")\n .append(\"Type : \" + sIr.getType() + \"\\n\")\n .append(\"SDK Version : \"\n + mSsensorExtension.getVersionName() + \"\\n\")\n .append(\"MaxRange : \" + sIr.getMaxRange() + \"\\n\")\n .append(\"Resolution : \" + sIr.getResolution() + \"\\n\")\n .append(\"FifoMaxEventCount : \" + sIr.getFifoMaxEventCount()\n + \"\\n\").append(\"Power : \" + sIr.getPower() + \"\\n\")\n .append(\"----------------------------\\n\")\n .append(\"IR RAW DATA(HRM) : \" + event.values[0] + \"\\n\");\n tIR.setText(sb.toString());\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n float[] valuesCopy = event.values.clone();\n\n if (uptime == 0) {\n uptime = event.timestamp;\n }\n\n double x = (double) ((event.timestamp - uptime))/1000000000.0;\n this.addValues(x, valuesCopy);\n\n TextView xAxisValue = (TextView) findViewById(R.id.xAxisValue);\n xAxisValue.setText(Float.toString(valuesCopy[0]) + \" \" + STI.getUnitString(sensorType));\n\n if (STI.getNumberValues(sensorType) > 1) {\n //set y value to textfield\n TextView yAxisValue = (TextView) findViewById(R.id.yAxisValue);\n yAxisValue.setText(Float.toString(valuesCopy[1]) + \" \" + STI.getUnitString(sensorType));\n\n //set z value to textfield\n TextView zAxisValue = (TextView) findViewById(R.id.zAxisValue);\n zAxisValue.setText(Float.toString(valuesCopy[2]) + \" \" + STI.getUnitString(sensorType));\n }\n }", "public interface SensorUpdateCallback {\n void onBearingValue(float f);\n}", "public void logSensorData () {\n\t}", "public void onSensorChanged(SensorEvent event) {\n\t\tif(event.sensor.getType() == Sensor.TYPE_PROXIMITY){\n\t\tproxview.setText(\"\\n\\n\"+\"PROXIMITY\"+\"\\n\"+String.valueOf(event.values[0]));\n\t\t\n\t\t\n\t\t}\n\t\tif(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){\n\t\t\t\n\t\taccview.setText(\"ACCELEROMETER\"+\"\\n\"+\"X: \"+event.values[0]+\"\\nY: \"+event.values[1]+\"\\nZ: \"+event.values[2]);\n\t\t\n\t\tdouble p = event.values[0];\n\t\tif(p<0.0)\n\t\t{mp.pause();}\n\t\telse{\n\t\t\tif(mp.isPlaying())\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{mp.start();}\n\t\t}\n\t\t\n\t}\n\t\tif(event.sensor.getType() == Sensor.TYPE_LIGHT){\n\t\t\t\n\t\t\tliview.setText(\"LIGHT\"+\"\\n\"+String.valueOf(event.values[0]));\n\t\t\t\n\t\t}\n}", "@Override\n public void OnAccuracyChanged(Ssensor arg0, int arg1) {\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n deltaX = Math.abs(lastX - event.values[0]);\n deltaY = Math.abs(lastY - event.values[1]);\n deltaZ = Math.abs(lastZ - event.values[2]);\n\n // if the change is below 5, it is just plain noise\n if (deltaX < 5)\n deltaX = 0;\n if (deltaY < 5)\n deltaY = 0;\n if (deltaZ < 5)\n deltaZ = 0;\n\n // set the last know values of x,y,z\n lastX = event.values[0];\n lastY = event.values[1];\n lastZ = event.values[2];\n\n vibrate();\n\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\tMessage msg = null;\n\t\tfloat values[] = event.values;\n\t\tsynchronized (this) { \n\t\t\tswitch(event.sensor.getType()) {\n\t\t\t/** 4.LIGHT:SensorEvent type is TYPE_LIGHT */\n\t\t\tcase Sensor.TYPE_LIGHT:\n\t\t\t\tsendLSensorChangedMSG(values, msg);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t} // end of switch(event.sensor.getType())\n\t\t} // end of synchronized (this)\n\t}", "public interface Sensor {\n\n\n\n\n /**\n * Each sensor simulator must collect and\n * report on the temperature of the oven simulator every 100 milliseconds.\n *\n * Each report must include a time stamp and a sensor identifier.\n */\n public abstract void temperatureReport();\n\n public abstract void timer(long milliseconds);\n\n public abstract void updateTemperature(int ovenTemperature);\n\n public abstract void updateTimestamp();\n\n /**\n * To set sensor on or off.\n * @param state set sensor on or off based on oven.\n */\n public abstract void setSensorState(boolean state);\n\n\n\n}", "@Override\r\n\t\t\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\t\ttemp_r[0] = event.values[0];\r\n\t\t\t\ttemp_r[1] = event.values[1];\r\n\t\t\t\ttemp_r[2] = event.values[2];\r\n\t\t\t\t// TipsTextView.setText(String.valueOf(temp_r[0]) + \" \"\r\n\t\t\t\t// + String.valueOf(temp_r[1]) + \" \"\r\n\t\t\t\t// + String.valueOf(temp_r[2]));\r\n\t\t\t}", "@Override\r\n public final void onSensorChanged(SensorEvent event) {\n double a0 = (double) event.values[0];\r\n double a1 = (double) event.values[1];\r\n double a2 = (double) event.values[2];\r\n\r\n double a = sqrt(a0*a0+a1*a1+a2*a2);\r\n\r\n // Do something with this sensor value.\r\n\r\n TextView textView = (TextView) findViewById(R.id.text_box2);\r\n textView.setText(Double.toString(a));\r\n\r\n if(count<size_accels) {\r\n accelerations[count] = a;\r\n times[count] = event.timestamp;\r\n }\r\n count = count + 1;\r\n }", "public interface LightSensorListener {\r\n\t/**\r\n\t * \r\n\t * When this class is being implemented, this class will be called upon when\r\n\t * one of the light sensors' state changes.\r\n\t * \r\n\t * @param position\r\n\t * the position of the sensor used\r\n\t * @param updatingsensor\r\n\t * the sensor that is been updated\r\n\t * @param oldValue\r\n\t * the value before the change\r\n\t * @param newValue\r\n\t * the value after the change\r\n\t */\r\n\tpublic void lightSensorChanged(Position position,\r\n\t\t\tUpdatingSensor updatingsensor, float oldValue, float newValue);\r\n}", "@Override\n public void onSensorChanged(SensorEvent event)\n {\n // Get the sensor which has triggered the event\n\n Sensor sensor = event.sensor;\n\n // Perform differing functionality depending upon\n // the sensor type (caller)\n\n switch (event.sensor.getType())\n {\n case Sensor.TYPE_STEP_COUNTER:\n\n if (reportedSteps < 1){\n\n // Log the initial value\n\n reportedSteps = (int)event.values [0];\n }\n\n // Calculate steps taken based on\n // first value received.\n\n stepsTaken = (int)event.values [0] - reportedSteps;\n\n // Output the value to the simple GUI\n\n countText.setText(\"Cnt: \" + stepsTaken);\n\n break;\n\n case Sensor.TYPE_STEP_DETECTOR:\n\n // Increment the step detector count\n\n stepDetector++;\n\n // Output the value to the simple GUI\n\n detectText.setText(\"Det: \" + stepDetector);\n\n break;\n\n case Sensor.TYPE_ACCELEROMETER:\n\n // Get the accelerometer values and set them to a string with 2dp\n\n String x = String.format(\"%.02f\", event.values[0]);\n String y = String.format(\"%.02f\", event.values[1]);\n String z = String.format(\"%.02f\", event.values[2]);\n\n // Output the string to the GUI\n\n accelText.setText(\"Acc:\" + x + \",\" + y + \",\" + z);\n\n break;\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n timestamp = event.timestamp;\n gyroX = event.values[0];\n gyroY = event.values[1];\n gyroZ = event.values[2];\n\n this.setChanged();\n this.notifyObservers(Sensor.TYPE_GYROSCOPE);\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n // Send data to phone\n if (count == 5) {\n count = 0;\n// Log.d(\"hudwear\", \"send accel data to mobile...\"\n// + \"\\nx-axis: \" + event.values[0]\n// + \"\\ny-axis: \" + event.values[1]\n// + \"\\nz-axis: \" + event.values[2]\n// );\n// Log.d(\"hudwear\", \"starting new task.\");\n\n if (connected)\n Log.d(\"atest\", \"values: \" + event.values[0] + \", \" + event.values[1] + \", \" + event.values[2]);\n// new DataTask().execute(new Float[]{event.values[0], event.values[1], event.values[2]});\n }\n else count++;\n }\n }", "@Override\r\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\r\n\t\tax = - event.values[0] / 7;\r\n\t\tay = event.values[1] / 7;\r\n\t}", "@Override\n public void onSensorChanged(SensorEvent event) {\n textView.setText(event.values[0]+\"\\n\"+event.values[1]+\"\\n\"+event.values[2]);\n\n }", "public void sensorSystem() {\n\t}", "RegisterSensor() {\n }", "public void onSensorChanged(int sensor, float[] values) {\n\t\t\t\n\t\t\t// grab the values required to respond to user movement.\n\t\t\tmAccelX = (float) (0.2 * values[0]);\n\t\t\tmAccelY = (float) (0.2 * values[1]);\n\t\t\t// mAccelZ = values[2];\n\t\t\tinvalidate();\n\t\t}", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n Sensor mySensor = event.sensor;\n\n //double checking if we are referencing the correct sensor type\n if(mySensor.getType()==Sensor.TYPE_ACCELEROMETER)\n {\n //reading the sensor values\n // x- axis lateral movement\n float x = event.values[0];\n //y axis vertical movement\n float y = event.values[1];\n //z-axis movement in and out of the plane\n float z= event.values[2];\n mAccelLast = mAccelCurrent;\n mAccelCurrent = (float) Math.sqrt((double) (x*x + y*y + z*z));\n float delta = mAccelCurrent - mAccelLast;\n mAccel = mAccel * 0.9f + delta; // perform low-cut filter\n displayAcceleration();\n }\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n Sensor sensor=event.sensor;\n mMeasure.setMesureX(event.values[0]);\n mMeasure.setMesureY(event.values[1]);\n mMeasure.setMesureZ(event.values[2]);\n switch(sensor.getType()){\n case Sensor.TYPE_ACCELEROMETER:\n mTextArea.getTextValue1().setText(\"X=\" + (double)Math.round(mMeasure.getMesureX() * 100) / 100);\n mTextArea.getTextValue2().setText(\"Y=\" + (double)Math.round(mMeasure.getMesureY() * 100) / 100);\n mTextArea.getTextValue3().setText(\"Z=\" + (double)Math.round(mMeasure.getMesureZ() * 100) / 100);\n System.out.println(\"\\n\");\n System.out.println(\"Acceleration measure\\n\");\n System.out.println(\"time of the new measured value= \"+event.timestamp+ \"\\n\"+\"x=\"+event.values[0]+\" y=\"+event.values[1]+\" z=\"+event.values[2]);\n System.out.println(\"\\n\");\n break;\n case Sensor.TYPE_MAGNETIC_FIELD:\n mTextArea.getTextValue1().setText(\"X=\" + (double)Math.round(mMeasure.getMesureX()* 100) / 100);\n mTextArea.getTextValue2().setText(\"Y=\" + (double)Math.round(mMeasure.getMesureY() * 100) / 100);\n mTextArea.getTextValue3().setText(\"Z=\" + (double)Math.round(mMeasure.getMesureZ() * 100) / 100);\n System.out.println(\"\\n\");\n System.out.println(\"Magnetic field measure\");\n System.out.println(\"time of the new measured value= \"+event.timestamp+ \"\\n\"+\"x=\"+event.values[0]+\" y=\"+event.values[1]+\" z=\"+event.values[2]);\n System.out.println(\"\\n\");\n break;\n case Sensor.TYPE_PROXIMITY:\n if (mMeasure.getMesureX()==0){\n mTextArea.getTextValue1().setText(\"Object detected\");\n mTextArea.getTextValue1().setBackgroundColor(Color.GREEN);\n } else {\n mTextArea.getTextValue1().setText(\"no object detected\");\n mTextArea.getTextValue1().setBackgroundColor(0xffffffff);\n }\n //mTextArea.getTextValue1().setText(\"\"+mMeasure.getMesureX());\n\n System.out.println(\"\\n\");\n System.out.println(\"Proximity measure\\n\");\n System.out.println(\"time of the new measured value= \"+event.timestamp+ \"\\n\"+\"x=\"+event.values[0]);\n System.out.println(\"\\n\");\n break;\n case Sensor.TYPE_LIGHT:\n mTextArea.getTextValue1().setText(\"\" + (double)Math.round(mMeasure.getMesureX() * 100) / 100);\n System.out.println(\"\\n\");\n System.out.println(\"Luminosity measure\\n\");\n System.out.println(\"time of the new measured value= \"+event.timestamp+ \"\\n\"+\"x=\"+event.values[0]);\n System.out.println(\"\\n\");\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n long currentTimeUnix = System.currentTimeMillis() / 1000L;\n long nSeconds = 30L;\n\n // send heartrate data and create new intent\n if (event.sensor.getType() == SENS_HEARTRATE && event.values.length > 0 && event.accuracy > 0) {\n int newValue = Math.round(event.values[0]);\n\n if(newValue!=0 && lastTimeSentUnixHR < (currentTimeUnix-nSeconds)) {\n lastTimeSentUnixHR = System.currentTimeMillis() / 1000L;\n currentValue = newValue;\n\n Log.d(TAG, \"Broadcast HR.\");\n Intent intent = new Intent();\n intent.setAction(\"com.example.Broadcast\");\n intent.putExtra(\"HR\", event.values);\n intent.putExtra(\"ACCR\", event.accuracy);\n intent.putExtra(\"TIME\", event.timestamp);\n sendBroadcast(intent);\n\n client.sendSensorData(event.sensor.getType(), event.accuracy, event.timestamp, event.values);\n\n }\n }\n // also send motion/humidity/step data to know when NOT to interpret hr data\n\n if (event.sensor.getType() == SENS_STEP_COUNTER && event.values[0]-currentStepCount!=0) {\n\n if(lastTimeSentUnixSC < (currentTimeUnix-nSeconds)){\n lastTimeSentUnixSC = System.currentTimeMillis() / 1000L;\n currentStepCount = event.values[0];\n client.sendSensorData(event.sensor.getType(), event.accuracy, event.timestamp, event.values);\n }\n\n }\n\n if (event.sensor.getType() == SENS_ACCELEROMETER) {\n\n if(lastTimeSentUnixACC < (currentTimeUnix-nSeconds)){\n lastTimeSentUnixACC = System.currentTimeMillis() / 1000L;\n\n client.sendSensorData(event.sensor.getType(), event.accuracy, event.timestamp, event.values);\n }\n }\n\n }", "@Override\n public final void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n accx = event.values[0];\n accy = event.values[1];\n accz = event.values[2];\n }else if (event.sensor.getType() == Sensor.TYPE_GYROSCOPE) {\n gyx = event.values[0];\n gyy = event.values[1];\n gyz = event.values[2];\n } else if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {\n magx = event.values[0];\n magy = event.values[1];\n magz = event.values[2];\n }\n }", "@Override\n public void onSensorChanged (SensorEvent event) {\n\n Sensor mySensor = event.sensor;\n\n if (mySensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n float x = event.values[0];\n float y = event.values[1];\n float z = event.values[2];\n\n// output.setText(\"x=\" + x + \"y=\" + y + \"z=\" + z);\n // Log.i(\"acc\",(\"x=\" + x + \"y=\" + y + \"z=\" + z));\n// try {\n// String value=String.valueOf(x)+\",\"+String.valueOf(y)+\",\"+ String.valueOf(z);\n// // outvalue.write(value.getBytes());\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// Log.i(\"acc\", Float.toString(x) + Float.toString(y)+Float.toString(z));\n\n }\n }", "private void timerEngine(){\n SensorController me = this;\n //generate new value or send existing to server\n if(isValueGeneratorRunning()){\n logger.trace(\"Generating new sensor value\");\n //create new values\n try{\n getModel().getValues().stream()\n .filter(Value::isGenerateValue) //if new value should be generated\n .forEach(v -> {\n Object next = v.nextValue();\n if (next != null) {\n Platform.runLater(() -> v.setValue(next));\n }\n }); //do it\n }catch (IllegalArgumentException e){\n adapterController.sendError(toString() + \" -> cannot generate new value!\",e,false);\n }\n logger.trace(\"Building sensor message\");\n //create XML message with new values\n XMLmessage = adapterController.getAdapter().getProtocol()\n .buildSensorMessage(adapterController.getAdapter().getProtocol().buildAdapterMessage(adapterController.getAdapter()), getModel());\n //change engine to send message mod\n setRunValueGenerator(false);\n }else if(getModel().getStatus()){\n //if sensor's message doesn't exist, error is showed\n if(XMLmessage == null){\n adapterController.sendError(toString() + \" doesn't have XML message to send\",null,false);\n return;\n }\n //if we have means to send message and adapter is registered, send message to adapter\n if(adapterController.getServerReceiver() != null || adapterController.getAdapter().getRegistered()){\n //full message contains information about adapter\n if(isFullMessage()){\n //used in \"Performance simulation\"\n adapterController.sendMessage(me.toString() + \" --> data sent\",XMLmessage,me, OutMessage.Type.SENSOR_MESSAGE);\n }else{\n //short message contains information only about sensor\n //used in \"Detailed simulation\"\n adapterController.sendMessage(\"Sensor \" + me.toString() + \" trying to send message.\");\n adapterController.sendMessage(\"Sensor \" + me.toString() + \" --> data sent\",XMLmessage,me, OutMessage.Type.SENSOR_MESSAGE);\n }\n //change engine to generate value mod\n setRunValueGenerator(true);\n }\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() == SENS_ACCELEROMETER && event.values.length > 0) {\n float x = event.values[0];\n float y = event.values[1];\n float z = event.values[2];\n\n latestAccel = (float)Math.sqrt(Math.pow(x,2.)+Math.pow(y,2)+Math.pow(z,2));\n //Log.d(\"pow\", String.valueOf(latestAccel));\n\n }\n // send heartrate data and create new intent\n if (event.sensor.getType() == SENS_HEARTRATE && event.values.length > 0 && event.accuracy >0) {\n\n Log.d(\"Sensor\", event.sensor.getType() + \",\" + event.accuracy + \",\" + event.timestamp + \",\" + Arrays.toString(event.values));\n\n int newValue = Math.round(event.values[0]);\n long currentTimeUnix = System.currentTimeMillis() / 1000L;\n long nSeconds = 30L;\n \n if(newValue!=0 && lastTimeSentUnix < (currentTimeUnix-nSeconds)) {\n lastTimeSentUnix = System.currentTimeMillis() / 1000L;\n currentValue = newValue;\n Log.d(TAG, \"Broadcast HR.\");\n Intent intent = new Intent();\n intent.setAction(\"com.example.Broadcast\");\n intent.putExtra(\"HR\", event.values);\n intent.putExtra(\"ACCR\", latestAccel);\n intent.putExtra(\"TIME\", event.timestamp);\n intent.putExtra(\"ACCEL\", latestAccel);\n\n\n Log.d(\"change\", \"send intent\");\n\n sendBroadcast(intent);\n\n client.sendSensorData(event.sensor.getType(), latestAccel, event.timestamp, event.values);\n }\n }\n\n }", "private void UI_RefreshSensorData ()\r\n\t{\r\n\t\t\t\t\r\n\t\tlong now = System.currentTimeMillis();\r\n\t\t\r\n\t\tif (now-ts_last_rate_calc>1000)\r\n\t\t{\r\n\t\t\tsensor_event_rate=last_nAccVal/((now-ts_last_rate_calc)/1000.0);\r\n\t\t\tts_last_rate_calc=now;\r\n\t\t}\r\n\t}", "public void setSensorOn() {\n\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\tint value = (int) event.values[0];\n\t\tif(0 == value) {\n\t\t\tnearFlag = true;\n\t\t} else if (1 <= value) {\n\t\t\tfarFlag = true;\n\t\t\tvalue = 1;\n\t\t} else {\n\t\t\t// Something is wrong\n\t\t}\n\t\ttip.setText(\"距离值 : \" + event.values[0]);\n\t\tif(nearFlag && farFlag && !pass) {\n\t\t\tpass = true;\n\t\t\t((AutoMMI)getApplication()).recordResult(PSensorTest.TAG, \"\", \"1\");\n\t\t}\n\t}", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n if (sensorEvent.sensor.getType() == Sensor.TYPE_ACCELEROMETER && s.equals(\"Accelerometre\")) {\n float Ax = sensorEvent.values[0];\n float Ay = sensorEvent.values[1];\n float Az = sensorEvent.values[2];\n\n acce = \" TimeAcc = \" + sensorEvent.timestamp + \"\\n Ax = \" + Ax + \" \" + \"\\n Ay = \" + Ay + \" \" + \"\\n Az = \" + Az + \"\\n\";\n\n // Do something with this sensor value .\n sensorTxt.setText(acce);\n Log.d(TAG, \" TimeAcc = \" + sensorEvent.timestamp + \" Ax = \" + Ax + \" \" + \" Ay = \" + Ay + \" \" + \" Az = \" + Az);\n }\n\n //LUMIERE\n if (sensorEvent.sensor.getType() == Sensor.TYPE_LIGHT && s.equals(\"Lumiere\")) {\n // La valeur de la lumière\n float lv = sensorEvent.values[0];\n\n light = \" TimeAcc = \" + sensorEvent.timestamp + \"\\n Light value = \" + lv + \"\\n\";\n //On affiche la valeur\n sensorTxt.setText(light);\n }\n\n //PROXIMITE\n if (sensorEvent.sensor.getType() == Sensor.TYPE_PROXIMITY && s.equals(\"Proximite\")) {\n // La valeur de proximité\n float p = sensorEvent.values[0];\n\n proxi = \" TimeAcc = \" + sensorEvent.timestamp + \"\\n Proximite value = \" + p + \"\\n\";\n //On affiche la valeur\n sensorTxt.setText(proxi);\n }\n\n //GYROSCOPE\n if (sensorEvent.sensor.getType() == Sensor.TYPE_GYROSCOPE && s.equals(\"Gyroscope\")) {\n // Les valeurs du gyroscope\n float xGyroscope = sensorEvent.values[0];\n float yGyroscope = sensorEvent.values[1];\n float zGyroscope = sensorEvent.values[2];\n\n gyro = \" TimeAcc = \" + sensorEvent.timestamp + \"\\n Valeur du gyroscope \\n Valeur en x = \" + xGyroscope + \" \" + \"\\n Valeur en y = \" + yGyroscope + \" \" + \"\\n Valeur en z = \" + zGyroscope + \"\\n\";\n //On affiche la valeur\n sensorTxt.setText(gyro);\n }\n\n }", "public interface AccelerometerListener extends SensorEventListener {\n\n void onSensorChanged(SensorEvent var1);\n\n void onAccuracyChanged(Sensor var1, int var2);\n\n void start(Context context, int samplingRate, String queryNumber,String ioPair);\n\n void stop();\n\n}", "@Override\n\tpublic void update(float temp, float humidity, float pressure) {\n\n\t}", "public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER && event.sensor.getType() != Sensor.TYPE_GYROSCOPE)\n return;\n\n if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n sensorCount++;\n\n if (sensorFirstRead) {\n nanotime = System.nanoTime();\n sensorFirstRead = false;\n } else {\n\n if (sensorCount > 0 && sensorCount % 10 == 0) {\n differenceNanoTime = System.nanoTime() - nanotime;\n if (differenceNanoTime > sensorCounterIntervalDelay) {\n differenceSeconds = (double) differenceNanoTime / 1000000000f;\n\n sensorAverageCount = sensorCount / differenceSeconds;\n sensorAverageCountTextView.setText(String.format(\"Read/s: %.2f\", sensorAverageCount));\n\n if (sensorFirstAverageCycle || Math.abs(sensorAverageCount - accValuesLimit * 2) > accValuesLimit * 0.2) {\n if (sensorFirstAverageCycle)\n sensorFirstAverageCycle = false;\n\n accValuesLimit = (int) sensorAverageCount / 2;\n gyroValuesLimit = accValuesLimit / 2;\n sensorCountLimitTextView.setText(String.format(\"Sensor count limit: %d\", accValuesLimit));\n\n stats.get(\"accX\").setLimit(accValuesLimit);\n stats.get(\"accY\").setLimit(accValuesLimit);\n stats.get(\"accZ\").setLimit(accValuesLimit);\n stats.get(\"accDegreeZ\").setLimit(accValuesLimit);\n stats.get(\"accDegreeX\").setLimit(accValuesLimit);\n stats.get(\"accDegreeY\").setLimit(accValuesLimit);\n stats.get(\"accTotalAcceleration\").setLimit(accValuesLimit);\n stats.put(\"gyroX\", new StatisticList(gyroValuesLimit));\n stats.put(\"gyroY\", new StatisticList(gyroValuesLimit));\n stats.put(\"gyroZ\", new StatisticList(gyroValuesLimit));\n }\n\n sensorCount = 0;\n nanotime = System.nanoTime();\n }\n }\n }\n }\n\n if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n\n mAccelerometerSensorX = event.values[0];\n mAccelerometerSensorY = event.values[1];\n mAccelerometerSensorZ = event.values[2];\n\n mAccelerometerTotalAcceleration = Math.sqrt(Math.pow(mAccelerometerSensorX, 2) + Math.pow(mAccelerometerSensorY, 2) + Math.pow(mAccelerometerSensorZ, 2));\n\n stats.get(\"accX\").addValue(mAccelerometerSensorX);\n stats.get(\"accY\").addValue(mAccelerometerSensorY);\n stats.get(\"accZ\").addValue(mAccelerometerSensorZ);\n stats.get(\"accTotalAcceleration\").addValue(mAccelerometerTotalAcceleration);\n\n tmp_y = stats.get(\"accY\").getAverage() / stats.get(\"accTotalAcceleration\").getAverage(); // g\n tmp_x = stats.get(\"accX\").getAverage() / stats.get(\"accTotalAcceleration\").getAverage();\n tmp_z = stats.get(\"accZ\").getAverage() / stats.get(\"accTotalAcceleration\").getAverage();\n\n mRotationDegreeZ = Math.asin(tmp_x) * 180 / Math.PI;\n if (Double.isNaN(mRotationDegreeZ))\n mRotationDegreeZ = stats.get(\"accDegreeZ\").getAverage() > 0 ? 90 : -90;\n\n mRotationDegreeX = Math.asin(tmp_z) * 180 / Math.PI;\n if (Double.isNaN(mRotationDegreeX))\n mRotationDegreeX = stats.get(\"accDegreeX\").getAverage() > 0 ? 90 : -90;\n\n mRotationDegreeY = Math.asin(tmp_y) * 180 / Math.PI;\n if (Double.isNaN(mRotationDegreeY))\n mRotationDegreeY = stats.get(\"accDegreeY\").getAverage() > 0 ? 90 : -90;\n\n stats.get(\"accDegreeZ\").addValue(mRotationDegreeZ);\n stats.get(\"accDegreeX\").addValue(mRotationDegreeX);\n stats.get(\"accDegreeY\").addValue(mRotationDegreeY);\n\n updateLog(Sensor.TYPE_ACCELEROMETER);\n }\n else\n if(event.sensor.getType()==Sensor.TYPE_GYROSCOPE)\n {\n mGyroX = event.values[0];\n mGyroY = event.values[1];\n mGyroZ = event.values[2];\n\n stats.get(\"gyroX\").addValue(mGyroX);\n stats.get(\"gyroY\").addValue(mGyroY);\n stats.get(\"gyroZ\").addValue(mGyroZ);\n\n updateLog(Sensor.TYPE_GYROSCOPE);\n }\n }", "public interface Observer {\n void updateWeather(Weather weather);\n}", "public interface Listener extends Remote{\n \n /**\n * \n * Handles new updated readings\n * @param sensors\n * @param monitorCount\n * @param sensorCount\n * @throws java.rmi.RemoteException \n */\n public void Changed(List<Sensor> sensors, int monitorCount, int sensorCount) throws java.rmi.RemoteException;\n \n /**\n * \n * Alerts monitor if the temperatures reach critical levels\n * @param sensor\n * @throws RemoteException \n */\n public void alertMonitor(Sensor sensor) throws RemoteException;\n \n /**\n * \n * Notifies monitors when a particular sensor is down\n * @param sensor\n * @throws RemoteException \n */\n public void notifySensorFailure(Sensor sensor) throws RemoteException;\n}", "public void onSensorChanged(SensorEvent event) {\n switch (event.sensor.getType()) {\n case Sensor.TYPE_ACCELEROMETER:\n acceleration_vals = event.values.clone();\n break;\n case Sensor.TYPE_MAGNETIC_FIELD:\n magnetic_vals = event.values.clone();\n break;\n }\n \n \n // If we have all the necessary data, update the orientation.\n if (acceleration_vals != null && magnetic_vals != null) {\n float[] R = new float[16];\n float[] I = new float[16];\n \n SensorManager.getRotationMatrix(R, I, acceleration_vals, \n magnetic_vals);\n \n float[] orientation = new float[3];\n SensorManager.getOrientation(R, orientation);\n \n acceleration_vals = null;\n magnetic_vals = null;\n \n // Use the pitch to determine whether we are in ID mode or\n // conference mode.\n if (orientation[1] <= -0.2) { // we're in conference mode\n this.setRequestedOrientation(\n ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n showScheduleView();\n } else if (orientation[1] >= 0.2) { // we're in ID mode\n this.setRequestedOrientation(\n ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);\n showBadgeView();\n }\n }\n }", "public void onSensorChanged(SensorEvent event) {\n try {\n Thread.sleep(16);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n //called when accelerometer senses directional change\n sensorX = event.values[0];\n sensorY = event.values[1];\n }", "public void stateChanged(SensorPort arg0, int arg1, int arg2) {\n\t\t\n\t}", "public void onSensorChanged(SensorEvent event) {\n\t\t\tint type = event.sensor.getType();\n\t\t\tif (type == Sensor.TYPE_ACCELEROMETER) {\n\t\t\t\tlong curTime = System.currentTimeMillis();\n\t\t\t\t// only allow one update every 100ms, otherwise updates\n\t\t\t\t// come way too fast and the phone gets bogged down\n\t\t\t\t// with garbage collection\n\t\t\t\t//Log.d(TAG, \"onSensorChanged(\"+type+\")\");\t\t\t\t\n\t\t\t\tif (lastUpdate == -1 || (curTime - lastUpdate) > 40) {\n\t\t\t\t\tlastUpdate = curTime;\t\t\t\t\n\t\t\t\t\tsynchronized (LOCK){\n\t\t\t\t\t\tmLastAccOrientation = calculateAngle(event);\n\t\t\t\t\t\tmLastSample.x = event.values[0];\n\t\t\t\t\t\tmLastSample.y = event.values[1];\n\t\t\t\t\t\tmLastSample.z = event.values[2];\n\t\t\t\t\t\tmLastSample.angle = mLastAccOrientation.angle;\t\t\n\t\t\t\t\t\t//mLastSample.orientation = mLastAccOrientation.orientation;\n\t\t\t\t\t\tmLastSample.orientation = mLastAccOrientation.rotation*90;\n\t\t\t\t\t\tmLastSample.threshold = mLastAccOrientation.threshold;\n\t\t\t\t\t\tmBuffer = mLastSample.x+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.y+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.z+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.angle+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.orientation+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.threshold;\n\t\t\t\t\t\tif (mShowLog)\n\t\t\t\t\t\t\tLog.d(TAG, mBuffer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n public void onDataChanged(DataEventBuffer dataEvents) {\n\n Log.i(TAG, \"onDataChanged()\");\n\n for (DataEvent dataEvent : dataEvents) {\n if (dataEvent.getType() == DataEvent.TYPE_CHANGED) {\n DataItem dataItem = dataEvent.getDataItem();\n Uri uri = dataItem.getUri();\n String path = uri.getPath();\n\n if (path.startsWith(\"/sensors/\")) {\n if (SmartWatch.getInstance() != null) {\n SmartWatch.getInstance().unpackSensorData(DataMapItem.fromDataItem(dataItem).getDataMap());\n }\n }\n }\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n // This code is directly taken from the Android website.\n // I used it since the linear accelerometer doesn't seem to work correctly.\n // Without borrowing this code, I would have had no idea how to do this.\n // https://developer.android.com/guide/topics/sensors/sensors_motion.html\n\n final float alpha = 0.8F;\n\n // Isolate the force of gravity with the low-pass filter.\n gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];\n gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];\n gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];\n\n // don't include first 10 pieces of data to make sure sensor is properly adjusted\n if(accuracyCounter>=0) {\n accuracyCounter--;\n } else {\n // Add the information to the dataset.\n dataSet.establishNextDataPoint(\n event.values[0] - gravity[0],\n event.values[1] - gravity[1],\n event.values[2] - gravity[2]);\n }\n }", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n storage.writePhoneAccelerometer(new double[]{sensorEvent.values[0], sensorEvent.values[1], sensorEvent.values[2]});\n //System.out.println(\"x: \" + sensorEvent.values[0] + \", y: \" + sensorEvent.values[1] + \", z: \" + sensorEvent.values[2]);\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\trawSensorValue = Math.round(event.values[0]); \n\t\twhile (rawSensorValue < 0) rawSensorValue += 360;\n\t\tm_azimuth_degrees = rawSensorValue - m_sun_azimuth_degrees;\n\t\twhile (m_azimuth_degrees < 0) m_azimuth_degrees += 360;\n\t\t\n\t\t// get pitch value\n\t\tint rotation = activity.getWindowManager().getDefaultDisplay().getRotation();\n\t\tif ((rotation == 0) || (rotation == 2)) m_pitch_degrees = Math.abs((int)event.values[1]); \n\t\telse m_pitch_degrees = Math.abs((int)event.values[2]);\n\t\t\n\t\t// Update event\n\t\tif (m_parent != null) m_parent.onSensorChanged(event);\n\t}", "@Override\n public void handleGpioPinAnalogValueChangeEvent(GpioPinAnalogValueChangeEvent event) {\n notifyListeners(new TemperatureChangeEvent(sensor, getValue(), event.getValue()));\n }", "public void onAccuracyChanged(int sensor, int accuracy) {\n }", "public interface ILocationListener\n{\n /**\n * Called when the speed changes.\n * @param speed The new speed value.\n */\n void OnSpeedChanges(float speed);\n\n /**\n * Called when the location signal is lost.\n */\n void OnSignalLost();\n}", "@Override\n\tpublic void onSensorChanged( SensorEvent event )\n\t{\n\t\tfloat y = -event.values[ 0 ] / GRAVITY;\n\t\tfloat x = event.values[ 1 ] / GRAVITY;\n\t\tfloat z = event.values[ 2 ] / GRAVITY;\n\t\t\n\t\tx = Math.abs(x);\n\n\t\t//Log.d( \"Control\", String.format( \"%+6f, %+6f, %+6f\", x, y, z ) );\n\n\t\t// The x component gives us tilt forward / backward\n\t\tx -= 0.5;\n\t\tx *= 200;\n\t\tif ( Math.abs(x) < 10 ) x = 0;\n\n\t\t// The y component gives us steering\n\t\ty *= 50;\n\t\tif ( Math.abs(y) < 10 ) y = 0;\n\n\t\tfloat\n\t\t\t\tmotorL = x + y,\n\t\t\t\tmotorR = x - y;\n\n\t\t//Log.d( \"Control\", String.format( \"%+6f, %+6f, %+6f\", motorL, motorR, 0f ) );\n\n\t\t// Clamp the values to [-100, 100]\n\t\tif ( motorL < -100 || motorL > 100 )\n\t\t{\n\t\t\tmotorL -= motorL % 100;\n\t\t}\n\t\tif ( motorR < -100 || motorR > 100 )\n\t\t{\n\t\t\tmotorR -= motorR % 100;\n\t\t}\n\t\t\n\t\tmovingAverageX = (movingAverageAlpha * motorL) + (1.0f - movingAverageAlpha) * movingAverageX;\n\t\tmovingAverageY = (movingAverageAlpha * motorR) + (1.0f - movingAverageAlpha) * movingAverageY;\n\n\t\tcallbackTarget.onControlEventResult( (int) movingAverageX, (int) movingAverageY, 0 );\n\t}", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n if (sensorEvent.sensor.getType() != Sensor.TYPE_ACCELEROMETER)\n return;\n\n // must be the accelerometer - number of milliseconds since Midnight, Jan 1, 1970\n // How many milliseconds in a day? 60(60)(24)(1000) = 90,000,000\n long curr_time = System.currentTimeMillis();\n\n if (curr_time - prev_time > 500) {\n prev_time = curr_time;\n float y = sensorEvent.values[1];\n accel_y_view.setText(Float.toString(y));\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {\n\n mGeomagnetic = new float[3];\n System.arraycopy(event.values, 0, mGeomagnetic, 0, 3);\n\n }\n\n // If we have readings from both sensors then\n // use the readings to compute the device's orientation\n // and then update the display.\n\n if (mGeomagnetic != null) {\n\n int R = (int) mGeomagnetic[0];\n int G = (int) mGeomagnetic[1];\n int B = (int) mGeomagnetic[2];\n\n setBackgroundColorDisplay(R, G, B);\n Log.d(TAG, \"mx : \"+mGeomagnetic[0]+\" my : \"+mGeomagnetic[1]+\" mz : \"+mGeomagnetic[2]);\n\n }\n\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\tint sensorType = event.sensor.getType(); \n //values[0]:X轴,values[1]:Y轴,values[2]:Z轴 \n float[] values = event.values; \n if (sensorType == Sensor.TYPE_ACCELEROMETER) \n { \n if ((Math.abs(values[0]) > 17 || Math.abs(values[1]) > 17 || Math \n .abs(values[2]) > 17)) \n { \n Log.d(\"sensor x \", \"============ values[0] = \" + values[0]); \n Log.d(\"sensor y \", \"============ values[1] = \" + values[1]); \n Log.d(\"sensor z \", \"============ values[2] = \" + values[2]); \n Intent intent = new Intent(this, MapActivity.class);\n startActivity(intent);\n //摇动手机后,再伴随震动提示~~ \n vibrator.vibrate(500); \n } \n \n } \n\t}", "public void lightSensorChanged(Position position,\r\n\t\t\tUpdatingSensor updatingsensor, float oldValue, float newValue);", "private interface Observer {\n void update(Observable observable, String errorMessage);\n }", "@Override\r\n public void changed(final ObservableValue<? extends Wave.Status> arg0, final Wave.Status arg1, final Wave.Status arg2) {\n \r\n }", "public void onSensorChanged(SensorEvent event)\n {\n if (event.sensor.getType()==Sensor.TYPE_ACCELEROMETER) {\n gravity[0] = event.values[0];\n gravity[1] = event.values[1];\n gravity[2] = event.values[2];\n\n }\n if (event.sensor.getType()==Sensor.TYPE_MAGNETIC_FIELD) {\n geomagnetic[0] = event.values[0];\n geomagnetic[1] = event.values[1];\n geomagnetic[2] = event.values[2];\n\n }\n\n if(SensorManager.getRotationMatrix(_R, null, gravity, geomagnetic)){\n _R = this.opglr.swapRotMatrix(_R);\n }\n\n }", "@Override\r\n\tpublic void update() {\n\t\tSystem.out.println(\"Observer1 has received update!\");\r\n\t}", "public void refresh()\n\t{\n\t\t// loop all sensors with calling read(), test() method of sensors\n\t\tfor(int i=0; i<SensorControl.MAX_SENSOR; i++)\n\t\t{\n\t\t\tif(SecurityZone.getDeviceUnit(DeviceUnit.TYPE_WINDOW_SENSOR, i+1).getUsing()){\n\t\t\t\tif(MainDemo.sensorController.testWinDoorSensor(i))\n\t\t\t\t{\n\t\t\t\t\ttestW[i].setForeground(Color.RED);\n\t\t\t\t\ttestW[i].setText(\"enable\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttestW[i].setForeground(Color.BLACK);\n\t\t\t\t\ttestW[i].setText(\"disable\");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif(MainDemo.sensorController.readWinDoorSensor(i))\n\t\t\t\t{\n\t\t\t\t\treadW[i].setForeground(Color.RED);\n\t\t\t\t\treadW[i].setText(\"open\");\n\t\t\t\t\tdsensor[i] = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treadW[i].setForeground(Color.BLACK);\n\t\t\t\t\treadW[i].setText(\"close\");\n\t\t\t\t\tdsensor[i] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdsensor[i] = false;\n\t\t\t}\n\n\t\t\tif(SecurityZone.getDeviceUnit(DeviceUnit.TYPE_MOTION_SENSOR, i+1).getUsing()){\n\t\t\t\tif(MainDemo.sensorController.testMotionDetector(i))\n\t\t\t\t{\n\t\t\t\t\ttestM[i].setForeground(Color.RED);\n\t\t\t\t\ttestM[i].setText(\"enable\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttestM[i].setForeground(Color.BLACK);\n\t\t\t\t\ttestM[i].setText(\"disable\");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif(MainDemo.sensorController.readMotionDetector(i))\n\t\t\t\t{\n\t\t\t\t\treadM[i].setForeground(Color.RED);\n\t\t\t\t\treadM[i].setText(\"detect\");\n\t\t\t\t\tdsensor[i+5] = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treadM[i].setForeground(Color.BLACK);\n\t\t\t\t\treadM[i].setText(\"clear\");\n\t\t\t\t\tdsensor[i+5] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdsensor[i+5] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tMainDemo.alarmController.detect(dsensor);\n\t}", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n float valueAzimuth = event.values[0];\n float valuePitch = event.values[1];\n\n parent.updateAccelerometer(\n valueAzimuth / maximumRange, -valuePitch / maximumRange);\n\n }", "@Override\r\n\tpublic void update(Observable o, Object data) {\r\n\t\t//Check if data is coming from Eclipse MQTT broker\r\n\t\tif(o.equals(mqttConn)) {\r\n\t\t\tif(((String[]) data)[0].equals(subscribeTopic)) {\r\n\t\t\t\tpd = DataUtil.jsonToPitchData(((String[]) data)[1], true);\r\n\t\t\t\t_Logger.info(\"Gateway device:\\nNew pitch reading received:\" + pd);\r\n\t\t\t\tubidotsApi.sendPitchValue((double) pd.getCurValue());\r\n\t\t\t\t\r\n\t\t\t\tif((pd.getCurValue() <= minPitch) && oneShot) {\r\n\t\t\t\t\tsmtpConn.sendMail(\"[email protected]\", \"ALERT: Water Level\", \"Water level has fallen below the minimum!\");\r\n\t\t\t\t\toneShot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if(((String[]) data)[0].equals(subscribeTopic2)) {\r\n\t\t\t\tsd = DataUtil.jsonToSensorData(((String[]) data)[1], true);\r\n\t\t\t\t_Logger.info(\"Gateway device:\\nNew Temperature reading received\" + sd);\r\n\t\t\t\tubidotsApi.sendTempValue((double) sd.getCurValue());\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t//Check if data is coming from Ubidots MQTT broker\r\n\t\telse if(o.equals(ubidotsMqtt)) {\r\n\t\t\tint valveData = Integer.parseInt(((String[]) data)[1]);\r\n\t\t\tif(valveData != ledON) {\r\n\t\t\t\tledON = valveData;\r\n\t\t\t\tmqttConn.publish(publishTopic, 2, String.valueOf(ledON));\r\n\t\t\t\t\r\n\t\t\t\tif(ledON==1) {\r\n\t\t\t\t\tSystem.out.println(\"Turning ON Valve(LED)...\\n\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(ledON==0) {\r\n\t\t\t\t\toneShot = true;\r\n\t\t\t\t\tSystem.out.println(\"Turning OFF Valve(LED)...\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)\n return;\n /*\n * record the accelerometer data, the event's timestamp as well as\n * the current time. The latter is needed so we can calculate the\n * \"present\" time during rendering. In this application, we need to\n * take into account how the screen is rotated with respect to the\n * sensors (which always return data in a coordinate space aligned\n * to with the screen in its native orientation).\n */\n\n switch (mDisplay.getRotation()) {\n case Surface.ROTATION_0:\n mSensorX = event.values[0];\n mSensorY = event.values[1];\n break;\n case Surface.ROTATION_90:\n mSensorX = -event.values[1];\n mSensorY = event.values[0];\n break;\n case Surface.ROTATION_180:\n mSensorX = -event.values[0];\n mSensorY = -event.values[1];\n break;\n case Surface.ROTATION_270:\n mSensorX = event.values[1];\n mSensorY = -event.values[0];\n break;\n }\n\n mGLView.updateScene(10*mSensorX,10*mSensorY,10*event.values[2]);\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (Minutes*60+Seconds==time){\n switch(event.sensor.getType()) {\n case Sensor.TYPE_STEP_DETECTOR:\n values[0]++;\n break;\n case Sensor.TYPE_ACCELEROMETER:\n values[1]+=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[1]/=2;\n break;\n case Sensor.TYPE_GYROSCOPE:\n values[2]+=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[2]/=2;\n break;\n }\n }\n else{\n if(values[0]==0||values[1]==0||values[2]==0){\n prediction.setText(\"00:00:00\");\n }\n else{\n predictionValue = Math.round(doInference(values));\n prediction.setText(\"00:\" + String.valueOf(predictionValue/60) + \":\" + String.valueOf(predictionValue%60));\n if(predictionValue>1.1*Double.parseDouble(target.getText().toString())){ //too slow\n pace.setBackgroundColor(Color.GREEN);\n pace.setText(\"SPEED UP!\");\n }\n else if(predictionValue<0.9*Double.parseDouble(target.getText().toString())){ //too fast\n pace.setBackgroundColor(Color.RED);\n pace.setText(\"SLOW DOWN!\");\n }\n else{\n pace.setBackgroundColor(Color.YELLOW);\n pace.setText(\"GOOD JOB!\");\n }\n }\n switch(event.sensor.getType()) {\n case Sensor.TYPE_STEP_DETECTOR:\n values[0]=1;\n values[1]=0;\n values[2]=0;\n break;\n case Sensor.TYPE_ACCELEROMETER:\n values[0]=0;\n values[1]=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[2]=0;\n break;\n case Sensor.TYPE_GYROSCOPE:\n values[0]=0;\n values[1]=0;\n values[2]=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n break;\n }\n time = Minutes*60+Seconds;\n }\n\n }", "@Override\r\n\t\t\tpublic void onSensorChanged(SensorEvent event)\r\n\t\t\t{\n\t\t\t\tx=event.values[0];\r\n\t\t\t\ty=event.values[1];\r\n\t\t\t\tz=event.values[2];\r\n\t\t\t\t//balle\r\n\t\t\t\tmx-=(int)x;\r\n\t\t\t\tmy+=(int)y;\r\n\t\t\t\tif (mx<40)\r\n\t\t\t\t{\r\n\t\t\t\t\tmx=40;\r\n\t\t\t\t}\r\n\t\t\t\tif (mx>1190)\r\n\t\t\t\t{\r\n\t\t\t\t\tmx=1190;\r\n\t\t\t\t}\r\n\t\t\t\tif (my<50)\r\n\t\t\t\t{\r\n\t\t\t\t\tmy=50;\r\n\t\t\t\t}\r\n\t\t\t\tif (my>700)\r\n\t\t\t\t{\r\n\t\t\t\t\tmy=700;\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t\t//departBalle\r\n\t\r\n\t\t\t\tdepartBalle.setPos_x(mx);\r\n\t\t\t\tdepartBalle.setPos_y(my);\r\n\t\t\tSystem.out.println(\"\"+mx+\":\"+my);\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t}", "void update(float temp, float humidity, float pressure);", "void onDataChanged();", "@Override\n public void onProcessedValueChanged(DSensorEvent dSensorEvent) {\n if (Float.isNaN(dSensorEvent.values[0])) {\n textToSpeech.speak(\"Compass is not working ,\" +\n \"please calibrate ypur phone.\"\n ,TextToSpeech.QUEUE_FLUSH,null);\n\n } else {\n compass = Distance.round(Math.toDegrees(dSensorEvent.values[0]),1);\n if (compass < 0) {\n compass = Distance.round((compass + 360) % 360,1);\n }\n }\n //Toast.makeText(RoutesActivity.this, String.valueOf(dSensorEvent.values[0]), Toast.LENGTH_SHORT).show();\n }", "GenericFloatSensor sensor();", "public void onDataChanged();", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\tString result=\"x axis: \"+event.values[0]+\"\\n\"+\n\t\t\t\t \"y axis: \"+event.values[1]+\"\\n\"+\n\t\t\t\t \"z axis: \"+event.values[2]+\"\\n\";\n\t\ttextView.setText(result);\n\t}", "@Override\r\n\tpublic void onAccuracyChanged(Sensor arg0, int arg1) \r\n\t{\n\t}", "@Override\r\n\tpublic void onUpdateIO(int device, int type, int code, int value,\r\n\t\t\tint timestamp) {\n\t\t\r\n\t}", "Sensor getSensor();", "public void notifySensorFailure(Sensor sensor) throws RemoteException;", "@Override\n public void onAccuracyChanged(Sensor arg0, int arg1 )\n {\n\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\n\t\taccleration.setText(\"X: \" + event.values[0]+\n\t\t\t\t\t\t\t\"\\n Y: \"+ event.values[1]+\n\t\t\t\t\t\t\t\"\\n Z:\" + event.values[2]);\n\t\t\n\t\t\n\t\t\n\t}", "@Override\n\tpublic void onSensorChanged(SensorEvent se) {\n\t\teventIesim++;\n\t\tif(eventIesim == THRESHOLD_EVENTS)\n\t\t{\n\n\t\t\tswitch (se.sensor.getType())\n\t\t\t{\n\t\t\t\tcase Sensor.TYPE_ACCELEROMETER:\n\t\t\t\t{\n\t\t\t\t\taccelerometerValues = se.values.clone();\n\t\t\t\t\tnew ListenerThread(accelerometerValues,delta_orientation,context,gps).start(); // use the last orientation set\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase Sensor.TYPE_MAGNETIC_FIELD:\n\t\t\t\t{\n\t\t\t\t\tgeomagneticMatrix = se.values.clone();\n\t\t\t\t\tsensorReady = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t} \n\n\t\t\tif (geomagneticMatrix != null && accelerometerValues != null && sensorReady) \n\t\t\t{\n\t\t\t\tsensorReady = false;\n\n\t\t\t\tfloat[] R = new float[16];\n\t\t\t\tfloat[] I = new float[16];\n\n\t\t\t\tSensorManager.getRotationMatrix(R, I, accelerometerValues, geomagneticMatrix);\n\n\t\t\t\tfloat[] actual_orientation = new float[3];\n\t\t\t\tSensorManager.getOrientation(R, actual_orientation); // lastorientation filled with orientation in radiant\n\t\t\t\t\n\t\t\t\tdelta_orientation[0]= (delta_orientation[0] > actual_orientation[0]) ? (delta_orientation[0] - actual_orientation[0]) : (actual_orientation[0] - delta_orientation[0]);\n\t\t\t\tdelta_orientation[1]= (delta_orientation[1] > actual_orientation[1]) ? (delta_orientation[1] - actual_orientation[1]) : (actual_orientation[1] - delta_orientation[1]);\n\t\t\t\tdelta_orientation[2]= (delta_orientation[2] > actual_orientation[2]) ? (delta_orientation[2] - actual_orientation[2]) : (actual_orientation[2] - delta_orientation[2]);\n\n\t\t\t\tLog.i(TAG, \"acceleration with gravity x:\"+accelerometerValues[0]+\" y:\"+accelerometerValues[1]+\" z:\"+accelerometerValues[2]);\n\n\t\t\t\tnew ListenerThread(accelerometerValues,delta_orientation,context,gps).start();\n\n\t\t\t\tLog.i(TAG, \"orientation x:\"+delta_orientation[0]+\" y:\"+delta_orientation[1]+\" z:\"+delta_orientation[2]);\n\t\t\t\t//Toast.makeText(context, \"orientation x:\"+delta_orientation[0]+\" y:\"+delta_orientation[1]+\" z:\"+delta_orientation[2], Toast.LENGTH_SHORT).show();\n\t\t\t\t\n\t\t\t\tdelta_orientation = actual_orientation;\n\t\t\t}\n\t\t\teventIesim = 0;\n\t\t}\n\t\t\n\n\n\t}", "@Override\n public void onAccuracyChanged(Sensor sensor, int i) {\n }", "@Override\n public void onAccuracyChanged(Sensor sensor, int i) {\n }", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n float currentValue = sensorEvent.values[0];\n setTitle(\"Proximity Sensor\");\n //display the retrieved value onto the textView\n proximitySensorText.setText(\"Distance = \" + String.valueOf(currentValue) + \" cm\");\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if(runOrNot) {\n Sensor mySensor = event.sensor;\n if (mySensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n long current = System.currentTimeMillis();\n\n if((current - prevTime) > 100) {\n prevTime = current;\n x = event.values[0];\n y = event.values[1];\n z = event.values[2];\n String text = \"x: \" + x + \" y: \" + y + \" z: \" + z;\n\n listOfPoints.append(new Coordinate(x,y,z));\n box.setText(text + \"\\n\" + box.getText().toString());\n }\n\n }\n }\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n double aX = event.values[0];\n double aY = event.values[1];\n double aZ = event.values[2];\n\n if(!isPowerConnected){\n // Call fall detection method - argument acceleration vector\n fallDetection(new MovementInstance(aX, aY, aZ).getAccelerationVector());\n //Alternate Method - argument MovementInstance object\n// fallDetectionV2(new MovementInstance(aX, aY, aZ));\n }\n else{\n // Call earthquake detection method - argument movement object\n earthquakeDetect(new MovementInstance(aX, aY, aZ));\n }\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if( event.values[0] < sensor.getMaximumRange() )\n {\n //// SI LA PANTALLA NO FUE TAPADA ANTERIORMENTE -> GUARDO EL MOMENTO DE INICIO DEL JUEGO\n if( !pantallaEstabaTapada )\n {\n tiempoDeInicio= SystemClock.uptimeMillis();\n pantallaEstabaTapada=true;\n getWindow().getDecorView().setBackgroundColor(Color.RED);\n }\n }\n else\n {\n //// SI LA PANTALLA ESTABA TAPADA Y AHORA NO LO ESTA --> CALCULO LOS SEGUNDOS TRANSCURRIDOS Y DESTRUYO EL LISTENER DEL SENSOR\n if( pantallaEstabaTapada )\n {\n segundosTranscurridos= pasarMilisegundoASegundo(SystemClock.uptimeMillis() - tiempoDeInicio);\n pantallaEstabaTapada=false;\n getWindow().getDecorView().setBackgroundColor(Color.WHITE);\n\n ServicePOST comunicacionApiRest = new ServicePOST(getApplicationContext());\n comunicacionApiRest.registrarEvento(String.valueOf(event.values[0]), \"SENSOR DE PROXIMIDAD\");\n\n sensorManag.unregisterListener(sensorListener);\n\n }\n }\n guardarInfoEnSharedPreference(event.values[0]);\n }", "@Override\n public void onAccuracyChanged(Sensor sensor, int i) {\n }", "@Override public void onSensorChanged(SensorEvent event) \n\t{\n\t\tif (Sensor.TYPE_ACCELEROMETER == event.sensor.getType())\n\t\t{\n\t\t\t//The values provided from the accelerometer are always relative to the default screen orientation which can change\n\t\t\t//from device to device. To alleviate this we are converting into \"screen\" coordinates. This has been taken from\n\t\t\t//the nvidia accelerometer white paper which can be found at : http://developer.download.nvidia.com/tegra/docs/tegra_android_accelerometer_v5f.pdf\n\t\t\tActivity activity = CSApplication.get().getActivity();\n\t\t\tWindowManager windowManager = (WindowManager)activity.getSystemService(Activity.WINDOW_SERVICE);\n\t\t\tint rotationIndex = windowManager.getDefaultDisplay().getRotation();\n\t\t\tAxisSwap axisSwap = m_axisSwapForRotation[rotationIndex];\n\t\t\tfloat fScreenX = ((float)axisSwap.m_negateX) * event.values[axisSwap.m_sourceX];\n\t\t\tfloat fScreenY = ((float)axisSwap.m_negateY) * event.values[axisSwap.m_sourceY];\n\t\t\tfloat fScreenZ = event.values[2];\n\n\t\t\t//the values provided by android are in ms^-2. Accelerometer values are more typically given in\n\t\t\t//terms of \"g\"'s so we are converting here. We are also converting from a x, y and z positive in the\n\t\t\t//left, up and backward directions respectively to right, up and forward directions to be more consistent with iOS.\n\t\t\tfinal float k_gravity = 9.80665f;\n\t\t\tfinal float k_accelerationX = -fScreenX / k_gravity;\n\t\t\tfinal float k_accelerationY = fScreenY / k_gravity;\n\t\t\tfinal float k_accelerationZ = -fScreenZ / k_gravity;\n\t\t\t\n\t\t\t//update acceleration on main thread.\n\t\t\tRunnable task = new Runnable()\n\t\t\t{ \n\t\t\t\t@Override public void run() \n\t\t\t\t{\n\t\t\t\t\tif (true == mbHasAccelerometer && true == mbListening)\n\t\t\t\t\t{\n\t\t\t UpdateAcceleration(k_accelerationX, k_accelerationY, k_accelerationZ);\n\t\t\t }\n\t\t\t\t}\n\t\t\t};\n\t\t\tCSApplication.get().scheduleMainThreadTask(task);\n\t\t}\n\t}", "@Override\n public void onAccuracyChanged(Sensor arg0, int arg1) {\n\n }", "@Override\n public final void onSensorChanged(SensorEvent event) {\n linearAccelerations = event.values;\n linearAccelerations[0] = linearAccelerations[0]-xOff;\n linearAccelerations[1] = linearAccelerations[1]-yOff;\n linearAccelerations[2] = linearAccelerations[2]-zOff;\n xAccel = (float) round(linearAccelerations[0]/9.8, 3);\n yAccel = (float) round(linearAccelerations[1]/9.8, 3);\n zAccel = (float) round(linearAccelerations[2]/9.8, 3);\n// Log.i(appLabel, \"Acceleration: (\"+xAccel+\", \"+yAccel+\", \"+zAccel+\")\");\n xAccelSquared = (float) round(xAccel*xAccel, 3);\n yAccelSquared = (float) round(yAccel*yAccel, 3);\n zAccelSquared = (float) round(zAccel*zAccel, 3);\n //If they are negative accelerations, squaring them will have made them positive\n if (xAccel < 0) {\n xAccelSquared = xAccelSquared*-1;\n }\n if (yAccel < 0) {\n yAccelSquared = yAccelSquared*-1;\n }\n if (zAccel < 0) {\n zAccelSquared = zAccelSquared*-1;\n }\n xAccelOutput.setText(String.valueOf(xAccel));\n yAccelOutput.setText(String.valueOf(yAccel));\n zAccelOutput.setText(String.valueOf(zAccel));\n// Log.i(appLabel, \"Acceleration squares: \"+xAccelSquared+\", \"+yAccelSquared+\", \"+zAccelSquared);\n float accelsSum = xAccelSquared+yAccelSquared+zAccelSquared;\n double accelsRoot;\n if (accelsSum < 0) {\n accelsSum = accelsSum * -1;\n accelsRoot = Math.sqrt(accelsSum) * -1;\n } else {\n accelsRoot = Math.sqrt(accelsSum);\n }\n// Log.i(appLabel, \"Acceleration squares sum: \"+accelsSum);\n// Log.i(appLabel, \"Acceleration sqrt:\"+accelsRoot);\n cAccel = (float) round(accelsRoot, 3);\n// Log.i(appLabel, \"Net Acceleration: \"+cAccel);\n //Store the maximum acceleration\n if (cAccel > maxAccel) {\n maxAccel = cAccel;\n }\n accelOutput.setText(String.valueOf(cAccel));\n if (isRunning) {\n setSpeed();\n }\n if (speed >= 60) {\n timeToSixty = seconds;\n timeToSixtyOutput.setText(String.valueOf(timeToSixty));\n stopTimer();\n }\n }", "public void alertMonitor(Sensor sensor) throws RemoteException;", "public void Changed(List<Sensor> sensors, int monitorCount, int sensorCount) throws java.rmi.RemoteException;" ]
[ "0.76291645", "0.7543118", "0.75394964", "0.74349546", "0.74349546", "0.73891777", "0.73874193", "0.72824717", "0.72824717", "0.7233742", "0.7132228", "0.70917904", "0.7079636", "0.70704496", "0.7016167", "0.69529283", "0.6862651", "0.68607515", "0.6840024", "0.6825336", "0.67801124", "0.6776987", "0.6751945", "0.67336243", "0.6696576", "0.6678047", "0.6674798", "0.6658924", "0.6621157", "0.66165984", "0.65824324", "0.6568745", "0.65421146", "0.65407777", "0.6530265", "0.6499288", "0.6493191", "0.6488078", "0.6478232", "0.6450511", "0.64463955", "0.6415322", "0.6406596", "0.64062357", "0.6390424", "0.6377601", "0.63761973", "0.635663", "0.63444704", "0.63434803", "0.63413805", "0.6340383", "0.63395816", "0.6336101", "0.63307226", "0.6302444", "0.6282069", "0.62811995", "0.6257381", "0.6247236", "0.6226062", "0.6206181", "0.6200594", "0.6199436", "0.6199094", "0.6195045", "0.61825633", "0.61815226", "0.61638594", "0.61551744", "0.6153051", "0.6151484", "0.6150884", "0.6144285", "0.61186606", "0.61173797", "0.6116018", "0.6108167", "0.61071515", "0.60986567", "0.60983264", "0.6092231", "0.60893786", "0.60877943", "0.6074139", "0.6066217", "0.60631514", "0.6056773", "0.6055048", "0.6055048", "0.605408", "0.6053892", "0.60498005", "0.60485893", "0.60474926", "0.6046293", "0.6039904", "0.6037269", "0.60333437", "0.60331386" ]
0.6352002
48
Is called when a new sensor value was received.
void onNewPulse(int pulse, int spo2 );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onSensorChanged() {\n\t\tsensorChanged();\n\t}", "@Override\n public void onSensorChanged(SensorEvent event) {\n long now = SystemClock.elapsedRealtime();\n\n long deltaMs = 0;\n if (mLastUpdateTS != 0) {\n deltaMs = now - mLastUpdateTS;\n if (mUpdateTargetMs > 0 && deltaMs < mUpdateTargetMs) {\n // New sample is arriving too fast. Discard it.\n return;\n }\n }\n\n // Format and post message for the emulator.\n float[] values = event.values;\n final int len = values.length;\n\n mChangeMsg.order(getEndian());\n mChangeMsg.position(0);\n mChangeMsg.putInt(getType());\n mChangeMsg.putFloat(values[0]);\n if (len > 1) {\n mChangeMsg.putFloat(values[1]);\n if (len > 2) {\n mChangeMsg.putFloat(values[2]);\n }\n }\n postMessage(ProtocolConstants.SENSORS_SENSOR_EVENT, mChangeMsg);\n\n // Computes average update time for this sensor and average globally.\n if (mLastUpdateTS != 0) {\n if (mGlobalAvgUpdateMs != 0) {\n mGlobalAvgUpdateMs = (mGlobalAvgUpdateMs + deltaMs) / 2;\n } else {\n mGlobalAvgUpdateMs = deltaMs;\n }\n }\n mLastUpdateTS = now;\n\n // Update the UI for the sensor, with a static throttling of 10 fps max.\n if (hasUiHandler()) {\n if (mLastDisplayTS != 0) {\n long uiDeltaMs = now - mLastDisplayTS;\n if (uiDeltaMs < 1000 / 4 /* 4fps in ms */) {\n // Skip this UI update\n return;\n }\n }\n mLastDisplayTS = now;\n\n mValues[0] = values[0];\n if (len > 1) {\n mValues[1] = values[1];\n if (len > 2) {\n mValues[2] = values[2];\n }\n }\n mValue = null;\n\n Message msg = Message.obtain();\n msg.what = SENSOR_DISPLAY_MODIFIED;\n msg.obj = MonitoredSensor.this;\n notifyUiHandlers(msg);\n }\n\n if (DEBUG) {\n long now2 = SystemClock.elapsedRealtime();\n long processingTimeMs = now2 - now;\n Log.d(TAG, String.format(\"glob %d - local %d > target %d - processing %d -- %s\",\n mGlobalAvgUpdateMs, deltaMs, mUpdateTargetMs, processingTimeMs,\n mSensor.getName()));\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() == SENS_ACCELEROMETER && event.values.length > 0) {\n float x = event.values[0];\n float y = event.values[1];\n float z = event.values[2];\n\n latestAccel = (float)Math.sqrt(Math.pow(x,2.)+Math.pow(y,2)+Math.pow(z,2));\n //Log.d(\"pow\", String.valueOf(latestAccel));\n\n }\n // send heartrate data and create new intent\n if (event.sensor.getType() == SENS_HEARTRATE && event.values.length > 0 && event.accuracy >0) {\n\n Log.d(\"Sensor\", event.sensor.getType() + \",\" + event.accuracy + \",\" + event.timestamp + \",\" + Arrays.toString(event.values));\n\n int newValue = Math.round(event.values[0]);\n long currentTimeUnix = System.currentTimeMillis() / 1000L;\n long nSeconds = 30L;\n \n if(newValue!=0 && lastTimeSentUnix < (currentTimeUnix-nSeconds)) {\n lastTimeSentUnix = System.currentTimeMillis() / 1000L;\n currentValue = newValue;\n Log.d(TAG, \"Broadcast HR.\");\n Intent intent = new Intent();\n intent.setAction(\"com.example.Broadcast\");\n intent.putExtra(\"HR\", event.values);\n intent.putExtra(\"ACCR\", latestAccel);\n intent.putExtra(\"TIME\", event.timestamp);\n intent.putExtra(\"ACCEL\", latestAccel);\n\n\n Log.d(\"change\", \"send intent\");\n\n sendBroadcast(intent);\n\n client.sendSensorData(event.sensor.getType(), latestAccel, event.timestamp, event.values);\n }\n }\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n // Send data to phone\n if (count == 5) {\n count = 0;\n// Log.d(\"hudwear\", \"send accel data to mobile...\"\n// + \"\\nx-axis: \" + event.values[0]\n// + \"\\ny-axis: \" + event.values[1]\n// + \"\\nz-axis: \" + event.values[2]\n// );\n// Log.d(\"hudwear\", \"starting new task.\");\n\n if (connected)\n Log.d(\"atest\", \"values: \" + event.values[0] + \", \" + event.values[1] + \", \" + event.values[2]);\n// new DataTask().execute(new Float[]{event.values[0], event.values[1], event.values[2]});\n }\n else count++;\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n float[] valuesCopy = event.values.clone();\n\n if (uptime == 0) {\n uptime = event.timestamp;\n }\n\n double x = (double) ((event.timestamp - uptime))/1000000000.0;\n this.addValues(x, valuesCopy);\n\n TextView xAxisValue = (TextView) findViewById(R.id.xAxisValue);\n xAxisValue.setText(Float.toString(valuesCopy[0]) + \" \" + STI.getUnitString(sensorType));\n\n if (STI.getNumberValues(sensorType) > 1) {\n //set y value to textfield\n TextView yAxisValue = (TextView) findViewById(R.id.yAxisValue);\n yAxisValue.setText(Float.toString(valuesCopy[1]) + \" \" + STI.getUnitString(sensorType));\n\n //set z value to textfield\n TextView zAxisValue = (TextView) findViewById(R.id.zAxisValue);\n zAxisValue.setText(Float.toString(valuesCopy[2]) + \" \" + STI.getUnitString(sensorType));\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n long currentTimeUnix = System.currentTimeMillis() / 1000L;\n long nSeconds = 30L;\n\n // send heartrate data and create new intent\n if (event.sensor.getType() == SENS_HEARTRATE && event.values.length > 0 && event.accuracy > 0) {\n int newValue = Math.round(event.values[0]);\n\n if(newValue!=0 && lastTimeSentUnixHR < (currentTimeUnix-nSeconds)) {\n lastTimeSentUnixHR = System.currentTimeMillis() / 1000L;\n currentValue = newValue;\n\n Log.d(TAG, \"Broadcast HR.\");\n Intent intent = new Intent();\n intent.setAction(\"com.example.Broadcast\");\n intent.putExtra(\"HR\", event.values);\n intent.putExtra(\"ACCR\", event.accuracy);\n intent.putExtra(\"TIME\", event.timestamp);\n sendBroadcast(intent);\n\n client.sendSensorData(event.sensor.getType(), event.accuracy, event.timestamp, event.values);\n\n }\n }\n // also send motion/humidity/step data to know when NOT to interpret hr data\n\n if (event.sensor.getType() == SENS_STEP_COUNTER && event.values[0]-currentStepCount!=0) {\n\n if(lastTimeSentUnixSC < (currentTimeUnix-nSeconds)){\n lastTimeSentUnixSC = System.currentTimeMillis() / 1000L;\n currentStepCount = event.values[0];\n client.sendSensorData(event.sensor.getType(), event.accuracy, event.timestamp, event.values);\n }\n\n }\n\n if (event.sensor.getType() == SENS_ACCELEROMETER) {\n\n if(lastTimeSentUnixACC < (currentTimeUnix-nSeconds)){\n lastTimeSentUnixACC = System.currentTimeMillis() / 1000L;\n\n client.sendSensorData(event.sensor.getType(), event.accuracy, event.timestamp, event.values);\n }\n }\n\n }", "@Override\r\n\t\t\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\t\ttemp_m[0] = event.values[0];\r\n\t\t\t\ttemp_m[1] = event.values[1];\r\n\t\t\t\ttemp_m[2] = event.values[2];\r\n\t\t\t}", "@Override\n public void OnSensorChanged(SsensorEvent event) {\n Ssensor sIr = event.sensor;\n StringBuffer sb = new StringBuffer();\n sb.append(\"==== Sensor Information ====\\n\")\n .append(\"Name : \" + sIr.getName() + \"\\n\")\n .append(\"Vendor : \" + sIr.getVendor() + \"\\n\")\n .append(\"Type : \" + sIr.getType() + \"\\n\")\n .append(\"SDK Version : \"\n + mSsensorExtension.getVersionName() + \"\\n\")\n .append(\"MaxRange : \" + sIr.getMaxRange() + \"\\n\")\n .append(\"Resolution : \" + sIr.getResolution() + \"\\n\")\n .append(\"FifoMaxEventCount : \" + sIr.getFifoMaxEventCount()\n + \"\\n\")\n .append(\"Power : \" + sIr.getPower() + \"\\n\")\n .append(\"----------------------------\\n\")\n .append(\"RED LED RAW DATA(HRM) : \" + event.values[0] + \"\\n\");\n tRED.setText(sb.toString());\n }", "public void recieve(String reading) {\n\t\tif(zeroValues == null) {\n\t\t\tsetZeroValues(reading);\n\t\t\treturn;\n\t\t}\n\t\tSensorReading s = extractReading(reading);\n\t\tif(s != null) {\n\t\t\tsensorData.add(s);\n\t\t\tnotifyListeners(s);\n\t\t}\n\t}", "public void handleSensorEvents(){\n\t}", "protected void received(){\n\t\tdouble max = 100; // this is the maximum value rain level range, the unit is mm/h.\n\t\tRandom random = new Random(); // Start a constructor to create random value.\n\n\t\t// Create a random double value between (0 to 400) mm/h and store the value into rain level parameter with 2 decimal places.\n\t\tthis.rain_level = Math.abs(random.nextGaussian() + 5);\n\t}", "@Override\n public void receivedSensor(SensorData sensor) {\n synchronized(_sensorListeners) {\n if (!_sensorListeners.containsKey(sensor.channel)) return;\n }\n \n try {\n // Construct message\n Response resp = new Response(UdpConstants.NO_TICKET, DUMMY_ADDRESS);\n resp.stream.writeUTF(UdpConstants.COMMAND.CMD_SEND_SENSOR.str);\n UdpConstants.writeSensorData(resp.stream, sensor);\n \n // Send to all listeners\n synchronized(_sensorListeners) {\n Map<SocketAddress, Integer> _listeners = _sensorListeners.get(sensor.channel);\n _udpServer.bcast(resp, _listeners.keySet());\n }\n } catch (IOException e) {\n throw new RuntimeException(\"Failed to serialize sensor \" + sensor.channel);\n }\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\n\t}", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\n\t}", "@Override\r\n public final void onSensorChanged(SensorEvent event) {\n double a0 = (double) event.values[0];\r\n double a1 = (double) event.values[1];\r\n double a2 = (double) event.values[2];\r\n\r\n double a = sqrt(a0*a0+a1*a1+a2*a2);\r\n\r\n // Do something with this sensor value.\r\n\r\n TextView textView = (TextView) findViewById(R.id.text_box2);\r\n textView.setText(Double.toString(a));\r\n\r\n if(count<size_accels) {\r\n accelerations[count] = a;\r\n times[count] = event.timestamp;\r\n }\r\n count = count + 1;\r\n }", "@Override\n public void OnSensorChanged(SsensorEvent event) {\n Ssensor sIr = event.sensor;\n StringBuffer sb = new StringBuffer();\n sb.append(\"==== Sensor Information ====\\n\")\n .append(\"Name : \" + sIr.getName() + \"\\n\")\n .append(\"Vendor : \" + sIr.getVendor() + \"\\n\")\n .append(\"Type : \" + sIr.getType() + \"\\n\")\n .append(\"SDK Version : \"\n + mSsensorExtension.getVersionName() + \"\\n\")\n .append(\"MaxRange : \" + sIr.getMaxRange() + \"\\n\")\n .append(\"Resolution : \" + sIr.getResolution() + \"\\n\")\n .append(\"FifoMaxEventCount : \" + sIr.getFifoMaxEventCount()\n + \"\\n\").append(\"Power : \" + sIr.getPower() + \"\\n\")\n .append(\"----------------------------\\n\")\n .append(\"IR RAW DATA(HRM) : \" + event.values[0] + \"\\n\");\n tIR.setText(sb.toString());\n }", "private void UI_RefreshSensorData ()\r\n\t{\r\n\t\t\t\t\r\n\t\tlong now = System.currentTimeMillis();\r\n\t\t\r\n\t\tif (now-ts_last_rate_calc>1000)\r\n\t\t{\r\n\t\t\tsensor_event_rate=last_nAccVal/((now-ts_last_rate_calc)/1000.0);\r\n\t\t\tts_last_rate_calc=now;\r\n\t\t}\r\n\t}", "public void receivedValue(HashMap<Sensor, Double> e) {\n\t\ttry {\n\t\t\tarmIMUAngle = e.get(Sensor.ARM_ANGLE);\n\t\t} catch (NullPointerException error) {\n\t\t\tif (debug)\n\t\t\t\tSystem.out.println(\"Bad Angle Sensor\");\n\t\t}\n\t\ttry {\n\t\t\tcurrentDist = e.get(Sensor.ULTRASONIC_DISTANCE);\n\t\t} catch (NullPointerException error) {\n\t\t\tif (debug)\n\t\t\t\tSystem.out.println(\"Bad Ultrasonic Sensor\");\n\t\t}\n\t}", "private void timerEngine(){\n SensorController me = this;\n //generate new value or send existing to server\n if(isValueGeneratorRunning()){\n logger.trace(\"Generating new sensor value\");\n //create new values\n try{\n getModel().getValues().stream()\n .filter(Value::isGenerateValue) //if new value should be generated\n .forEach(v -> {\n Object next = v.nextValue();\n if (next != null) {\n Platform.runLater(() -> v.setValue(next));\n }\n }); //do it\n }catch (IllegalArgumentException e){\n adapterController.sendError(toString() + \" -> cannot generate new value!\",e,false);\n }\n logger.trace(\"Building sensor message\");\n //create XML message with new values\n XMLmessage = adapterController.getAdapter().getProtocol()\n .buildSensorMessage(adapterController.getAdapter().getProtocol().buildAdapterMessage(adapterController.getAdapter()), getModel());\n //change engine to send message mod\n setRunValueGenerator(false);\n }else if(getModel().getStatus()){\n //if sensor's message doesn't exist, error is showed\n if(XMLmessage == null){\n adapterController.sendError(toString() + \" doesn't have XML message to send\",null,false);\n return;\n }\n //if we have means to send message and adapter is registered, send message to adapter\n if(adapterController.getServerReceiver() != null || adapterController.getAdapter().getRegistered()){\n //full message contains information about adapter\n if(isFullMessage()){\n //used in \"Performance simulation\"\n adapterController.sendMessage(me.toString() + \" --> data sent\",XMLmessage,me, OutMessage.Type.SENSOR_MESSAGE);\n }else{\n //short message contains information only about sensor\n //used in \"Detailed simulation\"\n adapterController.sendMessage(\"Sensor \" + me.toString() + \" trying to send message.\");\n adapterController.sendMessage(\"Sensor \" + me.toString() + \" --> data sent\",XMLmessage,me, OutMessage.Type.SENSOR_MESSAGE);\n }\n //change engine to generate value mod\n setRunValueGenerator(true);\n }\n }\n }", "@Override\n public void onReceiveValue(String value) {\n\n }", "public void setSensorValue (float value) {\n this.currentSensorValue = value;\n }", "@Override\n public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {\n if (HUMIDITY_DATA_CHAR.equals(characteristic.getUuid())) {\n mHandler.sendMessage(Message.obtain(null, MSG_HUMIDITY, characteristic));\n }\n if (PRESSURE_DATA_CHAR.equals(characteristic.getUuid())) {\n mHandler.sendMessage(Message.obtain(null, MSG_PRESSURE, characteristic));\n }\n if (PRESSURE_CAL_CHAR.equals(characteristic.getUuid())) {\n mHandler.sendMessage(Message.obtain(null, MSG_PRESSURE_CAL, characteristic));\n }\n\n //After reading the initial value, next we enable notifications\n setNotifyNextSensor(gatt);\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n timestamp = event.timestamp;\n gyroX = event.values[0];\n gyroY = event.values[1];\n gyroZ = event.values[2];\n\n this.setChanged();\n this.notifyObservers(Sensor.TYPE_GYROSCOPE);\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n deltaX = Math.abs(lastX - event.values[0]);\n deltaY = Math.abs(lastY - event.values[1]);\n deltaZ = Math.abs(lastZ - event.values[2]);\n\n // if the change is below 5, it is just plain noise\n if (deltaX < 5)\n deltaX = 0;\n if (deltaY < 5)\n deltaY = 0;\n if (deltaZ < 5)\n deltaZ = 0;\n\n // set the last know values of x,y,z\n lastX = event.values[0];\n lastY = event.values[1];\n lastZ = event.values[2];\n\n vibrate();\n\n }", "@Override\n public void onReceiveValue(String value) {\n\n }", "@Override\n public void onReceiveValue(String value) {\n\n }", "@Override\n public void onReceiveValue(String value) {\n\n }", "@Override\n public void onReceiveValue(String value) {\n\n }", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n float currentValue = sensorEvent.values[0];\n setTitle(\"Proximity Sensor\");\n //display the retrieved value onto the textView\n proximitySensorText.setText(\"Distance = \" + String.valueOf(currentValue) + \" cm\");\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\tMessage msg = null;\n\t\tfloat values[] = event.values;\n\t\tsynchronized (this) { \n\t\t\tswitch(event.sensor.getType()) {\n\t\t\t/** 4.LIGHT:SensorEvent type is TYPE_LIGHT */\n\t\t\tcase Sensor.TYPE_LIGHT:\n\t\t\t\tsendLSensorChangedMSG(values, msg);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t} // end of switch(event.sensor.getType())\n\t\t} // end of synchronized (this)\n\t}", "public interface OnSensorValueChangeListener {\n public void onSensorValueChanged(int newVal);\n}", "@Override\n public void OnAccuracyChanged(Ssensor arg0, int arg1) {\n }", "@Override\r\n\tpublic void onUpdateIO(int device, int type, int code, int value,\r\n\t\t\tint timestamp) {\n\t\t\r\n\t}", "RegisterSensor() {\n }", "@Override\n public void onSensorChanged(SensorEvent event)\n {\n // Get the sensor which has triggered the event\n\n Sensor sensor = event.sensor;\n\n // Perform differing functionality depending upon\n // the sensor type (caller)\n\n switch (event.sensor.getType())\n {\n case Sensor.TYPE_STEP_COUNTER:\n\n if (reportedSteps < 1){\n\n // Log the initial value\n\n reportedSteps = (int)event.values [0];\n }\n\n // Calculate steps taken based on\n // first value received.\n\n stepsTaken = (int)event.values [0] - reportedSteps;\n\n // Output the value to the simple GUI\n\n countText.setText(\"Cnt: \" + stepsTaken);\n\n break;\n\n case Sensor.TYPE_STEP_DETECTOR:\n\n // Increment the step detector count\n\n stepDetector++;\n\n // Output the value to the simple GUI\n\n detectText.setText(\"Det: \" + stepDetector);\n\n break;\n\n case Sensor.TYPE_ACCELEROMETER:\n\n // Get the accelerometer values and set them to a string with 2dp\n\n String x = String.format(\"%.02f\", event.values[0]);\n String y = String.format(\"%.02f\", event.values[1]);\n String z = String.format(\"%.02f\", event.values[2]);\n\n // Output the string to the GUI\n\n accelText.setText(\"Acc:\" + x + \",\" + y + \",\" + z);\n\n break;\n }\n }", "@Override\n public void handleGpioPinAnalogValueChangeEvent(GpioPinAnalogValueChangeEvent event) {\n notifyListeners(new TemperatureChangeEvent(sensor, getValue(), event.getValue()));\n }", "@Override\n\tprotected int getSensorData() {\n\t\treturn sensor.getLightValue();\n\t}", "public double getValue() {\n\t\treturn sensorval;\n\t}", "public void logSensorData () {\n\t}", "protected void postSensorValues(Sensor[] s) { sensors = s; }", "@Override\n public void onSensorChanged(SensorEvent event) {\n textView.setText(event.values[0]+\"\\n\"+event.values[1]+\"\\n\"+event.values[2]);\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if( event.values[0] < sensor.getMaximumRange() )\n {\n //// SI LA PANTALLA NO FUE TAPADA ANTERIORMENTE -> GUARDO EL MOMENTO DE INICIO DEL JUEGO\n if( !pantallaEstabaTapada )\n {\n tiempoDeInicio= SystemClock.uptimeMillis();\n pantallaEstabaTapada=true;\n getWindow().getDecorView().setBackgroundColor(Color.RED);\n }\n }\n else\n {\n //// SI LA PANTALLA ESTABA TAPADA Y AHORA NO LO ESTA --> CALCULO LOS SEGUNDOS TRANSCURRIDOS Y DESTRUYO EL LISTENER DEL SENSOR\n if( pantallaEstabaTapada )\n {\n segundosTranscurridos= pasarMilisegundoASegundo(SystemClock.uptimeMillis() - tiempoDeInicio);\n pantallaEstabaTapada=false;\n getWindow().getDecorView().setBackgroundColor(Color.WHITE);\n\n ServicePOST comunicacionApiRest = new ServicePOST(getApplicationContext());\n comunicacionApiRest.registrarEvento(String.valueOf(event.values[0]), \"SENSOR DE PROXIMIDAD\");\n\n sensorManag.unregisterListener(sensorListener);\n\n }\n }\n guardarInfoEnSharedPreference(event.values[0]);\n }", "@Override\n public void serialEvent(SerialPortEvent oEvent)\n {\n if (oEvent.getEventType() == SerialPortEvent.DATA_AVAILABLE) {\n try{\n String strIn = br.readLine();\n String[] strPara = strIn.split(\",\");\n if(strPara.length != 2){\n System.out.println(\"[Serial error]: \" + strIn);\n return;\n }\n\n // Check data validaty\n try{\n for(int i=0 ; i<strPara.length ; i++)\n Double.valueOf(strPara[i]);\n }\n catch(Exception e){\n System.out.println(\"[Serial error]: \" + strIn);\n return;\n }\n \n // Update data to window interface\n parent.setEMGData_From_SerialPort(strPara[0], strPara[1]);\n } \n catch (Exception e) {\n e.printStackTrace();\n }\n }\n // Ignore all the other eventTypes, but you should consider the other ones.\n\t}", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n storage.writePhoneAccelerometer(new double[]{sensorEvent.values[0], sensorEvent.values[1], sensorEvent.values[2]});\n //System.out.println(\"x: \" + sensorEvent.values[0] + \", y: \" + sensorEvent.values[1] + \", z: \" + sensorEvent.values[2]);\n }", "public void onSensorChanged(SensorEvent event) {\n\t\t\tint type = event.sensor.getType();\n\t\t\tif (type == Sensor.TYPE_ACCELEROMETER) {\n\t\t\t\tlong curTime = System.currentTimeMillis();\n\t\t\t\t// only allow one update every 100ms, otherwise updates\n\t\t\t\t// come way too fast and the phone gets bogged down\n\t\t\t\t// with garbage collection\n\t\t\t\t//Log.d(TAG, \"onSensorChanged(\"+type+\")\");\t\t\t\t\n\t\t\t\tif (lastUpdate == -1 || (curTime - lastUpdate) > 40) {\n\t\t\t\t\tlastUpdate = curTime;\t\t\t\t\n\t\t\t\t\tsynchronized (LOCK){\n\t\t\t\t\t\tmLastAccOrientation = calculateAngle(event);\n\t\t\t\t\t\tmLastSample.x = event.values[0];\n\t\t\t\t\t\tmLastSample.y = event.values[1];\n\t\t\t\t\t\tmLastSample.z = event.values[2];\n\t\t\t\t\t\tmLastSample.angle = mLastAccOrientation.angle;\t\t\n\t\t\t\t\t\t//mLastSample.orientation = mLastAccOrientation.orientation;\n\t\t\t\t\t\tmLastSample.orientation = mLastAccOrientation.rotation*90;\n\t\t\t\t\t\tmLastSample.threshold = mLastAccOrientation.threshold;\n\t\t\t\t\t\tmBuffer = mLastSample.x+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.y+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.z+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.angle+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.orientation+\",\"+\n\t\t\t\t\t\t\t\t mLastSample.threshold;\n\t\t\t\t\t\tif (mShowLog)\n\t\t\t\t\t\t\tLog.d(TAG, mBuffer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void updateLightSensorValues()\n {\n sendMessage((byte)Constants.LIGHTSENSVAL,(byte)Constants.REQ);\n try {\n Thread.sleep(4000);\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n sendMessage((byte)Constants.POTVAL, (byte)Constants.REQ);\n if(progPotToggleButton.isChecked())\n {\n int x =0;\n try {\n x = Integer.parseInt(progValueEditText.getText().toString());\n if(x>=0 && x<256)\n sendMessage((byte)Constants.PROGVAL,(byte)x);\n try {\n Thread.sleep(4000);\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n sendMessage((byte)Constants.USEPOT,(byte)Constants.NO);\n } catch (NumberFormatException e) {\n messageView.append(\"int för helvete\");\n }\n }else\n sendMessage((byte)Constants.USEPOT,(byte)Constants.YES);\n\n }", "@Override\r\n\t\t\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\t\ttemp_r[0] = event.values[0];\r\n\t\t\t\ttemp_r[1] = event.values[1];\r\n\t\t\t\ttemp_r[2] = event.values[2];\r\n\t\t\t\t// TipsTextView.setText(String.valueOf(temp_r[0]) + \" \"\r\n\t\t\t\t// + String.valueOf(temp_r[1]) + \" \"\r\n\t\t\t\t// + String.valueOf(temp_r[2]));\r\n\t\t\t}", "@Override\n\tpublic void onReceivePressure(int val, int pos) {\n\n\t}", "public void sensorSystem() {\n\t}", "@Override\n public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {\n readNextSensor(gatt);\n }", "@Override\n public void ioSampleReceived(RemoteXBeeDevice remote, IOSample sample) {\n IOValue value = sample.getDigitalValue(line);\n invoke(remote, value);\n }", "public void onTriggerChange() {\n findViewById(R.id.temp).post(new Runnable() {\n public void run() {\n ConsumerIrManager mCIR = ScaryUtil.getConsumerIRService(getApplicationContext());\n if (m_Inst.power) {\n TransmissionCode data = ScaryUtil.getIRCode(m_Inst.sequence, m_Inst.temp); // (TransmissionCode)samsung.get(m_Inst.temp);\n ScaryUtil.transmit(getApplicationContext(),data);\n }\n }\n });\n }", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n if (sensorEvent.sensor.getType() == Sensor.TYPE_ACCELEROMETER && s.equals(\"Accelerometre\")) {\n float Ax = sensorEvent.values[0];\n float Ay = sensorEvent.values[1];\n float Az = sensorEvent.values[2];\n\n acce = \" TimeAcc = \" + sensorEvent.timestamp + \"\\n Ax = \" + Ax + \" \" + \"\\n Ay = \" + Ay + \" \" + \"\\n Az = \" + Az + \"\\n\";\n\n // Do something with this sensor value .\n sensorTxt.setText(acce);\n Log.d(TAG, \" TimeAcc = \" + sensorEvent.timestamp + \" Ax = \" + Ax + \" \" + \" Ay = \" + Ay + \" \" + \" Az = \" + Az);\n }\n\n //LUMIERE\n if (sensorEvent.sensor.getType() == Sensor.TYPE_LIGHT && s.equals(\"Lumiere\")) {\n // La valeur de la lumière\n float lv = sensorEvent.values[0];\n\n light = \" TimeAcc = \" + sensorEvent.timestamp + \"\\n Light value = \" + lv + \"\\n\";\n //On affiche la valeur\n sensorTxt.setText(light);\n }\n\n //PROXIMITE\n if (sensorEvent.sensor.getType() == Sensor.TYPE_PROXIMITY && s.equals(\"Proximite\")) {\n // La valeur de proximité\n float p = sensorEvent.values[0];\n\n proxi = \" TimeAcc = \" + sensorEvent.timestamp + \"\\n Proximite value = \" + p + \"\\n\";\n //On affiche la valeur\n sensorTxt.setText(proxi);\n }\n\n //GYROSCOPE\n if (sensorEvent.sensor.getType() == Sensor.TYPE_GYROSCOPE && s.equals(\"Gyroscope\")) {\n // Les valeurs du gyroscope\n float xGyroscope = sensorEvent.values[0];\n float yGyroscope = sensorEvent.values[1];\n float zGyroscope = sensorEvent.values[2];\n\n gyro = \" TimeAcc = \" + sensorEvent.timestamp + \"\\n Valeur du gyroscope \\n Valeur en x = \" + xGyroscope + \" \" + \"\\n Valeur en y = \" + yGyroscope + \" \" + \"\\n Valeur en z = \" + zGyroscope + \"\\n\";\n //On affiche la valeur\n sensorTxt.setText(gyro);\n }\n\n }", "@Override\n\t\tpublic void onReceivePressure(int val, int pos) {\n\n\t\t}", "public void onSensorChanged(SensorEvent event) {\n try {\n Thread.sleep(16);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n //called when accelerometer senses directional change\n sensorX = event.values[0];\n sensorY = event.values[1];\n }", "protected void useDataOld() {\n\t\tfloat x = values[0];\n\t\tfloat y = values[1];\n\t\tfloat z = values[2];\n\n\t\tcallListener(new AccelarationSensorData(millis, nanos, x, y, z));\n\t}", "public void accionProximidad(SensorEvent sensorEvent){\n String valProximidad = String.valueOf(sensorEvent.values[0]);\n Float valor = Float.parseFloat(valProximidad);\n tviewProx.setText(Float.toString(valor));\n\n //VALOR ES LO QUE ME DA EL SENSOR ES EL DE PROXIMIDAD\n if(valor == 1){\n sm.unregisterListener(this);\n if(PuertaLecAppEscRas.getLed().getEstado().equals(\"on\")){\n Toast toast = Toast.makeText(getApplicationContext(), \"TRATANDO DE APAGAR LA LUZ\", Toast.LENGTH_LONG);\n toast.show();\n baseDatosSoaRef.child(\"PuertaEscAppLecRas\").child(\"Led\").child(\"estado\").setValue(\"off\");\n PuertaEscAppLecRas.setLed(\"off\");\n }else {\n Toast toast = Toast.makeText(getApplicationContext(), \"TRATANDO DE ENCENDER LA LUZ\", Toast.LENGTH_LONG);\n toast.show();\n baseDatosSoaRef.child(\"PuertaEscAppLecRas\").child(\"Led\").child(\"estado\").setValue(\"on\");\n PuertaEscAppLecRas.setLed(\"on\");\n }\n TareaLed tareaLed = new TareaLed();\n tareaLed.execute();\n }\n }", "public void handleUpdate(WasteBinSensorData updatedData)\n\t{\n\t\t// extract updated values and store them in the current instance\n\t\t// variables.\n\t\tthis.fillLevel = updatedData.getFillLevel();\n\t\tthis.temperatureAsMeasure = updatedData.getTemperature();\n\t\t\n\t\t// update the latest update time\n\t\tthis.latestUpdate = new Date();\n\t\tHashMap<String, Object> valuesMap = new HashMap<>();\n\t\tvaluesMap.put(\"getTemperature\", this.getTemperature());\n\t\tvaluesMap.put(\"getLevel\", this.getLevel());\n\t\tPWALNewDataAvailableEvent event = new PWALNewDataAvailableEvent(this.getUpdatedAt(), this.getPwalId(),\n\t\t\t\tthis.getExpiresAt(), valuesMap, this);\n\t\tlogger.info(\"Device {} is publishing a new data available event on topic: {}\", this.getPwalId(),\n\t\t\t\tthis.eventPublisher.getTopics());\n\t\tthis.eventPublisher.publish(event);\n\t\t\n\t}", "@Override\n public void onDataChanged() {\n }", "@Override\n public void onDataChanged() {\n }", "@Override\n public void onDataChanged() {\n\n }", "public void onDataChanged(){}", "private void saveSensor() {\n new SensorDataSerializer(sensorID, rawData);\n rawData.clear();\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\trawSensorValue = Math.round(event.values[0]); \n\t\twhile (rawSensorValue < 0) rawSensorValue += 360;\n\t\tm_azimuth_degrees = rawSensorValue - m_sun_azimuth_degrees;\n\t\twhile (m_azimuth_degrees < 0) m_azimuth_degrees += 360;\n\t\t\n\t\t// get pitch value\n\t\tint rotation = activity.getWindowManager().getDefaultDisplay().getRotation();\n\t\tif ((rotation == 0) || (rotation == 2)) m_pitch_degrees = Math.abs((int)event.values[1]); \n\t\telse m_pitch_degrees = Math.abs((int)event.values[2]);\n\t\t\n\t\t// Update event\n\t\tif (m_parent != null) m_parent.onSensorChanged(event);\n\t}", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n float valueAzimuth = event.values[0];\n float valuePitch = event.values[1];\n\n parent.updateAccelerometer(\n valueAzimuth / maximumRange, -valuePitch / maximumRange);\n\n }", "public void init(){\n int myValue = this.getArguments().getInt(\"sensor\");\r\n\r\n //Creates a sensor from the sensorID\r\n sensorM = (SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE);\r\n sensor = sensorM.getDefaultSensor(myValue);\r\n\r\n //Creates new sensor listener\r\n sensorListener = new SensorListener(getActivity(), myView, sensor);\r\n\r\n //Stores all sensor information in variables\r\n String name = sensor.getName();\r\n String vendor = sensor.getVendor();\r\n int version = sensor.getVersion();\r\n int minDelay = sensor.getMinDelay();\r\n int maxDelay = sensor.getMaxDelay();\r\n float range = sensor.getMaximumRange();\r\n float power = sensor.getPower();\r\n boolean isWakeUpSensor = sensor.isWakeUpSensor();\r\n float resolution = sensor.getResolution();\r\n\r\n //set text in all text views\r\n tvSensorName.setText(name);\r\n tvSensorVendor.setText(\"Vendor: \" + vendor);\r\n tvSensorVersion.setText(\"Version: \" + version);\r\n tvSensorMinDelay.setText(\"Minimum delay: \" + minDelay);\r\n tvSensorMaxDelay.setText(\"Maximum delay: \" + maxDelay);\r\n tvSensorRange.setText(\"Maximum range: \" + range);\r\n tvSensorPower.setText(\"Power consumption: \" + power);\r\n tvSensorWakeUp.setText(\"Is wake up sensor: \" + isWakeUpSensor);\r\n tvSensorResolution.setText(\"Resolution: \" + resolution);\r\n }", "@Override\r\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\r\n\t\tax = - event.values[0] / 7;\r\n\t\tay = event.values[1] / 7;\r\n\t}", "public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER && event.sensor.getType() != Sensor.TYPE_GYROSCOPE)\n return;\n\n if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n sensorCount++;\n\n if (sensorFirstRead) {\n nanotime = System.nanoTime();\n sensorFirstRead = false;\n } else {\n\n if (sensorCount > 0 && sensorCount % 10 == 0) {\n differenceNanoTime = System.nanoTime() - nanotime;\n if (differenceNanoTime > sensorCounterIntervalDelay) {\n differenceSeconds = (double) differenceNanoTime / 1000000000f;\n\n sensorAverageCount = sensorCount / differenceSeconds;\n sensorAverageCountTextView.setText(String.format(\"Read/s: %.2f\", sensorAverageCount));\n\n if (sensorFirstAverageCycle || Math.abs(sensorAverageCount - accValuesLimit * 2) > accValuesLimit * 0.2) {\n if (sensorFirstAverageCycle)\n sensorFirstAverageCycle = false;\n\n accValuesLimit = (int) sensorAverageCount / 2;\n gyroValuesLimit = accValuesLimit / 2;\n sensorCountLimitTextView.setText(String.format(\"Sensor count limit: %d\", accValuesLimit));\n\n stats.get(\"accX\").setLimit(accValuesLimit);\n stats.get(\"accY\").setLimit(accValuesLimit);\n stats.get(\"accZ\").setLimit(accValuesLimit);\n stats.get(\"accDegreeZ\").setLimit(accValuesLimit);\n stats.get(\"accDegreeX\").setLimit(accValuesLimit);\n stats.get(\"accDegreeY\").setLimit(accValuesLimit);\n stats.get(\"accTotalAcceleration\").setLimit(accValuesLimit);\n stats.put(\"gyroX\", new StatisticList(gyroValuesLimit));\n stats.put(\"gyroY\", new StatisticList(gyroValuesLimit));\n stats.put(\"gyroZ\", new StatisticList(gyroValuesLimit));\n }\n\n sensorCount = 0;\n nanotime = System.nanoTime();\n }\n }\n }\n }\n\n if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n\n mAccelerometerSensorX = event.values[0];\n mAccelerometerSensorY = event.values[1];\n mAccelerometerSensorZ = event.values[2];\n\n mAccelerometerTotalAcceleration = Math.sqrt(Math.pow(mAccelerometerSensorX, 2) + Math.pow(mAccelerometerSensorY, 2) + Math.pow(mAccelerometerSensorZ, 2));\n\n stats.get(\"accX\").addValue(mAccelerometerSensorX);\n stats.get(\"accY\").addValue(mAccelerometerSensorY);\n stats.get(\"accZ\").addValue(mAccelerometerSensorZ);\n stats.get(\"accTotalAcceleration\").addValue(mAccelerometerTotalAcceleration);\n\n tmp_y = stats.get(\"accY\").getAverage() / stats.get(\"accTotalAcceleration\").getAverage(); // g\n tmp_x = stats.get(\"accX\").getAverage() / stats.get(\"accTotalAcceleration\").getAverage();\n tmp_z = stats.get(\"accZ\").getAverage() / stats.get(\"accTotalAcceleration\").getAverage();\n\n mRotationDegreeZ = Math.asin(tmp_x) * 180 / Math.PI;\n if (Double.isNaN(mRotationDegreeZ))\n mRotationDegreeZ = stats.get(\"accDegreeZ\").getAverage() > 0 ? 90 : -90;\n\n mRotationDegreeX = Math.asin(tmp_z) * 180 / Math.PI;\n if (Double.isNaN(mRotationDegreeX))\n mRotationDegreeX = stats.get(\"accDegreeX\").getAverage() > 0 ? 90 : -90;\n\n mRotationDegreeY = Math.asin(tmp_y) * 180 / Math.PI;\n if (Double.isNaN(mRotationDegreeY))\n mRotationDegreeY = stats.get(\"accDegreeY\").getAverage() > 0 ? 90 : -90;\n\n stats.get(\"accDegreeZ\").addValue(mRotationDegreeZ);\n stats.get(\"accDegreeX\").addValue(mRotationDegreeX);\n stats.get(\"accDegreeY\").addValue(mRotationDegreeY);\n\n updateLog(Sensor.TYPE_ACCELEROMETER);\n }\n else\n if(event.sensor.getType()==Sensor.TYPE_GYROSCOPE)\n {\n mGyroX = event.values[0];\n mGyroY = event.values[1];\n mGyroZ = event.values[2];\n\n stats.get(\"gyroX\").addValue(mGyroX);\n stats.get(\"gyroY\").addValue(mGyroY);\n stats.get(\"gyroZ\").addValue(mGyroZ);\n\n updateLog(Sensor.TYPE_GYROSCOPE);\n }\n }", "@Override\n public void handleMessage(Message msg){\n switch (msg.what) {\n case PSensor.MESSAGE_STATE_CHANGE:\n break;\n case PSensor.MESSAGE_WRITE:\n break;\n case PSensor.MESSAGE_READ:\n PSensor.sensorData.parseInput((byte[])msg.obj);//parseInput((byte[])msg.obj);\n multiGauge.handleSensor(PSensor.sensorData.boost);\n multiGaugeVolts.handleSensor(PSensor.sensorData.batVolt);\n break;\n case PSensor.MESSAGE_DEVICE_NAME:\n break;\n case PSensor.MESSAGE_TOAST:\n break;\n default:\n break;\n }\n }", "@Override\n public void onProcessedValueChanged(DSensorEvent dSensorEvent) {\n if (Float.isNaN(dSensorEvent.values[0])) {\n textToSpeech.speak(\"Compass is not working ,\" +\n \"please calibrate ypur phone.\"\n ,TextToSpeech.QUEUE_FLUSH,null);\n\n } else {\n compass = Distance.round(Math.toDegrees(dSensorEvent.values[0]),1);\n if (compass < 0) {\n compass = Distance.round((compass + 360) % 360,1);\n }\n }\n //Toast.makeText(RoutesActivity.this, String.valueOf(dSensorEvent.values[0]), Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onSensorChanged (SensorEvent event) {\n\n Sensor mySensor = event.sensor;\n\n if (mySensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n float x = event.values[0];\n float y = event.values[1];\n float z = event.values[2];\n\n// output.setText(\"x=\" + x + \"y=\" + y + \"z=\" + z);\n // Log.i(\"acc\",(\"x=\" + x + \"y=\" + y + \"z=\" + z));\n// try {\n// String value=String.valueOf(x)+\",\"+String.valueOf(y)+\",\"+ String.valueOf(z);\n// // outvalue.write(value.getBytes());\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// Log.i(\"acc\", Float.toString(x) + Float.toString(y)+Float.toString(z));\n\n }\n }", "@Override\n\tvoid performReading() {\n\t\tthis.humiditySensorMeasurements.setAbsHumidity(this.varibles.get(\"absHumidity\"));\n\t\tthis.humiditySensorMeasurements.setRelHumidity(this.varibles.get(\"relHumidity\"));\n\t\tSensorResults hum = this.humiditySensorMeasurements.measurements();\n\t\n\t/*if (hum == SensorResults.HIGH && temp == SensorResults.HIGH) {\n\t\t\t// System.out.println(\"abnormal temp\");\n\t\t\tthis.creatMessage(\"abnormal hight Humidity\");\n\t\t}\n\t\tif (hum == SensorResults.LOW) {\n\t\t\t// System.out.println(\"abnormal Light\");\n\t\t\tthis.creatMessage(\"abnormal low Humidity\");\n\t\t}/**/\n\t\tmap.put(\"Light\", hum);\n\t\tthis.observer.update();\n\t}", "@Override\n public void onDataChanged(DataEventBuffer dataEvents) {\n\n Log.i(TAG, \"onDataChanged()\");\n\n for (DataEvent dataEvent : dataEvents) {\n if (dataEvent.getType() == DataEvent.TYPE_CHANGED) {\n DataItem dataItem = dataEvent.getDataItem();\n Uri uri = dataItem.getUri();\n String path = uri.getPath();\n\n if (path.startsWith(\"/sensors/\")) {\n if (SmartWatch.getInstance() != null) {\n SmartWatch.getInstance().unpackSensorData(DataMapItem.fromDataItem(dataItem).getDataMap());\n }\n }\n }\n }\n }", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n if (sensorEvent.sensor.getType() != Sensor.TYPE_ACCELEROMETER)\n return;\n\n // must be the accelerometer - number of milliseconds since Midnight, Jan 1, 1970\n // How many milliseconds in a day? 60(60)(24)(1000) = 90,000,000\n long curr_time = System.currentTimeMillis();\n\n if (curr_time - prev_time > 500) {\n prev_time = curr_time;\n float y = sensorEvent.values[1];\n accel_y_view.setText(Float.toString(y));\n }\n }", "public void valueChanged(ConfigurationIdentifier configurationIdentifier, Serializable value);", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)\n return;\n /*\n * record the accelerometer data, the event's timestamp as well as\n * the current time. The latter is needed so we can calculate the\n * \"present\" time during rendering. In this application, we need to\n * take into account how the screen is rotated with respect to the\n * sensors (which always return data in a coordinate space aligned\n * to with the screen in its native orientation).\n */\n\n switch (mDisplay.getRotation()) {\n case Surface.ROTATION_0:\n mSensorX = event.values[0];\n mSensorY = event.values[1];\n break;\n case Surface.ROTATION_90:\n mSensorX = -event.values[1];\n mSensorY = event.values[0];\n break;\n case Surface.ROTATION_180:\n mSensorX = -event.values[0];\n mSensorY = -event.values[1];\n break;\n case Surface.ROTATION_270:\n mSensorX = event.values[1];\n mSensorY = -event.values[0];\n break;\n }\n\n mGLView.updateScene(10*mSensorX,10*mSensorY,10*event.values[2]);\n\n }", "public void notifyAlgoUpdateCurrentValue() {\n this.mHwGradualBrightnessAlgo.updateTargetAndRate(this.mTargetValue, this.mRate);\n this.mHwGradualBrightnessAlgo.updateCurrentBrightnessValue((float) this.mCurrentValue);\n }", "public void onSensorChanged(SensorEvent event) {\n\t\tif(event.sensor.getType() == Sensor.TYPE_PROXIMITY){\n\t\tproxview.setText(\"\\n\\n\"+\"PROXIMITY\"+\"\\n\"+String.valueOf(event.values[0]));\n\t\t\n\t\t\n\t\t}\n\t\tif(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){\n\t\t\t\n\t\taccview.setText(\"ACCELEROMETER\"+\"\\n\"+\"X: \"+event.values[0]+\"\\nY: \"+event.values[1]+\"\\nZ: \"+event.values[2]);\n\t\t\n\t\tdouble p = event.values[0];\n\t\tif(p<0.0)\n\t\t{mp.pause();}\n\t\telse{\n\t\t\tif(mp.isPlaying())\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{mp.start();}\n\t\t}\n\t\t\n\t}\n\t\tif(event.sensor.getType() == Sensor.TYPE_LIGHT){\n\t\t\t\n\t\t\tliview.setText(\"LIGHT\"+\"\\n\"+String.valueOf(event.values[0]));\n\t\t\t\n\t\t}\n}", "public void onSensorChanged(int sensor, float[] values) {\n\t\t\t\n\t\t\t// grab the values required to respond to user movement.\n\t\t\tmAccelX = (float) (0.2 * values[0]);\n\t\t\tmAccelY = (float) (0.2 * values[1]);\n\t\t\t// mAccelZ = values[2];\n\t\t\tinvalidate();\n\t\t}", "public void onDataChanged();", "void onDataChanged();", "@Override\n public void measurementPatient(int value, int timestamp) {\n }", "protected abstract void onReceiveBatteryFrame(int[] value);", "public void recvSensorEvent(Object data_)\n\t{\n\t\tList<Tuple> event = ConstructSensingEvent((Message) data_) ;\n\t\tmicroLearner.handleSensorEvent(event);\t\t\n\t}", "public void run() {\n\t\t\t\t\t\tint success;\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t// Building Parameters\r\n\t\t\t\t\t\t\tList<NameValuePair> params = new ArrayList<NameValuePair>();\r\n\t\t\t\t\t\t\tparams.add(new BasicNameValuePair(TAG_NAME, \"TempSensor\"));\r\n\t\t\t\t\t\t\t// getting product details by making HTTP request\r\n\t\t\t\t\t\t\t// Note that product details url will use GET request\r\n\t\t\t\t\t\t\tJSONObject json = jsonParser.makeHttpRequest(\r\n\t\t\t\t\t\t\t\t\turl_read_sensor, \"GET\", params);\r\n\t\t\t\t\t\t// check your log for json response\r\n\t\t\t\t\t\t\tLog.d(\"Smart Home\",\"===========sensor value=================\");\r\n\t\t\t\t\t\t\tLog.d(\"Smart Home\",json.toString());\r\n\t\t\t\t\t\t\tString result = \"CurrentValue \" + json.getString(TAG_SENSOR) + \"\\n\";\r\n\t\t\t\t\t\t\twelcome.append(myUI.getStyle(result, 12, 15, \"GREEN\") );\t\t\t\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tcatch (Exception e) {\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "@Override\n public void valueChanged(double control_val) {\n playbackRate.setValue((float)control_val);\n // Write your DynamicControl code above this line\n }", "public synchronized void addRawData (SensorData sensorData) {\n if (!isEnabled) {\n return;\n }\n\n rawData.add(sensorData);\n\n GarmentOSService.callback(CallbackFlags.VALUE_CHANGED, new ValueChangedCallback(sensorData.getLongUnixDate(), sensorData.getData()));\n\n if (rawData.size() > savePeriod) {\n saveSensor();\n }\n }", "@Override\n protected void onDataChanged() {\n }", "public void setSensorOn() {\n\n }", "@Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n String texto = String.valueOf(sensorEvent.values[0]);\n tv.setText(texto);\n float valor = Float.parseFloat(texto);\n if (valor == 0){\n ln.setBackgroundColor(Color.BLUE);\n }else {\n ln.setBackgroundColor(Color.YELLOW);\n }\n }", "public void onSensorChanged(SensorEvent event) {\n switch (event.sensor.getType()) {\n case Sensor.TYPE_ACCELEROMETER:\n acceleration_vals = event.values.clone();\n break;\n case Sensor.TYPE_MAGNETIC_FIELD:\n magnetic_vals = event.values.clone();\n break;\n }\n \n \n // If we have all the necessary data, update the orientation.\n if (acceleration_vals != null && magnetic_vals != null) {\n float[] R = new float[16];\n float[] I = new float[16];\n \n SensorManager.getRotationMatrix(R, I, acceleration_vals, \n magnetic_vals);\n \n float[] orientation = new float[3];\n SensorManager.getOrientation(R, orientation);\n \n acceleration_vals = null;\n magnetic_vals = null;\n \n // Use the pitch to determine whether we are in ID mode or\n // conference mode.\n if (orientation[1] <= -0.2) { // we're in conference mode\n this.setRequestedOrientation(\n ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n showScheduleView();\n } else if (orientation[1] >= 0.2) { // we're in ID mode\n this.setRequestedOrientation(\n ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);\n showBadgeView();\n }\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if(runOrNot) {\n Sensor mySensor = event.sensor;\n if (mySensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n long current = System.currentTimeMillis();\n\n if((current - prevTime) > 100) {\n prevTime = current;\n x = event.values[0];\n y = event.values[1];\n z = event.values[2];\n String text = \"x: \" + x + \" y: \" + y + \" z: \" + z;\n\n listOfPoints.append(new Coordinate(x,y,z));\n box.setText(text + \"\\n\" + box.getText().toString());\n }\n\n }\n }\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n Sensor sensor=event.sensor;\n mMeasure.setMesureX(event.values[0]);\n mMeasure.setMesureY(event.values[1]);\n mMeasure.setMesureZ(event.values[2]);\n switch(sensor.getType()){\n case Sensor.TYPE_ACCELEROMETER:\n mTextArea.getTextValue1().setText(\"X=\" + (double)Math.round(mMeasure.getMesureX() * 100) / 100);\n mTextArea.getTextValue2().setText(\"Y=\" + (double)Math.round(mMeasure.getMesureY() * 100) / 100);\n mTextArea.getTextValue3().setText(\"Z=\" + (double)Math.round(mMeasure.getMesureZ() * 100) / 100);\n System.out.println(\"\\n\");\n System.out.println(\"Acceleration measure\\n\");\n System.out.println(\"time of the new measured value= \"+event.timestamp+ \"\\n\"+\"x=\"+event.values[0]+\" y=\"+event.values[1]+\" z=\"+event.values[2]);\n System.out.println(\"\\n\");\n break;\n case Sensor.TYPE_MAGNETIC_FIELD:\n mTextArea.getTextValue1().setText(\"X=\" + (double)Math.round(mMeasure.getMesureX()* 100) / 100);\n mTextArea.getTextValue2().setText(\"Y=\" + (double)Math.round(mMeasure.getMesureY() * 100) / 100);\n mTextArea.getTextValue3().setText(\"Z=\" + (double)Math.round(mMeasure.getMesureZ() * 100) / 100);\n System.out.println(\"\\n\");\n System.out.println(\"Magnetic field measure\");\n System.out.println(\"time of the new measured value= \"+event.timestamp+ \"\\n\"+\"x=\"+event.values[0]+\" y=\"+event.values[1]+\" z=\"+event.values[2]);\n System.out.println(\"\\n\");\n break;\n case Sensor.TYPE_PROXIMITY:\n if (mMeasure.getMesureX()==0){\n mTextArea.getTextValue1().setText(\"Object detected\");\n mTextArea.getTextValue1().setBackgroundColor(Color.GREEN);\n } else {\n mTextArea.getTextValue1().setText(\"no object detected\");\n mTextArea.getTextValue1().setBackgroundColor(0xffffffff);\n }\n //mTextArea.getTextValue1().setText(\"\"+mMeasure.getMesureX());\n\n System.out.println(\"\\n\");\n System.out.println(\"Proximity measure\\n\");\n System.out.println(\"time of the new measured value= \"+event.timestamp+ \"\\n\"+\"x=\"+event.values[0]);\n System.out.println(\"\\n\");\n break;\n case Sensor.TYPE_LIGHT:\n mTextArea.getTextValue1().setText(\"\" + (double)Math.round(mMeasure.getMesureX() * 100) / 100);\n System.out.println(\"\\n\");\n System.out.println(\"Luminosity measure\\n\");\n System.out.println(\"time of the new measured value= \"+event.timestamp+ \"\\n\"+\"x=\"+event.values[0]);\n System.out.println(\"\\n\");\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n // This code is directly taken from the Android website.\n // I used it since the linear accelerometer doesn't seem to work correctly.\n // Without borrowing this code, I would have had no idea how to do this.\n // https://developer.android.com/guide/topics/sensors/sensors_motion.html\n\n final float alpha = 0.8F;\n\n // Isolate the force of gravity with the low-pass filter.\n gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];\n gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];\n gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];\n\n // don't include first 10 pieces of data to make sure sensor is properly adjusted\n if(accuracyCounter>=0) {\n accuracyCounter--;\n } else {\n // Add the information to the dataset.\n dataSet.establishNextDataPoint(\n event.values[0] - gravity[0],\n event.values[1] - gravity[1],\n event.values[2] - gravity[2]);\n }\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n\n if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {\n\n mGeomagnetic = new float[3];\n System.arraycopy(event.values, 0, mGeomagnetic, 0, 3);\n\n }\n\n // If we have readings from both sensors then\n // use the readings to compute the device's orientation\n // and then update the display.\n\n if (mGeomagnetic != null) {\n\n int R = (int) mGeomagnetic[0];\n int G = (int) mGeomagnetic[1];\n int B = (int) mGeomagnetic[2];\n\n setBackgroundColorDisplay(R, G, B);\n Log.d(TAG, \"mx : \"+mGeomagnetic[0]+\" my : \"+mGeomagnetic[1]+\" mz : \"+mGeomagnetic[2]);\n\n }\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (Minutes*60+Seconds==time){\n switch(event.sensor.getType()) {\n case Sensor.TYPE_STEP_DETECTOR:\n values[0]++;\n break;\n case Sensor.TYPE_ACCELEROMETER:\n values[1]+=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[1]/=2;\n break;\n case Sensor.TYPE_GYROSCOPE:\n values[2]+=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[2]/=2;\n break;\n }\n }\n else{\n if(values[0]==0||values[1]==0||values[2]==0){\n prediction.setText(\"00:00:00\");\n }\n else{\n predictionValue = Math.round(doInference(values));\n prediction.setText(\"00:\" + String.valueOf(predictionValue/60) + \":\" + String.valueOf(predictionValue%60));\n if(predictionValue>1.1*Double.parseDouble(target.getText().toString())){ //too slow\n pace.setBackgroundColor(Color.GREEN);\n pace.setText(\"SPEED UP!\");\n }\n else if(predictionValue<0.9*Double.parseDouble(target.getText().toString())){ //too fast\n pace.setBackgroundColor(Color.RED);\n pace.setText(\"SLOW DOWN!\");\n }\n else{\n pace.setBackgroundColor(Color.YELLOW);\n pace.setText(\"GOOD JOB!\");\n }\n }\n switch(event.sensor.getType()) {\n case Sensor.TYPE_STEP_DETECTOR:\n values[0]=1;\n values[1]=0;\n values[2]=0;\n break;\n case Sensor.TYPE_ACCELEROMETER:\n values[0]=0;\n values[1]=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[2]=0;\n break;\n case Sensor.TYPE_GYROSCOPE:\n values[0]=0;\n values[1]=0;\n values[2]=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n break;\n }\n time = Minutes*60+Seconds;\n }\n\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\tint value = (int) event.values[0];\n\t\tif(0 == value) {\n\t\t\tnearFlag = true;\n\t\t} else if (1 <= value) {\n\t\t\tfarFlag = true;\n\t\t\tvalue = 1;\n\t\t} else {\n\t\t\t// Something is wrong\n\t\t}\n\t\ttip.setText(\"距离值 : \" + event.values[0]);\n\t\tif(nearFlag && farFlag && !pass) {\n\t\t\tpass = true;\n\t\t\t((AutoMMI)getApplication()).recordResult(PSensorTest.TAG, \"\", \"1\");\n\t\t}\n\t}", "@Override\n public void onValueAccessed(int value) {\n }", "public void sensorReader() {\n try {\n Log.i(TAG, \"wants to read from Arduino\");\n this.inputStream = socket.getInputStream();\n this.inputStreamReader = new InputStreamReader(inputStream);\n Log.i(TAG, \"inputstream ready\");\n this.bufferedReader = new BufferedReader(inputStreamReader);\n Log.i(TAG, \"buffered reader ready\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public interface SensorUpdateCallback {\n void onBearingValue(float f);\n}", "@Override\n public final void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n accx = event.values[0];\n accy = event.values[1];\n accz = event.values[2];\n }else if (event.sensor.getType() == Sensor.TYPE_GYROSCOPE) {\n gyx = event.values[0];\n gyy = event.values[1];\n gyz = event.values[2];\n } else if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {\n magx = event.values[0];\n magy = event.values[1];\n magz = event.values[2];\n }\n }" ]
[ "0.715614", "0.699007", "0.6805588", "0.6784752", "0.67644024", "0.66251683", "0.65540004", "0.6529422", "0.6525047", "0.6514144", "0.6508102", "0.6507415", "0.6494711", "0.6494711", "0.6479882", "0.6452721", "0.64020646", "0.6392537", "0.6385022", "0.6351298", "0.6313916", "0.6312677", "0.6308858", "0.6303056", "0.6296699", "0.6296699", "0.6296699", "0.6296699", "0.6256194", "0.6242336", "0.6241349", "0.6236154", "0.6206976", "0.61919874", "0.6188625", "0.61864305", "0.6171219", "0.61589515", "0.6138398", "0.61338264", "0.6123714", "0.6121555", "0.61193025", "0.6117791", "0.6088569", "0.6062992", "0.60509294", "0.6035708", "0.6010484", "0.59987396", "0.5993474", "0.59926873", "0.59733886", "0.59684694", "0.59662735", "0.596197", "0.5957129", "0.5947089", "0.594417", "0.594417", "0.59093124", "0.5896409", "0.58892554", "0.588088", "0.58576745", "0.5856452", "0.5854997", "0.5851251", "0.58444786", "0.5844353", "0.5840026", "0.5836542", "0.58310544", "0.5824165", "0.58187777", "0.5813993", "0.5813458", "0.58131987", "0.5810118", "0.58077574", "0.5802547", "0.5791713", "0.5787541", "0.5777799", "0.57703036", "0.57678485", "0.57662725", "0.5762571", "0.5755464", "0.5749081", "0.5748297", "0.574495", "0.5737869", "0.57335883", "0.57222974", "0.5721279", "0.57174546", "0.57124627", "0.5700496", "0.5697126", "0.5696661" ]
0.0
-1
/ Based on the API reference: POST/1/cards
@Test public void addCard_response_check_status_test() throws ClientProtocolException, IOException { System.out.println("\n--------------------------------------------------"); System.out.println("Start test: " + testName.getMethodName()); //Given String idList = testSuite.listId; String due = "null"; String name = "Add card"; String desc = "API test - Add card through trello API"; String query = String.format("idList=%s&due=%s&name=%s&desc=%s&key=%s&token=%s", URLEncoder.encode(idList, charset), URLEncoder.encode(due, charset), URLEncoder.encode(name, charset), URLEncoder.encode(desc, charset), URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); //When CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost postRequest = new HttpPost(cardUrl + "?" + query); HttpResponse response = httpClient.execute(postRequest); //Then /* * Expect: 200 - status code * */ assertEquals(response.getStatusLine().getStatusCode(), 200); //Tear down httpClient.close(); System.out.println("Finish test: " + testName.getMethodName()); System.out.println("--------------------------------------------------\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FormUrlEncoded\n @POST(\"/v2/cards/create.json\")\n void create(@Field(\"card_data\") CardData data, Callback<CardCreate> cb);", "@PostMapping(\"/cards\")\n StarbucksCard newCard() {\n StarbucksCard newcard = new StarbucksCard();\n\n Random random = new Random();\n int num = random.nextInt(900000000) + 100000000;\n int code = random.nextInt(900) + 100;\n\n newcard.setCardNumber(String.valueOf(num));\n newcard.setCardCode(String.valueOf(code));\n newcard.setBalance(20.00);\n newcard.setActivated(false);\n newcard.setStatus(\"New Card\");\n return repository.save(newcard);\n }", "@RequestMapping(value = \"/card/\", method = RequestMethod.POST)\n public ResponseEntity<Void> createCard(@RequestBody Card card, UriComponentsBuilder ucBuilder) {\n \tcard.setNbDispo(card.getNbItem());\n card.setDate(new Date(System.currentTimeMillis()));\n if (cardService.isCardExist(card)) {\n \tlogger.warn( \"A Card with name \" + card.getNameFr() + \" already exist\" );\n return new ResponseEntity<Void>(HttpStatus.CONFLICT);\n }\n cardService.saveCard(card);\n HttpHeaders headers = new HttpHeaders();\n headers.setLocation(ucBuilder.path(\"/card/{id}\").buildAndExpand(card.getId()).toUri());\n return new ResponseEntity<Void>(headers, HttpStatus.CREATED);\n }", "public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Card createCard();", "public void addPartnerCard(Card card);", "public interface CardService {\n\n /**\n * Internal API for creating Twitter cards.\n */\n @FormUrlEncoded\n @POST(\"/v2/cards/create.json\")\n void create(@Field(\"card_data\") CardData data, Callback<CardCreate> cb);\n}", "private void addCard() {\n Intent intent = new Intent(this, NewCard.class);\n intent.putExtra(\"cardSetId\", cardSetId);\n startActivity(intent);\n }", "public Builder setCards(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n cards_ = value;\n onChanged();\n return this;\n }", "private void onCreateCardSuccess(Response response) throws IOException {\n Gson gson = new Gson();\n Type type = new TypeToken<Map<String, Object>>(){}.getType();\n\n Map<String, Object> responseMap = gson.fromJson(\n Objects.requireNonNull(response.body()).string(), type\n );\n\n\n paymentMethodId = Objects.requireNonNull(responseMap.get(\"id\")).toString();\n\n //Create new payment method for Parse\n PaymentMethods pay = new PaymentMethods();\n pay.setStripeId(paymentMethodId);\n pay.setBrand(card.getBrand().toString());\n pay.setExpMonth(card.getExpMonth());\n pay.setExpYear(card.getExpYear());\n pay.setLast4(card.getLast4());\n pay.setUser(ParseUser.getCurrentUser());\n pay.saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n if(e == null) {\n Toast.makeText(getApplicationContext(), \"New Card Added.\", Toast.LENGTH_LONG).show();\n Intent i = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(i);\n }\n else\n {\n Toast.makeText(getApplicationContext(), \"Card Failed to add to database.\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n }\n });\n\n }", "Card dealOneCard();", "public void createCard(final WebsiteInterface.WebsiteResult verification){\n Response.Listener<JSONObject> createCard = setResponse(verification);\n //start the network request\n NetworkRequest networkRequest = new NetworkRequest(this.appContext);\n //Set the api endpoint\n String api = WebsiteInterface.CREATE_CARD;\n //set method to be POST request\n int method = networkRequest.getMethod(\"POST\");\n try {\n //set the body of the json post request\n JSONObject toPost = new JSONObject(\n \"{\\\"id\\\": \"+ id + \", \\\"front\\\": \"+ question + \", \\\"back\\\": \"+ answer + \"}\"\n );\n //send the network request to the Volley queue\n networkRequest.addToRequestQueue(new JsonObjectRequest(\n method,\n api,\n toPost,\n createCard,\n error\n ));\n } catch (JSONException e) {\n Log.e(\"FlashCard insertcard\", e.getMessage());\n }\n }", "private void cards() {\n newUserCard();\n editTypeCard();\n changePasswordCard();\n }", "public interface CardsService {\n\n @POST(\"cards\")\n Call<Card> createCard(@Query(\"idList\") String idList, @Body Card card);\n\n @GET(\"cards/{id}\")\n Call<Card> getCard(@Path(\"id\") String id);\n\n @DELETE(\"cards/{id}\")\n Call<ResponseBody> deleteCard(@Path(\"id\") String id);\n\n\n}", "public static void UpdateCardsTable() {\n\t\tString url = null;\n\t\tString cards = null;\n\n\t\ttry {\n\t\t\tfor (int i = 0; i < Config.getHundredsOfCardsAvailable(); i++) {\n\t\t\t\turl = \"https://contentmanager-lb.interact.io/content-cards/search?offset=\" + i * 100 + \"&limit=100\";\n\t\t\t\t// hard-set limit of Content Manager is 100 cards\n\t\t\t\tcards = Requester.sendPostRequest(url);\n\n\t\t\t\tString id;\n\t\t\t\tString metaDataContentType;\n\n\t\t\t\tfor (int cardIndex = 0; cardIndex < 100; cardIndex++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (isCardToBeAdded(cards, cardIndex)) {\n\t\t\t\t\t\t\tid = JsonPath.parse(cards).read(\"$.data.[\" + cardIndex + \"].id\");\n\t\t\t\t\t\t\tmetaDataContentType = JsonPath.parse(cards)\n\t\t\t\t\t\t\t\t\t.read(\"$.data.[\" + cardIndex + \"].metadata.contentType\");\n\t\t\t\t\t\t\t// Logger.print(id);\n\t\t\t\t\t\t\t// Logger.print(metaDataContentType);\n\t\t\t\t\t\t\tString labeledCardTag = metaDataContentType.replaceAll(\" \", \"_\").toLowerCase();\n\t\t\t\t\t\t\t// TODO if this tag isn't already in cards table, add it as a new column\n\t\t\t\t\t\t\taddCardToTable(id, labeledCardTag);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// FIXME don't ignore exception here... it's bad practice\n\t\t\t\t\t\t// TODO make it so that JsonPath only checks up until there are cards\n\t\t\t\t\t\t// e.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void takeACard(Card card){\n hand.add(card);\n }", "void pushCard(ICard card);", "public void addCard(Card card) {\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n \r\n ContentValues values = new ContentValues();\r\n values.put(COL_ACCOUNT, card.getAccount()); \r\n values.put(COL_USERNAME, card.getUsername()); \r\n values.put(COL_PASSWORD, card.getPassword()); \r\n values.put(COL_URL, card.getUrl()); \r\n values.put(COL_DELETED, card.getDeleted()); \r\n values.put(COL_HIDE_PWD, card.getHidePwd()); \r\n values.put(COL_REMIND_ME, card.getRemindMe()); \r\n values.put(COL_UPDATED_ON, card.getUpdatedOn()); \r\n values.put(COL_COLOR, String.valueOf(card.getColor()));\r\n values.put(COL_REMIND_ME_DAYS, card.getRemindMeDays());\r\n \r\n db.insert(TABLE_CARDS, null, values);\r\n db.close(); \r\n }", "public String POST(String uri, Map<Object, Object> parameters) {\n String retVal = \"\";\n\n try {\n StringBuilder builder = new StringBuilder();\n\n // only encode if we have parameters\n if (parameters != null) {\n // encode all the parameters\n for (Map.Entry<Object, Object> entry : parameters.entrySet()) {\n if (builder.length() > 0) {\n builder.append(\"&\");\n }\n builder.append(URLEncoder.encode(entry.getKey().toString(), StandardCharsets.UTF_8));\n builder.append(\"=\");\n builder.append(URLEncoder.encode(entry.getValue().toString(), StandardCharsets.UTF_8));\n }\n }\n\n request = HttpRequest.newBuilder()\n .uri(new URI(\"https://deckofcardsapi.com/api/deck/new/\"))\n .POST(\n // if we have no parameters, send a noBody\n parameters == null\n ? HttpRequest.BodyPublishers.noBody()\n : HttpRequest.BodyPublishers.ofString(builder.toString())\n )\n .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n .build();\n\n response = HttpClient.newBuilder()\n .build()\n .send(request, HttpResponse.BodyHandlers.ofString());\n\n retVal = response.body().toString();\n } catch (Exception e) {\n // correctly handles the exception according to framework\n // for this case, just returns an empty string\n }\n return retVal;\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == ADD_CARD_REQUEST_CODE && resultCode == RESULT_OK) {\n Bundle extras = data.getExtras();\n String newQuestion = extras.getString(\"question\");\n String newAnswer = extras.getString(\"answer\");\n String wrongAnswer1 = extras.getString(\"wrong_answer1\");\n String wrongAnswer2 = extras.getString(\"wrong_answer2\");\n\n database.insertCard(new Flashcard(newQuestion, newAnswer, wrongAnswer1, wrongAnswer2));\n allFlashCards = database.getAllCards();\n\n resetAnswerButtonStates();\n setAnswerButtonsAndQuestion(newQuestion, newAnswer, wrongAnswer1, wrongAnswer2);\n currentDisplayIndex = allFlashCards.size() - 1;\n } else if (requestCode == EDIT_CARD_REQUEST_CODE && resultCode == RESULT_OK) {\n Bundle extras = data.getExtras();\n String question = extras.getString(\"question\");\n String answer = extras.getString(\"answer\");\n String wrong1 = extras.getString(\"wrong_answer1\");\n String wrong2 = extras.getString(\"wrong_answer2\");\n\n Flashcard currentCard = allFlashCards.get(currentDisplayIndex);\n currentCard.setQuestion(question);\n currentCard.setAnswer(answer);\n currentCard.setWrongAnswer1(wrong1);\n currentCard.setWrongAnswer2(wrong2);\n database.updateCard(currentCard);\n allFlashCards = database.getAllCards();\n\n resetAnswerButtonStates();\n setAnswerButtonsAndQuestion(question, answer, wrong1, wrong2);\n }\n }", "@Override\n\tpublic void createCard(Card card) {\n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction(); \n\n\t\t/* persist */ \n\t\tsession.save(card); \n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\t}", "public void submitCard() {\n String description = cardDescription.getText().toString();\n String tag = LTAPIConstants.NAME_TO_TAG.get(cardTag.getSelectedItem().toString());\n String locationText = autoCompView.getText().toString();\n String CardAuthor = author.getText().toString();\n boolean test = photoFile == null;\n LTLog.debug(LOG_TAG, \"danjie: \" + test);\n String emptyComplain = buildSubmitEmptyComplain(\n Utils.isEmptyString(description), \"-1\".equals(tag),\n Utils.isEmptyString(locationText), photoFile == null,\n Utils.isEmptyString(CardAuthor));\n if (!Utils.isEmptyString(emptyComplain)) {\n ShowToast(emptyComplain);\n return;\n }\n TripCard tCard = ((NewTripCardActivity) getActivity()).getCurrentTripCard();\n if (Utils.isEnglishchar(description.trim().charAt(0))) {\n tCard.setDescriptionLang(\"en\");\n } else {\n tCard.setDescriptionLang(\"zh\");\n }\n// tCard.setTitle(cardTitle.getText().toString());\n tCard.setDescription(cardDescription.getText().toString());\n tCard.setCountry(location.getCountryCode());\n tCard.setCardAuthor(CardAuthor);\n tCard.setLocationFullName(locationText);\n tCard.setStatus(1);\n tCard.setGooglelocationid(location.getLocationId());\n // Associate the meal with the current user\n tCard.setAuthor(ParseUser.getCurrentUser());\n\n // Add the rating\n tCard.setTag(LTAPIConstants.NAME_TO_TAG.get(cardTag.getSelectedItem().toString()));\n\n // If the user added a photo, that data will be\n // added in the CameraFragment\n\n // Save the meal and return\n tCard.saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n if (e == null) {\n getActivity().setResult(Activity.RESULT_OK);\n getActivity().finish();\n } else {\n debugShowToast(\"Error saving: \" + e.getMessage());\n }\n }\n });\n }", "public String discardCards(DiscardedCards discardedCards) throws Exception {\n\t\tString url = server_url + \"/moves/discardCards\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"discardCards\");\n\t\tinfo.addProperty(\"playerIndex\", discardedCards.playerIndex);\n\t\t\n\t\tJsonObject discarded = new JsonObject();\n\t\tdiscarded.addProperty(\"wood\", discardedCards.wood);\n\t\tdiscarded.addProperty(\"sheep\", discardedCards.sheep);\n\t\tdiscarded.addProperty(\"ore\", discardedCards.ore);\n\t\tdiscarded.addProperty(\"wheat\", discardedCards.wheat);\n\t\tdiscarded.addProperty(\"brick\", discardedCards.brick);\n\t\tinfo.add(\"discardedCards\", discarded);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "public void setCards(Card[] cards) {\r\n this.cards = cards;\r\n }", "com.google.protobuf.ByteString getCards();", "Cards(String cardName, String cardDes, int puntosHabilidad) {\n this.nombre = cardName;\n this.descripcion = cardDes;\n this.puntos = puntosHabilidad;\n }", "Cards(String cardName, String cardDes, int ataque, int defensa) {\n this.nombre = cardName;\n this.descripcion = cardDes;\n this.puntos = ataque;\n this.def = defensa;\n }", "public void setCards(List<T> cards) {\n\t\tthis.cards = cards;\n\t}", "void setCard(Card card) {\n this.card = card;\n }", "public abstract void addCard();", "public void createCard(String front,String back)\n {\n dbObj=new dbFlashCards(uid);\n dbObj.createACard(packId, front, back);\n \n \n }", "@Test public void get_card_ckeck_content_format_is_JSON_test() throws ClientProtocolException, IOException\n\t{\n\t\t\n\t\tSystem.out.println(\"\\n--------------------------------------------------\");\n\t\tSystem.out.println(\"Start test: \" + testName.getMethodName());\n\t\t\n\t\t//Given\n\t\t//Add a card to get card content\n\t\tString idList = testSuite.listId;\n\t\tString due = \"null\";\n\t\tString name = \"Card need to get content\";\n\t\tString desc = \"API test - create this card and need to get its content\";\n\t\t\n\t\tString createQuery = String.format(\"idList=%s&due=%s&name=%s&desc=%s&key=%s&token=%s\", \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(idList, charset), \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(due, charset),\n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(name, charset), \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(desc, charset), \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(key, charset), \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(token, charset));\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\n\t\tHttpPost postRequest = new HttpPost(cardUrl + \"?\" + createQuery);\n\t\tHttpResponse response = httpClient.execute(postRequest);\n\t\tif(response.getStatusLine().getStatusCode() == 200) \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Add test card successfully \n\t\t{\n\t\t\tJsonReader jsonReader = Json.createReader(response.getEntity().getContent());\n\t\t\tJsonObject cardJson = jsonReader.readObject();\n\t\t\tString cardId = cardJson.getString(\"id\");\n\t\t\tjsonReader.close();\n\t\t\tString query = String.format(\"key=%s&token=%s\",\n\t\t\t\t\tURLEncoder.encode(key, charset), \n\t\t\t\t\tURLEncoder.encode(token, charset));\n\t\t\t//When\n\t\t\tHttpGet getRequest = new HttpGet(cardUrl + cardId + \"?\" + query);\n\t\t\tHttpResponse getResponse = httpClient.execute(getRequest);\n\t\t\t//Then\n\t\t\t/*\n\t\t\t * Expect: /application/json - content format\n\t\t\t * */\n\t\t\tString type = getResponse.getEntity().getContentType().getValue().toString();\n\t\t\tassertThat(type, CoreMatchers.containsString(\"application/json\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfail(\"Adding card is wrong, cannot get card content format\");\n\t\t}\n\t\t//Tear down\n\t\thttpClient.close();\n\t\t\n\t\tSystem.out.println(\"Finish test: \" + testName.getMethodName());\n\t\tSystem.out.println(\"--------------------------------------------------\\n\");\n\t}", "public void addCard(Card card) {\n myCards.add(card);\n cardNumber = myCards.size();// reset the number of cards\n }", "public int askWhatPermitCards(List<PermitCard> cards);", "public void addCard(PlayingCard aCard);", "public void buildCards(){\n\t\tfor(Suit suit: Suit.values()){\n\t\t\tfor(Face face: Face.values()){\n\t\t\t\tcards.add(new Card(face, suit));\n\t\t\t}\n\t\t}\n\t}", "Card getCard(UUID cardId);", "public CardRequest() {\r\n card = new MSRData(); // an empty one\r\n }", "public static DevelopmentCard parseCard(JsonValue jCard){\n\t JsonObject card = jCard.asObject();\n\n String name = card.get(\"name\").asString();\n String cardType = card.get(\"cardType\").asString();\n Integer period = card.get(\"period\").asInt();\n Integer actionValue;\n \n if(\"TERRITORYCARD\".equals(cardType) || \"BUILDINGCARD\".equals(cardType)){\n JsonValue action = card.get(\"minimumActionValue\"); \n actionValue = action.asInt();\n } else {\n actionValue = 0;\n }\n\n DevelopmentCard newCard = new DevelopmentCard(name, period, cardType, actionValue);\n \n // registrazione costi e requisiti\n JsonValue resourceCost = card.get(\"cost\");\n if(resourceCost != null && !resourceCost.isNull()){\n JsonArray resourceArray = new JsonArray();\n if( resourceCost.isObject() ){ // Carta con costo singolo\n resourceArray.add(resourceCost);\n }\n if( resourceCost.isArray() ){ // Carta con costo multiplo\n resourceArray = resourceCost.asArray();\n }\n newCard.registerCost(resourceArray.iterator());\n }\n \n JsonValue requirements = card.get(\"requirements\");\n if(requirements != null && !requirements.isNull())\n newCard.setRequirments(requirements.asObject());\n \n // registrazione effetti\n JsonValue instantEffect = card.get(\"instantEffect\");\n JsonValue instantPayload = card.get(\"instantPayload\"); \n List<Tuple<JsonValue, JsonValue>> instantEffectList = parseEffect(instantEffect,\n instantPayload);\n \n for(Tuple<JsonValue, JsonValue> effect: instantEffectList){\n newCard.registerInstantEffect(getEffectFromRegistry(effect.getFirstArg().asString(),\n effect.getSecondArg()));\n newCard.registerInstantEffectType(effect.getFirstArg().asString());\n }\n\n JsonValue permanentEffect = card.get(\"permanentEffect\");\n JsonValue permanentPayload = card.get(\"permanentPayload\");\n List<Tuple<JsonValue, JsonValue>> permanentEffectList = parseEffect(permanentEffect,\n permanentPayload);\n for(Tuple<JsonValue, JsonValue> effect : permanentEffectList){\n newCard.registerPermanentEffect(getEffectFromRegistry(effect.getFirstArg().asString(), effect.getSecondArg()));\n newCard.addPayload(effect.getSecondArg()); //used by CHANGE effect for pretty context build\n newCard.registerPermanentEffectType(effect.getFirstArg().asString());\n }\n return newCard;\n\t}", "public void addCard(Card card) {\n this.deck.push(card);\n }", "@PostMapping(\"/submitRound/{gameId}/{UID}/{yCardId}\")\n public void submitRound() {this method will take in the gameId, the UserId, and the ycardId\n //It will then store this, WHERE?!?!?!?!\n //\n }", "public Card getCard() {\n return this.card;\n }", "void addCustomerCard(CardDto cardDto, String name) throws EOTException;", "public com.google.protobuf.ByteString getCards() {\n return cards_;\n }", "private void createCardLists() {\n cardIDList = new ArrayList<>();\n cardNameList = new ArrayList<>();\n\n for (JsonElement jElement : cardCollection) {\n JsonObject jObject = jElement.getAsJsonObject();\n cardIDList.add(jObject.get(\"cardId\").getAsString());\n cardNameList.add(jObject.get(\"cardName\").getAsString());\n }\n }", "@PostMapping(value = \"/addcard/{mobileno}\", consumes = \"application/json\")\n\tpublic String addNewCard(@RequestBody CardDetails cdetails, @PathVariable String mobileno) {\n\t\treturn cservice.addNewCard(cdetails, mobileno);\n\t}", "public void addACard() {\n Card card = new Card();\n int index = 0;\n doubleCapacity(orderByTitle);\n doubleCapacity(orderByAuthor);\n doubleCapacity(orderBySubject);\n \n \n System.out.println(\"Title of book is : \");\n card.titleOfBook = input.next();\n orderByTitle[index] = card.titleOfBook;\n System.out.println(\"Author of book is : \");\n card.autherOfBook = input.next();\n orderByAuthor[index] = card.autherOfBook;\n System.out.println(\"Subject Of Book is : \");\n card.subjectOfBook = input.next();\n orderBySubject[index] = card.subjectOfBook;\n cards.add(card) ; \n System.out.println(card);\n System.out.println();\n }", "private void addCard() { \n\t\tint sic_idHolder; // declares sic_idHolder\n\t\tString titleHolder; // declares titleHolder\n\t\tString authorHolder; // declares authorHolder\n\t\tdouble priceHolder; // declares priceHolder\n\t\tint quantityHolder; // declares quantityHolder\n\t\t\n\t\t\n\t\tSystem.out.println(\"Making a new card:\\nPlease enter the new SIC-ID: \");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input the ID\n\t\tscan.nextLine();\n\t\t\n\t\tif(inventoryObject.cardExists(sic_idHolder) != true) {\n\t\t\tSystem.out.println(\"Please enter the title of the book: \");\n\t\t\ttitleHolder = scan.next(); // prompts user to input the title\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the author of the book\");\n\t\t\tauthorHolder = scan.next(); // prompts user to input the author\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the price of the book\");\n\t\t\tpriceHolder = scan.nextDouble(); // prompts user to input the price\n\t\t\tscan.nextLine();\n\t\t\n\t\t\tif(priceHolder < 0) { // checks to make sure priceHolder is positive\n\t\t\t\tSystem.out.println(\"ERROR! Price must be greater than or equal to 0:\");\n\t\t\t\tgetUserInfo();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Please enter the number of books in invetory\");\n\t\tquantityHolder = scan.nextInt(); // prompts user to input the quantity\n\t\tscan.nextLine();\n\t\t\n\t\tif(quantityHolder <= 0) { // checks to make sure quantity isn't less than 1\n\t\t\tSystem.out.println(\"Error! Quantity must be greater than 0\\n\"); \n\t\t\tgetUserInfo();\n\t\t}\n\t\tinventoryObject.addStockIndexCard(sic_idHolder, titleHolder, authorHolder, priceHolder, quantityHolder); // calls addStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"ERROR: The ID you entered is already in the system\\n\");\n\t\t\tgetUserInfo();\n\t\t}\n\t}", "@POST\n @Path(\"/scorecard/{user}\")\n public Response saveScorecard(\n @Context HttpServletRequest request \n ,@Context HttpServletResponse response\n ,@Context ServletContext servletContext\n ,@PathParam(\"user\") String user) throws JsonGenerationException, JsonMappingException, IOException{\n \n String payload=IOUtils.toString(request.getInputStream());\n log.debug(\"Saving \"+ payload);\n \n Database2 db=Database2.get();\n \n ObjectMapper objectMapper = new ObjectMapper();\n Map<String, Object> map = objectMapper.readValue(payload, new TypeReference<HashMap<String,Object>>(){});\n String username=(String)map.get(\"userId\");\n \n Map<String, String> userInfo=db.getUsers().get(username);\n Map<String, Integer> scorecard=db.getScoreCards().get(username);\n \n for(String k:map.keySet()){\n if (!k.equals(\"userId\")){\n \n if (userInfo.containsKey(k)) {\n log.debug(\"Setting 'userInfo.\"+k+\"' to \"+(String)map.get(k));\n userInfo.put(k, (String)map.get(k));\n }else if (scorecard.containsKey(k)) {\n log.debug(\"Setting 'scorecard.\"+k+\"' to \"+(String)map.get(k));\n scorecard.put(k, Integer.parseInt((String)map.get(k)));\n }else{\n log.debug(\"Setting 'userInfo.\"+k+\"' to \"+(String)map.get(k));\n userInfo.put(k, (String)map.get(k));\n //// ALERT! unknown field\n //log.error(\"UNKNOWN FIELD: \"+k+\" = \"+map.get(k));\n }\n\n }\n }\n \n db.save();\n return Response.status(200).entity(Json.newObjectMapper(true).writeValueAsString(\"OK\")).build();\n }", "private void addCards() {\r\n\t\tfor (Color color : UNO_COLORS) {\r\n\r\n\t\t\t// Create 76 NumberCards --> doubles except 0s.\r\n\t\t\tfor (int num : UNO_NUMBERS) {\r\n\t\t\t\tint i = 0;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tUNOcards.add(new NumberCard(color, Integer.toString(num)));\r\n\t\t\t\t\ti++;\r\n\t\t\t\t} while (num != 0 && i < 2);\r\n\t\t\t}\r\n\r\n\t\t\t// Create 24 ActionCards --> everything twice\r\n\t\t\tfor (String type : ActionTypes) {\r\n\t\t\t\tfor (int i = 0; i < 2; i++)\r\n\t\t\t\t\tUNOcards.add(new ActionCard(color, type));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (String type : WildTypes) {\r\n\t\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\t\tUNOcards.add(new WildCard(type));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void addCard(Card c){\n cards.add(c);\n }", "@RequestMapping(method = RequestMethod.POST, value = \"/init\")\n public List<Card> initGame() {\n return null;\n }", "void updateCards(List<CardEntity> data);", "public void sendCard(Card card) {\n try {\n dOut.writeObject(card);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send card object\");\n e.printStackTrace();\n }\n }", "public com.google.protobuf.ByteString getCards() {\n return cards_;\n }", "@Override\n\n public void onClick(View v) {\n\n simplify.createCardToken(cardEditor.getCard(), new CardToken.Callback() {\n\n @Override\n\n public void onSuccess(CardToken cardToken) {\n\n //Toast.makeText(getBaseContext(), \"Success\", Toast.LENGTH_SHORT).show();\n //finish();\n RequestManager.getInstance().init(getBaseContext());\n RequestManager.getInstance().paymentRequest(cardToken.getId());\n\n }\n\n @Override\n\n public void onError(Throwable throwable) {\n\n Toast.makeText(getBaseContext(), \"Success\", Toast.LENGTH_SHORT).show();\n\n }\n\n });\n\n\n }", "public Card getCard() {\n return this.card;\n }", "public void shuffleDeck() {\n JsonObjectRequest arrReq = new JsonObjectRequest(\n Request.Method.GET,\n url_shuffle,\n null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n try {\n currentDeckId = response.getString(\"deck_id\");\n card.setText(currentDeckId);\n\n } catch (Exception e) {\n\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n }\n }\n\n );\n // Add the request we just defined to our request queue.\n // The request queue will automatically handle the request as soon as it can.\n requestQueue.add(arrReq);\n }", "void parseCardData(ICardContext context);", "@GetMapping(\"/cards\")\n List<StarbucksCard> all() {\n return repository.findAll();\n }", "public void createCards(int n) {\n mController.createCards(n);\n }", "public void ActonCard() {\n\t}", "@Override\n protected void makeRequest(FullContactApi api, Callback<CardReaderUploadConfirmResponse> callback) {\n api.uploadCard(accessToken, params, body, callback);\n }", "public List<Card> getcardbyuser(String user_id);", "List<Card> getCards() {\n return cards;\n }", "void addCard(Card card) {\n\t\t_hand.addCard(card);\n\t}", "public void addCard() {\n for (int i = 0; i < 4; i++) {\n cards.add(new Wild());\n cards.add(new WildDrawFour());\n }\n for (Color color : Color.values())\n cards.add(new NumberCard(color.name(),0));\n for (Color color : Color.values()) {\n for (int i = 0; i < 2; i++) {\n for (int j = 1; j < 10; j++)\n cards.add(new NumberCard(color.name(),j));\n cards.add(new DrawTwo(color.name()));\n cards.add(new Reverse(color.name()));\n cards.add(new Skip(color.name()));\n }\n }\n }", "public List<Card> getCards(){\r\n\t\treturn cards;\r\n\t}", "public interface CardService {\n\n public Card storeCard(Long userId, Long subjectId, String question, String answer);\n\n}", "Card(){\t \n}", "public void addCard(Card c)\n {\n cards.add(c);\n }", "@GetMapping(\"{cardId}\")\n public Card getCardById(@PathVariable String cardId){\n return cardService.getCardById(cardId);\n // To service guy, grab the card object first, then iterate the \"finishedUsersId\"\n }", "Card(int num,String suit){\n this.number = num;\n this.suits = suit;\n }", "public void add(Card card) {\n this.cards.add(card);\n }", "public void addCard(Card card) {\r\n\t\tcards.add(card);\r\n\t}", "public Card push(Card card)\n {\n if (card != null)\n {\n cards.add(card);\n card.setBounds(0, 0, CARD_WIDTH, CARD_HEIGHT);\n add(card, 0);\n }\n \n return card;\n }", "private Card loadCardFromForm() {\n //validate fields\n Card card;\n\n String cardNum = mCardForm.getCardNumber();\n\n //build card object with ONLY the number, update the other fields later\n card = new Card.Builder(cardNum, 0, 0, \"\").build();\n String cvc = mCardForm.getCvv();\n //update the cvc field of the card\n card.setCvc(cvc);\n\n //validate expiry month;\n String sMonth = mCardForm.getExpirationMonth();\n int month = 0;\n try {\n month = Integer.parseInt(sMonth);\n } catch (Exception ignored) {\n }\n\n card.setExpiryMonth(month);\n\n String sYear = mCardForm.getExpirationYear();\n int year = 0;\n try {\n year = Integer.parseInt(sYear);\n } catch (Exception ignored) {\n }\n card.setExpiryYear(year);\n\n return card;\n }", "public void AddCard(Card card) {\n mCard[mCardCount++] = card;\n SetCardPosition(mCardCount - 1);\n }", "private void addCardToDeck(Card card) {\n\t\tdeck.add(card);\n\t}", "public Card[] GetCards() { return mCard; }", "public abstract String requestCard(byte[] messageRec) throws IOException;", "public void addCard(Card card) {\n personHand.add(card);\n }", "public void addCard(Card c)\n {\n hand.add(c);\n }", "public void addCard(Card card) {\r\n\t\tthis.cards.add(card);\r\n\t}", "public void addCard(Card card) {\n\t\tthis.content.add(card);\n\t}", "int insert(Card record);", "public void setCardInfo(CardInfo[] cardInfo) {\n this.cardInfo = cardInfo;\n }", "public List<Card> findAllCards();", "public void addCard(Card card)\n {\n if (card1 == null)\n {\n card1 = card;\n }\n else if (card2 == null)\n {\n card2 = card;\n }\n }", "public void addCard(Card card, GamePlayer GP){\n for(int i=0; i<4; i++){\n if(cardsPlayed[i] == null){\n cardsPlayed[i]=card;\n if(i == 0){\n suit = card.getSuit();\n }\n break;\n }\n }\n }", "public void addResourceCard(HexType type){\n \n }", "public int[] getCards() {\n \t\treturn cards;\n \t}", "@GetMapping(\"/create\")\n public ModelAndView create(@ModelAttribute(\"form\") final CardCreateForm form) {\n return getCreateForm(form);\n }", "@PostMapping(\"/card/activate/{num}/{code}\")\n StarbucksCard activate(@PathVariable String num, @PathVariable String code, HttpServletResponse response) {\n StarbucksCard card = repository.findByCardNumber(num);\n System.out.println(num);\n System.out.println(card);\n\n if (card == null) {\n throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"Error--Card not found\");\n }\n if (card.getCardCode().equals(code)) {\n card.setActivated(true);\n repository.save(card);\n } else {\n throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"Error--Card not valid\");\n }\n return card;\n }", "public void putCard(Cards cards) {\n playedCards.add(cards);\n }", "private void generateNewCards()\n {\n // Set the card sets to be drafted from.\n setsForDraft = new ArrayList<>();\n setsForDraft.add(M19_CARD_TABLE);\n\n // Generates sealed pool and places in openedCardPool.\n drawPacksFromSets();\n\n // Initialize a selectedCardPool that is empty, for the user to move cards into when desired.\n selectedCardPool = new ArrayList<>();\n }", "@Override\r\n\tpublic void buyCard() {\n\t\t\r\n\t}", "public Cards getCards() {\r\n\t\treturn cards;\r\n\t}", "public List<Card> list();", "public int askWhatPoliticCards(List<PoliticCard> cards);", "public PokerHand(Card... cards) {\n for (Card c : cards) {\n this.cards.add(c);\n }\n }" ]
[ "0.7279771", "0.698753", "0.69107866", "0.6804971", "0.65093553", "0.6464893", "0.64490724", "0.6346703", "0.6194059", "0.61654913", "0.61436886", "0.60516536", "0.60236305", "0.6020458", "0.59550285", "0.59252626", "0.59216136", "0.590427", "0.58967185", "0.58913577", "0.58889234", "0.5876057", "0.58643275", "0.5853991", "0.58514357", "0.5801224", "0.5786485", "0.57822853", "0.5774001", "0.57628965", "0.57276636", "0.5723374", "0.5715429", "0.57143056", "0.571351", "0.570807", "0.5704783", "0.5701129", "0.5696234", "0.5684182", "0.56597394", "0.56515545", "0.56464094", "0.56333995", "0.56164193", "0.5615385", "0.5609139", "0.5605151", "0.55982983", "0.5592915", "0.55783004", "0.5576717", "0.55731237", "0.5557023", "0.55501854", "0.5529831", "0.5527375", "0.5524301", "0.5522547", "0.55195206", "0.5513433", "0.551068", "0.55018026", "0.5492908", "0.5487579", "0.54855096", "0.5482394", "0.54819125", "0.5480099", "0.5475223", "0.5472048", "0.54437727", "0.544269", "0.54389673", "0.5438828", "0.54367656", "0.5422791", "0.541849", "0.54159355", "0.54109883", "0.5409876", "0.5387103", "0.5386684", "0.5377353", "0.53733444", "0.5372407", "0.53696704", "0.5369353", "0.5363835", "0.5351394", "0.53327113", "0.53322953", "0.53296256", "0.53219676", "0.5316924", "0.5313797", "0.5313256", "0.5310514", "0.5308783", "0.53054434" ]
0.57629
29
/ Based on the API reference: DELETE/1/cards/card id
@Test public void delete_card_check_status_test() throws ClientProtocolException, IOException { System.out.println("\n--------------------------------------------------"); System.out.println("Start test: " + testName.getMethodName()); //Given //Create a card first String idList = testSuite.listId; String due = "null"; String name = "Card need to delete"; String desc = "API test - create this card and need to delete"; String createQuery = String.format("idList=%s&due=%s&name=%s&desc=%s&key=%s&token=%s", URLEncoder.encode(idList, charset), URLEncoder.encode(due, charset), URLEncoder.encode(name, charset), URLEncoder.encode(desc, charset), URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost postRequest = new HttpPost(cardUrl + "?" + createQuery); HttpResponse response = httpClient.execute(postRequest); if(response.getStatusLine().getStatusCode() == 200) //Add test card successfully { JsonReader jsonReader = Json.createReader(response.getEntity().getContent()); JsonObject cardJson = jsonReader.readObject(); String cardId = cardJson.getString("id"); jsonReader.close(); String query = String.format("key=%s&token=%s", URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); //When HttpDelete deleteRequest = new HttpDelete(cardUrl + cardId + "?" + query); HttpResponse delResponse = httpClient.execute(deleteRequest); //Then /* * Expect: 200 - Status code * */ assertEquals(delResponse.getStatusLine().getStatusCode(), 200); } else { fail("Adding card is wrong, cannot delete card"); } //Tear down httpClient.close(); System.out.println("Finish test: " + testName.getMethodName()); System.out.println("--------------------------------------------------\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean delete(String cardid);", "public void deleteCard(int cardId)\n {\n dbObj=new dbFlashCards(uid);\n dbObj.deleteCard(cardId, packId);\n \n \n }", "int deleteByPrimaryKey(String card);", "public int deleteCard() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn CreditCardDA.deleteCard(id);\r\n\t}", "@Override\n\tpublic String deleteCard(int cid) {\n\t\treturn cb.deleteCard(cid);\n\t}", "int deleteByExample(CardExample example);", "@Query(\"DELETE FROM FlashCards WHERE cardId = :cardId\")\n abstract void deleteByCardId(String cardId);", "@RequestMapping(value = \"/card/\", method = RequestMethod.DELETE)\n public ResponseEntity<Card> deleteAllCards() {\n cardService.deleteAllCards();\n return new ResponseEntity<Card>(HttpStatus.NO_CONTENT);\n }", "public void deleteCard(String user_id, String card_id) throws IOException {\n\t\t\n\t\tBasicDBObject document = new BasicDBObject();\n\t\tdocument.put(\"card_id\", card_id);\n\t\tcoll2.remove(document);\n\t\t\n\t\t\t\t\n\t}", "public void deleteCard(final WebsiteInterface.WebsiteResult verification,\n int id, String front, String back){\n Response.Listener<JSONObject> deleteCard = setResponse(verification);\n //isntantiate network request object\n NetworkRequest networkRequest = new NetworkRequest(this.appContext);\n //set api endpoint; use /:id/:front?/:back?\n //TODO: change the value here to incluse the fron and back\n String api = WebsiteInterface.DELETE_CARD + String.valueOf(id) + \"/\" + front + \"/\" + back;\n //set method\n int method = networkRequest.getMethod(\"DELETE\");\n //send the network request off into queue\n networkRequest.addToRequestQueue(new JsonObjectRequest(\n method,\n api,\n null,\n deleteCard,\n error\n ));\n }", "public void deleteCard(final int id) {\n\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\tLOGGER.debug(\"Start: ERetailCardTypeServiceImpl.deleteCard()\");\n\t\t}\n\t\tCardTypeServiceClient.deleteCard(id);\n\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\tLOGGER.debug(\"End: ERetailCardTypeServiceImpl.deleteCard()\");\n\t\t}\n\n\t}", "@Override\n\tpublic String deletecard(String phonum) {\n\t\treturn this.vd.deletecard(phonum)?\"删除成功\":\"删除失败\";\n\t}", "public void cancelCard(String cardNumber) {}", "public void cancelCard() {}", "@Override\n\tpublic void delete(int ShopLoyaltyCardId) {\n\t\t\n\t}", "@Override\n\tpublic int deleteById(int id) {\n\t\treturn wdReceiveCardMapper.deleteById(id);\n\t}", "@Override\n\tpublic void delete(Integer id) {\n\t\tString sql = \"DELETE FROM tbl_flashcard WHERE flcard_id = ?\";\n\t\tDelete(sql, id);\n\t\t\n\t}", "private void removeCard() {\n\t\tint sic_idHolder; // declares sic_idHolder\n\t\t\n\t\tSystem.out.println(\"Please enter the SIC ID number you'd like to remove:\");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input sic_idHolder\n\t\tscan.nextLine();\n\t\t\n\t\tinventoryObject.removeStockIndexCard(sic_idHolder); //calls removeStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t}", "Card getCard(UUID cardId);", "void removeCardFromArgument(UUID argumentId, UUID cardId, short index);", "@Override\r\n\tpublic int delete(Integer bankcardid) {\n\t\treturn bankcardMapper.deleteByPrimaryKey(bankcardid);\r\n\t}", "@DeleteMapping(\"/cards\")\n Message deleteAll() {\n repository.deleteAllInBatch();\n Message msg = new Message();\n msg.setStatus(\"All cards cleared\");\n return msg;\n }", "public CardDeletedCommand(Card card) {\n this.card = card;\n }", "private void TempCardDelete(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tresponse.setCharacterEncoding(\"UTF-8\");\n\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\tString tempcard_id =request.getParameter(\"card_id\");\n\t\t\n\t\tPrintWriter out=response.getWriter();\n\t\tTempCardDao tempcardDao=new TempCardDao();\n\t\tif(tempcardDao.deleteTempCard(tempcard_id)) {\n\t\t\ttry {\n\t\t\t\tout.write(\"<script>alert('删除信息成功!'); location.href = '/ParkManager/TempCardServlet?type=gettempcardlist';</script>\");\n\t\t\t\t//response.getWriter().write(\"success\");\n\t\t\t}finally {\n\t\t\t\ttempcardDao.closeCon();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\ttry {\n\t\t\t\tout.write(\"<script>alert('删除信息失败!'); location.href = '/ParkManager/TempCardServlet?type=gettempcardlist';</script>\");\n\t\t\t\t//response.getWriter().write(\"failed\");\n\t\t\t}finally {\n\t\t\t\ttempcardDao.closeCon();\n\t\t\t}\n\t\t}\n\t}", "public void deleteCard(Card card)\n\t{\n\t\tcards.remove(card);\n\t\t\n\t\t// Remove and re-add all cards\n\t\tsyncCardsWithViews();\n\t\t\n\t}", "@Override\n\tpublic void deleteFlashcard(Flashcard f) {\n\t\t\n\t}", "@DELETE\n @Path(\"bank/account/{account_id}\")\n public void deleteBankAccunt(@PathParam(\"account_id\") \n String accountId) {\n int id = Integer.parseInt(accountId);\n System.out.println(id);\n }", "public void RemoveCardFromDeck(int value){\n deck.remove(value);\n }", "public void removePresentCard() {\n storageCards.remove();\n }", "public void handleDeleteClick(final Integer position){\n int idToRemove = mDataset.get(position).getSetId();\n\n RequestQueue queue = Volley.newRequestQueue(this);\n String url = \"http://ec2-18-188-60-72.us-east-2.compute.amazonaws.com/FlashcardsPro/deleteCardSet.php?id=\" + idToRemove;\n\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n try {\n if(response.getString(\"status\").equals(\"succeeded\")){\n //update local data-set and notify recyclerView\n mDataset.remove(mDataset.get(position));\n recyclerView.removeViewAt(position);\n flashcardSetRecyclerAdapter.notifyItemRemoved(position);\n flashcardSetRecyclerAdapter.notifyItemRangeChanged(position, mDataset.size());\n\n if(mDataset.isEmpty()){\n emptyView.setVisibility(View.VISIBLE);\n }\n }\n else {\n Toast.makeText(getApplicationContext(), \"Could not connect to server\", Toast.LENGTH_SHORT).show();\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"LOGIN ERROR\", error.toString());\n }\n });\n\n queue.add(request);\n\n }", "public void removeCard(int index) {\n cards.remove(index);\n }", "public CardCollection destroyCardType(String type) ;", "public CardCollection destroyCards(List<AbstractCard> cardsToDestroy) ;", "@ActionMapping(\"delete\")\n public void delete(ActionRequest request, ActionResponse response, @ModelAttribute(\"options\") ApplicationCardOptions options) throws PortletException {\n // Portal controller context\n PortalControllerContext portalControllerContext = new PortalControllerContext(this.portletContext, request, response);\n\n this.service.deleteApplication(portalControllerContext, options);\n \n response.setRenderParameter(\"view\",\"deleted\");\n }", "public void deleteCardInventory() {\n try {\n System.out.println(\"********************ServiceBean=>deleteCardInventory********\");\n if (cardInventoryDataBean != null) {\n cardInventoryTransformerBean.deleteCardInventory(cardInventoryDataBean);\n retrieveCardInventoryList();\n System.out.println(\"CardInventory Delete Sussesfully\");\n messageDataBean.setMessage(\"CardInventory deleted successfully.\");\n messageDataBean.setIsSuccess(Boolean.TRUE);\n }\n } catch (Exception e) {\n System.out.println(e);\n messageDataBean.setMessage(\"Error in Deleting CardInventory.\");\n messageDataBean.setIsSuccess(Boolean.FALSE);\n }\n }", "public void onClick(DialogInterface dialog, int which) {\n\n\n cardsDCM = cardActivity.cardsDCMList.get(i);\n cardActivity.cardsDAO.delete(cardsDCM);\n try {\n cardActivity.cardsDCMList = cardActivity.cardsDAO.getAll();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n cardActivity.cardListAdapter.notifyDataSetChanged();\n\n }", "@Test\n public void testDeleteCartsIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteCartsIdAction(\"{id}\", \"{customerId}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Cart\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "public void remove(Card card) {\r\n\t\tcards.remove(card);\r\n\t}", "int delete(String clientId);", "@Test\n public void testDeleteCartsIdPaymentAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteCartsIdPaymentAction(\"{id}\", \"{customerId}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Cart\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "int deleteContent(@Param(\"id\") long id);", "int deleteByPrimaryKey(String contractNo);", "public Card drawCard() {\n Card c = cards.get(0);//get a card\n cards.remove(0);//remove the card form the deck that's given out\n discard.add(c);//so the card given out is added to the discard list\n return c;//return a card object\n\n }", "public void findAndRemoveCard(Card c){\n\t\tboolean b = myCards.remove(c);\n//\t\tSystem.out.println(\"mycards size\" + myCards.size() + \"and removed was \" + b);\n\t\treturn;\n\t}", "@Override\n\tpublic ResultMessage deleteCar(String id) {\n\t\treturn inList.delete(id);\n\t}", "public void removeCard(Card rCard, int id)\n\t{\n\t\tfor (int x = 0; x < hands[id].size(); x++) //look at each card in hand\n\t\t{\n\t\t\tCard cCard = hands[id].getCardAtSlot(x);\n\t\t\tif (rCard.getCardID() == cCard.getCardID())\n\t\t\t{\n\t\t\t\thands[id].remove(cCard);\n\t\t\t}\n\t\t}\n\t}", "Card dealOneCard();", "public int delete( Integer idConge ) ;", "void deleteByIdWithResponse(String id, Context context);", "void deleteByIdWithResponse(String id, Context context);", "void deleteByIdWithResponse(String id, Context context);", "void deleteByIdWithResponse(String id, Context context);", "void deleteByIdWithResponse(String id, Context context);", "public CardCollection destroyAllCards() ;", "@Override\n\tpublic UnoCard getCard(int index){\n\t\ttry{\n\t\t\treturn this.cardList.remove(index);\n\t\t} catch(IndexOutOfBoundsException e){\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\r\n\tpublic ResponseDTO delete(String uid) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn null;\r\n\t}", "@DELETE\n public void delete(@PathParam(\"id\") String id) {\n }", "@Test\n public void testRemoveCard() {\n d_gameData.getD_playerList().get(1).addCard(GameCard.BOMB);\n d_gameData.getD_playerList().get(1).removeCard(GameCard.BOMB);\n assertEquals(false, d_gameData.getD_playerList().get(1).getD_cards().contains(GameCard.BOMB));\n }", "@DELETE\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n @Consumes(MediaType.APPLICATION_JSON)\n public void deleteCc(@PathParam(\"id\") final Long id) {\n service.deleteCc(id);\n }", "public Optional<Card> dealOneCard() {\n if (cards.size() > 0) {\n return Optional.of(cards.remove(0));\n } else {\n return Optional.empty();\n }\n }", "@DELETE\n @Path(\"/user/account/{uid}\")\n public void deleteUserAccount(@PathParam(\"uid\") \n String uid) {\n int id = Integer.parseInt(uid);\n System.out.println(uid);\n }", "@FormUrlEncoded\n\t@POST(\"post/delete\")\n\tCall<BasicResponse> deleteItem(\n\t\t\t\t\t@Field(\"id_content\") String idContent);", "public Long getCardId() {\r\n return cardId;\r\n }", "public void RemoveCardFromComputer(int value){\n handComputer.remove(value);\n }", "public void deleteAllCards()\n\t{\n\t\tcards.clear();\n\t\t\n\t\t// Update the views\n\t\tsyncCardsWithViews();\n\t\t\n\t}", "public interface CardsService {\n\n @POST(\"cards\")\n Call<Card> createCard(@Query(\"idList\") String idList, @Body Card card);\n\n @GET(\"cards/{id}\")\n Call<Card> getCard(@Path(\"id\") String id);\n\n @DELETE(\"cards/{id}\")\n Call<ResponseBody> deleteCard(@Path(\"id\") String id);\n\n\n}", "boolean canBeRemoved(int cardIndex);", "public void RemoveCardFromHuman(int value){\n handHuman.remove(value);\n }", "for (Card ca : deck) {\n\t\tif (ca.suit == 'c') {\n\t\t\tdeck.remove(ca);\n\t\t}\n\t}", "public void removeCard(UnoCard cardToRemove){\n for (UnoCard c : this.cards){\n if (c.getName().equals(cardToRemove.getName())){\n Log.d(\"Removed Card:\", c.getName());\n this.cards.remove(c);\n break;\n }\n }\n }", "@Override\n public void removeCard(int i) {\n this.cards.remove(i);\n }", "ResponseEntity deleteById(UUID id);", "void discardCards(Resources resources);", "@DELETE\n\tResponse delete();", "public void delete(Integer id) {\n\t\t\t\t\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\tPerson person=(Person)session.get(Person.class, id);\n\t\t\n\t\tSet<CreditCard> creditCards =person.getCreditCards();\n\t\t\n\t\t// Delete person\n\t\tsession.delete(person);\n\t\t\n\t\t// Delete associated credit cards\n\t\tfor (CreditCard creditCard: creditCards) {\n\t\t\tsession.delete(creditCard);\n\t\t}\n\t}", "public int deletePack(String name)\n {\n dbObj=new dbFlashCards(userId);\n \n return dbObj.deletePack(name);\n \n \n }", "int deleteByPrimaryKey(String cid);", "@Override\n\tpublic ServerResponse movesDiscardCards(DiscardedCards cards) {\n\t\treturn null;\n\t}", "@DELETE(\"posts/{id}/\")\n Call<Void> delete(@Path(\"id\") int id);", "void deleteByIdWithResponse(String id, UUID clientRequestId, Context context);", "public Card remove() {\n return (this.cards.size() > 0) ? this.cards.remove(0) : null;\n }", "@DeleteMapping(\"{id}\")\n public ResponseEntity<Long> delete(@PathVariable(\"id\") Long id) {\n logger.debug(\"Request to delete Contractor with id \" + id);\n if(id == null || id == 0) throw new IllegalArgumentException(\"Expects a valid id value > 0\");\n Optional<Contractor> contractor = contractorService.getByID(id);\n if(contractor == null || !contractor.isPresent()) throw new ResourceNotFoundException(\"In order to delete Contractor \" + id + \", existing Contractor must be available with same ID\");\n contractorService.deleteByID(id);\n return new ResponseEntity<Long>(id,new HttpHeaders(), HttpStatus.ACCEPTED);\n }", "@Override\n\tpublic void delete(BatimentoCardiaco t) {\n\t\t\n\t}", "public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }", "int deleteByExample(CraftAdvReqExample example);", "int deleteByExample(CGcontractCreditExample example);", "public Card removeFirstCard()\n {\n return cards.remove(0);\n }", "Boolean delete(HttpServletRequest request, Long id);", "public void deleteCrime(UUID id) {\n\n }", "public Cards dealCards(List<Cards> cardsList) {\n\t\tif(!cardsList.isEmpty()) {\n\t\t\tCards card = cardsList.get(0);\n\t\t\tcardsList.remove(card);\n\t\t\treturn card;\n\t\t}else {\n\t\t\treturn null;\n\t\t}\n\t}", "public Card deal()\r\n\t{\r\n\t\tCard card = deck.remove(0);\r\n\t\treturn card;\r\n\t}", "public void deleteReportCard(ReportCardModel inputModel) {\n System.out.println(\"ReportCardDao.deleteReportCard \" + \"start\");\n // TODO: Implement this function.\n Transaction trans = Datastore.beginTransaction();\n \n Key parentKey = KeyFactory.createKey(\"ReportCard\", inputModel.getStudentName());\n Key key = Datastore.allocateId(parentKey, \"ReportCardModel\");\n \n Datastore.delete(key);\n \n trans.commit();\n System.out.println(\"ReportCardDao.deleteReportCard \" + \"end\");\n }", "@DeleteMapping(value = \"/{id}\", produces = MediaType.APPLICATION_JSON_VALUE)\n\t\t\tpublic ResponseEntity<Object> deleteReview(@PathVariable(\"id\") int id, HttpServletResponse response) {\n\t\t\t\t\t\t\t\n\t\t\t\tReview deletedReview = reviewService.deleteReview(id);\n\t\t\t\t\t\t\t\n\t\t\t\tresponse.addHeader(\"Date\", new Date().toString());\n\t\t\t\tresponse.setHeader(\"Cache-Control\",\"no-cache,no-store,must-revalidate\");\n\t\t\t\tresponse.setHeader(\"Pragma\",\"no-cache\");\n\t\t\t\tresponse.setHeader(\"Version\",\"Mechanic API V-2.0\");\n\t\t\t\tresponse.setDateHeader(\"Expires\", 0);\n\t\t\t\t\t\t\t\n\t\t\t\treturn new ResponseEntity<>(deletedReview, HttpStatus.CREATED);\n\t\t\t}", "Card selectByPrimaryKey(String card);", "@Test\n public void testDeleteCartsIdEntriesCartEntryIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteCartsIdEntriesCartEntryIdAction(\"{id}\", \"{cartEntryId}\", \"{customerId}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Cart\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "public void discardCard(int player, Card card) {\r\n\t\tplayers.get(player).removeCard(card);\r\n\t\tdiscardPile.addCard(card);\r\n\t}", "@GetMapping(\"{cardId}\")\n public Card getCardById(@PathVariable String cardId){\n return cardService.getCardById(cardId);\n // To service guy, grab the card object first, then iterate the \"finishedUsersId\"\n }", "@RequestMapping(value = \"/deleteBook/{id}\", method = RequestMethod.DELETE)\r\n public ResponseEntity<?> delete(@PathVariable(\"id\") long id) throws Exception{\r\n\t ProducerTemplate pt = camelContext.createProducerTemplate();\r\n\t String destination = \"direct:cm.delete\";\r\n\t\tSystem.out.println(\"Send message to \" + destination);\r\n\t\tpt.sendBody(destination, id);\r\n\t\t\r\n return ResponseEntity.ok().body(\"Book has been deleted successfully.\");\r\n }", "@DeleteMapping(\"/contabancarias/{id}\")\n @Timed\n public ResponseEntity<Void> deleteContabancaria(@PathVariable Long id) {\n log.debug(\"REST request to delete Contabancaria : {}\", id);\n contabancariaRepository.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "void deleteByIdWithResponse(String id, Boolean force, Boolean retain, Context context);" ]
[ "0.8034475", "0.772111", "0.7711954", "0.72669363", "0.72219986", "0.7083216", "0.7022358", "0.6982365", "0.68764615", "0.6845651", "0.67519015", "0.6616671", "0.6567832", "0.6489056", "0.6455875", "0.6367895", "0.63646346", "0.6363494", "0.63333553", "0.63033545", "0.6301077", "0.6291219", "0.6279501", "0.6266488", "0.625933", "0.61294353", "0.61032885", "0.6088904", "0.6070804", "0.6069831", "0.60526496", "0.6039603", "0.5975601", "0.5964891", "0.59644043", "0.59550416", "0.594609", "0.5915287", "0.5911765", "0.5904567", "0.5897145", "0.588997", "0.5882607", "0.58821726", "0.5855714", "0.58435106", "0.583433", "0.58289236", "0.5824671", "0.5824671", "0.5824671", "0.5824671", "0.5824671", "0.5822881", "0.5811535", "0.5784665", "0.5772113", "0.5759089", "0.5750175", "0.57466924", "0.57434815", "0.5731688", "0.57168263", "0.57076436", "0.5703134", "0.56992036", "0.5695653", "0.5693972", "0.5686925", "0.56809545", "0.5676151", "0.56641257", "0.5651982", "0.5638263", "0.5623566", "0.5616279", "0.5607587", "0.5600623", "0.559836", "0.5594635", "0.55941457", "0.55861336", "0.558057", "0.557876", "0.55783993", "0.5577313", "0.55746156", "0.5568601", "0.5567829", "0.5566708", "0.55559945", "0.55553496", "0.5551117", "0.55480856", "0.5542526", "0.553901", "0.55324054", "0.55316985", "0.5529482", "0.5529139" ]
0.6127452
26
/ Test the default reponse content type should be JSON
@Test public void get_card_ckeck_content_format_is_JSON_test() throws ClientProtocolException, IOException { System.out.println("\n--------------------------------------------------"); System.out.println("Start test: " + testName.getMethodName()); //Given //Add a card to get card content String idList = testSuite.listId; String due = "null"; String name = "Card need to get content"; String desc = "API test - create this card and need to get its content"; String createQuery = String.format("idList=%s&due=%s&name=%s&desc=%s&key=%s&token=%s", URLEncoder.encode(idList, charset), URLEncoder.encode(due, charset), URLEncoder.encode(name, charset), URLEncoder.encode(desc, charset), URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost postRequest = new HttpPost(cardUrl + "?" + createQuery); HttpResponse response = httpClient.execute(postRequest); if(response.getStatusLine().getStatusCode() == 200) //Add test card successfully { JsonReader jsonReader = Json.createReader(response.getEntity().getContent()); JsonObject cardJson = jsonReader.readObject(); String cardId = cardJson.getString("id"); jsonReader.close(); String query = String.format("key=%s&token=%s", URLEncoder.encode(key, charset), URLEncoder.encode(token, charset)); //When HttpGet getRequest = new HttpGet(cardUrl + cardId + "?" + query); HttpResponse getResponse = httpClient.execute(getRequest); //Then /* * Expect: /application/json - content format * */ String type = getResponse.getEntity().getContentType().getValue().toString(); assertThat(type, CoreMatchers.containsString("application/json")); } else { fail("Adding card is wrong, cannot get card content format"); } //Tear down httpClient.close(); System.out.println("Finish test: " + testName.getMethodName()); System.out.println("--------------------------------------------------\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isJSON(Response response) {\n return response.getHeaderString(\"Content-Type\").equalsIgnoreCase(MediaType.APPLICATION_JSON);\n }", "@Test\n\tpublic void requestDataForCustomer12212_checkContentType_expectApplicationJson() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "public static boolean useJsonResponse(HttpServletRequest request) {\n String acceptHeaderValue = request.getHeader(\"Accept\");\n if (acceptHeaderValue == null) {\n return false;\n }\n HttpHeaders httpHeaders = new HttpHeaders();\n httpHeaders.add(HttpHeaders.ACCEPT, acceptHeaderValue);\n List<MediaType> acceptedMediaTypes = httpHeaders.getAccept();\n boolean acceptsHtml = acceptedMediaTypes.contains(MediaType.TEXT_HTML);\n boolean acceptsJson = acceptedMediaTypes.contains(MediaType.APPLICATION_JSON);\n if (acceptsJson && (!acceptsHtml)) {\n return true;\n } else {\n return false;\n }\n }", "@Test\n\t@Ignore\n\tpublic void testResponse() throws UnsupportedEncodingException {\n\t\tws = resource().path(\"omxdata\");\n\t\tClientResponse response = ws.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);\n\t\tassertEquals(200, response.getStatus());\n\t\tSystem.out.println(response.getStatus());\n\t}", "public boolean supportsJsonType() {\n return false;\n }", "@Test\n public void VerifyContentTypeWithAssertThat(){\n given().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/employees/100\")\n .then().assertThat().statusCode(200)\n .and().contentType(ContentType.JSON);\n }", "boolean isSerializeResponse();", "@Override\n\tpublic boolean isResponseExpected() {\n\t\treturn false;\n\t}", "@Test(priority=5)\r\n\tpublic void validateHeader()\r\n\t{\r\n\t\tgiven()\r\n\t\t.get(\"https://reqres.in/api/users/2\")\r\n\t\t.then() \r\n\t \t.header(\"Content-Type\", containsString(\"application/json\")); \r\n\t\t//application/json; charset=utf-8 \r\n\t}", "@Override\r\n\tprotected ResponseEntity<Object> handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex,\r\n\t\t\tHttpHeaders headers, HttpStatus status, WebRequest request) {\n\t\treturn super.handleHttpMediaTypeNotSupported(ex, headers, status, request);\r\n\t}", "default boolean checkJsonResp(JsonElement response) {\n return false;\n }", "@Ignore\n @Test\n public void testPostDisambiguatesOnContentType() throws ClientProtocolException, IOException\n {\n verifyOkResult(new PostRequestResult(\"post/bycontenttype\", xml, ContentType.APPLICATION_XML_TYPE), \"xml\");\n verifyOkResult(new PostRequestResult(\"post/bycontenttype\", json, ContentType.APPLICATION_JSON_TYPE), \"json\");\n verifyOkResult(new PostRequestResult(\"post/bycontenttype\", text, ContentType.TEXT_PLAIN_TYPE), \"text\");\n }", "protected static HttpHeaders getJsonHeaders(){ \n HttpHeaders headers = new HttpHeaders();\n headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));\n headers.setContentType(MediaType.APPLICATION_JSON);\n return headers;\n }", "@Test\n\tpublic void testHighlightProducesDefaultJsonWithBrowserRequest() throws Exception {\n\t\tHttpServletRequest req = mock(HttpServletRequest.class);\n\n\t\twhen(req.getHeaders(Constants.HEADER_ACCEPT)).thenAnswer(theInvocation -> new ArrayEnumeration<>(\"text/html,application/xhtml+xml,application/xml;q=0.9\"));\n\n\t\tHttpServletResponse resp = mock(HttpServletResponse.class);\n\t\tStringWriter sw = new StringWriter();\n\t\twhen(resp.getWriter()).thenReturn(new PrintWriter(sw));\n\n\t\tPatient resource = new Patient();\n\t\tresource.addName().setFamily(\"FAMILY\");\n\n\t\tServletRequestDetails reqDetails = new TestServletRequestDetails(mock(IInterceptorBroadcaster.class));\n\t\treqDetails.setRequestType(RequestTypeEnum.GET);\n\t\treqDetails.setParameters(new HashMap<>());\n\t\tRestfulServer server = new RestfulServer(ourCtx);\n\t\tserver.setDefaultResponseEncoding(EncodingEnum.JSON);\n\t\treqDetails.setServer(server);\n\t\treqDetails.setServletRequest(req);\n\n\t\tassertFalse(ourInterceptor.outgoingResponse(reqDetails, new ResponseDetails(resource), req, resp));\n\n\t\tString output = sw.getBuffer().toString();\n\t\tourLog.info(output);\n\t\tassertThat(output, containsString(\"resourceType\"));\n\t}", "boolean hasGenericResponse();", "@Override\n\tpublic boolean isReadable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) {\n\t\treturn arg0 == JSONObject.class && MediaType.APPLICATION_JSON_TYPE.equals(arg3);\n\t}", "@Test\n\tpublic void verifyHeader() {\n\t\t\tHeaders head = response.getHeaders();\n\t\t\tAssert.assertEquals(head.getValues(\"Content-Type\").toString(), \"[application/json; charset=utf-8]\");\n\t\t}", "@Test\n\tpublic void testDeSerializationUsingContentType() {\n\t\t\n\t\tZebraRequestClassNew reqObj = new ZebraRequestClassNew();\n\t\treqObj.setAge(10);\n\t\treqObj.setWeight(100);\n\t\treqObj.setHome(\"India\");\t\t\n\t\n\t\tZebraRequestClass respObj = \n\t\tgiven()\n\t\t\t.body(reqObj). \n\t\twhen()\n\t\t\t.post(\"http://www.thomas-bayer.com/restnames/countries.groovy\")\n\t\t\t.as(ZebraRequestClass.class);\n\t\t\n\t\trespObj.setregId(1101);\n\t\tAssert.assertTrue(respObj.getregId() > 0);\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJSON() {\n throw new UnsupportedOperationException();\n }", "@Override\n public void intercept(RequestInterceptor.RequestFacade request) {\n request.addHeader(\"Accept\", \"application/json\");\n }", "@Override\n protected ResponseEntity<Object> handleHttpMediaTypeNotSupported(\n HttpMediaTypeNotSupportedException ex,\n HttpHeaders headers,\n HttpStatus status,\n WebRequest request) {\n\n LOGGER.info(\"handleHttpMediaTypeNotSupported\");\n return new ResponseEntity<>(new ErrorDto(\"handleHttpMediaTypeNotSupported\"), HttpStatus.UNSUPPORTED_MEDIA_TYPE);\n }", "@Test\n public void testNodeInfoDefault() throws Exception, JSONException {\n WebResource r = resource();\n ClientResponse response = r.path(\"ws\").path(\"v1\").path(\"node\").path(\"info\").get(ClientResponse.class);\n Assert.assertEquals((((MediaType.APPLICATION_JSON) + \"; \") + (JettyUtils.UTF_8)), response.getType().toString());\n JSONObject json = response.getEntity(JSONObject.class);\n verifyNodeInfo(json);\n }", "@Override\n public Response intercept(Chain chain) throws IOException {\n Request request = chain.request();\n Request.Builder newRequest;\n\n newRequest = request.newBuilder()\n .addHeader(\"Content-type\", \"application/json;charset=UTF-8\")\n .addHeader(\"Accept\", \"application/json\");\n return chain.proceed(newRequest.build());\n }", "@Test\n public void testNodeDefault() throws Exception, JSONException {\n WebResource r = resource();\n ClientResponse response = r.path(\"ws\").path(\"v1\").path(\"node\").get(ClientResponse.class);\n Assert.assertEquals((((MediaType.APPLICATION_JSON) + \"; \") + (JettyUtils.UTF_8)), response.getType().toString());\n JSONObject json = response.getEntity(JSONObject.class);\n verifyNodeInfo(json);\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJson() {\n return null;\n }", "public Map<String, JsonElementType> getJsonResponseStructure();", "public void testGetJSON() {\n\t}", "public MediaType getDefault();", "public static String getFileType() {return \"json\";}", "private void setContentType(Operation operation) {\n operation.getResponses().values().forEach(response -> {\n Content content = response.getContent();\n if (content != null) {\n MediaType mediaType = content.remove(\"*/*\");\n if (mediaType != null) {\n content.addMediaType(\"application/json\", mediaType);\n }\n }\n });\n }", "@ResponseStatus(HttpStatus.UNSUPPORTED_MEDIA_TYPE)\n @ExceptionHandler(HttpMediaTypeNotSupportedException.class)\n public R handleHttpMediaTypeNotSupportedException(HttpMediaTypeNotSupportedException e) {\n log.error(\"不支持当前媒体类型\", e);\n return R.error(400 , \"content_type_not_supported\");\n }", "public ZserioType getResponseType()\n {\n return responseType;\n }", "Optional<String> getResponseBody();", "@Override\n public JsonElement serialize(FrontPageContentResponse src, Type typeOfSrc, JsonSerializationContext context) {\n\treturn null;\n }", "HarvestResponseType createHarvestResponseType();", "@Override\n public boolean accepts(HttpResponse response) {\n Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);\n for (Header header : headers) {\n if (header != null && header.getValue().contains(NTLMConstants.CONTENT_TYPE_FOR_SPNEGO)) {\n return true;\n }\n }\n return false;\n }", "public DocumentLifecycleWorkflowRequest setContentTypeJson() {\n\t\tthis.headerContentType = HttpRequestConnector.HTTP_CONTENT_TYPE_JSON;\n\t\treturn this;\n\t}", "@Test\n public void testGetItem() throws Exception {\n RequestBuilder request = MockMvcRequestBuilders\n .get(\"/dummy-item\").accept(MediaType.APPLICATION_JSON);\n MvcResult mvcResult = mockMvc.perform(request)\n // perform request and check status\n .andExpect(status().isOk())\n // check content \n // if response is easy check directly\n .andExpect(content().json(\"{\\\"id\\\": 123,\\\"name\\\": \\\"Indarpreet\\\",\\\"price\\\": 120,\\\"quantity\\\": 1}\"))\n // return the object\n .andReturn();\n\n // if response is complex check using Assert Equals and other libraries \n // assertEquals(\"Hello World\", mvcResult.getResponse().getContentAsString());\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJson() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJson() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJson() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }", "@GET\n @Produces(\"application/json\")\n public String getJson() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }", "@ResponseStatus (HttpStatus.UNSUPPORTED_MEDIA_TYPE)\n\t@ExceptionHandler (HttpMediaTypeNotSupportedException.class)\n\tpublic Result handleHttpMediaTypeNotSupportedException (Exception e)\n\t{\n\t\treturn new Result ().failure (\"content_type_not_supported\");\n\t}", "@Override\r\n protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) {\r\n try {\r\n if (response.data.length == 0) {\r\n byte[] responseData = \"{}\".getBytes(\"UTF8\");\r\n response = new NetworkResponse(response.statusCode, responseData, response.headers, response.notModified);\r\n }\r\n } catch (UnsupportedEncodingException e) {\r\n e.printStackTrace();\r\n }\r\n return super.parseNetworkResponse(response);\r\n }", "TypedResponse createTypedResponse();", "@ResponseStatus(HttpStatus.UNSUPPORTED_MEDIA_TYPE)\n @ExceptionHandler(HttpMediaTypeNotSupportedException.class)\n public String handleHttpMediaTypeNotSupportedException(Exception e) {\n log.error(\"不支持当前媒体类型\", e);\n return new Msg().fail().addVal(Msg.msg, \"content_type_not_supported\").toJson();\n }", "@Override\r\n\tprotected GuardarSustentoResponse responseText(String json) {\n\t\tGuardarSustentoResponse guardarSustentoResponse = JSONHelper.desSerializar(json, GuardarSustentoResponse.class);\r\n\t\treturn guardarSustentoResponse;\r\n\t}", "@Override\n\tprotected ResponseEntity<Object> handleHttpMediaTypeNotAcceptable(\n\t\t\tHttpMediaTypeNotAcceptableException ex, HttpHeaders headers,\n\t\t\tHttpStatus status, WebRequest request) {\n\t\tMediaType mediaType= MediaType.parseMediaType(request.getHeader(\"accept\"));\n\t\tHttpMediaTypeNotSupportedException exa = new HttpMediaTypeNotSupportedException(mediaType, ex.getSupportedMediaTypes());\n\t\theaders.setAccept(ex.getSupportedMediaTypes());\n\t\tResponseError body= createResponseError(exa, HttpStatus.UNSUPPORTED_MEDIA_TYPE,HttpStatus.UNSUPPORTED_MEDIA_TYPE.toString(), \"ERROR_BUSINESS_EXCEPTION\");\n\t\treturn handleExceptionInternal(exa,body, headers, HttpStatus.UNSUPPORTED_MEDIA_TYPE, request);\n\t}", "private Response toRequestedType(int id, String type) {\n\tPrediction pred = plist.find(id);\n\tif (pred == null) {\n\t String msg = id + \" is a bad ID.\\n\";\n\t return Response.status(Response.Status.BAD_REQUEST).\n\t\t entity(msg).\n\t\t type(MediaType.TEXT_PLAIN).\n\t\t build();\n\t}\n\telse if (type.contains(\"json\"))\n\t return Response.ok(toJson(pred), type).build();\n\telse\n\t return Response.ok(pred, type).build(); // toXml is automatic\n }", "public MediaType getContentType()\r\n/* 193: */ {\r\n/* 194:289 */ String value = getFirst(\"Content-Type\");\r\n/* 195:290 */ return value != null ? MediaType.parseMediaType(value) : null;\r\n/* 196: */ }", "public String getContentType() {\n return this.response.getContentType();\n }", "public RestTemplate contentTypeHelper(RestTemplate restTemplatex) {\n restTemplatex = new RestTemplateBuilder().build();\n List<HttpMessageConverter<?>> messageConverters = new ArrayList<>();\n MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();\n converter.setSupportedMediaTypes(Collections.singletonList(MediaType.ALL));\n messageConverters.add(converter);\n restTemplatex.setMessageConverters(messageConverters);\n return restTemplatex;\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException\n\t{\n\t\tresponse.setContentType(\"application/json;charset=UTF-8\");\n\t}", "public boolean isResponse(){\n return true;\n }", "public JSONResponse convertReponse(HttpResponse response){\n\n\t\ttry {\n\t\t\tString json = EntityUtils.toString(response.getEntity(), \"UTF-8\");\n\t\t\tint statusCode = response.getStatusLine().getStatusCode();\n\t return new JSONResponse(json, statusCode);\n\t\t} catch (ParseException | IOException e) {\n\t\t\tlogger.error(\"convert http response to json failed, error={}\", e.getLocalizedMessage());\n\t\t\t// e.printStackTrace();\n\t\t\treturn null;\n\t\t} \n \n }", "@Path(\"/\")\n @GET\n @Produces(MediaType.APPLICATION_JSON) // indique que la réponse est en json\n public Response test(@Context final UriInfo ui) {\n\n return Response.ok(true).build();\n }", "@Test\n public void testReportProducesValidJson() throws Exception {\n testReportProducesCorrectOutput(\"json\");\n }", "@Override\r\n\tprotected GuardarVtaCeroMotivoResponse responseText(String json) {\n\t\tGuardarVtaCeroMotivoResponse guardarVtaCeroMotivoResponse = JSONHelper.desSerializar(json, GuardarVtaCeroMotivoResponse.class);\r\n\t\treturn guardarVtaCeroMotivoResponse;\r\n\t}", "void setContentType(HttpServletResponse response);", "ResponseType createResponseType();", "public String badOrMissingResponseData();", "protected abstract boolean isExpectedResponseCode(int httpStatus);", "@ResponseStatus(HttpStatus.UNSUPPORTED_MEDIA_TYPE)\n @ExceptionHandler(HttpMediaTypeNotSupportedException.class)\n public Result handleHttpMediaTypeNotSupportedException(Exception e) {\n logger.error(\"不支持当前媒体类型\", e);\n return new Result(415,\"不支持当前媒体类型\");\n }", "@Override\n public Class<AppPayApiResponse> responseType() {\n return AppPayApiResponse.class;\n }", "private void writeHttpServiceResponse(String contentType, HttpServletResponse response, Object result) throws\r\n IOException {\r\n if (contentType.indexOf(CONTENT_TYPE_BSF) > -1) {\r\n OutputStream outputStream = response.getOutputStream();\r\n ObjectOutputStream oos = new ObjectOutputStream(outputStream);\r\n oos.writeObject(new ServiceResponse(result));\r\n oos.close();\r\n } else {\r\n //JSONObject jsonResult = new JSONObject();\r\n \tJsonObject jsonResult = new JsonObject();\r\n if (result instanceof Throwable) {\r\n Throwable ex = (Throwable) result;\r\n jsonResult.addProperty(ERROR, ex.getMessage());\r\n StringWriter sw = new StringWriter();\r\n ex.printStackTrace(new PrintWriter(sw));\r\n jsonResult.addProperty(STACK_TRACE, sw.toString());\r\n } /*else if (result != null && ObjectUtil.isCollection(result)) {\r\n jsonResult.put(VALUE, JSONArray.fromObject(result));\r\n } else if (result instanceof String && JSONUtils.mayBeJSON((String) result)) {\r\n jsonResult.put(VALUE, JSONObject.fromObject((String) result));\r\n } else if (JSONUtils.isNumber(result) || JSONUtils.isBoolean(result) || JSONUtils.isString(result)) {\r\n jsonResult.put(VALUE, result);\r\n }*/ \r\n else {\r\n System.out.println(\">>>result class: \" + result.getClass());\r\n jsonResult.add(VALUE, JSONConverter.toJsonTree(result));\r\n }\r\n response.setCharacterEncoding(RESP_ENCODING);\r\n response.getWriter().write(JSONConverter.gson().toJson(jsonResult));\r\n }\r\n }", "@Override\n\tpublic BaseResponse testResponse() {\n\t\treturn setResultSuccess();\n\t}", "@Test\r\n public void test_getContentType_Accuracy() {\r\n assertEquals(\"incorrect default value\", null, instance.getContentType());\r\n instance.setContentType(\"a\");\r\n assertEquals(\"incorrect value after setting\", \"a\", instance.getContentType());\r\n }", "void shouldParseTheJsonPostData() {\n }", "@Override\n public boolean isMaybeStrJSON() {\n checkNotPolymorphicOrUnknown();\n return (flags & STR_JSON) != 0;\n }", "@Override\n public int getContentType() {\n return 0;\n }", "@Test\n public void testGetSingleTpTagRecordSetRepresentationAsString() {\n WebResource r = resource().path(\"RecordSet\").path(\"TpTag\").path(\"single\");\n // Assert String representation\n String expected = \"{\\\"startIndex\\\":0,\\\"pageSize\\\":10,\\\"totalNumberOfRecords\\\":1,\\\"records\\\":[{\\\"TpTag\\\":[{\\\"tagName\\\":\\\"tagname\\\",\\\"tpTagId\\\":10}]}]}\";\n String s = r.accept(MediaType.APPLICATION_JSON_TYPE).get(String.class);\n assertEquals(expected, s);\n }", "boolean supports(GenericType<? extends Source<?>> type, HttpClientResponse response);", "@Test\n\tvoid testJSONObject1() {\n\t\tassertNotNull(r1.getOutput());\n\t}", "@Test\n void getAllProfessors() throws Exception{\n MvcResult result = mvc.perform(get(\"/api/v1/professors\")).andExpect(status().isOk()).andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)).andReturn();\n System.out.println(result.getResponse().getContentAsString());\n\n }", "protected abstract MediaType getSupportedMediaType();", "public <T> T deserialize(HttpResponse response, Type returnType) throws PdfFillerAPIException {\n String body;\n if (response.getBody() != null && !response.getBody().isEmpty())\n body = response.getBody();\n else\n body = \"\";\n \n List<String> contentType = response.getHeaders().get(\"Content-Type\"); \n\n if (contentType.contains(\"application/json\")) {\n return this.deserialize(body, returnType);\n } else if (returnType.equals(String.class)) {\n // Expecting string, return the raw response body.\n return (T) body;\n } else {\n throw new PdfFillerAPIException(\n \"Content type \\\"\" + contentType + \"\\\" is not supported for type: \"\n + returnType\n );\n }\n }", "@Value.Default\n public String getMediaType() {\n\treturn \"\";\n }", "ValueType getJsonValueType();", "@Override\n public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {\n\n Map<String, MediaType> types = new HashMap<>();\n types.put(\"json\", MediaType.APPLICATION_JSON);\n types.put(\"xml\", MediaType.APPLICATION_XML);\n\n configurer.favorPathExtension(false).\n useJaf(false).\n defaultContentType(MediaType.APPLICATION_JSON).\n mediaType(\"xml\", MediaType.APPLICATION_XML).\n mediaType(\"json\", MediaType.APPLICATION_JSON);\n }", "@Test\r\n public void test_setContentType_Accuracy() {\r\n instance.setContentType(\"a\");\r\n assertEquals(\"incorrect value after setting\", \"a\", instance.getContentType());\r\n }", "@Test\n public void jsonTest() {\n // TODO: test json\n }", "private boolean shouldParseBody(final HttpServerExchange exchange) {\n HttpString method = exchange.getRequestMethod();\n boolean hasBody = method.equals(Methods.POST) || method.equals(Methods.PUT) || method.equals(Methods.PATCH);\n return !config.isSkipProxyBodyHandler() &&\n hasBody &&\n exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE) != null &&\n exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE).startsWith(\"application/json\");\n }", "private boolean attachJsonBody(final HttpServerExchange exchange, String string) {\n Object body;\n string = string.trim();\n if (string.startsWith(\"{\")) {\n try {\n body = Config.getInstance().getMapper().readValue(string, new TypeReference<Map<String, Object>>() {\n });\n } catch (JsonProcessingException e) {\n if(exchange.getConnection().getBufferSize() <= string.length()) {\n setExchangeStatus(exchange, PAYLOAD_TOO_LARGE, \"application/json\");\n } else {\n setExchangeStatus(exchange, CONTENT_TYPE_MISMATCH, \"application/json\");\n }\n return false;\n }\n } else if (string.startsWith(\"[\")) {\n try {\n body = Config.getInstance().getMapper().readValue(string, new TypeReference<List<Object>>() {\n });\n } catch (JsonProcessingException e) {\n if(exchange.getConnection().getBufferSize() <= string.length()) {\n setExchangeStatus(exchange, PAYLOAD_TOO_LARGE, \"application/json\");\n } else {\n setExchangeStatus(exchange, CONTENT_TYPE_MISMATCH, \"application/json\");\n }\n return false;\n }\n } else {\n // error here. The content type in head doesn't match the body.\n setExchangeStatus(exchange, CONTENT_TYPE_MISMATCH, \"application/json\");\n return false;\n }\n if (config.isCacheRequestBody()) {\n exchange.putAttachment(REQUEST_BODY_STRING, string);\n }\n exchange.putAttachment(REQUEST_BODY, body);\n return true;\n }", "private static boolean canResponseHaveBody(int status) {\n LOG.trace(\"enter HttpMethodBase.canResponseHaveBody(int)\");\n\n boolean result = true;\n\n if ((status >= 100 && status <= 199) || (status == 204)\n || (status == 304)) { // NOT MODIFIED\n result = false;\n }\n\n return result;\n }", "public String getJson();", "@Override\n\tpublic Response toResponse(JsonParseException exception) {\n return Response.status(Response.Status.BAD_REQUEST).build();\n\t}", "boolean hasJsonReqMsg();", "@GET\n @Path(\"/types\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getBlahTypes(@Context HttpServletRequest request) {\n try {\n final long start = System.currentTimeMillis();\n final Response response = RestUtilities.make200OkResponse(getBlahManager().getBlahTypes(LocaleId.en_us));\n getSystemManager().setResponseTime(GET_BLAH_TYPES_OPERATION, (System.currentTimeMillis() - start));\n return response;\n } catch (SystemErrorException e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n } catch (Exception e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n } finally {\n\n }\n }", "protected JsonEncoding getJsonEncoding(MediaType contentType)\n/* */ {\n/* 401 */ if ((contentType != null) && (contentType.getCharset() != null)) {\n/* 402 */ Charset charset = contentType.getCharset();\n/* 403 */ for (JsonEncoding encoding : JsonEncoding.values()) {\n/* 404 */ if (charset.name().equals(encoding.getJavaName())) {\n/* 405 */ return encoding;\n/* */ }\n/* */ }\n/* */ }\n/* 409 */ return JsonEncoding.UTF8;\n/* */ }", "@JsonProperty(\"contentType\")\n public String getContentType() {\n return contentType;\n }", "void setResponseFormatError(){\n responseFormatError = true;\n }", "protected String getDefaultContentType() {\n return DEFAULT_CONTENT_TYPE;\n }", "public SimpleResponse ERROR_UNSUPPORTED_MEDIA_TYPE() {\n this.state = HttpStatus.UNSUPPORTED_MEDIA_TYPE.value();\n return ERROR_CUSTOM();\n }", "@Override\n public String getContentType() {\n return null;\n }", "static void invokeResponse(RoutingContext rc, Method m, Object toret, String resultType) {\n String[] _corsAllowedIPs = getCORS(m);\n \n if (_corsAllowedIPs != null && _corsAllowedIPs.length > 0) {\n CORS.allow(rc, _corsAllowedIPs);\n }\n \n // Combine errors\n if (toret == null || !(toret instanceof RestResponse)){\n\n \t// Handling function didn't return a RestResponse object, return an appropriate error message\n rc.response().setStatusCode(500).setStatusMessage(\"Error: Function didn't return a RestResponse object\").end();\n \n // We don't \"have\" to throw an exception, a 500 may suffice and client may log error and message in their logs\n// new RuntimeException(\"The return type of a REST function must be a RestResponse\");\n }else {\n \t\n \t// Put the custom headers first, if any\n \tputHeaders(((RestResponse) toret).getHeaders(), rc);\n \t\n \t// PUt the custom status code/message, if any\n \tputStatus((RestResponse) toret, rc);\n \t\n if (resultType != null) {\n\n if (resultType.equals(\"file\")) {\n \t\n // Send the file\n rc.response().sendFile(((RestResponse) toret).getBody()).end();\n } else if (resultType.equals(\"json\")) {\n\n // Set the header for json content - will override any custom header for content-type\n rc.response().putHeader(\"content-type\", \"application/json; charset=utf-8\");\n \n rc.response().end(((RestResponse) toret).getBody());\n }\n } else {\n \t\n \t// New assumption: If result type not set, we're sending back whatever the custom headers say to return\n \t// or else if no custom headers for content-type, we'll return text\n \t\n \tif (!rc.response().headers().contains(\"content-type\")) {\n \t\trc.response().putHeader(\"content-type\", \"text/plain\");\n \t}\n \t\n \tString result = ((((RestResponse) toret).getBody() != null) ? ((RestResponse) toret).getBody() : \" \");\n \t\n rc.response().end(result);\n }\n }\n }", "@Test\n public void shouldReturnOKStatus() throws Exception{\n Mockito.when(itemService.getItemById(1)).thenReturn(new Item(1,\"Item1\",12,25));\n RequestBuilder requestBuilder= MockMvcRequestBuilders.get(\"/item?id=1\").accept(MediaType.APPLICATION_JSON);\n mockMvc.perform(requestBuilder).andExpect(status().isOk()).andExpect(content().json(\"{\" +\n \"id:1,name:Item1,price:12,quantity:25}\"));\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static JSONObject getDefaultResponse() {\n\t\tJSONObject res = new JSONObject();\n\t\t\n\t\tres.put(\"result\", \"SUCCESS\");\n\t\t\n\t\treturn res;\n\t}", "@DisplayName(\"Spartan /api/hello Endpoint Test\")\n @Test\n public void TestHello(){\n Response response = get(\"http://3.95.214.153:8000/api/hello\");\n\n // get status code out of this Response object\n System.out.println(\"response.statusCode() = \" + response.statusCode());//200\n\n // assert the status code is 200\n assertThat(response.statusCode(),is(200));\n\n // how to pretty print entire \"response body\"\n // prettyPrint() -- print and return the body as String\n String responseBodyAsString = response.prettyPrint();//print the body as a String\n\n System.out.println(\"==========================\");\n\n // assertThat the body is Hello from Sparta\n assertThat(responseBodyAsString,is(\"Hello from Sparta\"));\n\n // get the header called ContentType from the response\n //three ways of getting content-Type header in restAssure\n System.out.println(\"response.getHeader(\\\"Content-Type\\\") = \" + response.getHeader(\"Content-Type\"));//text/plain;charset=UTF-8 as String\n System.out.println(\"response.getContentType() = \" + response.getContentType());//text/plain;charset=UTF-8 as String\n System.out.println(\"response.contentType() = \" + response.contentType());//returns text/plain;charset=UTF-8 as String\n System.out.println(\"response.header(\\\"Content-Type\\\") = \" + response.header(\"Content-Type\"));//text/plain;charset=UTF-8\n\n\n // assert That Content-Type is text/plain;charset=UTF-8\n assertThat(response.contentType() , is(\"text/plain;charset=UTF-8\") );\n // assert That Content-Type startWith text\n assertThat(response.contentType(),startsWith(\"text\"));\n\n\n // Easy way to work with Content-type without typing much\n // We can use \"ContentType Enum\" from RestAssured to easily get \"main\" part content-type\n // ContentType.TEXT -->> returns text/plain as Enum(Object) not as String\n // startWith accept a String object\n // so use toString method to convert ContentType.TEXT to String so we can use it startWith\n //response.contentType() ===returns you String\n assertThat(response.contentType(),startsWith(ContentType.TEXT.toString()));// /api/hello end point returns us ONLY plain text\n\n assertThat(response.contentType() , is( not(ContentType.JSON) ) );//since end point does not return us JSON we can assert that this endpoint does not return JSON\n\n\n\n }", "@Test\n public void testGetJobTypesById_request_OK()\n {\n JobTypes jobType1 = new JobTypes(1, \"test1\");\n \n Optional<JobTypes> jobType = Optional.of(jobType1);\n \n doReturn(jobType).when(jobTypesService).getJobType(anyInt());\n\n try {\n mockMvc.perform(MockMvcRequestBuilders.get(\"/job_types/{id}\", \"1\")\n .content(asJsonString(jobType))\n .contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isOk())\n .andExpect(content().contentType(\"application/json\"));\n } catch (Exception ex) {\n Logger.getLogger(JobTypesControllerTest.class.getName()).log(Level.SEVERE, null, ex);\n fail();\n }\n }", "public void setResponseType(java.lang.CharSequence value) {\n this.ResponseType = value;\n }" ]
[ "0.7164561", "0.68194175", "0.6786626", "0.6441385", "0.64413357", "0.64173", "0.6272414", "0.6241088", "0.6177883", "0.6056852", "0.6056435", "0.60303175", "0.6025985", "0.5999686", "0.59974045", "0.5941785", "0.5930924", "0.59274423", "0.586862", "0.58255243", "0.58205396", "0.58018816", "0.5765693", "0.5763004", "0.57605255", "0.5746159", "0.57225585", "0.572122", "0.57023984", "0.5696248", "0.56908196", "0.5681472", "0.5671894", "0.5666504", "0.5666293", "0.5659913", "0.5658949", "0.56568", "0.5651526", "0.5651526", "0.5651526", "0.56367147", "0.56340647", "0.5625663", "0.5623565", "0.5616659", "0.56091404", "0.5605486", "0.559889", "0.5593927", "0.5589919", "0.55834603", "0.5565854", "0.5535107", "0.55197453", "0.55146146", "0.55138457", "0.5510914", "0.55017537", "0.54935384", "0.5491462", "0.548606", "0.54786146", "0.54774904", "0.54670614", "0.5440056", "0.54375327", "0.54343176", "0.5427092", "0.5425575", "0.5422107", "0.54194635", "0.5414668", "0.54133135", "0.54115504", "0.5410436", "0.53975165", "0.5394217", "0.5392353", "0.5386032", "0.53654516", "0.53595644", "0.5354211", "0.53485584", "0.53415114", "0.5339738", "0.5336988", "0.53196824", "0.53180325", "0.5312119", "0.5311689", "0.53088266", "0.5305527", "0.5302473", "0.5300264", "0.529743", "0.529743", "0.5291523", "0.529017", "0.5278403" ]
0.5787216
22
Initialize Properties (only once in program
public static void loadProperties() { if (!isLoaded) { new BCProperties() ; isLoaded = true ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initProperties()\r\n {\r\n try\r\n {\r\n properties.load(new FileInputStream(propertiesURL));\r\n }\r\n catch (IOException ex)\r\n {\r\n log.log(DEBUG,\"\"+ex);\r\n } \r\n }", "public void init(Properties props) ;", "public void init(java.util.Properties props) {\r\n }", "public void IntialProperties() {\r\n Properties prop = new Properties();\r\n try (FileInputStream input = new FileInputStream(\"./config.properties\")) {\r\n prop.load(input);\r\n generate = prop.getProperty(\"generate\");\r\n solve = prop.getProperty(\"algorithm\");\r\n setChanged();\r\n notifyObservers(\"prop\");\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "public void init() {\n this.properties = loadProperties(\"/project3.properties\");\n }", "void initProperties()\n\t{\n\t\tpropertyPut(LIST_SIZE, 10);\n\t\tpropertyPut(LIST_LINE, 1);\n\t\tpropertyPut(LIST_MODULE, 1); // default to module #1\n\t\tpropertyPut(COLUMN_WIDTH, 70);\n\t\tpropertyPut(UPDATE_DELAY, 25);\n\t\tpropertyPut(HALT_TIMEOUT, 7000);\n\t\tpropertyPut(BPNUM, 0);\t\t\t\t// set current breakpoint number as something bad\n\t\tpropertyPut(LAST_FRAME_DEPTH, 0);\t\t// used to determine how much context information should be displayed\n\t\tpropertyPut(CURRENT_FRAME_DEPTH, 0); // used to determine how much context information should be displayed\n\t\tpropertyPut(DISPLAY_FRAME_NUMBER, 0); // houses the current frame we are viewing\n\t\tpropertyPut(FILE_LIST_WRAP, 999999); // default 1 file name per line\n\t\tpropertyPut(NO_WAITING, 0);\n\t\tpropertyPut(INFO_STACK_SHOW_THIS, 1); // show this pointer for info stack\n\t}", "private static synchronized void initialize(String prop) {\n\t\tFileInputStream is=null;\n\t\tproperties = new Properties();\n\t\ttry {\n\t\t\tis = new FileInputStream(prop);\n\t\t\tif (is == null) {\n\t\t\t System.out.println(\"The prop is null.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tproperties.load(is);\n\t\t} \n\t\tcatch (IOException e) {\n\t\t System.out.println(\"properties loading fails.\");\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\tfinally{\n\t\t\t\ttry{\n\t\t\t\t\tif(is!=null)\n\t\t\t\t\t\tis.close();\n\t\t\t\t}\n\t\t\t\tcatch(Exception ex){\n\t\t\t\t System.out.println(\"properties loading fails for runtime exception.\");\n\t\t\t\t\tthrow new RuntimeException(ex);\n\t\t\t}\n\t\t}\n\t}", "public void setupProperties() {\n // left empty for subclass to override\n }", "private void init(String propFilePath) {\n properties = new Properties();\n try {\n properties.load(new FileInputStream(new File(propFilePath)));\n } catch (FileNotFoundException e1) {\n logger.error(\"External properties file not found!\", e1);\n System.exit(1);\n } catch (IOException e2) {\n logger.error(\"Error while reading External properties file!\", e2);\n System.exit(1);\n }\n }", "public TestProperties() {\n\t\tthis.testProperties = new Properties();\n\t}", "@PostConstruct\n\tpublic void init() {\n\t\ttry {\n\t\t\tprops = PropertiesLoaderUtils.loadProperties(new ClassPathResource(\"/META-INF/build-info.properties\"));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Unable to load build.properties\", e);\n\t\t\tprops = new Properties();\n\t\t}\n\t}", "public void initProperties() {\n propAssetClass = addProperty(AssetComponent.PROP_CLASS, \"MilitaryOrganization\");\n propAssetClass.setToolTip(PROP_CLASS_DESC);\n propUniqueID = addProperty(AssetComponent.PROP_UID, \"UTC/RTOrg\");\n propUniqueID.setToolTip(PROP_UID_DESC);\n propUnitName = addProperty(AssetComponent.PROP_UNITNAME, \"\");\n propUnitName.setToolTip(PROP_UNITNAME_DESC);\n propUIC = addProperty(PROP_UIC, \"\");\n propUIC.setToolTip(PROP_UIC_DESC);\n }", "private void initializeProperties() throws IOException {\n String userHome = org.wattdepot.util.logger.WattDepotUserHome.getHomeString();\n String wattDepotHome = userHome + \"/.wattdepot\";\n String clientHome = wattDepotHome + \"/client\";\n String propFile = clientHome + \"/datainput.properties\";\n initializeProperties(propFile);\n }", "public void init(Properties properties) throws IOException;", "public static void init() throws Exception\r\n\t{\r\n\t\tinit(PROPERTY_FILE, \"Properties\", new String[0]);\r\n\t}", "public void init(){\n\t\tif(prop==null){\r\n\t\t\tprop=new Properties();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tFileInputStream fs = new FileInputStream(System.getProperty(\"user.dir\")+\"//src//test//resources//projectconfig.properties\");\r\n\t\t\t\tprop.load(fs);\r\n\t\t\t\t\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setupProp() {\r\n\t\tprop = new Properties();\r\n\t\tInputStream in = getClass().getResourceAsStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(in);\r\n\t\t\tFileInputStream fin = new FileInputStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(fin);\r\n\t\t\tdblogic = (PatronDBLogic) ois.readObject();\r\n\t\t\tois.close();\r\n\r\n\t\t} catch (IOException | ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void init()\n {\n try\n {\n userPasswordsProperties = new Properties();\n userPasswordsProperties.load(new FileInputStream(userPasswordsPropertiesFileName));\n log.info(\"Successfully initialized. UsersPasswords property file is: \" + userPasswordsPropertiesFileName);\n }\n catch (Exception e)\n {\n throw new IllegalArgumentException(\"UserNamesPropertyFile name: \" + userPasswordsPropertiesFileName + \" not valid. Error: \" + e);\n }\n \n }", "private void init() {\n\t\tif ( PropertiesConfigurationFilename == null ) {\n\t\t\tlogger.info(\"config.properties is default\");\n\t\t\tconfigProp = createDefaultProperties();\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tlogger.info(\"config.properties is \"+ PropertiesConfigurationFilename.getAbsolutePath());\n\t\t\t\tconfigProp = new PropertiesConfiguration();\n\t\t\t\tconfigProp.load(PropertiesConfigurationFilename);\n\t\t\t} catch (ConfigurationException e) {\n\t\t\t\tlogger.error(\"Unable to open config file: \" + PropertiesConfigurationFilename.getAbsolutePath(), e);\n\t\t\t\tlogger.info(\"config.properties is default\");\n\t\t\t\tconfigProp = createDefaultProperties();\n\t\t\t}\n\t\t}\n\n\n\t\t// Load the locale information\n\t\tString locale = configProp.getString(\"locale\");\n\n\t\tconfigProp.setProperty(\"zmMsg\", ResourceBundle.getBundle(\"ZmMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zhMsg\", ResourceBundle.getBundle(\"ZhMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"ajxMsg\", ResourceBundle.getBundle(\"AjxMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"i18Msg\", ResourceBundle.getBundle(\"I18nMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zsMsg\", ResourceBundle.getBundle(\"ZsMsg\", new Locale(locale)));\n\n\t}", "private PropertyUtil(){\n\t\ttry{\n\t\t\tloadURL();\n\t\t\tRuntime.getRuntime().addShutdownHook(new UtilShutdownHook());\n\t\t}catch(IOException ioe){\n\t\t\tLOGGER.error(\"Unable to load Property File\\n\"+ioe);\n\t\t}\n\t\tLOGGER.debug(\"INSTANTIATED\");\n\t}", "private void loadProperties() {\n\t\tInputStream propsFile;\n\t\tProperties tempProp = new Properties();\n\n\t\ttry {\n\t\t\t//propsFile = new FileInputStream(\"plugins\\\\balloonplugin\\\\BalloonSegmentation.properties\");\n\t\t\tpropsFile = getClass().getResourceAsStream(\"/BalloonSegmentation.properties\");\n\t\t\ttempProp.load(propsFile);\n\t\t\tpropsFile.close();\n\n\t\t\t// load properties\n\t\t\tinit_channel = Integer.parseInt(tempProp.getProperty(\"init_channel\"));\t\t\t\t// initial channel selected for segmenting the cell architecture 1 - red, 2 - green, 3 - blue\n\t\t\tinit_max_pixel = Integer.parseInt(tempProp.getProperty(\"init_max_pixel\"));\t\t\t// initial max pixel intensity used for finding the doundaries of the colony of cells\n\t\t\tinit_HL = Integer.parseInt(tempProp.getProperty(\"init_HL\"));\t\t\t\t\t\t// initial H*L factor used finding seeds in the population\n\t\t\tinit_min_I = Integer.parseInt(tempProp.getProperty(\"init_min_I\"));\t\t\t\t\t// initial pixel intensity when balloon algorithm starts\n\t\t\tinit_max_I = Integer.parseInt(tempProp.getProperty(\"init_max_I\"));\t\t\t\t\t// final pixel intensity when balloon algorithm stops\n\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tIJ.error(\"I/O Exception: cannot read .properties file\");\n\t\t}\n\t}", "public ServerProperties() {\n try {\n initializeProperties();\n }\n catch (Exception e) {\n System.out.println(\"Error initializing server properties.\");\n }\n }", "private static synchronized void init() {\n if (CONFIG_VALUES != null) {\n return;\n }\n\n CONFIG_VALUES = new Properties();\n processLocalConfig();\n processIncludedConfig();\n }", "public\n YutilProperties()\n {\n super(new Properties());\n }", "protected void initialise() {\r\n loadDefaultConfig();\r\n loadCustomConfig();\r\n loadSystemConfig();\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"--- Scope properties ---\");\r\n for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) {\r\n String key = (String) i.next();\r\n Object value = properties.get(key);\r\n LOG.debug(key + \" = \" + value);\r\n }\r\n LOG.debug(\"------------------------\");\r\n }\r\n }", "private GlobalPrefs() {\n\t\tprops = new Properties();\n\t}", "public static void loadProperties()\n {\n Properties props = new Properties();\n try {\n props.load( new BufferedInputStream( ClassLoader.getSystemResourceAsStream(\"bench.properties\") ) );\n } catch (IOException ioe)\n {\n logger.log(Level.SEVERE, ioe.getMessage());\n }\n props.putAll(System.getProperties()); //overwrite\n System.getProperties().putAll(props);\n }", "private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}", "public Properties initProperties() {\r\n\t\tprop = new Properties();\r\n\t\ttry {\r\n\t\t\tFileInputStream fis = new FileInputStream(\"./src/main/java/com/automation/qe/config/config.properties\");\r\n\t\t\tprop.load(fis);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn prop;\r\n\t}", "@BeforeTest\n\t\tpublic void propCalling() throws IOException\n\t\t{\n\t\t\t\n\t\t\tIntializingProperties();\n\t\t}", "private void setupDefaultAsPerProperties()\n {\n /// Do the minimum of what App.init() would do to allow to run.\n Gui.mainFrame = new MainFrame();\n App.p = new Properties();\n App.loadConfig();\n System.out.println(App.getConfigString());\n Gui.progressBar = Gui.mainFrame.getProgressBar(); //must be set or get Nullptr\n\n // configure the embedded DB in .jDiskMark\n System.setProperty(\"derby.system.home\", App.APP_CACHE_DIR);\n\n // code from startBenchmark\n //4. create data dir reference\n App.dataDir = new File(App.locationDir.getAbsolutePath()+File.separator+App.DATADIRNAME);\n\n //5. remove existing test data if exist\n if (App.dataDir.exists()) {\n if (App.dataDir.delete()) {\n App.msg(\"removed existing data dir\");\n } else {\n App.msg(\"unable to remove existing data dir\");\n }\n }\n else\n {\n App.dataDir.mkdirs(); // create data dir if not already present\n }\n }", "@Before(order=0)\n\tpublic void getProperty() {\n\t\tconfigReader = new ConfigReaders();\n\t\tprop = configReader.init_prop();\n\t\t\n\t}", "@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\tinit();\n\t}", "public Properties initForRuntime() {\n initProperties();\n return this;\n }", "public void init() {\n\t\tProperties prop = new Properties();\n\t\tInputStream propStream = this.getClass().getClassLoader().getResourceAsStream(\"db.properties\");\n\n\t\ttry {\n\t\t\tprop.load(propStream);\n\t\t\tthis.host = prop.getProperty(\"host\");\n\t\t\tthis.port = prop.getProperty(\"port\");\n\t\t\tthis.dbname = prop.getProperty(\"dbname\");\n\t\t\tthis.schema = prop.getProperty(\"schema\");\n\t\t\tthis.passwd=prop.getProperty(\"passwd\");\n\t\t\tthis.user=prop.getProperty(\"user\");\n\t\t} catch (IOException e) {\n\t\t\tString message = \"ERROR: db.properties file could not be found\";\n\t\t\tSystem.err.println(message);\n\t\t\tthrow new RuntimeException(message, e);\n\t\t}\n\t}", "public PropertyManager() {\n propFileName = System.getProperty(\"user.home\") + File.separator +\n defPropFile;\n\n recentResult = loadPropertyFile(propFileName);\n }", "private void initProperties(URL url) {\n if(null == url) {\n LOGGER.error(\"Can Load empty path.\");\n return;\n }\n\n Properties invProperties = getProperties(url);\n if(null == invProperties || invProperties.isEmpty()) {\n LOGGER.error(\"Load invsvr.properties failed !\");\n return;\n }\n\n INVTABLEPREFIX = invProperties.getProperty(\"tableprefix\");\n EXTENSIONTABLEPOSTFIX = invProperties.getProperty(\"exttablepostfix\");\n RELATIONTABLEPOSTFIX = invProperties.getProperty(\"relationtablepostfix\");\n CHANGESETAUTHOR = invProperties.getProperty(\"changesetauthor\");\n DEFAULTSCHEMA = invProperties.getProperty(\"defaultschema\");\n BASICTABLEFIXEDCOLIMN = invProperties.getProperty(\"basictablefixedcolumn\").split(\"/\");\n EXRENSIONTABLECOLUMN = invProperties.getProperty(\"exttablecolumn\").split(\"/\");\n EXTENDINDEXS = invProperties.getProperty(\"exttableindex\").split(\"/\");\n RELATIONTABLECOLUMN = invProperties.getProperty(\"relationtablecolumn\").split(\"/\");\n RELATIONINDEXS = invProperties.getProperty(\"relationtableindex\").split(\"/\");\n\n INFOMODELPREFIX = invProperties.getProperty(\"infomodelprefix\");\n DATAMODELPREFIX = invProperties.getProperty(\"datamodelprefix\");\n RELAMODELPREFIX = invProperties.getProperty(\"relamodelprefix\");\n RELATIONTYPEVALUES = getRelationTypeValues(invProperties.getProperty(\"relationtypevalue\"));\n }", "private void initializeProperties () throws Exception {\n String userHome = System.getProperty(\"user.home\");\n String userDir = System.getProperty(\"user.dir\");\n String hackyHome = userHome + \"/.hackystat\";\n String sensorBaseHome = hackyHome + \"/sensorbase\"; \n String propFile = userHome + \"/.hackystat/sensorbase/sensorbase.properties\";\n this.properties = new Properties();\n // Set defaults\n properties.setProperty(ADMIN_EMAIL_KEY, \"[email protected]\");\n properties.setProperty(ADMIN_PASSWORD_KEY, \"[email protected]\");\n properties.setProperty(CONTEXT_ROOT_KEY, \"sensorbase\");\n properties.setProperty(DB_DIR_KEY, sensorBaseHome + \"/db\");\n properties.setProperty(DB_IMPL_KEY, \"org.hackystat.sensorbase.db.derby.DerbyImplementation\");\n properties.setProperty(HOSTNAME_KEY, \"localhost\");\n properties.setProperty(LOGGING_LEVEL_KEY, \"INFO\");\n properties.setProperty(SMTP_HOST_KEY, \"mail.hawaii.edu\");\n properties.setProperty(PORT_KEY, \"9876\");\n properties.setProperty(XML_DIR_KEY, userDir + \"/xml\");\n properties.setProperty(TEST_INSTALL_KEY, \"false\");\n properties.setProperty(TEST_DOMAIN_KEY, \"hackystat.org\");\n FileInputStream stream = null;\n try {\n stream = new FileInputStream(propFile);\n properties.load(stream);\n System.out.println(\"Loading SensorBase properties from: \" + propFile);\n }\n catch (IOException e) {\n System.out.println(propFile + \" not found. Using default sensorbase properties.\");\n }\n finally {\n if (stream != null) {\n stream.close();\n }\n }\n // Now add to System properties. Since the Mailer class expects to find this stuff on the \n // System Properties, we will add everything to it. In general, however, clients should not\n // use the System Properties to get at these values, since that precludes running several\n // SensorBases in a single JVM. And just is generally bogus. \n Properties systemProperties = System.getProperties();\n systemProperties.putAll(properties);\n System.setProperties(systemProperties);\n }", "private PropertiesUtils() {}", "public LoadTestProperties() {\n }", "public synchronized static void initConfig() {\n\t\tMap<CatPawConfigProperty, String> initialValues = new HashMap<CatPawConfigProperty, String>();\n\t\tinitConfig(initialValues);\n\t}", "private void initializeProperties(String propertiesFilename) throws IOException {\n this.properties = new Properties();\n\n // Set defaults for 'standard' operation.\n // properties.setProperty(FILENAME_KEY, clientHome + \"/bmo-data.tsv\");\n properties.setProperty(BMO_URI_KEY,\n \"http://www.buildingmanageronline.com/members/mbdev_export.php/download.txt\");\n\n FileInputStream stream = null;\n try {\n stream = new FileInputStream(propertiesFilename);\n properties.load(stream);\n System.out.println(\"Loading data input client properties from: \" + propertiesFilename);\n }\n catch (IOException e) {\n System.out.println(propertiesFilename\n + \" not found. Using default data input client properties.\");\n throw e;\n }\n finally {\n if (stream != null) {\n stream.close();\n }\n }\n trimProperties(properties);\n }", "private void init() {\n listeners = new PropertyChangeSupport(this);\n }", "protected void initVars() {}", "public PSBeanProperties()\n {\n loadProperties();\n }", "public GlobalSetup(){\n\t\t\n\t\tpropertyData = new Properties();\n\t\t\n\t\ttry{\n\t\t\tInputStream propertyPath = new FileInputStream(\"src/test/resources/properties/categoriesData.properties\");\n\t\t\tpropertyData.load(propertyPath);\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}", "public Properties(){\n\n }", "private mxPropertiesManager()\n\t{\n\t}", "public PropertiesUtil() {\n\t\t// Read properties file.\n\n\t\tproperties = new Properties();\n\t\ttry {\n\t\t\tproperties.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(\"variables.properties\"));\n\t\t\tlog.info(\"variables.properties file loaded successfully\");\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"variables.properties file not found: \", e);\n\t\t}\n\t}", "@PostConstruct\n\tpublic void loadProperties() {\n\t\tproperties.put(PropertyKey.TRANSLATION_FILE_STORE, \"C:\\\\development\\\\projects\\\\mega-translator\\\\store\");\n\t}", "@SuppressWarnings(\"unchecked\")\n private void loadProperties()\n {\n File f = getPropertiesFile();\n if (!f.exists())\n return;\n \n m_props = (Map<String, Object>) PSConfigUtils.loadObjectFromFile(f);\n }", "public Properties init_prop() {\n\t\tprop = new Properties();\n\t\tString path = null;\n\t\tString env = null;\n\n\t\ttry {\n\n\t\t\tenv = System.getProperty(\"env\");\n\t\t\tSystem.out.println(\"Running on Envirnment: \" + env);\n\n\t\t\tif (env == null) {\n\t\t\t\tSystem.out.println(\"Default Envirnment: \" + \"PROD\");\n\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.prod.properties\";\n\n\t\t\t} else {\n\t\t\t\tswitch (env) {\n\t\t\t\tcase \"qa\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.qa.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"dev\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.dev.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"stage\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.stage.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"prod\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.prod.properties\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Please Pass the Correct Env Value...\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFileInputStream finput = new FileInputStream(path);\n\t\t\tprop.load(finput);\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\n\t\treturn prop;\n\t}", "private static void initObjectProperties() {\n OntModel ontologie = ModelFactory.createOntologyModel();\n OntologyFactory.readOntology(ontologyPath, ontologie);\n objectProperties.addAll(ontologie.listObjectProperties().toList());\n }", "private void initialize() {\r\n\t\tsetLayout(new BorderLayout());\r\n\t\tadd(createInfoTable(), BorderLayout.CENTER);\r\n\r\n\t\t// load the data\r\n\t\ttry {\r\n\t\t\tProperties props = System.getProperties();\r\n\t\t\tEnumeration names = props.propertyNames();\r\n\t\t\twhile (names.hasMoreElements()) {\r\n\t\t\t\tString name = (String) names.nextElement();\r\n\t\t\t\tString value = props.getProperty(name);\r\n\t\t\t\tObject[] row = new Object[2];\r\n\t\t\t\trow[0] = name;\r\n\t\t\t\trow[1] = value;\r\n\t\t\t\tm_model.addRow(row);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t}", "public Properties() \r\n\t{\r\n\t\tsuper();\r\n\t\tthis.port = 1234;\r\n\t\tthis.ip = \"127.0.0.1\";\r\n\t}", "public PropertyParser()\n\t{\n\t\tthis(System.getProperties());\n\t}", "@Override\n\tpublic void loadProperties() {\n\t\tPropertySet mPropertySet = PropertySet.getInstance();\n\t\tdouble kp = mPropertySet.getDoubleValue(\"angleKp\", 0.05);\n\t\tdouble ki = mPropertySet.getDoubleValue(\"angleKi\", 0.0);\n\t\tdouble kd = mPropertySet.getDoubleValue(\"angleKd\", 0.0001);\n\t\tdouble maxTurnOutput = mPropertySet.getDoubleValue(\"turnPIDMaxMotorOutput\", Constants.kDefaultTurnPIDMaxMotorOutput);\n\t\tmAngleTolerance = mPropertySet.getDoubleValue(\"angleTolerance\", Constants.kDefaultAngleTolerance);\n\t\tsuper.setPID(kp, ki, kd);\n\t\tsuper.setOutputRange(-maxTurnOutput, maxTurnOutput);\n\t}", "public void initialize() {\n\t\tcompartmentName = new SimpleStringProperty(compartment.getName());\t\t\n\t\tcompartmentId = new SimpleStringProperty(compartment.getId());\n\t\tcompartmentSBOTerm = new SimpleStringProperty(compartment.getSBOTermID());\n\t}", "private void myInit() {\n init_key();\n\n String business_name = System.getProperty(\"business_name\", \"Tyrol Restaurant\");\n jTextField1.setText(business_name);\n String operated_by = System.getProperty(\"operated_by\", \"Fely Romano Sanin\");\n jTextField2.setText(operated_by);\n String address = System.getProperty(\"address\", \"Mayfair place 12th Lacson St, Bacolod City\");\n jTextField3.setText(address);\n\n String tin_no = System.getProperty(\"tin_no\", \"161-107-778-000\");\n jTextField4.setText(tin_no);\n String serial_no = System.getProperty(\"serial_no\", \"\");\n jTextField5.setText(serial_no);\n String permit_no = System.getProperty(\"permit_no\", \"\");\n jTextField6.setText(permit_no);\n }", "@Override\n public void initialize(Map<String, String> propertyValues) {\n // Set the configurable properties\n properties.setValues(propertyValues);\n }", "public void init(Properties properties) throws ExtensionException {\n\t}", "public void initEventsAndProperties() {\r\n }", "public Properties init() {\n // init nested properties starting from the bottom ones\n initProperties();\n initLayout();\n return this;\n }", "@Test\r\n\t\tpublic static void Properties() \r\n\r\n\t\t{\r\n\t\t\ttry{\r\n\t\t\t\tprop = new Properties();\r\n\t\t\t\tfile = new File(\"C:\\\\Users\\\\vardhan\\\\eclipse-workspace\\\\com.makemytrip\\\\prop.properties\");\r\n\t\t\t\tfilereader = new FileReader(file);\r\n\t\t\t\tprop.load(filereader);\r\n\t\t\t\t\r\n\t\t\t }\r\n\t\t\r\n\t\t\r\n\t\t\tcatch(Exception e)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}", "private void addProperties() {\n\n\t\t/**\n\t\t * Add fusion.conf = src/test/resource\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.conf.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.conf.dir\")).andReturn(\n\t\t\t\t\t\"src/test/resources/\").anyTimes();\n\t\t}\n\t\t/**\n\t\t * set fusion.process.dir\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.process.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.process.dir\"))\n\t\t\t\t\t.andReturn(\"src/test/resources/\").anyTimes();\n\t\t}\n\n\t\t/**\n\t\t * set fusion.process.temp\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.process.temp.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.process.temp.dir\"))\n\t\t\t\t\t.andReturn(\"src/test/resources/\").anyTimes();\n\t\t}\n\n\t\t/**\n\t\t * set fusion.home\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.home\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.home\")).andReturn(\n\t\t\t\t\t\"src/test/resources/\").anyTimes();\n\t\t}\n\t}", "@Override\n\tpublic void setProperties(Properties p) {\n\t\t\n\t}", "private void initializeTestProperties(InputStream is)\n throws IOException, MissingRequiredTestPropertyException\n {\n testProperties.load(is);\n \n // TODO This method should perform validation, i.e. make sure that properties\n // that are required for Java are set when they should be set, etc. We\n // should fail as soon as we have a test.properties file that doesn't make sense\n // (at load time) rather than waiting until we try to load a property that is broken\n setLanguage(getRequiredStringProperty(BUILD_LANGUAGE));\n setPerformCodeCoverage(getOptionalBooleanProperty(PERFORM_CODE_COVERAGE, false));\n setMaxDrainOutputInBytes(getOptionalIntegerProperty(MAX_DRAIN_OUTPUT_IN_BYTES, DEFAULT_MAX_DRAIN_OUTPUT_IN_BYTES));\n setJavaSourceVersion(getOptionalStringProperty(SOURCE_VERSION, DEFAULT_JAVA_SOURCE_VERSION));\n setTestRunnerInTestfileDir(getOptionalBooleanProperty(RUN_IN_TESTFILES_DIR, false));\n setLdLibraryPath(getOptionalStringProperty(LD_LIBRARY_PATH));\n setVmArgs(getOptionalStringProperty(VM_ARGS));\n \n setMakeCommand(getOptionalStringProperty(MAKE_COMMAND, DEFAULT_MAKE_COMMAND));\n setMakefileName(getOptionalStringProperty(MAKE_FILENAME));\n setStudentMakefileName(getOptionalStringProperty(STUDENT_MAKE_FILENAME));\n\n // XXX For legacy reasons, the test.properties file used to support:\n // test.timeout.testProcess\n // This was the timeout for the entire process from back when we tried to run\n // each test case in a separate thread.\n // Now instead we just use:\n // test.timeout.testCase\n // So we're going to ignore test.timeout.testProcess because it's almost certainly\n // going to be too long.\n\n // If no individual test timeout is specified, then use the default.\n // Note that we ignore test.timeout.testProcess since we're not timing out\n // the entire process anymore.\n setTestTimeoutInSeconds(getOptionalIntegerProperty(TEST_TIMEOUT, DEFAULT_PROCESS_TIMEOUT));\n }", "private SystemProperties() {}", "public static void loadProperties() {\n properties = new Properties();\n try {\n File f = new File(\"system.properties\");\n if (!(f.exists())) {\n OutputStream out = new FileOutputStream(f);\n }\n InputStream is = new FileInputStream(f);\n properties.load(is);\n lastDir = getLastDir();\n if (lastDir == null) {\n lastDir = \"~\";\n setLastDir(lastDir);\n }\n properties.setProperty(\"lastdir\", lastDir);\n\n // Try loading properties from the file (if found)\n properties.load(is);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected void initialize() {\n \tstartTime = System.currentTimeMillis();\n \tintake.setLeftPower(power);\n \tintake.setRightPower(power);\n }", "void loadPropertiesFile()\n\t{\n\t\tlogger.info(\"Fetching the properties files\");\n\t\t\n\t\tconfigProp=new Properties(); \n\t\ttry{\tconfigProp.load(loadFile(\"Config.properties\"));\t\t} \n\t\tcatch (IOException e){\tAssert.assertTrue(\"Cannot initialise the Config properties file, Check if the file is corrupted\", false);\t}\t\t\t\n\t}", "@Override\n public void init(Properties properties) {\n super.init(properties);\n String categoriesFilePath = properties.getProperty(\"categoriesFilePath\", \"\");\n String gemetFilePath = properties.getProperty(\"gemetFilePath\", \"\");\n String lang = properties.getProperty(\"lang\", \"\");\n\n for (Locale l: Locale.getAvailableLocales()) {\n if (l.getLanguage().equalsIgnoreCase(lang)) {\n locale = l;\n break;\n }\n }\n\n ContextInitializer initializer = new ContextInitializer(ontCtx,\n categoriesFilePath, gemetFilePath);\n initializer.initialize();\n\n }", "private void init() {\n\n\t}", "private void init() {\n }", "protected void initVars() {\n prefFile = \"./server.ini\";\n mimeFile = \"./mime.ini\";\n }", "private void loadProperties() {\n driver = JiveGlobals.getXMLProperty(\"database.defaultProvider.driver\");\n serverURL = JiveGlobals.getXMLProperty(\"database.defaultProvider.serverURL\");\n username = JiveGlobals.getXMLProperty(\"database.defaultProvider.username\");\n password = JiveGlobals.getXMLProperty(\"database.defaultProvider.password\");\n String minCons = JiveGlobals.getXMLProperty(\"database.defaultProvider.minConnections\");\n String maxCons = JiveGlobals.getXMLProperty(\"database.defaultProvider.maxConnections\");\n String conTimeout = JiveGlobals.getXMLProperty(\"database.defaultProvider.connectionTimeout\");\n // See if we should use Unicode under MySQL\n mysqlUseUnicode = Boolean.valueOf(JiveGlobals.getXMLProperty(\"database.mysql.useUnicode\")).booleanValue();\n try {\n if (minCons != null) {\n minConnections = Integer.parseInt(minCons);\n }\n if (maxCons != null) {\n maxConnections = Integer.parseInt(maxCons);\n }\n if (conTimeout != null) {\n connectionTimeout = Double.parseDouble(conTimeout);\n }\n }\n catch (Exception e) {\n Log.error(\"Error: could not parse default pool properties. \" +\n \"Make sure the values exist and are correct.\", e);\n }\n }", "private void loadProperties() {\n try (InputStream in = getClass().getClassLoader().getResourceAsStream(PATH_TO_PROPERTIES)) {\n this.prs.load(in);\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "protected void readProperties() {\n\t\tproperties = new HashMap<>();\n\t\tproperties.put(MQTT_PROP_CLIENT_ID, id);\n\t\tproperties.put(MQTT_PROP_BROKER_URL, brokerUrl);\n\t\tproperties.put(MQTT_PROP_KEEP_ALIVE, 30);\n\t\tproperties.put(MQTT_PROP_CONNECTION_TIMEOUT, 30);\n\t\tproperties.put(MQTT_PROP_CLEAN_SESSION, true);\n\t\tproperties.put(MQTT_PROP_USERNAME, user);\n\t\tproperties.put(MQTT_PROP_PASSWORD, password.toCharArray());\n\t\tproperties.put(MQTT_PROP_MQTT_VERSION, MqttConnectOptions.MQTT_VERSION_3_1_1);\n\t}", "public void loadProperties() throws IOException\n\t{\n\t\tFile src = new File(\"D://Selenium Stuff//Selenium Workspace//OpenCartL2_28112017//ObjectRepo.properties\");\n\t\tFileInputStream fis = new FileInputStream(src);\n\t\tpro = new Properties();\n\t\tpro.load(fis);\n\t}", "public TestBase()\r\n\t{\r\n\t\tprop = new Properties();\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"src\\\\test\\\\resources\\\\intellicus.properties\");\r\n\t\t\tFileInputStream fis = new FileInputStream(file);\r\n\t\t\tprop.load(fis);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public void init() {\r\n\r\n\t}", "static void setDefaultProperties() {\n properties.put(\"VERSION\", \"6\");\n\n // Directories and file names\n properties.put(\"SOURCE_DIRECTORY\", \"jspin-examples\");\n properties.put(\"C_COMPILER\", \"clang\");\n properties.put(\"SPIN\", \"/home/victor/Spin/spin\");\n properties.put(\"PAN\", \"pan\");\n properties.put(\"DOT\", \"dot\");\n properties.put(\"HELP_FILE_NAME\", \"txt\" + sep + \"help.txt\");\n properties.put(\"ABOUT_FILE_NAME\", \"txt\" + sep + \"copyright.txt\");\n\n // Options for executing Spin\n properties.put(\"SINGLE_QUOTE\", Boolean.toString(false));\n properties.put(\"COMMON_OPTIONS\", \"-g -l -p -r -s\");\n // Check options changed for version 6 (for now)\n // properties.put(\"CHECK_OPTIONS\", \"-a -v\");\n properties.put(\"CHECK_OPTIONS\", \"-a\");\n properties.put(\"RANDOM_OPTIONS\", \"-X\");\n properties.put(\"INTERACTIVE_OPTIONS\", \"-i -X\");\n properties.put(\"VERIFY_OPTIONS\", \"-a\");\n properties.put(\"C_COMPILER_OPTIONS\", \"-o pan pan.c\");\n properties.put(\"PAN_OPTIONS\", \"-X\");\n properties.put(\"TRAIL_OPTIONS\", \"-t -X\");\n properties.put(\"TRANSLATE_OPTIONS\", \"-f\");\n\n // Settings\n properties.put(\"MAX_STEPS\", \"250\");\n properties.put(\"MAX_DEPTH\", \"2000\");\n properties.put(\"SEED\", \"0\");\n properties.put(\"NEGATE_LTL\", Boolean.toString(true));\n properties.put(\"FAIRNESS\", Boolean.toString(true));\n properties.put(\"VERIFY_MODE\", Safety);\n properties.put(\"RAW\", Boolean.toString(false));\n properties.put(\"PROCESS_WIDTH\", Integer.toString(7));\n properties.put(\"STATEMENT_WIDTH\", Integer.toString(18));\n properties.put(\"VARIABLE_WIDTH\", Integer.toString(10));\n properties.put(\"LINES_PER_TITLE\", Integer.toString(20));\n\n // Size of main frame\n properties.put(\"WIDTH\", Integer.toString(1000));\n properties.put(\"HEIGHT\", Integer.toString(700));\n\n // Select dialog\n properties.put(\"SELECT_BUTTON\", Integer.toString(220));\n properties.put(\"SELECT_HEIGHT\", Integer.toString(70));\n properties.put(\"SELECT_MENU\", Integer.toString(5));\n properties.put(\"UNEXECUTABLE\", Boolean.toString(false));\n\n // Location of dividers in JSplitPanes: Left-right and top-bottom\n properties.put(\"LR_DIVIDER\", Integer.toString(400));\n properties.put(\"TB_DIVIDER\", Integer.toString(500));\n properties.put(\"MIN_DIVIDER\", Integer.toString(50));\n\n // Font\n properties.put(\"FONT_FAMILY\", \"Lucida Sans Typewriter\");\n properties.put(\"FONT_STYLE\", Integer.toString(java.awt.Font.PLAIN));\n properties.put(\"FONT_SIZE\", Integer.toString(14));\n\n // Tab size in editor\n properties.put(\"TAB_SIZE\", Integer.toString(4));\n\n // Display of Spin output\n properties.put(\"WRAP\", Boolean.toString(true));\n properties.put(\"MSC\", Boolean.toString(false));\n properties.put(\"PROCESS_TITLE\", \"Process \");\n properties.put(\"STATEMENT_TITLE\", \"Statement \");\n\n // Delay while waiting for user input\n properties.put(\"POLLING_DELAY\", Integer.toString(200));\n }", "public static synchronized void initProjectProperties() {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.initProjectProperties\");\n try {\n String projectPropertiesFilename = System.getProperty(USER_DIR)\n + File.separator\n + QVCSConstants.QVCS_PROPERTIES_DIRECTORY\n + File.separator\n + QVCSConstants.QVCS_SERVED_PROJECTNAME_PREFIX + getTestProjectName() + \".properties\";\n File projectPropertiesFile = new File(projectPropertiesFilename);\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.initProjectProperties project properties file name: [\" + projectPropertiesFilename + \"]\");\n\n if (projectPropertiesFile.exists()) {\n // If the properties file exists, delete it, so we can create a fresh one.\n projectPropertiesFile.delete();\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.initProjectProperties deleting existing property file.\");\n }\n // Make sure the properties directory exists...\n if (!projectPropertiesFile.getParentFile().exists()) {\n projectPropertiesFile.getParentFile().mkdirs();\n }\n\n // Make sure the property file exists. (This should create it.)\n if (projectPropertiesFile.createNewFile()) {\n AbstractProjectProperties projectProperties = ProjectPropertiesFactory.getProjectPropertiesFactory().buildProjectProperties(getTestProjectName(), QVCSConstants.QVCS_SERVED_PROJECT_TYPE);\n\n // This is where the archives go...\n String projectLocation = System.getProperty(USER_DIR)\n + File.separator\n + QVCSConstants.QVCS_PROJECTS_DIRECTORY\n + File.separator\n + getTestProjectName();\n\n File archiveLocation = new File (projectLocation);\n String canonicalArchiveLocation = archiveLocation.getCanonicalPath();\n\n // This the root directory for the archives for this project.\n projectProperties.setArchiveLocation(canonicalArchiveLocation);\n\n // Make sure the directory exists.\n File projectDirectory = new File(projectLocation);\n projectDirectory.mkdirs();\n\n // Set the project info for the reference copies\n projectProperties.setCreateReferenceCopyFlag(false);\n\n // Set the ignore case flag.\n projectProperties.setIgnoreCaseFlag(true);\n\n projectProperties.setDirectoryContentsInitializedFlag(true);\n\n projectProperties.saveProperties();\n }\n } catch (IOException e) {\n Logger.getLogger(TestHelper.class.getName()).log(Level.SEVERE, null, e);\n }\n }", "private void initialize() {\n }", "private void readProperties() throws Exception{\n\t\t InputStream fisGlobal=null,fisModul=null; \n\t\t propiedades = new Properties();\n try {\n \t // Path directorio de configuracion\n \t String pathConf = System.getProperty(\"ad.path.properties\");\n \t \n \t // Propiedades globales\n \t fisGlobal = new FileInputStream(pathConf + \"sistra/global.properties\");\n \t propiedades.load(fisGlobal);\n \t\t \n \t // Propiedades modulo\n \t\t fisModul = new FileInputStream(pathConf + \"sistra/plugins/plugin-firma.properties\");\n \t\t propiedades.load(fisModul);\n \t \t \t\t \n } catch (Exception e) {\n \t propiedades = null;\n throw new Exception(\"Excepcion accediendo a las propiedadades del modulo\", e);\n } finally {\n try{if (fisGlobal != null){fisGlobal.close();}}catch(Exception ex){}\n try{if (fisModul != null){fisModul.close();}}catch(Exception ex){}\n }\t\t\n\t}", "private void initialize() {\n\t}", "private void initialize() {\n\t\t\n\t}", "private void loadData() {\n\n \tInputStream inputStream = this.getClass().getResourceAsStream(propertyFilePath);\n \n //Read configuration.properties file\n try {\n //prop.load(new FileInputStream(propertyFilePath));\n \tprop.load(inputStream);\n //prop.load(this.getClass().getClassLoader().getResourceAsStream(\"configuration.properties\"));\n } catch (IOException e) {\n System.out.println(\"Configuration properties file cannot be found\");\n }\n \n //Get properties from configuration.properties\n browser = prop.getProperty(\"browser\");\n testsiteurl = prop.getProperty(\"testsiteurl\");\n defaultUserName = prop.getProperty(\"defaultUserName\");\n defaultPassword = prop.getProperty(\"defaultPassword\");\n }", "@Override\r\n\tpublic void setProperties(Properties arg0) {\n\r\n\t}", "public void loadProperties(){\n\n\ttry{\n\t prop.load(file);\n // get the property value and print it out\n host = prop.getProperty(\"host\");\n\t port = prop.getProperty(\"port\");\n\t sslmode = prop.getProperty(\"sslmode\");\n\t source = prop.getProperty(\"source\");\n dbname = prop.getProperty(\"dbname\");\n help_url_prefix = prop.getProperty(\"base.help.url\");\n password = prop.getProperty(\"password\");\n\t user = prop.getProperty(\"user\");\t \n\t temp_dir = new File(System.getProperty(\"java.io.tmpdir\")).toString();\n\t working_dir = new File(System.getProperty(\"user.dir\")).toString();\n\t file.close();\n\t}catch(IOException ioe){\n\t\t\n\t} \n\t \n }", "public void init() {\n\t\t}", "private PropertySingleton(){}", "public void initialize() {\n\n getStartUp();\n }", "public static void init() {\n if(!initialized){\r\n // Initialize Properties & InputStream variables\r\n Properties prop = new Properties();\r\n InputStream input = null;\r\n\r\n try { // Read the file\r\n String filename = \"config.properties\";\r\n input = MariaDB.class.getClassLoader().getResourceAsStream(filename);\r\n \r\n if(input == null){\r\n System.out.println(\"Unable to find: \" + filename);\r\n return;\r\n }\r\n \r\n prop.load(input);\r\n setAddress(prop.getProperty(\"mysqlAddress\"));\r\n setPort(prop.getProperty(\"mysqlPort\"));\r\n setDatabase(prop.getProperty(\"dbName\"));\r\n setUsername(prop.getProperty(\"dbUser\"));\r\n setPassword(prop.getProperty(\"dbPass\"));\r\n setInitialized(true);\r\n } // end of try\r\n catch(IOException ex) {\r\n ex.printStackTrace();\r\n } // end of catch\r\n finally { // Close the InputStream\r\n if(input != null) {\r\n try {\r\n input.close();\r\n }\r\n catch(IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n } // end of finally\r\n } \r\n }", "public static int initProperties() {\n\n\t\t// creating a new conf file if none exists yet\n\t\tPathHelper ph = new PathHelper();\n\t\ttry {\n\t\t\thomeFolder = ph.getMarabouHomeFolder();\n\t\t\tconf = new File(ph.getMarabouHomeFolder() + \"marabou.properties\");\n\t\t} catch (UnknowPlatformException e1) {\n\t\t\tlog.severe(\"Your OS couldn't get detected properly.\\n\"\n\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\treturn 1;\n\t\t}\n\t\t// if config is found, check if updates are needed\n\t\tif (conf.exists()) {\n\t\t\tif (!conf.canRead() || !conf.canWrite()) {\n\t\t\t\tlog.severe(\"Couldn't read or write config file.\"\n\t\t\t\t\t\t+ \" Please make sure that your file permissions are set properly.\");\n\t\t\t\treturn 1;\n\t\t\t\t// config is existens and accessable\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tproperties.load(new FileReader(conf.getAbsolutePath()));\n\t\t\t\t} catch (FileNotFoundException e) {\n\n\t\t\t\t\tlog.severe(\"Couldn't find user's config file in path: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't load config file: \"\n\t\t\t\t\t\t\t+ conf.getAbsolutePath());\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tProperties vendorProp = new Properties();\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\n\t\t\t\ttry {\n\t\t\t\t\tvendorProp.load(new FileReader(\n\t\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\tlog.severe(\"Couldn't find vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.severe(\"Couldn't open vendor config.\");\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\t// if the user's conf is older than the current marabou version,\n\t\t\t\t// update the missing entries\n\t\t\t\tif (properties.getProperty(\"version\").compareTo(\n\t\t\t\t\t\tvendorProp.getProperty(\"version\")) < 0) {\n\t\t\t\t\tSet<Object> vendorKeys = vendorProp.keySet();\n\t\t\t\t\tSet<Object> userKeys = properties.keySet();\n\n\t\t\t\t\t// set the latest version in users conf\n\t\t\t\t\tproperties.setProperty(\"version\",\n\t\t\t\t\t\t\tvendorProp.getProperty(\"version\"));\n\n\t\t\t\t\t// copy missing new key/value pairs\n\t\t\t\t\tfor (Object key : vendorKeys) {\n\t\t\t\t\t\tif (!userKeys.contains(key)) {\n\t\t\t\t\t\t\tproperties.put(key, vendorProp.get(key));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tpersistSettings();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// conf is not existent yet\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tFile mhfFile = new File(homeFolder);\n\t\t\t\t// create foler if no folder exists yet\n\t\t\t\tif (!mhfFile.exists()) {\n\t\t\t\t\tif (!mhfFile.mkdir()) {\n\t\t\t\t\t\tlog.severe(\"Couldn't create marabou folder in your home.\\n\"\n\t\t\t\t\t\t\t\t+ \"Please file a bugreport.\");\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// create marabou.properties file in new folder\n\t\t\t\tconf.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.severe(\"Couldn't create config file, please check your file permission in your home folder.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ttry {\n\n\t\t\t\t// TODO RELEASE replace path with method call of PathHelper (for\n\t\t\t\t// specific OS)\n\t\t\t\tBufferedReader vendorConf = new BufferedReader(new FileReader(\n\t\t\t\t\t\t\"src/main/resources/marabou.properties\"));\n\n\t\t\t\tproperties.load(vendorConf);\n\t\t\t\t// copy all entries to the new conf\n\t\t\t\tpersistSettings();\n\t\t\t\tvendorConf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.warning(\"Couldn't create config file in \"\n\t\t\t\t\t\t+ System.getProperty(\"user.home\"));\n\t\t\t\tlog.warning(e.toString());\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public void initialize(final InputStream stream) throws IOException\n {\n // load up the properties\n final Properties props = new Properties();\n props.load(stream);\n initialize(props);\n }" ]
[ "0.7953739", "0.7848436", "0.78292656", "0.7778296", "0.7730502", "0.75931615", "0.7592292", "0.7509239", "0.7415025", "0.73598385", "0.7356839", "0.73269737", "0.7293548", "0.72551364", "0.7245999", "0.7226907", "0.718164", "0.71767116", "0.71667635", "0.7155544", "0.71402615", "0.71386117", "0.71273386", "0.70846003", "0.702985", "0.70038444", "0.69964856", "0.69630265", "0.69616574", "0.6934289", "0.6926871", "0.6908489", "0.6904121", "0.68995535", "0.688993", "0.6853954", "0.68487084", "0.6847872", "0.68365633", "0.6826684", "0.68249357", "0.680752", "0.68047804", "0.6800326", "0.67948836", "0.678079", "0.67575336", "0.67381334", "0.6726801", "0.67227113", "0.6708885", "0.6699022", "0.66831774", "0.66756403", "0.6675539", "0.6654321", "0.6652006", "0.66450334", "0.65844846", "0.65678203", "0.65608084", "0.6541544", "0.65363735", "0.6525933", "0.651783", "0.6492847", "0.6488824", "0.6488471", "0.6486008", "0.6474455", "0.64598536", "0.64546806", "0.64475673", "0.6434773", "0.64338326", "0.6431241", "0.64270514", "0.6422637", "0.6422637", "0.6422637", "0.6422637", "0.641852", "0.64127034", "0.64117473", "0.6410403", "0.6407325", "0.64037937", "0.6402198", "0.6401516", "0.64012986", "0.6400762", "0.6400647", "0.64001113", "0.6398462", "0.6395573", "0.63931656", "0.639167", "0.6389083", "0.6377548", "0.6371636" ]
0.74668914
8
Get Property with default.
public static String getProperty(String key, String defaultValue) { return properties.getProperty(key, defaultValue) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getProperty(String name, String defaultValue);", "protected <T> Property getProperty(String key, T defaultVal) {\r\n return getProperty(key, defaultVal, RestartReqs.NONE);\r\n }", "public String getProperty(Object obj, String key, String defaultValue);", "@Override\n\t\tpublic Object getProperty(String key, Object defaultValue) {\n\t\t\treturn null;\n\t\t}", "protected <T> T getValue(Property prop, T defaultVal) {\r\n return getValue(prop, defaultVal, null);\r\n }", "public String getProperty(String name, String default_value) {\n if (this.properties.containsKey(name)) {\n return this.properties.get(name);\n }\n return default_value;\n }", "private String getProperty(\n String name,\n String defaultValue\n ) {\n return properties.getProperty(\n String.format(\"%s%s\", propertiesPrefix, name),\n defaultValue\n );\n }", "public String getProperty(Class type, String key, String defaultValue);", "public static String getProperty(String propertyName, String defaultValue){\r\n String propertyValue = getProperty(propertyName);\r\n return propertyValue == null ? defaultValue : propertyValue;\r\n }", "public <T> T getProperty(String name, Class<T> type, T defaultValue);", "public String getStringProperty(String propertyName, String defaultValue);", "public final <T> T getProperty(String key, T defaultValue) {\n/* 72 */ Object value = Launch.blackboard.get(key);\n/* 73 */ return (value != null) ? (T)value : defaultValue;\n/* */ }", "Property getProperty();", "Property getProperty();", "java.lang.String getProperty();", "public String getPropertyValue(String key){\n\t\treturn this.prop.getProperty(key,\"Default Value\");\n\t}", "@Override\n public int getDefaultPropertyIndex() {\n return defaultPropertyIndex;\n }", "public String get(final String name, final String defaultValue) {\r\n String prop = (String) properties.get(name);\r\n \r\n if (prop == null) {\r\n prop = defaultValue;\r\n }\r\n return prop;\r\n }", "private Object getDefaultPropertyValue(Control control, PropertyDescriptor property) {\n \n \t\tClass<? extends Control> controlClass = control.getClass();\n \t\tif (!DEFAULT_PROPERTY_VALUES.containsKey(controlClass)) {\n \t\t\tControl defaultControl = createDefaultControl(controlClass, control.getParent(), control.getStyle());\n \t\t\tif (defaultControl != null) {\n \t\t\t\tList<PropertyDescriptor> properties = getProperties(control);\n \t\t\t\tMap<String, Object> defaults = new Hashtable<String, Object>(properties.size());\n \t\t\t\tfor (PropertyDescriptor defaultProperty : properties) {\n \t\t\t\t\tObject value = getPropertyValue(defaultControl, defaultProperty);\n \t\t\t\t\tvalue = getResourceData(value);\n \t\t\t\t\tif (value != null) {\n \t\t\t\t\t\tdefaults.put(defaultProperty.getName(), value);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tdefaultControl.dispose();\n \t\t\t\tDEFAULT_PROPERTY_VALUES.put(controlClass, defaults);\n \t\t\t} else {\n \t\t\t\tLOGGER.log(LogService.LOG_ERROR, \"Cannot create an instance of \\\"\" + controlClass.getName() + \"\\\"\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \t\t}\n \n \t\tMap<String, Object> defaultValues = DEFAULT_PROPERTY_VALUES.get(controlClass);\n \t\tif (defaultValues == null) {\n \t\t\treturn null;\n \t\t}\n \t\treturn defaultValues.get(property.getName());\n \n \t}", "protected <T> Property getProperty(String key, T defaultVal, RestartReqs req) {\r\n checkInitialized();\r\n Section section = activeSection;\r\n Property prop = null;\r\n\r\n // @formatter:off\r\n // same logic as above method, mostly\r\n if (defaultVal instanceof Integer)\r\n {\r\n prop = getConfig().get(section.name, key, (Integer) defaultVal);\r\n }\r\n if (defaultVal instanceof Boolean)\r\n {\r\n prop = getConfig().get(section.name, key, (Boolean) defaultVal);\r\n }\r\n if (defaultVal instanceof int[])\r\n {\r\n prop = getConfig().get(section.name, key, (int[]) defaultVal);\r\n }\r\n if (defaultVal instanceof String)\r\n {\r\n prop = getConfig().get(section.name, key, (String) defaultVal);\r\n }\r\n if (defaultVal instanceof String[])\r\n {\r\n prop = getConfig().get(section.name, key, (String[]) defaultVal);\r\n }\r\n // @formatter:on\r\n\r\n if (defaultVal instanceof Float || defaultVal instanceof Double) {\r\n double val = defaultVal instanceof Float ? ((Float) defaultVal).doubleValue() : ((Double) defaultVal).doubleValue();\r\n prop = getConfig().get(section.name, key, val);\r\n }\r\n\r\n if (prop != null) {\r\n return req.apply(prop);\r\n }\r\n\r\n throw new IllegalArgumentException(\"default value is not a config value type.\");\r\n }", "public int getPropertyInt(String key, int defaultValue);", "public String getProperty() {\n return \"\";\n }", "public Object getDefaultValue();", "public Object getDefaultValue();", "public static String getDefaultProperty(String key) {\n return defaults.getProperty(key);\n }", "public SimpleBooleanProperty getUseDefault() {\n return useDefault;\n }", "Properties defaultProperties();", "@Override\n public Property getProperty() throws ItemNotFoundException,\n ValueFormatException, RepositoryException {\n return null;\n }", "@Override\n public String toDefaultValue(Property p) {\n if (p instanceof StringProperty) {\n StringProperty dp = (StringProperty) p;\n if (dp.getDefault() != null) {\n return \"\\\"\" + dp.getDefault().toString() + \"\\\"\";\n }\n } else if (p instanceof BooleanProperty) {\n BooleanProperty dp = (BooleanProperty) p;\n if (dp.getDefault() != null) {\n return dp.getDefault().toString();\n }\n } else if (p instanceof DateProperty) {\n // TODO\n } else if (p instanceof DateTimeProperty) {\n // TODO\n } else if (p instanceof DoubleProperty) {\n DoubleProperty dp = (DoubleProperty) p;\n if (dp.getDefault() != null) {\n return dp.getDefault().toString();\n }\n } else if (p instanceof FloatProperty) {\n FloatProperty dp = (FloatProperty) p;\n if (dp.getDefault() != null) {\n return dp.getDefault().toString();\n }\n } else if (p instanceof IntegerProperty) {\n IntegerProperty dp = (IntegerProperty) p;\n if (dp.getDefault() != null) {\n return dp.getDefault().toString();\n }\n } else if (p instanceof LongProperty) {\n LongProperty dp = (LongProperty) p;\n if (dp.getDefault() != null) {\n return dp.getDefault().toString();\n }\n }\n\n return null;\n }", "public Optional<Object> getProperty(String name) {\n return Optional.ofNullable(properties.get(name));\n }", "public static String getProperty(String key, String defaultValue) {\r\n\t\tString resultVal = prop.getProperty(key);\r\n\t\treturn CommonUtil.isEmpty(resultVal) ? defaultValue : resultVal;\r\n\t}", "@JSProperty\n String getDefaultValue();", "String getProperty();", "String getProperty();", "String getProperty();", "public int getDefaultPropertyIndex() {\n return defaultPropertyIndex;\n }", "public Object getProperty(String name) {\n return null;\n }", "@Override\n public String getProperty(String s) {\n return null;\n }", "public String getDefault(){\n return _default;\n }", "public String getProperty();", "Object getProperty(String name);", "java.lang.String getPropertiesOrDefault(\n java.lang.String key,\n /* nullable */\n java.lang.String defaultValue);", "@Override\n\tpublic IPropertyGetter getPropertyGetter() {\n\t\treturn null;\n\t}", "public T getDefaultValue() {\n return defaultValue.orNull();\n }", "Object getDefaultValue(String key);", "public Object getProperty(String arg0) {\n return null;\n }", "String getDefaultValue();", "String getDefaultValue();", "private int getOptionalIntegerProperty(String property, int defaultValue) {\n\t\ttry {\n\t\t\tString value = testProperties.getProperty(property);\n\t\t\tif (value == null)\n\t\t\t\treturn defaultValue;\n\t\t\treturn Integer.parseInt(value);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}", "private PropertyDefinition getProperty(\n String property,\n String name,\n String description,\n String defaultValue,\n PropertyType type\n ) {\n return PropertyDefinition.builder(property)\n .name(name)\n .description(description)\n .defaultValue(defaultValue)\n .type(type)\n .category(Constants.CATEGORY)\n .subCategory(Constants.SUBCATEGORY)\n .index(propertyIndex++)\n .build();\n }", "public final Properties getDefaultProperties() {\n \t\treturn properties;\n \t}", "String getProperty(String name);", "String getProperty(String property);", "public String getDefault();", "public static Properties getDefaultProperties() {\r\n return getProperties(true);\r\n }", "int getProperty0();", "public @NotNull T getDefaultValue() {\n return defaultValue;\n }", "public Object get(String aName, Object aDefault)\n{\n Object value = get(aName);\n return value!=null? value : aDefault;\n}", "public static String getUserProperty(String key, String defaultValue){\n return DataStore.getUserProperty(context, key, defaultValue);\n }", "public String getProperties(String key,String defaultValue){\n return properties.getProperty(key,defaultValue);\n }", "public String getDefaultTargetPropertyName() {\r\n return null;\r\n }", "public String getOptionalStringProperty(String property) {\n\t\treturn testProperties.getProperty(property);\n\t}", "public Property getProperty() {\n\treturn commonproperty;\r\n}", "@Override\n\t\t\tpublic Object getPropertyValue() {\n\t\t\t\treturn null;\n\t\t\t}", "Object getPropertytrue();", "public static String getProperty(String key, String defaultValue) {\n\t\tString val = null;\n\t\ttry {\n\t\t\tval = getProperty(key);\n\t\t} catch (Alert a) {\n\t\t\tval = defaultValue;\n\t\t}\n\t\treturn val;\n\t}", "public Integer getProperty() {\n\t\t\treturn null;\n\t\t}", "public Object getDefault() {\n\t\treturn defaultField;\n\t}", "public static String get(ServerProperty property)\n\t{\n\t\tString value = properties.getProperty(property.getKey());\n\n\t\treturn StringUtils.isEmpty(value) ? property.getDefaultValue() : value;\n\t}", "public String getProperty(String name);", "T getDefaultValue();", "@Override\r\n\tpublic Property getProperty(String absPath) throws PathNotFoundException,\r\n\t\t\tRepositoryException {\n\t\treturn null;\r\n\t}", "public String getProperty( String name )\n {\n return getProperty( name, false );\n }", "public String getPropertyValue(String name)\n {\n // Don't bother with empty property names.\n if (name.equals(EMPTY_STRING))\n {\n return this.predicateEmptyDefault;\n } \n \n // Retrieve the contents of the property.\n String value = this.properties.get(name);\n if (value != null)\n {\n return value;\n } \n // (otherwise...)\n return this.predicateEmptyDefault;\n }", "public static String verifyAndFetchOptionalProperty(String key,\r\n\t\t\tString defaultValue, Properties prop) {\r\n\t\tString property;\r\n\t\tproperty = fetchProperty(key, prop);\r\n\r\n\t\t// Property should not be blank.\r\n\t\tif (property == null || (property != null && property.trim().isEmpty())) {\r\n\t\t\treturn defaultValue;\r\n\t\t}\r\n\t\treturn property;\r\n\t}", "@Override\n\t\tpublic Object getProperty(String key) {\n\t\t\treturn null;\n\t\t}", "@Override\n\tProp getProp() {\n\t\treturn null;\n\t}", "Object getPreference(String prefKey, Object defaultValue);", "@Override\r\n\tpublic String getProp(final String propName) {\n\t\treturn exec(new Callable<String>() {\r\n\t\t\t@Override\r\n\t\t\tpublic String call() throws Exception {\r\n\t\t\t\treturn System.getProperty(propName);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "Object getProperty(String requestedProperty) {\n return properties.getProperty(requestedProperty);\n }", "private String getProperty(Properties properties, String key, String defaultValue) {\r\n\r\n if (properties.containsKey(key)) {\r\n Object value = properties.getProperty(key);\r\n if (value instanceof String && ((String)value).length() > 0) {\r\n return (String)value;\r\n }\r\n }\r\n\r\n return defaultValue;\r\n }", "public static String sysProp(String key, Object defaultValue) {\n return _sysProp(key, defaultValue);\n }", "public String getDefaultValue() {\n return defaultValue;\n }", "public String get(String key, String defaultValue) {\n return System.getProperty(prefix + key, defaultValue);\n }", "@Test\n public void getDefaultValueForSetting_noPlatformPropertyForKeyDefined_propertyHasDefault()\n throws Throwable {\n clearAllPlatformSettings();\n\n runTX(new Callable<Void>() {\n @Override\n public Void call() throws Exception {\n String value = ldapSettingsMgmtSvc\n .getDefaultValueForSetting(SettingType.LDAP_CONTEXT_FACTORY);\n assertEquals(\"Returned value must correspond to default value\",\n SettingType.LDAP_CONTEXT_FACTORY.getDefaultValue(),\n value);\n return null;\n }\n });\n }", "public final String getPropertyString(String key, String defaultValue) {\n/* 87 */ Object value = Launch.blackboard.get(key);\n/* 88 */ return (value != null) ? value.toString() : defaultValue;\n/* */ }", "@OnThread(Tag.Any)\n public static String getPropString(String key, String defaultValue)\n {\n return projectProperties.getString(key, defaultValue);\n }", "@Deprecated\n public Object getPropertyDefaultValue(String str, AnnotatedMember annotatedMember, JavaType javaType) {\n Object defaultBean = getDefaultBean();\n if (defaultBean == null) {\n return getDefaultValue(javaType);\n }\n try {\n return annotatedMember.getValue(defaultBean);\n } catch (Exception e) {\n return _throwWrapped(e, str, defaultBean);\n }\n }", "private String getPropertyValue(String namespace, String propertyName, String defaultValue)\r\n throws CockpitConfigurationException {\r\n try {\r\n String prop = ConfigManager.getInstance().getString(namespace, propertyName);\r\n\r\n // Property is missing\r\n if (prop == null) {\r\n // the property is required\r\n if (defaultValue == null) {\r\n throw new CockpitConfigurationException(\"Error in configuration. Missing required property '\"\r\n + propertyName + \"'\");\r\n } else {\r\n // the property is optional\r\n return defaultValue;\r\n }\r\n }\r\n\r\n // Empty property value is not allowed\r\n if (prop.trim().length() == 0) {\r\n throw new CockpitConfigurationException(\"Error in configuration. Property value: '\" + propertyName\r\n + \"' is empty\");\r\n }\r\n\r\n return prop;\r\n } catch (UnknownNamespaceException e) {\r\n throw new CockpitConfigurationException(\"The namespace '\" + namespace\r\n + \"' is missing in configuration\", e);\r\n }\r\n }", "public String getProperty(String propertyName) {\n\t\tProperties properties = new Properties();\n\t\tFileReader fileReader;\n\t\ttry {\n\t\t\tfileReader = new FileReader(new File(\"src\\\\main\\\\resources\\\\default.properties\"));\n\t\t\tproperties.load(fileReader);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString value = properties.getProperty(propertyName);\n\t\treturn value;\n\t}", "Integer getMyProperty3() {return null;}", "@Deprecated\n public Object getDefault(String path) {return defaultConfig.get(path); }", "public String getDefaultValue () {\n return defaultValue;\n }", "protected PortalObject getDefaultChild()\n {\n String portalName = getDeclaredProperty(PORTAL_PROP_DEFAULT_OBJECT_NAME);\n if (portalName == null)\n {\n portalName = DEFAULT_OBJECT_NAME;\n }\n return getChild(portalName);\n }", "public static String getProperty(String alias, String def)\r\n\t{\r\n\t\talias = processalias(alias);\r\n\r\n\t\tif(dynoption != null && dynoption.containsKey(alias))\r\n\t\t{\t\r\n\t\t\tString val = dynoption.get(alias);\r\n\t\t\t\r\n\t\t\tif(val == null && def != null)\r\n\t\t\t\treturn def;\r\n\t\t\telse\r\n\t\t\t\treturn val;\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(cmd != null && cmd.hasOption(alias))\r\n\t\t{\r\n\t\t\treturn cmd.getOptionValue(alias);\r\n\t\t}\r\n\t\telse if(config != null)\r\n\t\t{\r\n\t\t\treturn config.getString(alias, def);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn def;\r\n\t\t}\r\n\t}", "@Override\n public Object getProperty(String property) {\n for (Map.Entry<String, RequiredFunctionalExtension> requiredBehaviorEntry : myRequiredBehaviorById.entrySet()) {\n Object prop = requiredBehaviorEntry.getValue().getProperty(property);\n if (prop != null) {\n return prop;\n }\n }\n return null;\n }", "private static String getPropertyValueOrDefault(String value) {\n return value != null ? value : \"\";\n }", "public <T> T get(String attr, Object defaultValue) {\n Object result = super.get(attr);\n return (T) (result != null ? result : defaultValue);\n }", "@java.lang.Override\n public /* nullable */\n java.lang.String getPropertiesOrDefault(\n java.lang.String key,\n /* nullable */\n java.lang.String defaultValue) {\n if (key == null) {\n throw new NullPointerException(\"map key\");\n }\n java.util.Map<java.lang.String, java.lang.String> map =\n internalGetProperties().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "public String getDefaultValue() {\n return defaultValue;\n }" ]
[ "0.79449034", "0.76693577", "0.7535586", "0.73681635", "0.7261764", "0.71442485", "0.7095214", "0.6977769", "0.69530714", "0.69316983", "0.6869481", "0.68666834", "0.680654", "0.680654", "0.6738604", "0.6706819", "0.6688152", "0.66342986", "0.6591907", "0.6584483", "0.65609103", "0.6558905", "0.6546223", "0.6546223", "0.65444535", "0.652996", "0.65133315", "0.6510755", "0.65098685", "0.64981157", "0.6492279", "0.648343", "0.64815396", "0.64815396", "0.64815396", "0.6440579", "0.64311814", "0.64036244", "0.63970554", "0.6382743", "0.63631666", "0.6347708", "0.63366365", "0.6330617", "0.6328573", "0.63189435", "0.62965816", "0.62965816", "0.62944156", "0.6281978", "0.627499", "0.62610376", "0.62566674", "0.62509316", "0.6235352", "0.62092173", "0.6199395", "0.6192747", "0.61922497", "0.6185802", "0.61831546", "0.6178517", "0.61653256", "0.61652607", "0.61628705", "0.6158604", "0.6158505", "0.61578673", "0.6151592", "0.61509323", "0.6149282", "0.6135902", "0.6128824", "0.6127064", "0.61189044", "0.6114724", "0.61067945", "0.60929364", "0.6030409", "0.60266316", "0.6008286", "0.60019535", "0.6001307", "0.59983337", "0.5995269", "0.59923834", "0.5988477", "0.59806913", "0.5975184", "0.59694207", "0.5942961", "0.594093", "0.5936108", "0.593054", "0.59274197", "0.59259814", "0.59195286", "0.5889448", "0.5879163", "0.587549" ]
0.66298187
18
Constructor for objects of class MyVM constructor with no params
public MyVM( ) { // initialise instance variables try { // your code here this.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()), SJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true); } catch ( Exception e ) { System.out.println( e.toString() ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public VM() {\n initComponents();\n }", "VM createVM();", "public TParametrosVOImpl() {\r\n }", "public VMProcess() \n\t{\n\t\tsuper();\n\t}", "public VMProcess() {\n\t\tsuper();\n\t}", "public TV() {\r\n\t}", "public VMKernel() {\n }", "public MyVM(String virtual_machine_name)\n {\n \ttry\n \t{\n \t\tthis.vmname= virtual_machine_name;\n \t\tthis.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()),\n\t\t\t\t\tSJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true);\n \t\t\n \t\tthis.folder = si.getRootFolder();\n \t\tthis.vm=(VirtualMachine) new InventoryNavigator(folder).searchManagedEntity(\"VirtualMachine\",\n \t\t\t\tthis.vmname);\n \t\tSystem.out.println(\"MyVM, vm value : \"+vm);\n \t\t\n \t\tthis.hs= (HostSystem) new InventoryNavigator(folder).searchManagedEntity(\"HostSystem\", \"130.65.132.194\");\n \t\tSystem.out.println(\"MyVM, HS value : \"+hs);\n \t\tthis.snapshotname=\"snap2\";\n \t\t\n \t}\n \tcatch(Exception e)\n \t{\n \t\tSystem.out.println(e.toString());\n \t}\n }", "public AFMV() {\r\n }", "public VMKernel()\n {\n super();\n }", "public CommonVO() {\r\n }", "public CvSVM()\r\n {\r\n\r\n super( CvSVM_0() );\r\n\r\n return;\r\n }", "public Vaccine() {\n\t}", "public Machine() {\n\t\tsuper();\n\t}", "public MySpacesListVOImpl() {\r\n }", "public Vector() {\n construct();\n }", "public TacChrtypmstVOImpl() {\n }", "public VITACareer()\r\n {\r\n }", "defaultConstructor(){}", "public VMWareDriver() {\n }", "@Override\n protected void initViewModel() {\n }", "public PersonaVO() {\n }", "public VirtualMachineTest(String name) {\r\n\t\tsuper(name);\r\n\t}", "void DefaultConstructor(){}", "public VOIVector() {\r\n super();\r\n }", "public ViewModel(IModel model) {\n this.model = model;\n }", "VM getVM();", "public MonteCarloVSmp()\r\n\t{\r\n\t}", "private void translateConstructor( ) {\n \n Set<MethodInfoFlags> flags = EnumSet.noneOf( MethodInfoFlags.class );\n \n AVM2Method method = new AVM2Method( null, flags );\n avm2Class.avm2Class.constructor = method;\n \n AVM2MethodBody body = method.methodBody;\n body.maxStack = 1;\n body.maxRegisters = 1;\n body.maxScope = 11;\n body.scopeDepth = 10;\n \n InstructionList il = body.instructions;\n \n// il.append( OP_getlocal0 );\n// il.append( OP_pushscope );\n il.append( OP_getlocal0 );\n il.append( OP_constructsuper, 0 );\n \n// il.append( OP_findpropstrict, new AVM2QName( PUBLIC_NAMESPACE, \"drawTest\" ));\n il.append( OP_getlocal0 );\n \n il.append( OP_callpropvoid, new AVM2QName( EmptyPackage.namespace, \"drawTest\" ), 0 );\n\n il.append( OP_returnvoid );\n }", "public VM(String name, String os, List<String> ipAddresses) {//passed from gui form\r\n\r\n this.name = name;\r\n this.os = os;\r\n\r\n int ethNumber = 0;\r\n for (String ipAddress : ipAddresses) { //for each valid ip address submitted in the form, add an interface\r\n String intrfcLabel = \"eth\" + ethNumber;\r\n this.intrfces.add(new VMinterface(intrfcLabel, ipAddress));\r\n ethNumber++;\r\n }\r\n\r\n //same version and src set for every vm: dependent on OS\r\n switch (os) {\r\n case \"WINDOWS\":\r\n this.setOs(\"WINDOWS\");\r\n break;\r\n case \"LINUX\":\r\n this.setOs(\"LINUX\");\r\n break;\r\n }\r\n if (this.getOs() == \"WINDOWS\") {\r\n this.setVer(\"7.0\");\r\n this.setSrc(\"/srv/VMLibrary/win7\");\r\n } else {\r\n this.setVer(\"7.3\");\r\n this.setSrc(\"/srv/VMLibrary/JeOS\");\r\n }\r\n\r\n\r\n }", "Reproducible newInstance();", "public LpgSvcCacheViewImpl() {\n }", "public GeneralListVueController() {\n\n\t}", "VehicleClass() {}", "public XxGamMaPaymentReqVOImpl() {\n }", "public Vending_MachineTest()\n {\n // initialise instance variables\n \n \n }", "public LibvirtManager(final Machine m) {\n super(m);\n }", "HotspotRuntime(VMManagement vm) {\n jvm = vm;\n }", "public PartsViewImpl() {\n }", "public Demo()\n {\n machine = new Machine();\n }", "public Constructor(){\n\t\t\n\t}", "public ProfitDistribTpViewImpl() {\n }", "public Demo3() {}", "public native void constructor();", "protected CreateMachineNodeModel() {\r\n super(0,1);\r\n }", "public CvSVM(Mat trainData, Mat responses, Mat varIdx, Mat sampleIdx, CvSVMParams params)\r\n {\r\n\r\n super( CvSVM_1(trainData.nativeObj, responses.nativeObj, varIdx.nativeObj, sampleIdx.nativeObj, params.nativeObj) );\r\n\r\n return;\r\n }", "public static void main(String[] args) {\n My obj2=new My(9);//--->called overloaded Constructor\n }", "public EmployeesViewImpl() {\r\n }", "public VirtualPanel() {}", "public Vin() {\n super(\"Vin\");\n\n }", "private Model(){}", "public VectorImage() {\n\t}", "public DetailVORowImpl() {\n }", "public interface IVM {\n\n /***\n * This method is used to instantiate the data of your viewmodel / its components\n */\n void init();\n\n /***\n * This method is called when you have o clear subscription when using Reactive for example\n */\n void destroy();\n}", "private NonGuiController(MusicEditorModel model0, ViewModel vm, NonGuiViewAdapter view) {\n model = requireNonNull(model0);\n this.vm = vm;\n this.view = view;\n }", "public Vehiculo() {\r\n }", "Constructor() {\r\n\t\t \r\n\t }", "public Vehicle(){}", "public VaccineInfo(){}", "public ZTest1() {\n this(\"z_test1\", null);\n }", "public Machine() {\n this(MachineType.values()[0]);\n }", "private Instantiation(){}", "public p1() {\r\n this((java.lang.System[]) null);\r\n ppp$p1$$init$S();\r\n }", "public VisualView(IModel model1, int tickPerSecond) {\n super();\n this.tickPerSecond = tickPerSecond;\n panel = new MyPanel(model1, tickPerSecond);\n model = model1;\n }", "public Vehicle() {}", "protected abstract void construct();", "public ViewModel(TableHomeFrame tableHomeFrame){\n dbActions = new Model();\n this.tableHomeFrame = tableHomeFrame;\n calculations = new Calculations();\n }", "private void initViewModel() {\n viewmodel = new ViewModelProvider(getActivity()).get(ScannerViewModel.class);\n viewmodel.createList();\n }", "public LVInfo() {\r\n }", "private void __sep__Constructors__() {}", "@Override\n\tpublic void init(String[] args) {\n\t\tsuper.init(args);\n\t\tmodel = new ArenaModel();\n\t\tview = new ArenaView(model);\n\t\tmodel.setView(view);\n\t\tupdatePercepts();\n\t}", "public ValorVariavel() {\r\n }", "public UsersDataVO() {\n }", "@Model\r\n\tpublic Vector() {\r\n\t\tthis(50,50);\r\n\t}", "public Carmodel() {\n this(\"CarModel\", null);\n }", "public MARealEstateBuildingVORowImpl() {\n }", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "public Model() {\n\t}", "public Model() {\n\t}", "private View() {}", "public CvSVM(Mat trainData, Mat responses)\r\n {\r\n\r\n super( CvSVM_2(trainData.nativeObj, responses.nativeObj) );\r\n\r\n return;\r\n }", "public HomeVM() {\n dao = DataBaseHelper.getInstance().countriesDao();\n this.countryRepo = new HomeMod(dao, new RestClient());\n }", "public Estado() {\r\n //Constructor vacio\r\n }", "public Generic(){\n\t\tthis(null);\n\t}", "@Override\n\tpublic Task constructInstance(Robot robot) {\n\t\treturn null;\n\t}", "public Presenter(Model model, View view)\r\n\t{\r\n\t\tthis.myModel=model;\r\n\t\tthis.myView=view;\r\n\t\tConcurrentHashMap<String, RemoteControlCommand> commandMap=new ConcurrentHashMap<String, RemoteControlCommand>(); \r\n\t\tcommandMap.put(\"connection status\", new CheckConnectionStatus());\r\n\t\tcommandMap.put(\"disconnect user\", new DisconnectUser());\r\n\t\tcommandMap.put(\"start server\",new StartServer());\r\n\t\tcommandMap.put(\"stop server\", new StopServer());\r\n\t\tcommandMap.put(\"exit\", new exit());\r\n\r\n\t\tmyView.setCommands(commandMap);\r\n\t}", "public Vocas(String jmeno) {\r\n super(jmeno);\r\n }", "public Vehicle() {\n\n\t}", "private void initViewModel() {\n SearchUserViewModel uvm = new SearchUserViewModel(this);\n mBinding.searchUserLayout.setUvm(uvm);\n }", "public ColorFabRollInvVOImpl() {\n }", "@SuppressWarnings(\"unused\")\n\tprivate VNode()\n {\n \tvrsContext=null;\n }", "public AfiliadoVista() {\r\n }", "public L1Compiler(L1Machine machine)\n {\n // Keep the machine to compile into.\n this.machine = machine;\n }", "@Test\n public void ctor(){\n assertNotNull(CuT.templateEngine, \"The Template Engine is Null and should not be\");\n }", "TypicalCustomer() {\n super();\n }", "public FragmentMy() {\n }", "public GeneralViewControl() {\r\n }", "public DayPlanFragment() {\n\t}", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "public ItsNatImpl()\r\n {\r\n }" ]
[ "0.68000185", "0.66570985", "0.6456419", "0.64098823", "0.6294041", "0.62277627", "0.6080493", "0.60427845", "0.60379905", "0.6031631", "0.6003446", "0.5989035", "0.5940657", "0.59176236", "0.59052676", "0.590135", "0.58363867", "0.5822306", "0.5790701", "0.5761024", "0.57485735", "0.573198", "0.56694925", "0.56674975", "0.5659231", "0.5631748", "0.56289804", "0.56267357", "0.5560326", "0.55485845", "0.55398077", "0.553238", "0.5529935", "0.5528795", "0.5514198", "0.5513345", "0.5505245", "0.5502311", "0.5479614", "0.54719466", "0.5467572", "0.5466327", "0.5465642", "0.5465563", "0.5461904", "0.5461895", "0.5456453", "0.5434146", "0.54306585", "0.5417426", "0.5412012", "0.54115486", "0.5401902", "0.54008454", "0.53964806", "0.53914285", "0.5390432", "0.5387763", "0.5375646", "0.5366349", "0.5366071", "0.5364406", "0.536437", "0.5354409", "0.53535736", "0.53518945", "0.53465444", "0.53384846", "0.5328359", "0.53282404", "0.53270066", "0.53245866", "0.5321944", "0.53216374", "0.5317113", "0.53117436", "0.5311239", "0.53093195", "0.53093195", "0.5309254", "0.5308371", "0.53026885", "0.5287893", "0.5284965", "0.5269323", "0.52653795", "0.52637124", "0.5253209", "0.5250775", "0.5246222", "0.52404314", "0.5238456", "0.5233508", "0.5232469", "0.52318245", "0.5224412", "0.5218993", "0.51990217", "0.51983947", "0.51950455" ]
0.71302825
0
constructor with 1 param
public MyVM(String virtual_machine_name) { try { this.vmname= virtual_machine_name; this.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()), SJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true); this.folder = si.getRootFolder(); this.vm=(VirtualMachine) new InventoryNavigator(folder).searchManagedEntity("VirtualMachine", this.vmname); System.out.println("MyVM, vm value : "+vm); this.hs= (HostSystem) new InventoryNavigator(folder).searchManagedEntity("HostSystem", "130.65.132.194"); System.out.println("MyVM, HS value : "+hs); this.snapshotname="snap2"; } catch(Exception e) { System.out.println(e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "public Pasien() {\r\n }", "public Video( int arg1 ) { \n\t\tsuper( );\n\t}", "ConstuctorOverloading(int num){\n\t\tSystem.out.println(\"I am contructor with 1 parameter\");\n\t}", "public Clade() {}", "DefaultConstructor(int a){}", "defaultConstructor(){}", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "private Params()\n {\n }", "public Parameters() {\n\t}", "public Video( int arg1, int arg2 ) { \n\t\tsuper( );\n\t}", "public tn(String paramString, ho paramho)\r\n/* 12: */ {\r\n/* 13:11 */ super(paramString, paramho);\r\n/* 14: */ }", "public BaseParameters(){\r\n\t}", "public Complex(){\r\n\t this(0,0);\r\n\t}", "public Generic(){\n\t\tthis(null);\n\t}", "public LightParameter()\r\n\t{\r\n\t}", "private Instantiation(){}", "public CacheFIFO(int paramInt)\r\n/* 11: */ {\r\n/* 12: 84 */ super(paramInt);\r\n/* 13: */ }", "private SingleObject(){}", "Reproducible newInstance();", "public PowerMethodParameter() {\r\n\t\t\r\n\t\t//constructor fara parametru, utilizat in cazul in care utilizatorul nu introduce\r\n\t\t//fisierul sursa si nici fiesierul destinatie ca parametrii in linia de comanda\r\n\t\tSystem.out.println(\"****The constructor without parameters PowerMethodParameter has been called****\");\r\n\t\tSystem.out.println(\"You did not specify the input file and the output file\");\r\n\t\t\r\n\t}", "public bwq(String paramString1, String paramString2)\r\n/* 10: */ {\r\n/* 11: 9 */ this.a = paramString1;\r\n/* 12:10 */ this.f = paramString2;\r\n/* 13: */ }", "public Cgg_jur_anticipo(){}", "public Curso() {\r\n }", "public CyanSus() {\n\n }", "public Card() { this(12, 3); }", "public AntrianPasien() {\r\n\r\n }", "void DefaultConstructor(){}", "private Point(int param, double value) {\r\n this(param, value, false);\r\n }", "public ParamJson() {\n\t\n\t}", "private SingleObject()\r\n {\r\n }", "ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}", "protected abstract void construct();", "public MockClass(String arg) {\n\t}", "public ContasCorrentes(){\n this(0,\"\",0.0,0.0,0);\n }", "public prueba()\r\n {\r\n }", "public Chauffeur() {\r\n\t}", "public ListParameter()\r\n\t{\r\n\t}", "public LiveRef(int paramInt) {\n/* 74 */ this(new ObjID(), paramInt);\n/* */ }", "public Contructor(int year, String name) {\n // constructor name must match class name and cannot have return type\n // all classes have constructor by default\n // f you do not create a class constructor yourself, Java creates one for you.\n // However, then you are not able to set initial values for object attributes.\n // constructor can also take parameters\n batchYear = year;\n studentName = name;\n }", "public Identity()\n {\n super( Fields.ARGS );\n }", "public Achterbahn() {\n }", "public TTau() {}", "public Complex() {\n this(0);\n }", "public ctq(File paramFile, String paramString, oa paramoa, ckh paramckh)\r\n/* 22: */ {\r\n/* 23: 33 */ super(paramoa);\r\n/* 24: 34 */ this.i = paramFile;\r\n/* 25: 35 */ this.j = paramString;\r\n/* 26: 36 */ this.k = paramckh;\r\n/* 27: */ }", "public lo() {}", "public ZTest1() {\n this(\"z_test1\", null);\n }", "public ModuleParams()\n\t{\n\t}", "public Node(){\n this(9);\n }", "Constructor(int i,String n ,int x){ //taking three parameters which shows that it is constructor overloaded\r\n\t\t id = i; \r\n\t\t name = n; \r\n\t\t marks =x; \r\n\t\t }", "public UserParameter() {\n }", "public Pitonyak_09_02() {\r\n }", "public Person(String vorname, String nachname) {\n\n\t}", "public ahr(aqu paramaqu)\r\n/* 20: */ {\r\n/* 21: 34 */ super(paramaqu);\r\n/* 22: 35 */ a(0.25F, 0.25F);\r\n/* 23: */ }", "public Alojamiento() {\r\n\t}", "public ListElement()\n\t{\n\t\tthis(null, null, null); //invokes constructor with 3 arguments\n\t}", "public Individual()\r\n\t{\r\n\t}", "public Classe() {\r\n }", "public Rol() {}", "public Lanceur() {\n\t}", "public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }", "public Message(){\n this(\"Not Specified\",\"Not Specified\");\n }", "public PSRelation()\n {\n }", "public ArgList(Object arg1) {\n super(1);\n addElement(arg1);\n }", "public aed(World paramaqu)\r\n/* 9: */ {\r\n/* 10: 24 */ super(paramaqu);\r\n/* 11: */ }", "Param createParam();", "Param createParam();", "Param createParam();", "public Bicycle() {\n // You can also call another constructor:\n // this(1, 50, 5, \"Bontrager\");\n System.out.println(\"Bicycle.Bicycle- no arguments\");\n gear = 1;\n cadence = 50;\n speed = 5;\n name = \"Bontrager\";\n }", "public PotionEffect(int paramInt1, int paramInt2, int paramInt3)\r\n/* 21: */ {\r\n/* 22: 32 */ this(paramInt1, paramInt2, paramInt3, false, true);\r\n/* 23: */ }", "public Supercar() {\r\n\t\t\r\n\t}", "public Spec__1() {\n }", "public Sock( /*int n , int ar[]*/)\n{\n\t//this.n=n;\n\t//this.ar=ar;\n}", "public void testConstructor1() {\n XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n }", "public void Constructor(String name, Integer age) {\r\n this.name = name;\r\n this.age = age;\r\n }", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "public MyPoint1 (double x, double y) {}", "public Phl() {\n }", "public Basic() {}", "public Request(){\n\t\tthis(null, null, null);\n\t}", "public Chant(){}", "public Busca(){\n }", "public c(Object obj) {\n super(1);\n this.a = obj;\n }", "public Postoj() {}", "public MyClass1(String name) {\n\t\tsuper();\n\t\tthis.name = name;\n\t}", "public LifeComponent() {\n // call other constructor with null param\n this(null);\n }", "private GrupoCuenta(String nombre, int operacion)\r\n/* 11: */ {\r\n/* 12:31 */ this.nombre = nombre;\r\n/* 13:32 */ this.operacion = operacion;\r\n/* 14: */ }", "public Person() {\n\t\t\n\t}", "public Member() {}", "public Field(){\n\n // this(\"\",\"\",\"\",\"\",\"\");\n }", "Rectangle()\n {\n this(1.0,1.0);\n }", "public Demo3() {}", "public Person(String inName)\n {\n name = inName;\n }", "public JsonFactory() { this(null); }", "public LiveRef(ObjID paramObjID, int paramInt) {\n/* 93 */ this(paramObjID, TCPEndpoint.getLocalEndpoint(paramInt), true);\n/* */ }", "public Plato(){\n\t\t\n\t}", "private Parameter(int key, String name, String value){\n this.key = key;\n this.name = name;\n this.value = value;\n }", "public static void main(String[] args) {\n My obj2=new My(9);//--->called overloaded Constructor\n }", "private Font(long paramLong, Object paramObject) {\n/* 1031 */ this.a = paramLong;\n/* 1032 */ this.b = paramObject;\n/* */ }", "public Self__1() {\n }" ]
[ "0.7162059", "0.7107145", "0.67049795", "0.6667298", "0.6629703", "0.6563407", "0.6556004", "0.65439355", "0.65434146", "0.654272", "0.65323627", "0.6527024", "0.6521265", "0.6507124", "0.6492242", "0.6492124", "0.64867884", "0.64830494", "0.64561105", "0.6426002", "0.64122856", "0.64058316", "0.63966805", "0.6390774", "0.6384914", "0.6372782", "0.6361178", "0.63380396", "0.6330537", "0.63252026", "0.63250446", "0.6323216", "0.6322911", "0.6316638", "0.6310255", "0.6295966", "0.6292961", "0.6290609", "0.62871957", "0.6269579", "0.62564164", "0.6245539", "0.6243229", "0.6234547", "0.62291026", "0.6225106", "0.6222517", "0.6207553", "0.6206272", "0.6196709", "0.6195718", "0.61937886", "0.61728126", "0.6161685", "0.61583525", "0.61531425", "0.6151489", "0.61465144", "0.6143283", "0.6123905", "0.61199844", "0.6118504", "0.61180377", "0.6106053", "0.61041296", "0.6102755", "0.609988", "0.609988", "0.609988", "0.60995686", "0.6097042", "0.6081203", "0.60782564", "0.60753024", "0.60743093", "0.6073986", "0.6073712", "0.6071292", "0.6070936", "0.6067122", "0.60665417", "0.60659695", "0.60645145", "0.6060409", "0.6060333", "0.6058368", "0.6056957", "0.6053323", "0.6051964", "0.6051607", "0.6049462", "0.6045061", "0.6044579", "0.6044161", "0.60421765", "0.6040911", "0.60383034", "0.60381055", "0.6037574", "0.60338366", "0.6033827" ]
0.0
-1
Destructor for objects of class MyVM
protected void finalize() throws Throwable { // your code here this.si.getServerConnection().logout(); super.finalize(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cleanup() {\n try {\n resManager.stopVirtualNodes();\n } catch (Exception e) {\n logger.error(ITConstants.TS + \": \" + DEL_VM_ERR, e);\n }\n logger.info(\"Cleanup done\");\n }", "void destroyWithClearVisitorData();", "public void destruct() {\n\t\tif (super.getUsia() == 0) {\n\t\t\t// destructor Singa\n\t\t\tSystem.gc();\n\t\t\ttry {\n\n\t\t\t\tfinalize();\n\t\t\t} catch (Throwable throwable) {\n\t\t\t\tthrowable.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public final void cleanUp() {\n\t\tmgdmfunctions = null;\n\t\tmgdmlabels = null;\n\t\theap.finalize();\n\t\theap = null;\n\t\tSystem.gc();\n\t}", "@Override\n protected void onDestroy() {\n mObjectGraph = null;\n super.onDestroy();\n }", "@Override()\r\n protected void finalize() {\r\n destroy();\r\n }", "public void destructor() {\n \t \t \n \t \t int n = pimpl.pathcodearray.getLength();\n \t \t for (int i = 0; i < n; i++) Destroyable.delete( pimpl.pathcodearray.operator_square_bracket(i));\n \t \t Destroyable.delete( this.state);\n\n \t \t this.currentpath.unrefNoDelete(); // to match the ref() in the constructor\n \t \t \n \t \t Destroyable.delete(currentpath); // java port \t \t \n \t \t Destroyable.delete(pimpl); // java port\n \t }", "@Override\n public void destroy() {\n }", "public void destroy() {}", "public void destroy() {}", "public void destroy() {\n \t\n }", "public void destroyForAll() {\n super.destroyForAll();\n }", "public void destroy() {\n this.bfc.cleanUp();\n }", "@Override\r\n public void destroy() {\n }", "@Override\r\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "public void destroy();", "public void destroy();", "public void destroy();", "public void destroy();", "public void destroy();", "public void destroy();", "public void destroy();", "public void destroy();", "@Override\r\n\tpublic void vmTerminated(VM vm) {\n\t\t\r\n\t}", "@Override\r\n\t\tpublic void destroy() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tSystem.gc();\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "public void destroy() {\r\n }", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "public void destructor()\n//\n////////////////////////////////////////////////////////////////////////\n{\n // Free up path\n path.unref();\n\n // The SoDetailList destructor deletes all details in the list, so\n // we don't have to do it here\n}", "@Override\n protected void onDestroy() {\n super.onDestroy();\n flightViewModel.reset();\n }", "@Override\r\n\tpublic void destroy()\r\n\t{\n\t\t\r\n\t}", "@Override\t\n\tpublic void destroy() {\n\t\t\n\t}", "public static void destruct() {\n\t\tinstance = null;\n\t}", "public void destroy() {\n destroyIn(0);\n }", "@Override\r\n\tpublic void destroy() {\n\t}", "synchronized public void destroy() {\n \t\tsuper.destroy();\n \t\tp = null;\n \t\tp_layer = null;\n \t}", "default void destroy() {}", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "public void finalize() {\n delete();\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n this.deleteObservers();\n timer.stop();\n }", "@Override\n\tpublic void destroy() {\n\t\t// Do nothing\n\t}", "public void destroy() {\n this.octaveExec.destroy();\n }", "public void finalize() {\r\n\r\n mask = null;\r\n newMask = null;\r\n newShortMask = null;\r\n System.gc();\r\n }", "public void vide_Objet_en_memoire(){\n\t\t\n\t\tfor (int i =0; i < this.objets_instanciated.size(); i++)\n\t\t\t\tthis.objets_instanciated.elementAt(i).clear();\n\t\n\t\t\tthis.nombre_objets = 0;\n\t\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}" ]
[ "0.7119121", "0.68975234", "0.65350753", "0.63792914", "0.6311796", "0.6282837", "0.6259797", "0.62440515", "0.61907613", "0.61907613", "0.61802995", "0.61696875", "0.61578166", "0.61412394", "0.61412394", "0.6135392", "0.6135392", "0.6135392", "0.6135392", "0.6135392", "0.61137563", "0.61137563", "0.61137563", "0.61137563", "0.61137563", "0.61137563", "0.61137563", "0.61137563", "0.61073697", "0.6105983", "0.6102398", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6101285", "0.6086662", "0.60768527", "0.60768527", "0.60768527", "0.60668176", "0.60603744", "0.6058093", "0.60476923", "0.60449517", "0.60390925", "0.60345167", "0.60340863", "0.6032017", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.602708", "0.6025464", "0.60253894", "0.6009786", "0.6009786", "0.6009786", "0.6009786", "0.6009786", "0.6009786", "0.6009786", "0.6009786", "0.6009786", "0.6009786", "0.6009786", "0.6006054", "0.60028446", "0.5989757", "0.5985566", "0.598486", "0.59836733", "0.59836733", "0.59836733", "0.59836733", "0.59836733", "0.59836733", "0.59836733", "0.59836733", "0.59836733" ]
0.0
-1
Power On the Virtual Machine
public void powerOn() { try { // your code here System.out.println("Powering on virtual machine '"+vm.getName() +"'. Please wait..."); Task t=vm.powerOnVM_Task(null); if(t.waitForTask()== Task.SUCCESS) { System.out.println("Virtual machine powered on."); System.out.println("===================================="); } else System.out.println("Power on failed / VM already powered on..."); } catch ( Exception e ) { System.out.println( e.toString() ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void powerOnVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tString status;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\tTask startupVmTask = null;\r\n\t\ttry {\r\n\t\t\tstartupVmTask = virtualMachine.powerOnVM_Task(null);\r\n\t\t\tSystem.out.print(\"Power on VM: status = \");\r\n\t\t\tstatus = startupVmTask.waitForTask();\r\n\t\t\tif(status.equals(\"error\")){\r\n\t\t\t\tstatus = startupVmTask.getTaskInfo().getError().getLocalizedMessage();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(status+\", completion time = \"+formatCompletionTime(startupVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t} catch (RemoteException e) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(e.getLocalizedMessage()\r\n\t\t\t\t\t\t+ \", completion time : \"+formatCompletionTime(startupVmTask.getTaskInfo().getCompleteTime().getTimeInMillis())+\"\\n\");\r\n\t\t\t} catch (RemoteException e1){\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"ig tv power on\");\r\n\t}", "@Override\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"samsongTV powerOn\");\n\n\t}", "public void powerOff() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Powering off virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.powerOffVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine powered off.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Power off failed / VM already powered on...\");\n \t\n } catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n }", "public void power()\r\n {\r\n powerOn = true;\r\n }", "void powerOn();", "public void turnOn(){\n Logger.getGlobal().log(Level.INFO,\" Turning On..\");\n vendingMachine = new VendingMachine();\n inventoryPopulation();\n idle();\n }", "public void powerOffAllVms() throws Exception\n {\n VirtualMachine ivm = null;\n ivm = new VirtualMachine(connectAnchor);\n Vector<ManagedObjectReference> vmMors = ivm.getAllVM();\n if (vmMors != null && vmMors.size() > 0) {\n for (ManagedObjectReference vmMor : vmMors) {\n if (ivm.getVMState(vmMor) == VirtualMachinePowerState.POWERED_ON) {\n ivm.powerOffVM(vmMor);\n }\n }\n }\n }", "public void power() {\r\n\t\tpowerOn = !powerOn;\r\n\t}", "@Override\n\tpublic void powerUp(int PowerId) {\n\n\t}", "@Override\r\n\tpublic void powerOff() {\n\r\n\t\tSystem.out.println(\"ig tv power off\");\r\n\r\n\t}", "@Override\r\n\tpublic void power() {\n\t\tSystem.out.println(\"Power off\");\r\n\t\t\r\n\t}", "public void powerOffVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tString status;\r\n\t\tTask powerOffVmTask = null;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\ttry {\r\n\t\t\tpowerOffVmTask = virtualMachine.powerOffVM_Task();\r\n\t\t\tstatus = powerOffVmTask.waitForTask();\r\n\t\t\tSystem.out.print(\"Power off VM: status = \");\r\n\t\t\tif(status.equals(\"error\")){\r\n\t\t\t\tstatus = powerOffVmTask.getTaskInfo().getError().getLocalizedMessage();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(status+\", completion time = \"+formatCompletionTime(powerOffVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t} catch (RemoteException e) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(e.getLocalizedMessage()\r\n\t\t\t\t\t\t+\",completion time : \"+formatCompletionTime(powerOffVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t\t} catch (RemoteException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\r\n\t}", "public abstract void PowerOn();", "@Override\r\n public void start() {\r\n runtime.reset();\r\n FL.setPower(1);\r\n FR.setPower(1);\r\n BR.setPower(1);\r\n BL.setPower(1);\r\n try{\r\n Thread.sleep(850);\r\n }\r\n catch (Exception e) {\r\n \r\n }\r\n FL.setPower(0);\r\n FR.setPower(0);\r\n BL.setPower(0);\r\n BR.setPower(0); \r\n }", "public void turnOn ()\n\t{\n\t\tthis.powerState = true;\n\t}", "public void start() {\n System.out.println(\"Machine started.\");\n }", "void start(String resourceGroupName, String virtualMachineName);", "@Override\r\n\tpublic void onMachine() {\n System.out.println(\"Please On the machine to cook \");\r\n grillmachine.setState(grillmachine.getOnState());\r\n\t}", "@Override\n\tpublic void powerOff() {\n\t\tSystem.out.println(\"samsongTV powerOff\");\n\n\t}", "void restart(String resourceGroupName, String virtualMachineName);", "void start(String resourceGroupName, String virtualMachineName, Context context);", "public void activatePowerup(Powerup p)\r\n\t{\r\n\t\thasPowerup = true;\r\n\t\tcurrentPowerup = p;\r\n\t}", "public void powerdown() {\n monitor.sendPowerdown();\n }", "@Override\n public void start() {\n robot.shooterPower(1);\n runtime.reset();\n }", "public synchronized void power_on_reset()\n {\n // Flush data memory\n for(int i=0;i<=DATA_MEMORY_SIZE;i++)\n this.setDataMemory(i,0x00);\n\n mPC = 0;\n mMBR = mMBR2 = 0;\n for(int i=0;i<=PROGRAM_MEMORY_SIZE;i++) \n this.setProgramMemory(i,0xFFFF);\n // Power on reset sets the PORF bit of the MCUSR\n try { set_ioreg(MCUSR,get_ioreg(MCUSR) | 0x01); }\n catch (RuntimeException e) { }\n mClockCycles = 0;\n mSleeping = false;\n }", "@Override\n public void powerOn() {\n if(isOn)System.out.println(\"The Projector is already ON!\");\n else{\n System.out.println(\"The Projector is now ON!\");\n isOn = true;\n }\n }", "void restart(String resourceGroupName, String virtualMachineName, Context context);", "public void turnOnCooler() {\n oilPompController.turnPompsOn();\n breakController.turnOff();\n mainPowerController.turnOn();\n supportPowerController.turnOn();\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n System.out.println(\"Waiting to stand up was interrupted.\");\n }\n supportPowerController.turnOff();\n System.out.println(\"System is running.\");\n }", "public abstract void execute(VirtualMachine vm);", "private boolean startVirtualMachine(String instanceId) throws Exception {\n try {\n CloudStackUserVm resp = getApi().startVirtualMachine(instanceId);\n if (logger.isDebugEnabled())\n logger.debug(\"Starting VM \" + instanceId);\n return resp != null;\n } catch (Exception e) {\n logger.error(\"StartVirtualMachine - \", e);\n throw new Exception(e.getMessage() != null ? e.getMessage() : e.toString());\n }\n }", "public void switchOn() throws RemoteHomeConnectionException {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"o\");\n setCurrentState(true);\n }", "public void start() {\n\t\t// Used to keep track of if we're still attached to the VM.\n\t\tScheduledFuture<?> future = null;\n\t\ttry {\n\t\t\t// Start redirecting process output\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tInputStream pOutput = vm.process().getInputStream();\n\t\t\tInputStream pErr = vm.process().getErrorStream();\n\t\t\tfuture = ThreadUtil.runRepeated(PRINT_THREAD_DELAY, () -> {\n\t\t\t\ttry {\n\t\t\t\t\t// Handle receiving output\n\t\t\t\t\tif (out != null) {\n\t\t\t\t\t\tint size = pOutput.available();\n\t\t\t\t\t\tif (size > 0) {\n\t\t\t\t\t\t\tint n = pOutput.read(buffer, 0, Math.min(size, buffer.length));\n\t\t\t\t\t\t\tout.println(new String(buffer, 0, n));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize = pErr.available();\n\t\t\t\t\t\tif (size > 0) {\n\t\t\t\t\t\t\tint n = pErr.read(buffer, 0, Math.min(size, buffer.length));\n\t\t\t\t\t\t\tout.println(new String(buffer, 0, n));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch(IOException ex) {\n\t\t\t\t\terror(ex, \"Exception occurred while processing VM IPC\");\n\t\t\t\t}\n\t\t\t});\n\t\t\t// Handle vm events\n\t\t\teventLoop();\n\t\t} catch(VMDisconnectedException ex) {\n\t\t\t// Expected\n\t\t} catch(InterruptedException ex) {\n\t\t\terror(ex, \"Failed processing VM event queue\");\n\t\t}\n\t\tif (future != null)\n\t\t\tfuture.cancel(true);\n\t}", "public void helloVM()\n {\n \ttry {\n\n\t\t\t\n\t\t\tVirtualMachineConfigInfo vminfo = vm.getConfig();\n\t\t\tVirtualMachineCapability vmc = vm.getCapability();\n\t\t\tVirtualMachineRuntimeInfo vmri = vm.getRuntime();\n\t\t\tVirtualMachineSummary vmsum = vm.getSummary();\n\n\t\t\t\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"VM Information : \");\n\t\t\t\n\t\t\tSystem.out.println(\"VM Name: \" + vminfo.getName());\n\t\t\tSystem.out.println(\"VM OS: \" + vminfo.getGuestFullName());\n\t\t\tSystem.out.println(\"VM ID: \" + vminfo.getGuestId());\n\t\t\tSystem.out.println(\"VM Guest IP Address is \" +vm.getGuest().getIpAddress());\n\t\t\t\n\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"Resource Pool Informtion : \");\n\t\t\t\n\t\t\tSystem.out.println(\"Resource pool: \" +vm.getResourcePool());\n\t\t\t\n\t\t\tSystem.out.println(\"VM Parent: \" +vm.getParent());\n\t\t\t//System.out.println(\"VM Values: \" +vm.getValues());\n\t\t\tSystem.out.println(\"Multiple snapshot supported: \"\t+ vmc.isMultipleSnapshotsSupported());\n\t\t\tSystem.out.println(\"Powered Off snapshot supported: \"+vmc.isPoweredOffSnapshotsSupported());\n\t\t\tSystem.out.println(\"Connection State: \" + vmri.getConnectionState());\n\t\t\tSystem.out.println(\"Power State: \" + vmri.getPowerState());\n\t\t\t\n\n\t\t\t//CPU Statistics\n\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"CPU and Memory Statistics\" );\n\t\t\t\n\t\t\tSystem.out.println(\"CPU Usage: \" +vmsum.getQuickStats().getOverallCpuUsage());\n\t\t\tSystem.out.println(\"Max CPU Usage: \" + vmri.getMaxCpuUsage());\n\t\t\tSystem.out.println(\"Memory Usage: \"+vmsum.getQuickStats().getGuestMemoryUsage());\n\t\t\tSystem.out.println(\"Max Memory Usage: \" + vmri.getMaxMemoryUsage());\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\n\t\t} catch (InvalidProperty e) {\n\t\t\te.printStackTrace();\n\t\t} catch (RuntimeFault e) {\n\t\t\te.printStackTrace();\n\t\t} catch (RemoteException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "private void setScreenProperty(boolean on) throws DeviceNotAvailableException {\n CLog.d(\"set svc power stay on \" + on);\n mTestDevice.executeShellCommand(\"svc power stayon \" + on);\n }", "private void psvm() {\n\t\tSystem.out.println(\"test\");\r\n\t}", "public boolean startVBClone() {\n\n String out = RapidUtils\n .executeCommand(\"/usr/local/bin/VBoxManage startvm \" + this.name + \" --type headless\");\n\n if (out.contains(\"has been successfully started.\")) {\n return true;\n }\n\n return false;\n }", "public void goToSleep() {\n mPowerManager.goToSleep(SystemClock.uptimeMillis());\n }", "public static JSqResult sq_suspendvm(JSqVM v) {\r\n\t\treturn new JSqResult(sq_suspendvm_native(v.m_nativeHandle));\r\n\t}", "public MyVM(String virtual_machine_name)\n {\n \ttry\n \t{\n \t\tthis.vmname= virtual_machine_name;\n \t\tthis.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()),\n\t\t\t\t\tSJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true);\n \t\t\n \t\tthis.folder = si.getRootFolder();\n \t\tthis.vm=(VirtualMachine) new InventoryNavigator(folder).searchManagedEntity(\"VirtualMachine\",\n \t\t\t\tthis.vmname);\n \t\tSystem.out.println(\"MyVM, vm value : \"+vm);\n \t\t\n \t\tthis.hs= (HostSystem) new InventoryNavigator(folder).searchManagedEntity(\"HostSystem\", \"130.65.132.194\");\n \t\tSystem.out.println(\"MyVM, HS value : \"+hs);\n \t\tthis.snapshotname=\"snap2\";\n \t\t\n \t}\n \tcatch(Exception e)\n \t{\n \t\tSystem.out.println(e.toString());\n \t}\n }", "public void setPowerUp(object_type powerUp) {\n this.powerUp = powerUp;\n }", "public ModifyVirtualMachine(){\r\n\t\t super(COMMAND);\r\n\t}", "void systemBoot();", "@Override\n public void activate(boolean status) {\n godPower.activate(status);\n }", "@Override\n public void start() {\n runtime.reset();\n arm.setPower(0);\n }", "public void sendPowerUpdate()\n\t{\n\t\tif (!this.worldObj.isRemote)\n\t\t{\n\t\t\tPacketHandler.sendPacketToClients(ResonantInduction.PACKET_TILE.getPacket(this, SimplePacketTypes.RUNNING.name, this, this.functioning), worldObj, new Vector3(this), 64);\n\t\t}\n\t}", "public boolean doPowerUpStuff() {\n System.out.println(\"* Performing robot stuff that we would do on power up.\");\n // Home motors, move stuff to starting position, etc.\n // System.out.println(\"Robot wheelbase in inches: \" + m_robotGeometry.wheelbaseInches);\n return true;\n }", "void start(String resourceGroupName, String referer, String virtualMachineName);", "VM createVM();", "@Override\n public void run() {\n startVMS(mStrVMID, mParams);\n }", "private NotifySuspendedCommandControllerPowerState() {\n\n\t}", "public void start() {\r\n vcr().start();\t\r\n }", "public void switchOn();", "public static void main(String[] args){\n\t\tXenVM vm22 = new XenVM(\"vm22\", \"172.16.1.22\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm31 = new XenVM(\"vm31\", \"172.16.1.31\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm31 = new XenVM(\"vm31\", \"172.16.1.31\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm21 = new XenVM(\"vm21\", \"172.16.1.21\", 22, \"root\", \"welcome\");\n\t\t//StartApp s11 = new StartApp(vm11);\n\t\tStartApp s22 = new StartApp(vm22);\n\t\t//StartApp s31 = new StartApp(vm31);\n\t\t//StartApp s31 = new StartApp(vm31);\n\t\t//StartApp s21 = new StartApp(vm21);\n\t\t//s11.start();\n\t\ts22.start();\n\t\t//s31.start();\n\t\t//s11.join();\n\t\t//s12.join();\n\t\t//s31.join();\n\t\t//s21.start();\n\t\ts22.join();\n\t}", "@Override\r\n\tpublic void volume() {\n\t\tSystem.out.println(\"Turn up\");\r\n\t\t\r\n\t}", "public boolean togglePower() {\r\n if(power) {\r\n pioneerclient.sendCommand(\"PF\");\r\n return false;\r\n } else {\r\n pioneerclient.sendCommand(\"PO\");\r\n return true;\r\n }\r\n\t}", "public void switchOnWhenAppliedPower(boolean onWhenPower) throws RemoteHomeConnectionException {\n if (onWhenPower) {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"co\");\n } else {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"cf\");\n }\n setOnWhenAppliedPower(onWhenPower);\n }", "public static native void startAutoSwitch();", "public void powerOn() { //power_on\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.ON));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.ON) {\n isTurningOn = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }", "public void reboot() {\n writeData(ESC.CMD_CONTROL_REBOOT);\n }", "public void start() {\n rfMotor.setPower(1);\n rrMotor.setPower(1);\n lfMotor.setPower(1);\n lrMotor.setPower(1);\n }", "public void reset() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Resetting virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.resetVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine reset.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Reset failed...\");\n } \n catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n }", "@Override \n public void runOpMode() \n {\n leftMotors = hardwareMap.get(DcMotor.class, \"left_Motors\");\n rightMotors = hardwareMap.get(DcMotor.class, \"right_Motors\");\n vLiftMotor = hardwareMap.get(DcMotor.class, \"vLift_Motor\"); \n \n leftMotors.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n rightMotors.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftMotors.setDirection(DcMotor.Direction.REVERSE);\n rightMotors.setDirection(DcMotor.Direction.FORWARD);\n vLiftMotor.setDirection(DcMotor.Direction.REVERSE);\n vLiftMotor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n \n waitForStart(); //press play button, actives opMode\n intakePivotServo.setPosition(intakePivotServoPos);\n while (opModeIsActive()) \n { \n drive();\n pivotIntake();\n pivotLift();\n \n }//opModeIsActive \n \n }", "void sitOn();", "void start(String resourceGroupName, String referer, String virtualMachineName, Context context);", "public void powerOn() \n\t{\n\t\t//put active to true\n\t\tactive = true;\n\t\t\n\t\t// Set attached lever\n\t\tif (FactoryModPlugin.LEVER_OUTPUT_ENABLED) {\n\t\t\tsetActivationLever(true);\n\t\t}\n\t\t\n\t\t//lots of code to make the furnace light up, without loosing contents.\n\t\tFurnace furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState();\n\t\tbyte data = furnace.getData().getData();\n\t\tItemStack[] oldContents = furnace.getInventory().getContents();\n\t\tfurnace.getInventory().clear();\n\t\tfactoryPowerSourceLocation.getBlock().setType(Material.BURNING_FURNACE);\n\t\tfurnace = (Furnace) factoryPowerSourceLocation.getBlock().getState();\n\t\tfurnace.setRawData(data);\n\t\tfurnace.update();\n\t\tfurnace.getInventory().setContents(oldContents);\n\t\t//reset the production timer\n\t\tcurrentProductionTimer = 0;\n\t}", "public void setPowerup(Powerup p)\n\t{\n\t\titsPowerup = p;\n\t}", "protected void execute() {\n\t\tshooter.runShooter(power);\n\t}", "public void run(){\n\n Thread t;\n try {\n t = new Thread(command);\n t.start();\n if (DEBUG) System.out.println(\"Virtual Machine: \" + command_file + \" started\");\n exit_state = command.getExitStatus();\n } catch (Exception e){\n e.printStackTrace();\n System.out.println(\"error executing \" + command_file + \": \" + e.toString());\n exit_state = false;\n }\n\n\n }", "public void askForPowerUpAsAmmo() {\n mainPage.setRemoteController(senderRemoteController);\n mainPage.setMatch(match);\n if (!mainPage.isPowerUpAsAmmoActive()) { //check if there is a PowerUpAsAmmo already active\n Platform.runLater(\n () -> {\n try {\n mainPage.askForPowerUpAsAmmo();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }\n\n }", "public void changePowerUp(boolean powerUpQuestion)\n {\n this.currentState = ClientStateName.POWERUP;\n setChanged();\n notifyObservers(currentState);\n }", "@Override\r\n\tpublic void offMachine() {\n\t\t System.out.println(\"Off the machine when the cook is done \");\r\n\t}", "@Override\n public void onMachineActivated()\n {\n \n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tmp.start();\n\t}", "public boolean resumeVBClone() {\n RapidUtils.executeCommand(\"/usr/local/bin/VBoxManage controlvm \" + this.name + \" resume\");\n\n switch (getTheStateOfPhysicalMachine()) {\n case STOPPED:\n return false;\n case PAUSED:\n return false;\n case RESUMED:\n return true;\n\n default:\n break;\n }\n\n return false;\n }", "@Override\n public void start() {\n smDrive.start();\n smArm.start();\n }", "@Override\n public void suspend_execute(final SuspendMethod method) {\n String _hostname = this.compute.getHostname();\n String _plus = (\"EXECUTE COMMAND: machine suspend \" + _hostname);\n InputOutput.<String>println(_plus);\n }", "public void shutDownVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tboolean isShutdownComplete = false;\r\n\t\tlong startTime;\r\n\t\tlong completionTime = 0;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\ttry {\r\n\t\t\tvirtualMachine.shutdownGuest();\r\n\t\t\tstartTime = System.currentTimeMillis();\r\n\r\n\t\t\t/**\r\n\t\t\t * Extra credit part\r\n\t\t\t */\r\n\t\t\t//Poll the machine status in each loop to get the status.\r\n\t\t\twhile(!isTimeUp(startTime)){\r\n\t\t\t\t//Check the machine status.\r\n\t\t\t\tif(VirtualMachinePowerState.poweredOff.equals(virtualMachine.getRuntime().getPowerState())){\r\n\t\t\t\t\tisShutdownComplete = true;\r\n\t\t\t\t\tcompletionTime = System.currentTimeMillis();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!isShutdownComplete){\r\n\t\t\t\tthrow new RemoteException();\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Shutdown guest: completed, completion time = \"+formatCompletionTime(completionTime));\r\n\t\t\t}\r\n\t\t} catch (RemoteException e) {\r\n\t\t\t//Shutdown operation is not complete. Force shutdown.\r\n\t\t\tSystem.out.print(\"Graceful shutdown failed. Now try a hard power off.\\nPower off VM: status: \");\r\n\t\t\tTask forcePowerOffTask;\r\n\t\t\ttry {\r\n\t\t\t\tforcePowerOffTask = virtualMachine.powerOffVM_Task();\r\n\t\t\t\tString forceShutdownStatus = forcePowerOffTask.waitForTask();\r\n\t\t\t\tSystem.out.println(forceShutdownStatus+\" completion time = \"+formatCompletionTime(completionTime));\r\n\t\t\t} catch (RemoteException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "public interface VirtualMachines {\n /**\n * The operation to assess patches on a vSphere VMware machine identity in Azure.\n *\n * @param resourceGroupName The name of the resource group.\n * @param name The name of the vSphere VMware machine.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return describes the properties of an AssessPatches result.\n */\n VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name);\n\n /**\n * The operation to assess patches on a vSphere VMware machine identity in Azure.\n *\n * @param resourceGroupName The name of the resource group.\n * @param name The name of the vSphere VMware machine.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return describes the properties of an AssessPatches result.\n */\n VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name, Context context);\n\n /**\n * The operation to install patches on a vSphere VMware machine identity in Azure.\n *\n * @param resourceGroupName The name of the resource group.\n * @param name The name of the vSphere VMware machine.\n * @param installPatchesInput Input for InstallPatches as directly received by the API.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the result summary of an installation operation.\n */\n VirtualMachineInstallPatchesResult installPatches(\n String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput);\n\n /**\n * The operation to install patches on a vSphere VMware machine identity in Azure.\n *\n * @param resourceGroupName The name of the resource group.\n * @param name The name of the vSphere VMware machine.\n * @param installPatchesInput Input for InstallPatches as directly received by the API.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the result summary of an installation operation.\n */\n VirtualMachineInstallPatchesResult installPatches(\n String resourceGroupName,\n String name,\n VirtualMachineInstallPatchesParameters installPatchesInput,\n Context context);\n\n /**\n * Gets a virtual machine.\n *\n * <p>Implements virtual machine GET method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return define the virtualMachine.\n */\n VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName);\n\n /**\n * Gets a virtual machine.\n *\n * <p>Implements virtual machine GET method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return define the virtualMachine along with {@link Response}.\n */\n Response<VirtualMachine> getByResourceGroupWithResponse(\n String resourceGroupName, String virtualMachineName, Context context);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param force Whether force delete was specified.\n * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void delete(String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void delete(String resourceGroupName, String virtualMachineName);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param force Whether force delete was specified.\n * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void delete(String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain, Context context);\n\n /**\n * Implements the operation to stop a virtual machine.\n *\n * <p>Stop virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param body Virtualmachine stop action payload.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body);\n\n /**\n * Implements the operation to stop a virtual machine.\n *\n * <p>Stop virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void stop(String resourceGroupName, String virtualMachineName);\n\n /**\n * Implements the operation to stop a virtual machine.\n *\n * <p>Stop virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param body Virtualmachine stop action payload.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context);\n\n /**\n * Implements the operation to start a virtual machine.\n *\n * <p>Start virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void start(String resourceGroupName, String virtualMachineName);\n\n /**\n * Implements the operation to start a virtual machine.\n *\n * <p>Start virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void start(String resourceGroupName, String virtualMachineName, Context context);\n\n /**\n * Implements the operation to restart a virtual machine.\n *\n * <p>Restart virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void restart(String resourceGroupName, String virtualMachineName);\n\n /**\n * Implements the operation to restart a virtual machine.\n *\n * <p>Restart virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void restart(String resourceGroupName, String virtualMachineName, Context context);\n\n /**\n * Implements GET virtualMachines in a subscription.\n *\n * <p>List of virtualMachines in a subscription.\n *\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return list of VirtualMachines as paginated response with {@link PagedIterable}.\n */\n PagedIterable<VirtualMachine> list();\n\n /**\n * Implements GET virtualMachines in a subscription.\n *\n * <p>List of virtualMachines in a subscription.\n *\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return list of VirtualMachines as paginated response with {@link PagedIterable}.\n */\n PagedIterable<VirtualMachine> list(Context context);\n\n /**\n * Implements GET virtualMachines in a resource group.\n *\n * <p>List of virtualMachines in a resource group.\n *\n * @param resourceGroupName The Resource Group Name.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return list of VirtualMachines as paginated response with {@link PagedIterable}.\n */\n PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName);\n\n /**\n * Implements GET virtualMachines in a resource group.\n *\n * <p>List of virtualMachines in a resource group.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return list of VirtualMachines as paginated response with {@link PagedIterable}.\n */\n PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName, Context context);\n\n /**\n * Gets a virtual machine.\n *\n * <p>Implements virtual machine GET method.\n *\n * @param id the resource ID.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return define the virtualMachine along with {@link Response}.\n */\n VirtualMachine getById(String id);\n\n /**\n * Gets a virtual machine.\n *\n * <p>Implements virtual machine GET method.\n *\n * @param id the resource ID.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return define the virtualMachine along with {@link Response}.\n */\n Response<VirtualMachine> getByIdWithResponse(String id, Context context);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param id the resource ID.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void deleteById(String id);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param id the resource ID.\n * @param force Whether force delete was specified.\n * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void deleteByIdWithResponse(String id, Boolean force, Boolean retain, Context context);\n\n /**\n * Begins definition for a new VirtualMachine resource.\n *\n * @param name resource name.\n * @return the first stage of the new VirtualMachine definition.\n */\n VirtualMachine.DefinitionStages.Blank define(String name);\n}", "public void begin(){\r\n\t\t\ttry {\r\n\t\t\t\twhile( !superpower )\r\n\t\t\t\t\tThread.sleep( 10 );\r\n\t\t\t}\r\n\t\t\tcatch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}", "public PowerUpASICCommand()\n\t{\n\t\tsuper();\n\t\tcommandString = new String(\"POWERUPASIC\");\n\t}", "public void bridge$lambda$0$KswMcuListener() {\n SystemProperties.set(\"sys.powerctl\", \"shutdown\");\n }", "public void startPVs() {\n //the pv should be started at the last minute\n for(String pvPropId : pvMap.keySet()){\n IPV pv = pvMap.get(pvPropId);\n try {\n pv.start();\n } catch (Exception e) {\n OPIBuilderPlugin.getLogger().log(Level.WARNING,\n \"Unable to connect to PV:\" + pv.getName(), e); //$NON-NLS-1$\n }\n }\n }", "public void setPower(boolean power){\n this.power = power;\n }", "public void start() {\n\t\tSystem.out.println(\"开启系统1\");\r\n\t}", "void setPowerBox(boolean powerBox);", "@Override\r\n\tpublic boolean powerOnOff() {\n\t\tif (power == true)\r\n\t\t{\r\n\t\t\tpower = false;\r\n\t\t}\r\n\t\telse if(power == false)\r\n\t\t{\r\n\t\t\tpower = true;\r\n\t\t}\r\n\t\treturn power;\r\n\t}", "public void activate() {\r\n\t\tif (state != MachineState.DOWN)\r\n\t\t\tthrow new IllegalStateException(\r\n\t\t\t\t\t\"Only a machine in state DOWN can be activated.\");\r\n\t\tassert curJob == null;\r\n\r\n\t\tstate = MachineState.IDLE;\r\n\t\tprocFinished = -1.0d;\r\n\t\tprocStarted = -1.0d;\r\n\r\n\t\tworkStation.activated(this);\r\n\r\n\t\tdownReason = null;\r\n\t}", "@Override\n public void restart_execute(final RestartMethod method) {\n String _hostname = this.compute.getHostname();\n String _plus = (\"EXECUTE COMMAND: machine restart \" + _hostname);\n InputOutput.<String>println(_plus);\n }", "public void manualControl(double power){\n leftMotor.set(power);\n rightMotor.set(power);\n }", "public void setPowerState(Map<String,PowerState> devicesPowerState) throws NotExistingEntityException, FailedOperationException, MethodNotImplementedException;", "VirtualMachineProfile virtualMachineProfile();", "public void enableKillSwitch(){\n isClimbing = false;\n isClimbingArmDown = false;\n Robot.isKillSwitchEnabled = true;\n }", "public void go() {\n try {\n go(pc);\n dp.refresh(pc, stackRegister, compareRegister);\n } catch (Exception e) {\n con.cPrintln(\"Error : \" + e.toString());\n } catch (Error e) {\n con.cPrintln(\"Error : \" + e.getMessage());\n }\n }", "@Override\n\tpublic void upgrade() {\n\t\tthis.power += 5;\n\t}", "public void washAndPark(Vehicle v) { \t\n \twash.washVehicle(v);\n \tparkVehicle(v);\n }", "boolean run(final double POWER)\n {\n boolean success = true; // Tells whether attempt to power lift is successful or not\n\n try\n {\n _motor.setPower(POWER);\n }\n catch(Exception e)\n {\n Log.e(\"Error\" , \"Cannot power lift, check your mapping\");\n success = false;\n }\n\n return success;\n }", "public void Power() {\n if (Estado == false){\r\n Estado = true;\r\n } else if (Estado == true){\r\n Estado = false;\r\n }\r\n }", "public boolean canRequestPower();", "public void start() {\n System.out.println(\"This vehicle starts\");\n }" ]
[ "0.7698023", "0.71723765", "0.69221616", "0.690357", "0.6575138", "0.65694773", "0.63068694", "0.6272768", "0.62666786", "0.622527", "0.6215877", "0.6214729", "0.61698985", "0.61639667", "0.6120324", "0.6112539", "0.5982004", "0.59781194", "0.5973714", "0.5943565", "0.58406454", "0.5804586", "0.57940775", "0.5788164", "0.57791764", "0.5770075", "0.5767818", "0.5759869", "0.5677092", "0.5645229", "0.5584594", "0.5581683", "0.55710274", "0.5558084", "0.5524456", "0.5518299", "0.551521", "0.549286", "0.5492159", "0.54825836", "0.5475048", "0.5460121", "0.54445183", "0.54356974", "0.5429019", "0.54153395", "0.54136384", "0.54082924", "0.53990793", "0.53935856", "0.53784835", "0.53781736", "0.5366048", "0.53576916", "0.5353766", "0.53468853", "0.5346838", "0.53438544", "0.5343303", "0.5338348", "0.5331931", "0.53202236", "0.5314304", "0.53078043", "0.5296027", "0.5289444", "0.52856743", "0.5262019", "0.524085", "0.52341884", "0.52043", "0.52003914", "0.5199394", "0.5196061", "0.5191557", "0.5189981", "0.51894814", "0.5187119", "0.5175617", "0.5170622", "0.51475245", "0.51427525", "0.51419455", "0.5131064", "0.5128425", "0.5127779", "0.51209164", "0.51048607", "0.50977856", "0.50964016", "0.5088916", "0.5086572", "0.5082241", "0.5081659", "0.5077332", "0.5053543", "0.50510013", "0.5048942", "0.5038631", "0.50374067" ]
0.84864235
0
Power Off the Virtual Machine
public void powerOff() { try { // your code here System.out.println("Powering off virtual machine '"+vm.getName() +"'. Please wait..."); Task t=vm.powerOffVM_Task(); if(t.waitForTask()== Task.SUCCESS) { System.out.println("Virtual machine powered off."); System.out.println("===================================="); } else System.out.println("Power off failed / VM already powered on..."); } catch ( Exception e ) { System.out.println( e.toString() ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void powerOffVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tString status;\r\n\t\tTask powerOffVmTask = null;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\ttry {\r\n\t\t\tpowerOffVmTask = virtualMachine.powerOffVM_Task();\r\n\t\t\tstatus = powerOffVmTask.waitForTask();\r\n\t\t\tSystem.out.print(\"Power off VM: status = \");\r\n\t\t\tif(status.equals(\"error\")){\r\n\t\t\t\tstatus = powerOffVmTask.getTaskInfo().getError().getLocalizedMessage();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(status+\", completion time = \"+formatCompletionTime(powerOffVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t} catch (RemoteException e) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(e.getLocalizedMessage()\r\n\t\t\t\t\t\t+\",completion time : \"+formatCompletionTime(powerOffVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t\t} catch (RemoteException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\r\n\t}", "@Override\r\n\tpublic void powerOff() {\n\r\n\t\tSystem.out.println(\"ig tv power off\");\r\n\r\n\t}", "public void powerOffAllVms() throws Exception\n {\n VirtualMachine ivm = null;\n ivm = new VirtualMachine(connectAnchor);\n Vector<ManagedObjectReference> vmMors = ivm.getAllVM();\n if (vmMors != null && vmMors.size() > 0) {\n for (ManagedObjectReference vmMor : vmMors) {\n if (ivm.getVMState(vmMor) == VirtualMachinePowerState.POWERED_ON) {\n ivm.powerOffVM(vmMor);\n }\n }\n }\n }", "@Override\n\tpublic void powerOff() {\n\t\tSystem.out.println(\"samsongTV powerOff\");\n\n\t}", "public void powerOn() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Powering on virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.powerOnVM_Task(null);\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine powered on.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Power on failed / VM already powered on...\");\n } \n catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ;\n }\n }", "@Override\r\n\tpublic void power() {\n\t\tSystem.out.println(\"Power off\");\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void offMachine() {\n\t\t System.out.println(\"Off the machine when the cook is done \");\r\n\t}", "public void powerdown() {\n monitor.sendPowerdown();\n }", "public void shutDownVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tboolean isShutdownComplete = false;\r\n\t\tlong startTime;\r\n\t\tlong completionTime = 0;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\ttry {\r\n\t\t\tvirtualMachine.shutdownGuest();\r\n\t\t\tstartTime = System.currentTimeMillis();\r\n\r\n\t\t\t/**\r\n\t\t\t * Extra credit part\r\n\t\t\t */\r\n\t\t\t//Poll the machine status in each loop to get the status.\r\n\t\t\twhile(!isTimeUp(startTime)){\r\n\t\t\t\t//Check the machine status.\r\n\t\t\t\tif(VirtualMachinePowerState.poweredOff.equals(virtualMachine.getRuntime().getPowerState())){\r\n\t\t\t\t\tisShutdownComplete = true;\r\n\t\t\t\t\tcompletionTime = System.currentTimeMillis();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!isShutdownComplete){\r\n\t\t\t\tthrow new RemoteException();\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Shutdown guest: completed, completion time = \"+formatCompletionTime(completionTime));\r\n\t\t\t}\r\n\t\t} catch (RemoteException e) {\r\n\t\t\t//Shutdown operation is not complete. Force shutdown.\r\n\t\t\tSystem.out.print(\"Graceful shutdown failed. Now try a hard power off.\\nPower off VM: status: \");\r\n\t\t\tTask forcePowerOffTask;\r\n\t\t\ttry {\r\n\t\t\t\tforcePowerOffTask = virtualMachine.powerOffVM_Task();\r\n\t\t\t\tString forceShutdownStatus = forcePowerOffTask.waitForTask();\r\n\t\t\t\tSystem.out.println(forceShutdownStatus+\" completion time = \"+formatCompletionTime(completionTime));\r\n\t\t\t} catch (RemoteException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "@ServiceMethod(returns = ReturnType.SINGLE)\n public void powerOff(\n String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) {\n powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).block();\n }", "public void powerOnVm(String vmName){\r\n\t\tVirtualMachine virtualMachine;\r\n\t\tString status;\r\n\t\ttry {\r\n\t\t\tvirtualMachine = searchVirtualMachine(vmName);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\tTask startupVmTask = null;\r\n\t\ttry {\r\n\t\t\tstartupVmTask = virtualMachine.powerOnVM_Task(null);\r\n\t\t\tSystem.out.print(\"Power on VM: status = \");\r\n\t\t\tstatus = startupVmTask.waitForTask();\r\n\t\t\tif(status.equals(\"error\")){\r\n\t\t\t\tstatus = startupVmTask.getTaskInfo().getError().getLocalizedMessage();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(status+\", completion time = \"+formatCompletionTime(startupVmTask.getTaskInfo().getCompleteTime().getTimeInMillis()));\r\n\t\t} catch (RemoteException e) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(e.getLocalizedMessage()\r\n\t\t\t\t\t\t+ \", completion time : \"+formatCompletionTime(startupVmTask.getTaskInfo().getCompleteTime().getTimeInMillis())+\"\\n\");\r\n\t\t\t} catch (RemoteException e1){\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void turnOff(){\n vendingMachine = null;\n Logger.getGlobal().log(Level.INFO,\" Turning Off...\");\n }", "@ServiceMethod(returns = ReturnType.SINGLE)\n public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) {\n powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block();\n }", "public void reset() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Resetting virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.resetVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine reset.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Reset failed...\");\n } \n catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n }", "@ServiceMethod(returns = ReturnType.SINGLE)\n public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) {\n final Boolean skipShutdown = null;\n powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block();\n }", "@Override\n\tpublic void stopMachine() {\n\t\t\n\t}", "public static void poweroff(NetSocket socket) {\n String data = \"CS01*868807049006736*0008*POWEROFF,20190814114414I4021\";\n String deviceId = \"868807049006736\";\n send(socket, data, deviceId);\n }", "public synchronized void power_on_reset()\n {\n // Flush data memory\n for(int i=0;i<=DATA_MEMORY_SIZE;i++)\n this.setDataMemory(i,0x00);\n\n mPC = 0;\n mMBR = mMBR2 = 0;\n for(int i=0;i<=PROGRAM_MEMORY_SIZE;i++) \n this.setProgramMemory(i,0xFFFF);\n // Power on reset sets the PORF bit of the MCUSR\n try { set_ioreg(MCUSR,get_ioreg(MCUSR) | 0x01); }\n catch (RuntimeException e) { }\n mClockCycles = 0;\n mSleeping = false;\n }", "protected void notAllowedToWork_stopMachine_EM() {\n stopMachine();\n }", "@Override\n\tpublic void powerUp(int PowerId) {\n\n\t}", "@Override\r\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"ig tv power on\");\r\n\t}", "public void power() {\r\n\t\tpowerOn = !powerOn;\r\n\t}", "void restart(String resourceGroupName, String virtualMachineName);", "public void bridge$lambda$0$KswMcuListener() {\n SystemProperties.set(\"sys.powerctl\", \"shutdown\");\n }", "void unsetPowerBox();", "void stop(\n String resourceGroupName,\n String referer,\n String virtualMachineName,\n StopMode mode,\n VirtualMachineStopMode m,\n Context context);", "@ServiceMethod(returns = ReturnType.SINGLE)\n private Mono<Void> powerOffAsync(\n String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) {\n return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context)\n .last()\n .flatMap(this.client::getLroFinalResultOrError);\n }", "void restart(String resourceGroupName, String virtualMachineName, Context context);", "public void power()\r\n {\r\n powerOn = true;\r\n }", "void stop(String resourceGroupName, String virtualMachineName);", "@Override\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"samsongTV powerOn\");\n\n\t}", "void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body);", "public void reboot() {\n writeData(ESC.CMD_CONTROL_REBOOT);\n }", "public void switchOff();", "public void deactivatePowerup()\r\n\t{\r\n\t\thasPowerup = false;\r\n\t\tcurrentPowerup = null;\r\n\t}", "@ServiceMethod(returns = ReturnType.SINGLE)\n private PollerFlux<PollResult<Void>, Void> beginPowerOffAsync(\n String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) {\n context = this.client.mergeContext(context);\n Mono<Response<Flux<ByteBuffer>>> mono =\n powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context);\n return this\n .client\n .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);\n }", "public void switchOff() throws RemoteHomeConnectionException {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"f\");\n setCurrentState(false);\n }", "void turnOff() {\n System.out.println(\"Turning off the TV\");\n }", "public void powerOff() { //power_off\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.OFF));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.OFF) {\n isTurningOff = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }", "void powerOn();", "void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context);", "public void rebootToRecoveryMode() {\n mPowerManager.reboot(\"recovery\");\n }", "public void stopRobot(){\n LAM.setPower(0);\n RAM.setPower(0);\n ILM.setPower(0);\n IRM.setPower(0);\n BLM.setPower(0);\n BRM.setPower(0);\n FLM.setPower(0);\n FRM.setPower(0);\n }", "private void halt() {\n robot.leftFront.setPower(0);\n robot.leftBack.setPower(0);\n robot.rightFront.setPower(0);\n robot.rightBack.setPower(0);\n }", "@Override\n\tprotected void onPause() {\n\t\tsuper.onPause();\n\t\t// setPowerOff();\n\t}", "public static void stopNetworkVirtualization(AppiumDriver driver) {\r\n\r\n\t\t\tHashMap<Object, Object> params = new HashMap<>();\r\n\r\n\t\t\tdriver.executeScript(\"mobile:vnetwork:stop\", params);\r\n\r\n\t\t}", "@ServiceMethod(returns = ReturnType.SINGLE)\n public Mono<Void> powerOffAsync(\n String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) {\n return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown)\n .last()\n .flatMap(this.client::getLroFinalResultOrError);\n }", "public void off() {\n\t\tSystem.out.println(\"Tuner is off\");\n\t}", "public static void switchScreenOff(Context ctx) {\n PowerManager pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);\n if (pm!= null && pm.isScreenOn()) {\n pm.goToSleep(SystemClock.uptimeMillis());\n }\n }", "public void powerOff() \n\t{\n\t\tif(active)\n\t\t{\n\t\t\tif (FactoryModPlugin.LEVER_OUTPUT_ENABLED) {\n\t\t\t\tsetActivationLever(false);\n\t\t\t}\n\t\t\t\n\t\t\t//lots of code to make the furnace turn off, without loosing contents.\n\t\t\tFurnace furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState();\n\t\t\tbyte data = furnace.getData().getData();\n\t\t\tItemStack[] oldContents = furnace.getInventory().getContents();\n\t\t\tfurnace.getInventory().clear();\n\t\t\tfactoryPowerSourceLocation.getBlock().setType(Material.FURNACE);\n\t\t\tfurnace = (Furnace) factoryPowerSourceLocation.getBlock().getState();\n\t\t\tfurnace.setRawData(data);\n\t\t\tfurnace.update();\n\t\t\tfurnace.getInventory().setContents(oldContents);\n\t\t\t\n\t\t\t//put active to false\n\t\t\tactive = false;\n\t\t\t//reset the production timer\n\t\t\tcurrentProductionTimer = 0;\n\t\t}\n\t}", "@ServiceMethod(returns = ReturnType.SINGLE)\n public SyncPoller<PollResult<Void>, Void> beginPowerOff(\n String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) {\n return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).getSyncPoller();\n }", "public static boolean ifPwrOffAlertset(VirtualMachine vm, AlarmManager am)throws IOException, InterruptedException{\n\t\t\tAlarm[] alarms = am.getAlarm(vm);\n\t\t\tboolean setAlarm = false;\n\t\t\tfor(Alarm alarm:alarms){\n\t\t\tif(alarm.getAlarmInfo().name.equals(\"Pwr_Off_vm \"+vm.getName())){setAlarm = true;}\n\t\t\t}\n\t\t\treturn setAlarm;\n\t\t}", "public abstract void PowerOn();", "public void servoOff() throws DeviceException {\n \t\ttry {\n \t\t\tcontroller.caput(svonChannel, 0, 2.0);\n \t\t} catch (Throwable e) {\n \t\t\tthrow new DeviceException(\"failed to turn servos on\", e);\n \t\t}\n \t}", "public void rebootToBootloader() {\n mPowerManager.reboot(\"bootloader\");\n }", "public void stop() {\n\t\tsetPower(Motor.STOP);\r\n\t}", "@Override\r\n public void start() {\r\n runtime.reset();\r\n FL.setPower(1);\r\n FR.setPower(1);\r\n BR.setPower(1);\r\n BL.setPower(1);\r\n try{\r\n Thread.sleep(850);\r\n }\r\n catch (Exception e) {\r\n \r\n }\r\n FL.setPower(0);\r\n FR.setPower(0);\r\n BL.setPower(0);\r\n BR.setPower(0); \r\n }", "public void off() {\n this.relay.set(Relay.Value.kOff);\n }", "public void halt();", "@ServiceMethod(returns = ReturnType.SINGLE)\n public PollerFlux<PollResult<Void>, Void> beginPowerOffAsync(\n String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) {\n Mono<Response<Flux<ByteBuffer>>> mono =\n powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown);\n return this\n .client\n .<Void, Void>getLroResult(\n mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());\n }", "public void setSwitchOff() throws UnavailableDeviceException, ClosedDeviceException, IOException {\n\t\tswitch1.setValue(true);\n\t\tthis.switchState = false; \n\t}", "@Override\n public void start() {\n robot.shooterPower(1);\n runtime.reset();\n }", "@Override\n\tpublic void volDown() {\n\n\t}", "@Override\n public void stop() {\n\n leftDrive.setPower(0);\n rightDrive.setPower(0);\n armMotor.setPower(0);\n // extendingArm.setPower(0);\n\n telemetry.addData(\"Status\", \"Terminated Interative TeleOp Mode\");\n telemetry.update();\n\n\n }", "@ServiceMethod(returns = ReturnType.SINGLE)\n public Mono<Void> powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) {\n final Boolean skipShutdown = null;\n return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown)\n .last()\n .flatMap(this.client::getLroFinalResultOrError);\n }", "@Override\n public void start() {\n runtime.reset();\n arm.setPower(0);\n }", "void driveStop() {\n flMotor.setPower(0);\n frMotor.setPower(0);\n blMotor.setPower(0);\n brMotor.setPower(0);\n }", "void systemBoot();", "public void setEngineOff();", "public void shutDown();", "@TestProperties(name = \"PnP procedure in NMS cold reboot IPV4 With SW Upgrade\", returnParam = {\n\t\t\t\"IsTestWasSuccessful\" }, paramsExclude = { \"IsTestWasSuccessful\" })\n\tpublic void PnPColdRebootIPV4WithSWUpgrade() throws Exception {\n\t\tisWarmReset = false;\n\t\tmainProcedure();\n\t\tpostTest();\n\t}", "@Override\n public void turnOff() {\n System.out.println(\"this wont happen\");\n }", "public void execute(Context context) {\n try{\n model.setDeviceStatus(context.getDevicePath(), context.getValue(), \"off\", false);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Could not shut off oven: \" + context.getDevicePath());\n }\n }", "private void setScreenProperty(boolean on) throws DeviceNotAvailableException {\n CLog.d(\"set svc power stay on \" + on);\n mTestDevice.executeShellCommand(\"svc power stayon \" + on);\n }", "@Override\n\tprotected void execute() {\n\t\tRobot.arm.armDown();\n\t}", "public ModifyVirtualMachine(){\r\n\t\t super(COMMAND);\r\n\t}", "@Override\r\n public void turnOff() {\r\n isOn = false;\r\n Reporter.report(this, Reporter.Msg.SWITCHING_OFF);\r\n if (this.engaged()) {\r\n disengageLoads();\r\n }\r\n }", "@ServiceMethod(returns = ReturnType.SINGLE)\n public SyncPoller<PollResult<Void>, Void> beginPowerOff(\n String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) {\n return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).getSyncPoller();\n }", "public void machineFlash() {\n\t\tmachineFlash = !machineFlash;\n\t}", "public void stop()\n {\n robot.FL_drive.setPower(0);\n robot.FR_drive.setPower(0);\n robot.BL_drive.setPower(0);\n robot.BR_drive.setPower(0);\n }", "private void stopDistributedSystem() {\n try {\n disconnectFromSystem();\n } catch (Exception e) {\n // disconnectFromSystem already prints any Exceptions\n } catch (VirtualMachineError err) {\n SystemFailure.initiateFailure(err);\n throw err;\n } catch (Error e) {\n // Whenever you catch Error or Throwable, you must also catch VirtualMachineError (see above).\n // However, there is _still_ a possibility that you are dealing with a cascading error\n // condition,\n // so you also need to check to see if the JVM is still usable:\n SystemFailure.checkFailure();\n }\n }", "@Override\n\tpublic void off() {\n\t\tSystem.out.println(\"turn off the \"+name+\" Light\");\n\t}", "public static void systemShutdown() throws IOException {\n\t\t/*Runtime runtime = Runtime.getRuntime();\n\t\tProcess proc = runtime.exec(\"shutdown -l -t 30\");//.exec(\"shutdown -l\");//.exec(\"shutdown -l -t 0\").exec(\"shutdown -r\");\t\t\n\t\tSystem.out.println(\"\"+proc);\n\t\tSystem.exit(0);*/\n\t}", "public boolean togglePower() {\r\n if(power) {\r\n pioneerclient.sendCommand(\"PF\");\r\n return false;\r\n } else {\r\n pioneerclient.sendCommand(\"PO\");\r\n return true;\r\n }\r\n\t}", "public void stop() {\r\n\t\t// Tell the Gui Agent to shutdown the system\r\n\t\tGui.shutdown = true;\r\n\t}", "@Test\n\t@TestProperties(name = \"PnP procedure in NMS cold reboot IPV4\", returnParam = {\n\t\t\t\"IsTestWasSuccessful\" }, paramsExclude = { \"IsTestWasSuccessful\" })\n\tpublic void PnPColdRebootIPV4() throws Exception {\n\t\tisWarmReset = false;\n\t\tmainProcedure();\n\t\tpostTest();\n\t}", "protected abstract void switchOffCustom();", "void turnOff() throws ActorServiceCallException;", "void shutDown();", "public static JSqResult sq_suspendvm(JSqVM v) {\r\n\t\treturn new JSqResult(sq_suspendvm_native(v.m_nativeHandle));\r\n\t}", "public void shutdown() {\n this.dontStop = false;\n }", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();", "void shutdown();" ]
[ "0.75514495", "0.73757213", "0.7362848", "0.71390206", "0.70354736", "0.68561757", "0.6710834", "0.66837555", "0.65910894", "0.65397954", "0.65063614", "0.64322364", "0.64014786", "0.61788213", "0.61652994", "0.6159223", "0.6141097", "0.61261576", "0.61108625", "0.6060724", "0.59900504", "0.5984578", "0.5980196", "0.5973246", "0.59172404", "0.58764297", "0.58739454", "0.5866269", "0.5817503", "0.57985586", "0.5794428", "0.5773716", "0.5760784", "0.5758685", "0.5746717", "0.57456523", "0.5722968", "0.5716329", "0.57143843", "0.5713655", "0.56889397", "0.5645728", "0.56415945", "0.55994034", "0.55981284", "0.5549813", "0.5517506", "0.55018616", "0.54961205", "0.5483543", "0.54757863", "0.54717374", "0.54655033", "0.5452486", "0.54504776", "0.5436535", "0.53967696", "0.5383728", "0.53827804", "0.5377654", "0.5373321", "0.5360704", "0.53528464", "0.5346523", "0.53445107", "0.53425807", "0.5342272", "0.5325302", "0.5316773", "0.5313267", "0.5306106", "0.53012764", "0.5295544", "0.529038", "0.5273964", "0.52709484", "0.52690357", "0.5264517", "0.52603287", "0.5251209", "0.5245837", "0.5244645", "0.52357244", "0.52274394", "0.52217406", "0.52200097", "0.5214409", "0.52135825", "0.5201369", "0.5195766", "0.5186445", "0.51861095", "0.51861095", "0.51861095", "0.51861095", "0.51861095", "0.51861095", "0.51861095", "0.51861095", "0.51861095" ]
0.8280028
0
Reset the Virtual Machine
public void reset() { try { // your code here System.out.println("Resetting virtual machine '"+vm.getName() +"'. Please wait..."); Task t=vm.resetVM_Task(); if(t.waitForTask()== Task.SUCCESS) { System.out.println("Virtual machine reset."); System.out.println("===================================="); } else System.out.println("Reset failed..."); } catch ( Exception e ) { System.out.println( e.toString() ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void reset() throws EnvironmentException;", "private void cmdReset() throws NoSystemException {\n fSession.reset();\n }", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset() ;", "void reset ();", "public void reset () {}", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset()\n\t{\n\t}", "public void reset()\n\t{\n\t}", "public void reset() {\n\n }", "private void reset() {\n }", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t\treset(false);\n\t\tGraphvizUtils.setDotExecutable(null);\n\t}", "void reset()\n {\n\n }", "public void reset() {\n cycles = 0;\n nextHaltCycle = GB_CYCLES_PER_FRAME;\n nextUpdateCycle = 0;\n running = false;\n timer.reset();\n \n cpu.reset();\n ram.reset();\n soundHandler.reset();\n }", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n\n\t}", "@Override\n\tpublic boolean reset() throws emException, TException {\n\t\tvm.reset();\n\t\treturn true;\n\t}", "public void reset(){\n paycheckController.reset();\n }", "public void reset(){\n }", "public static void reset() {\r\n\t\t// System.out.println(\"ExPar.reset()\");\r\n\t\t// new RuntimeException().printStackTrace();\r\n\t\truntimePars.clear();\r\n\t\tresetValues();\r\n\t\tGlobalAssignments.exec();\r\n\t}", "@Override\n\tpublic void reset() throws SIMException\n\t{\n\t\tsuper.reset();\n\t\tArrays.fill(memory,(byte)0xff);\n\t}", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public abstract void reset();", "public void reset() {\n\r\n\t}", "abstract void reset();", "public void reset() throws Exception;", "public synchronized void reset() {\n }", "private void reset() {\n clearSolutions();\n clearHeapUsages(this.pm_heap);\n placeMappings(this.pm_heap, this.instance.getPhysicalMachines(), this.mappings);\n }", "protected abstract void reset();", "public void resetState();", "private void reset() {\n ms = s = m = h = 0;\n actualizar();\n }", "void resetApp();", "public void reset()\n {\n handler = new StackDynamic<T>(restart);\n }", "@Override\n\tpublic void reset() {\n\t\t\n\t}", "@Override\n\tpublic void reset() {\n\t\t\n\t}", "public void reset() {\n\t\t\t\t\r\n\t\t\t}", "protected void reset() {\n\t\t}", "public void reset() {\n context.reset();\n state = State.NAME;\n }", "public void powerOff() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Powering off virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.powerOffVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine powered off.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Power off failed / VM already powered on...\");\n \t\n } catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n }", "public final void Reset()\n\t{\n\t}", "public void reset() {\n monitor.sendReset();\n }", "public void reset() {\n\t\tinit(0, 0, 1, false);\n\t}", "@Override\r\n\tpublic void reset() {\n\t}", "@Override\r\n\tpublic void reset()\r\n\t{\r\n\t}", "public void restart();", "@Override\n public void reset() {\n }", "public void reset() {\n\t\t// set any default values\n\t\t// setDefaultController() ???\n\t}", "public void reset(){\n this.context.msr.setReadyForInput(false);\n emptyAllInputBuffers();\n emptyAllOutputBuffers();\n emptyEngineersConsoleBuffer();\n }", "@Override\n\tpublic void reset() {\n\t}", "public static\n void reset() {\n try {\n Ansi.out.write(AnsiOutputStream.RESET_CODE);\n Ansi.err.write(AnsiOutputStream.RESET_CODE);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void resetView();" ]
[ "0.6969766", "0.68501455", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.6662484", "0.66359943", "0.6581542", "0.6516193", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6509787", "0.6456467", "0.6456467", "0.6450784", "0.644943", "0.6441256", "0.6441256", "0.6441256", "0.6441256", "0.64392716", "0.6437497", "0.6433969", "0.6431675", "0.6431675", "0.6431675", "0.6431675", "0.64205253", "0.6418052", "0.6410681", "0.63997835", "0.6362905", "0.63502437", "0.6336075", "0.6336075", "0.6336075", "0.6336075", "0.6336075", "0.6336075", "0.6336075", "0.6336075", "0.6336075", "0.6336075", "0.6336075", "0.62801296", "0.6275259", "0.6272369", "0.62658507", "0.6260825", "0.6252413", "0.6191979", "0.61842674", "0.6182922", "0.6181376", "0.6138075", "0.6138075", "0.613162", "0.6121115", "0.61111355", "0.61046535", "0.61018914", "0.60961646", "0.60890144", "0.60880405", "0.6086841", "0.6073877", "0.6073524", "0.60726625", "0.6071789", "0.60697174", "0.60652566", "0.6062537" ]
0.8303154
0
ManagedObjectReference mor; System.out.println("in get tree");
static ManagedObjectReference getSnapshotFromTree(VirtualMachineSnapshotTree[] vmst, String s) { for(int i=0; i <vmst.length; i++) { VirtualMachineSnapshotTree node = vmst[i]; if(s.equals(node.getName())) { return node.getSnapshot(); } else { VirtualMachineSnapshotTree[] childTree = node.getChildSnapshotList(); if(childTree!=null) { ManagedObjectReference mor = getSnapshotFromTree(childTree, s); if(mor!=null) { return mor; } } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ObjectReference getObject();", "public Object getObject() {\r\n/* 109 */ return this.object;\r\n/* */ }", "List<SoftObjectReference> getObjects();", "String getObjectRefName();", "public Object getObject() ;", "OperationNode getNode();", "public NetObject getObject();", "@Test\n public void testManipulateObjectByReference() {\n TreeNode root = new TreeNode(0);\n root.left = new TreeNode(1);\n root.right = new TreeNode(2);\n setLeftChildToNull(root);\n System.out.println(root.left);\n }", "Reference owner();", "public Object getObject() throws javax.naming.NamingException {\n if (ThreadContext.isValid()) {\n ThreadContext cntx = ThreadContext.getThreadContext();\n byte operation = cntx.getCurrentOperation();\n checkOperation(operation);\n }\n return ref.getObject();\n }", "@DISPID(1611006000) //= 0x60060030. The runtime will prefer the VTID if present\n @VTID(75)\n boolean externalReferencesNodeInTree();", "public GitTree getTree() { return _cmt.getTree(); }", "public java.lang.String getObjectName(){\n return localObjectName;\n }", "public INamedReference<IEntity> getEntityRef();", "@Override\n public final ObjectGraph getObjectGraph() {\n return mObjectGraph;\n }", "public Object getObject();", "public MyTree getTree() {\r\n\t\treturn tree;\r\n\t}", "SyncTree getInfoSyncTree() {\n return infoSyncTree;\n }", "PIMBankObject getDomainObjectRef();", "public ObjectInfo getObjectInfo();", "void doMcTree() throws NotConnectedException, NotSuspendedException, NoResponseException\n\t{\n\t\t/* wait a bit if we are not halted */\n\t\twaitTilHalted();\n\t\ttry\n\t\t{\n\t\t\tString var = nextToken(); // our variable reference\n\t\t\tString member = \"_target\"; //$NON-NLS-1$\n\t\t\tboolean printPath = false;\n\t\t\tObject result = null;\n\t\t\tString name = null;\n\n\t\t\t// did the user specify a member name\n\t\t\tif (hasMoreTokens())\n\t\t\t{\n\t\t\t\tmember = nextToken();\n\n\t\t\t\t// did they specify some other options\n\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t{\n\t\t\t\t\tString option = nextToken();\n\t\t\t\t\tif (option.equalsIgnoreCase(\"fullpath\")) //$NON-NLS-1$\n\t\t\t\t\t\tprintPath = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// first parse it, then attempt to evaluate the expression\n\t\t\tValueExp expr = parseExpression(var);\n\t\t\tresult = evalExpression(expr).value;\n\n\t\t\tStringBuilder sb = new StringBuilder();\n\n\t\t\tif (result instanceof Variable)\n\t\t\t{\n\t\t\t\tname = ((Variable)result).getName();\n\t\t\t\tresult = ((Variable)result).getValue();\n\t\t\t}\n\n\t\t\t// It worked an should now be a value that we can traverse looking for member properties\n\n\t\t\tif (result instanceof Value)\n\t\t\t{\n\t\t\t\tArrayList<Object> e = new ArrayList<Object>();\n\t\t\t\tdumpTree(new HashMap<Object, String>(), e, name, (Value)result, member);\n\n\t\t\t\t// now sort according to our criteria\n\t\t\t\ttreeResults(sb, e, member, printPath);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new NoSuchVariableException(result);\n\n\t\t\tout( sb.toString() );\n\t\t}\n\t\tcatch(NoSuchVariableException nsv)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"variable\", nsv.getMessage()); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"variableUnknown\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"couldNotEvaluate\")); //$NON-NLS-1$\n\t\t}\n\t}", "public java.lang.String HR_GetEmployeeHierarchy3(java.lang.String accessToken) throws java.rmi.RemoteException;", "TreeNode getTreeNode();", "public String getRefNodeType() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn \"lfims:branchDetails\";\r\n\t\t\t\t\t}", "Object getObject();", "Object getObject();", "Object getObject();", "Object getObject();", "eu.learnpad.transformations.metamodel_corpus.xwiki.Object getObject();", "void dumpTree(Map<Object, String> tree, List<Object> e, String name, Value result, String member) throws NotSuspendedException, NoResponseException, NotConnectedException\n\t{\n\t\t// name for this variable\n\t\tif (name == null)\n\t\t\tname = \"\"; //$NON-NLS-1$\n\n\t\t// have we seen it already\n\t\tif (tree.containsKey(result))\n\t\t\treturn;\n\n\t\ttree.put(result, name); // place it\n\n\t\t// first iterate over our members looking for 'member'\n\t\tValue proto = result;\n\t\tboolean done = false;\n\t\twhile(!done && proto != null)\n\t\t{\n\t\t\tVariable[] members = proto.getMembers(m_session);\n\t\t\tproto = null;\n\n\t\t\t// see if we find one called 'member'\n\t\t\tfor(int i=0; i<members.length; i++)\n\t\t\t{\n\t\t\t\tVariable m = members[i];\n\t\t\t\tString memName = m.getName();\n\t\t\t\tif (memName.equals(member) && !tree.containsKey(m))\n\t\t\t\t{\n\t\t\t\t\te.add(name);\n\t\t\t\t\te.add(result);\n\t\t\t\t\te.add(m);\n\t\t\t\t\ttree.put(m, name+\".\"+memName); //$NON-NLS-1$\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t\telse if (memName.equals(\"__proto__\")) //$NON-NLS-1$\n\t\t\t\t\tproto = members[i].getValue();\n\t\t\t}\n\t\t}\n\n\t\t// now traverse other mcs recursively\n\t\tdone = false;\n\t\tproto = result;\n\t\twhile(!done && proto != null)\n\t\t{\n\t\t\tVariable[] members = proto.getMembers(m_session);\n\t\t\tproto = null;\n\n\t\t\t// see if we find an mc\n\t\t\tfor(int i=0; i<members.length; i++)\n\t\t\t{\n\t\t\t\tVariable m = members[i];\n\t\t\t\tString memName = m.getName();\n\n\t\t\t\t// if our type is NOT object or movieclip then we are done\n\t\t\t\tif (m.getValue().getType() != VariableType.OBJECT && m.getValue().getType() != VariableType.MOVIECLIP)\n\t\t\t\t\t;\n\t\t\t\telse if (m.getValue().getId() != Value.UNKNOWN_ID)\n\t\t\t\t\tdumpTree(tree, e, name, m.getValue(), member);\n\t\t\t\telse if (memName.equals(\"__proto__\")) //$NON-NLS-1$\n\t\t\t\t{\n\t\t\t\t\tproto = m.getValue();\n//\t\t\t\t\tname = name + \".__proto__\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "Object visitReference(ReferenceNode node, Object state);", "@VTID(6)\n mmarquee.automation.uiautomation.TreeScope treeScope();", "TetrisObject getCurrentTetrisObject();", "public Object getHierarchyLock() {\n return hierarchyLock;\n }", "NodeInformationProvider getNodeInformationProvider();", "public Object getObject() {\n return getGroup();\n }", "private EmployeeHierarchy getHierarchyObject(Employee processedCEO) {\n if (processedCEO.getClass()!= Manager.class) // does not have any subordinates\n throw new RuntimeException(\"CEO Does not have any subordinates\");\n return new EmployeeHierarchy((Manager) processedCEO);\n }", "javax.management.ObjectName getStateManager();", "String getReferenceType();", "public java.lang.String HR_GetEmployeeHierarchy4(java.lang.String accessToken, java.lang.String hie3) throws java.rmi.RemoteException;", "public String getRefNodeKey() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn BankMaster.class.getName();\r\n\t\t\t\t\t}", "public Node getReference() {\n return this.reference;\n }", "Object get(Node node);", "public T getObject()\n\t{\n\t\treturn object;\n\t}", "public org.pentaho.pms.cwm.pentaho.meta.instance.CwmObject getObject();", "public interface RMITreeNode extends Remote {\n\n\t/**\n\t * Set the father of the RMITreeNodeImpl. If it's set to null, the RMITreeNodeImpl becomes a root.\n\t * @param father The father of the RMITreeNodeImpl. If it's null, the RMITreeNodeImpl is a root.\n\t */\n\tpublic void setFather(RMITreeNode father) throws RemoteException;\n\t\n\tpublic void addChild(RMITreeNode child) throws RemoteException;\n\t\n\tpublic void removeChild(int index) throws RemoteException;\n\t\n\tpublic void removeChild(RMITreeNode child) throws RemoteException;\n\t\n\t/**\n\t * Remove every child of the RMITreeNode so it becomes a leaf.\n\t */\n\tpublic void clearChildren() throws RemoteException;\n\t\n\tpublic RMITreeNode getFather() throws RemoteException;\n\t\n\tpublic List<RMITreeNode> getChildren() throws RemoteException;\n\t\n\tpublic RMITreeNode getChild(int index) throws RemoteException;\n\t\n\tpublic String getName() throws RemoteException;\n\t\n\t/**\n\t * Return a String containing the trace of the propogation since its beginning.\n\t * @return The trace of the propogation.\n\t * @throws RemoteException\n\t */\n\tpublic String getTrace() throws RemoteException;\n\t\n\t/**\n\t * Give data as an array of byte to the RMITreeNode in order to propagate to the leaves of the tree.\n\t * @param data The data to propagate to the leaves of the tree.\n\t * @return The trace of the entire propagation.\n\t * @throws RemoteException\n\t */\n\tpublic String propagate(byte[] data) throws RemoteException;\n\t\n\t/**\n\t * Send data as an array of byte to every children of the RMITreeNode.\n\t * If the node is a leaf, put the message in the trace.\n\t * @param data An array of byte containing the data to send to the children.\n\t * @return The trace of the children receiving the data.\n\t * @throws RemoteException\n\t */\n\tpublic String sendDataToChildren(byte[] data) throws RemoteException;\n\n}", "public ObjectReferenceImpl getObjectReferenceImpl() {\n return (ObjectReferenceImpl) objectReference;\n }", "slco.Object getObject2();", "public com.vmware.converter.ManagedObjectReference getObj() {\r\n return obj;\r\n }", "public abstract Reference getReference() throws NamingException ;", "ManagementLockObjectInner innerModel();", "public abstract org.omg.CORBA.Object read_Object();", "public Node getNode(Reference ref, Presentation presentation);", "public java.lang.String HR_GetEmployeeHierarchy5(java.lang.String accessToken, java.lang.String hie3, java.lang.String hie4) throws java.rmi.RemoteException;", "EReference getModelReference();", "List<CMSObject> getNodeByName(String name, Object session) throws RepositoryAccessException;", "public nodeTree getHijoDer (){\n return this._hDer;\n }", "public Git.Entry getObject() { return ent; }", "public Object getObject()\n {\n return m_object;\n }", "public JTree getTree(){\n return tree;\n }", "public ObjectReference getObjectReference() {\n return new ObjectReferenceBuilder()\n .withApiVersion(getApiVersion())\n .withKind(getKind())\n .withName(getMetaName())\n .withNamespace(getMetaspace())\n .withUid(getMetadata().getUid())\n .build();\n }", "@Test public void testAuthorityRefs() throws Exception {\n \t\tStorage ss=makeServicesStorage(base+\"/cspace-services/\");\n\t\tJSONObject person=makePerson();\n \t\tString p=ss.autocreateJSON(\"person/person\",person);\n \t\tlog.info(\"p=\"+p);\n \t\tJSONObject po=ss.retrieveJSON(\"person/person/\"+p);\n \t\tlog.info(\"po=\"+po);\n \t\tString pname=po.getString(\"refid\");\n \t\tJSONObject data=getJSON(\"int4.json\");\n \t\tdata.remove(\"valuer\");\n \t\tdata.put(\"valuer\",pname);\n \t\tString p1=ss.autocreateJSON(\"intake/\",data);\n \t\tlog.info(\"p1=\"+p1);\n \t\tJSONObject mini=ss.retrieveJSON(\"intake/\"+p1+\"/refs\");\n \t\tlog.info(\"mini=\"+mini);\n \t\tJSONObject member=mini.getJSONObject(\"valuer\");\t\t\n \t\tassertNotNull(member);\n \t\tassertEquals(\"Dic Penderyn\",member.getString(\"displayName\"));\n \t\t\n \t\t// XXX retrieve by authority\n \t\t// XXX also authorities\n \t}", "public PrimObject reference(String name) {\n return resolveObject(name);\n }", "public String getObjectName() { return objectName; }", "@Override\r\n\tpublic Ref getRef() {\n\t\treturn ref;\r\n\t}", "private static void demonstrateTreeOperation(IndexWord word) throws JWNLException {\n PointerTargetTree hyponyms = PointerUtils.getInstance().getHyponymTree(word.getSense(1));\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n Synset rootsynset = rootnode.getSynset();\n System.out.println(rootsynset.getWord(0).getLemma());\n PointerTargetTreeNodeList childList = rootnode.getChildTreeList();\n PointerTargetTreeNode rootnode1=(PointerTargetTreeNode)childList.get(0);\n System.out.println(rootnode1.getSynset().getWord(0).getLemma());\n System.out.println(\"Hyponyms of \\\"\" + word.getLemma() + \"\\\":\");\n hyponyms.print();\n }", "@Override\n String getClassRef() {\n return this.classNode.name;\n }", "public String describeRoot();", "slco.Object getObject1();", "public void dumpTree(String msg) {\n\t\tSystem.out.println(msg);\n\t\tSystem.out.println(((org.eclipse.etrice.runtime.java.messaging.RTObject)getRoot()).toStringRecursive());\n\t}", "entities.Torrent.NodeId getNode();", "entities.Torrent.NodeId getNode();", "Symbol getRef();", "public TreeNode getLeft(){ return leftChild;}", "@Test\n public void testGetObject() throws java.sql.SQLException {\n // Get the NaturalKey by using the key factory,\n // supplying the appropriate key attributes using\n // test accessor methods. \n com.poesys.db.pk.NaturalPrimaryKey key = \n (com.poesys.db.pk.NaturalPrimaryKey)org.tair.db.locusdetail.LocusdetailFactory.getLocusDetailPrimaryKey(getTestKeyLocusTairObjectId(0));\n assertTrue(\"No key generated from concrete implementation\", key != null);\n \n // Query the object.\n BsLocusDetail object = delegate.getObject(key);\n assertTrue(\"Couldn't get object\", object != null);\n \n // Testing lazy loading of annotation Collection property\n java.util.Collection<org.tair.bs.locusdetail.BsAnnotation> annotation = \n object.getAnnotation();\n assertTrue(\"annotation not lazily loaded\", annotation != null);\n \n // Testing lazy loading of references Collection property\n java.util.Collection<org.tair.bs.locusdetail.BsReference> references = \n object.getReferences();\n assertTrue(\"references not lazily loaded\", references != null);\n }", "public Agent getOwner(){\n return owner;\n }", "@DISPID(1611006012) //= 0x6006003c. The runtime will prefer the VTID if present\n @VTID(87)\n boolean relationsNodeInTree();", "public TreeNode getTreeNode() {\n return treeNode;\n }", "AssociationTreeBean getAssociationTree(String path, String type) throws RegistryException;", "public void testPropfindPropOwnerAndAclOnNode() throws Exception\n {\n\n NodeImpl testNode = (NodeImpl)root.addNode(\"test_acl_property\", \"nt:folder\");\n testNode.addMixin(\"exo:owneable\");\n testNode.addMixin(\"exo:privilegeable\");\n session.save();\n\n Map<String, String[]> permissions = new HashMap<String, String[]>();\n\n String userName = USER_JOHN;\n permissions.put(userName, PermissionType.ALL);\n\n testNode.setPermissions(permissions);\n testNode.getSession().save();\n\n MultivaluedMap<String, String> headers = new MultivaluedMapImpl();\n headers.putSingle(\"Depth\", \"1\");\n headers.putSingle(HttpHeaders.CONTENT_TYPE, \"text/xml; charset=\\\"utf-8\\\"\");\n\n EnvironmentContext ctx = new EnvironmentContext();\n\n Set<String> adminRoles = new HashSet<String>();\n adminRoles.add(\"administrators\");\n\n DummySecurityContext adminSecurityContext = new DummySecurityContext(new Principal()\n {\n public String getName()\n {\n return USER_ROOT;\n }\n }, adminRoles);\n\n ctx.put(SecurityContext.class, adminSecurityContext);\n\n RequestHandlerImpl handler = (RequestHandlerImpl)container.getComponentInstanceOfType(RequestHandlerImpl.class);\n ResourceLauncher launcher = new ResourceLauncher(handler);\n\n String request =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\" + \"<D:propfind xmlns:D=\\\"DAV:\\\">\" + \"<D:prop>\" + \"<D:owner/>\"\n + \"<D:acl/>\" + \"</D:prop>\" + \"</D:propfind>\";\n\n ContainerResponse cres =\n launcher.service(WebDAVMethods.PROPFIND, getPathWS() + testNode.getPath(), BASE_URI, headers,\n request.getBytes(), null, ctx);\n\n assertEquals(HTTPStatus.MULTISTATUS, cres.getStatus());\n\n HierarchicalPropertyEntityProvider provider = new HierarchicalPropertyEntityProvider();\n InputStream inputStream = TestUtils.getResponseAsStream(cres);\n HierarchicalProperty multistatus = provider.readFrom(null, null, null, null, null, inputStream);\n\n assertEquals(new QName(\"DAV:\", \"multistatus\"), multistatus.getName());\n assertEquals(1, multistatus.getChildren().size());\n\n HierarchicalProperty resourceProp = multistatus.getChildren().get(0);\n\n HierarchicalProperty resourceHref = resourceProp.getChild(new QName(\"DAV:\", \"href\"));\n assertNotNull(resourceHref);\n assertEquals(BASE_URI + getPathWS() + testNode.getPath() + \"/\", resourceHref.getValue());\n\n HierarchicalProperty propstatProp = resourceProp.getChild(new QName(\"DAV:\", \"propstat\"));\n HierarchicalProperty propProp = propstatProp.getChild(new QName(\"DAV:\", \"prop\"));\n\n HierarchicalProperty aclProp = propProp.getChild(ACLProperties.ACL);\n assertEquals(1, aclProp.getChildren().size());\n\n HierarchicalProperty aceProp = aclProp.getChild(ACLProperties.ACE);\n assertEquals(2, aceProp.getChildren().size());\n\n HierarchicalProperty principalProp = aceProp.getChild(ACLProperties.PRINCIPAL);\n assertEquals(1, principalProp.getChildren().size());\n\n assertEquals(userName, principalProp.getChildren().get(0).getValue());\n\n HierarchicalProperty grantProp = aceProp.getChild(ACLProperties.GRANT);\n assertEquals(2, grantProp.getChildren().size());\n\n HierarchicalProperty writeProp = grantProp.getChild(0).getChild(ACLProperties.WRITE);\n assertNotNull(writeProp);\n HierarchicalProperty readProp = grantProp.getChild(1).getChild(ACLProperties.READ);\n assertNotNull(readProp);\n\n }", "public Object obj()\n\t{\n\t\treturn object;\n\t}", "ObjectInspector getObjectInspector() throws SerDeException;", "public SecurityNode getNode() {\n\t return fo;\n\t}", "public List<?> getTreePath(Object object)\n {\n LinkedList<Object> result = new LinkedList<Object>();\n result.addFirst(object);\n while ((object = getParent(object)) != null)\n {\n result.addFirst(object);\n }\n \n return result;\n }", "@Override\n public String getObjectName() {\n\treturn null;\n }", "public void testEntireObjectNestedSearch4() throws ApplicationException\r\n\t{\r\n\t\tWheel searchObject = new Wheel();\r\n\t\tCollection results = getApplicationService().search(\"gov.nih.nci.cacoresdk.domain.inheritance.parentwithassociation.sametable.Wheel\",searchObject );\r\n\r\n\t\tassertNotNull(results);\r\n\t\tassertEquals(3,results.size());\r\n\t\t\r\n\t\tfor(Iterator i = results.iterator();i.hasNext();)\r\n\t\t{\r\n\t\t\tWheel result = (Wheel)i.next();\r\n\t\t\tassertNotNull(result);\r\n\t\t\tassertNotNull(result.getId());\r\n\t\t\tassertEquals(result.getId().getRoot(),II_ROOT_GLOBAL_CONSTANT_VALUE);\r\n\t\t\tassertNotNull(result.getRadius());\r\n\t\t}\r\n\t}", "String getContainmentReference();", "RenderedOp getNode(Long id) throws RemoteException;", "OsType getObjectStore();", "private void testEvidenceBankFolder() {\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n NodeRef eviBankFolder = getEvidenceBankFolder();\n assertNotNull(eviBankFolder);\n LOG.debug(\"Got Evidence Bank Folder NodeRef: \" + eviBankFolder); \n\n }", "public ObjRef getRootObjRef() {\n return rootRef;\n }", "public Commit getLeaf(){\n\t\treturn myLeaf;\n\t}", "public EntryTree tree() {\n return tree;\n }", "public T get() {\n return object;\n }", "public interface ObjectGraph {\n\n\t\n\t/**\n\t * As in neo4j, starts a new transaction and associates it with the current thread.\n\t * @return a transaction from NeoService.\n\t */\n\tTransaction beginTx();\n\n\t/**\n\t * Mirror a java object within the neo4j graph. Only fields annotated with {@code}neo\n\t * will be considered.\n\t * @param o\n\t */\n\t<A> void persist(A... o);\n\n\t/**\n\t * removes all data representing an object from the graph.\n\t * \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t */\n\tvoid delete(Object... o);\n\t\n\t\n\t/**\n\t * Looks up a neo4j graph node using it's java object\n\t * mirror. \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t * @return neo4j node represented by o\n\t */\n\tNode get(Object o);\n\t\n\t/**\n\t * Looks up all instances of {@code}type in the graph.\n\t * \n\t * @param type a type previously stored in the graph\n\t * @return a Collection of {@code}type instances.\n\t */\n\t<T> Collection<T> get(Class<T> type);\n\n\t/**\n\t * Type safe lookup of object given it's neo4j nodeid.\n\t * Your domain classes may use {@link Nodeid#id()} to discover\n\t * their neo4j nodeid. \n\t * \n\t * @param t\n\t * @param key neo4j node id.\n\t * @return\n\t */\n\t<T> T get(Class<T> t, long key);\n\n\t\n\t/**\n\t * Return an object represented by <code>node</code> provided\n\t * the node was created by jo4neo.\n\t * \n\t * @param node\n\t * @return an object that mirrors node.\n\t */\n\tObject get(Node node);\n\t\n\t/**\n\t * Looks up the node representation of a given \n\t * uri. This method may update your graph if no node\n\t * was previously allocated for the uri.\n\t * \n\t * @return the node representation of uri.\n\t */\n\tNode get(URI uri);\n\n\n\t/**\n\t * Unmarshal a collections of nodes into objects.\n\t * \n\t */\n\t<T> Collection<T> get(Class<T> type, Iterable<Node> nodes);\n\n\t/**\n\t * Closes this ObjectGraph after which it will be unavailable \n\t * for use. Calling close is necessary, and should be called even\n\t * if the application is halted suddenly. ObjectGraph's maintain \n\t * a lucene index which may become corrupt without proper shutdown.\n\t * \n\t */\n\tvoid close();\n\n\t/**\n\t * Begin fluent interface find. <code>a</code> should be \n\t * a newly constructed instance as it's contents will be modified/initialized\n\t * by this call.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * </code>\n\t * </pre>\n\t * \n\t * @param a\n\t * @return\n\t */\n\t<A> Where<A> find(A a);\n\n\t/**\n\t * Counts child entities without loading objects into memory. This is preferable to \n\t * using Collection.size(), which would load the full collection into memory.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * long numOrders = graph.count(customer.orders);\n\t * </code>\n\t * </pre>\n\t * \n\t * @param values a collection value from a jo4neo annotated field.\n\t * @return\n\t */\n\tlong count(Collection<? extends Object> values);\n\n\t/**\n\t * Returns a collection of entities added since <code>d</code>.\n\t * Type <code>t</code> must be annotated with {@link Timeline}\n\t * \n\t * @see Timeline\n\t * \n\t */\n\t<T> Collection<T> getAddedSince(Class<T> t, Date d);\n\n\t/**\n\t * Returns a collection of entities added bewteen dates from and to.\n\t * Type <code>t</code> must be annotated with {@link Timeline}.\n\t * \n\t * @see Timeline\n\t */\n\t<T> Collection<T> getAddedBetween(Class<T> t, Date from,\n\t\t\tDate to);\n\n\t\n\t/**\n\t * Returns up to <code>max</code> most recently added instances of type <code>t</code>\n\t * \n\t * @param max limit the number of instances returned\n\t * @see neo#recency()\n\t */\n\t<T> Collection<T> getMostRecent(Class<T> t, int max);\n\t\n\t\n\t<T> T getSingle(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> get(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> fullTextQuery(Class<T> t, String indexname, Object value);\n\n}", "ReferenceKind getKind();", "public String getRefPropertyName() {\r\n\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\treturn \"lfims:branches\";\r\n\t\t\t\t\t}", "public ObjectContainer getObjectContainer()\n {\n return container;\n }", "private void getTreeOperation(OperationResponse response, ObjectIdData requestData) throws ConnectorException {\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tint httpStatusCode = 200;\n\t\t\n\t\tLogger.severe(this.getContext().getObjectTypeId());\n\t\trestWrapper = MapsHelpers.initRestWrapperAndLogin(getContext());\n\t\t\n\t\tif ( restWrapper != null ) {\n\t\t\tTreeDTO[] loy = restWrapper.getListOfYears();\n\t\t\thttpStatusCode = restWrapper.getHttpClient().getLastStatus();\n\t\t\t\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tmapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);\n\t\t\tmapper.setDateFormat(df);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tString jsonInString = mapper.writeValueAsString(loy);\n//\t\t\t\tLogger.severe(jsonInString);\n\t\t\t\t\n\t\t\t\tResponseUtil.addSuccess(response, requestData, String.valueOf(httpStatusCode), ResponseUtil.toPayload(jsonInString));\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t} catch (JsonProcessingException e) {\n\t\t\t\tLogger.log(Level.SEVERE, \"An error\", e);\n\t\t\t\tthrow new ConnectorException(e);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tresponse.addResult(requestData, OperationStatus.FAILURE, null, \"Authentication failed\", null);\n\t\t}\n\t}", "private void walk (Node node) {\n int type = node.getNodeType();\n\tString svc = null;\n\n if (type == Node.ELEMENT_NODE) {\n String name = node.getNodeName ();\n\n\t // For the target element, look for the Resolver name attribute.\n\t if (name.equals (\"target\") ) {\n NamedNodeMap nnm = node.getAttributes();\n if (nnm != null) {\n\n for (int i = 0; i < nnm.getLength(); i++) {\n Attr attr = (Attr) nnm.item(i);\n\t\t\tString attrName = attr.getNodeName();\n\n\t\t\tif (attrName.equals (\"name\") ) {\n\t\t\t svc = attr.getNodeValue ();\n\t\t\t break;\n\t\t\t}\n }\n }\n\t }\n\n\t // Get the value of the element as the content text.\n\t String text = node.getFirstChild().getNodeValue().trim();\n\n\t // Save the content to the object data.\n\t if (name.equals (\"target\") ) {\n\t\ttarget = text;\n\t } else if (name.equals (\"Resolver\") ) {\n\t\tservice = svc;\n\t } else if (name.equals (\"otype\") ) {\n\t\totype = text;\n\t } else if (name.equals (\"jpos\") ) {\n\t\tpos = text;\n\t } else if (name.equals (\"jradeg\") ) {\n\t\tra = Double.parseDouble (text);\n\t } else if (name.equals (\"jdedeg\") ) {\n\t\tdec = Double.parseDouble (text);\n\t } else if (name.equals (\"errRAmas\") ) {\n\t\traERR = Double.parseDouble (text);\n\t } else if (name.equals (\"errDEmas\") ) {\n\t\tdecERR = Double.parseDouble (text);\n\t } else if (name.equals (\"oname\") ) {\n\t\toname = text;\n\t } else if (name.equals (\"alias\") ) {\n\t\t; // alias lists not implemented\n\t }\n } \n\n // Recurse to finish reading the branch.\n for (Node child = node.getFirstChild(); child != null;\n child = child.getNextSibling()) {\n\t\twalk(child);\n\t}\n\n }" ]
[ "0.6373411", "0.5802637", "0.5706356", "0.5596996", "0.5573875", "0.5499967", "0.54803413", "0.5422541", "0.5413481", "0.54087365", "0.53731936", "0.5372477", "0.5372465", "0.5368373", "0.5357186", "0.530591", "0.52754134", "0.526531", "0.5260424", "0.5252059", "0.52301097", "0.5213889", "0.52067924", "0.520082", "0.51996875", "0.51996875", "0.51996875", "0.51996875", "0.5199604", "0.5185541", "0.517818", "0.51757157", "0.5163348", "0.5140633", "0.51193905", "0.51129556", "0.5100974", "0.5093527", "0.5091771", "0.50851405", "0.505873", "0.5051492", "0.5043194", "0.5041613", "0.5039078", "0.5031117", "0.5030418", "0.5029495", "0.5021937", "0.5003678", "0.49987695", "0.49950284", "0.49941504", "0.49938732", "0.49877208", "0.49665686", "0.4966297", "0.4943652", "0.49431157", "0.494164", "0.4933413", "0.4933009", "0.49213514", "0.49196213", "0.49151492", "0.4914242", "0.4904612", "0.48979437", "0.4897613", "0.48946097", "0.48944005", "0.48944005", "0.48887637", "0.48845485", "0.48772505", "0.4873829", "0.48699218", "0.48695728", "0.48664787", "0.48650172", "0.4856243", "0.4855482", "0.48544604", "0.4846009", "0.4845896", "0.48370135", "0.48276168", "0.48180655", "0.4816676", "0.4814112", "0.48134056", "0.48122826", "0.4812202", "0.48092252", "0.4806852", "0.4806099", "0.48058873", "0.4802487", "0.48022428", "0.48020685" ]
0.511111
36
/Print details of all VMs present on the vCenter (multiple hosts included)
public void helloVM() { try { VirtualMachineConfigInfo vminfo = vm.getConfig(); VirtualMachineCapability vmc = vm.getCapability(); VirtualMachineRuntimeInfo vmri = vm.getRuntime(); VirtualMachineSummary vmsum = vm.getSummary(); System.out.println("------------------------------------------"); System.out.println("VM Information : "); System.out.println("VM Name: " + vminfo.getName()); System.out.println("VM OS: " + vminfo.getGuestFullName()); System.out.println("VM ID: " + vminfo.getGuestId()); System.out.println("VM Guest IP Address is " +vm.getGuest().getIpAddress()); System.out.println("------------------------------------------"); System.out.println("Resource Pool Informtion : "); System.out.println("Resource pool: " +vm.getResourcePool()); System.out.println("VM Parent: " +vm.getParent()); //System.out.println("VM Values: " +vm.getValues()); System.out.println("Multiple snapshot supported: " + vmc.isMultipleSnapshotsSupported()); System.out.println("Powered Off snapshot supported: "+vmc.isPoweredOffSnapshotsSupported()); System.out.println("Connection State: " + vmri.getConnectionState()); System.out.println("Power State: " + vmri.getPowerState()); //CPU Statistics System.out.println("------------------------------------------"); System.out.println("CPU and Memory Statistics" ); System.out.println("CPU Usage: " +vmsum.getQuickStats().getOverallCpuUsage()); System.out.println("Max CPU Usage: " + vmri.getMaxCpuUsage()); System.out.println("Memory Usage: "+vmsum.getQuickStats().getGuestMemoryUsage()); System.out.println("Max Memory Usage: " + vmri.getMaxMemoryUsage()); System.out.println("------------------------------------------"); } catch (InvalidProperty e) { e.printStackTrace(); } catch (RuntimeFault e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printVirtualMachines() throws InvalidProperty, RuntimeFault, RemoteException{\r\n\t\tManagedEntity[] mes = new\r\n\t\t\t\tInventoryNavigator(_instance.getRootFolder()).searchManagedEntities(\"VirtualMachine\");\r\n\t\tfor (int i = 0; i < mes.length; i++) {\r\n\t\t\tVirtualMachine currVm = (VirtualMachine)mes[i];\r\n\t\t\tSystem.out.printf(\"vm[%d]: Name = %s\\n\", i, currVm.getName());\r\n\t\t}\r\n\t}", "public void printInfo(){\n\t\tSystem.out.println(\"id : \" + id + \" label : \" + label);\n\t\tSystem.out.println(\"vms : \" );\n\t\tfor(VirtualMachine v : vms){\n\t\t\tv.printInfo();\n\t\t}\n\t}", "@Override\n @GET\n @Path(\"/vms\")\n @Produces(\"application/json\")\n public Response getVMs() throws Exception {\n log.trace(\"getVMs() started.\");\n JSONArray json = new JSONArray();\n for (Vm vm : cluster.getVmList()) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/vms/%d\", rootUri, vm.getVmId());\n String vmUri = String.format(\"/providers/%d/vms/%d\", provider.getProviderId(), vm.getVmId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", vmUri);\n json.put(o);\n }\n\n log.trace(\"getVMs() finished successfully.\");\n return Response.ok(json.toString()).build();\n }", "public static void printVMinfo(VirtualMachine vm) throws IOException, InterruptedException{\n\t\t\t\n\t\t\t\tvm.getResourcePool();\n\t\t\t\tSystem.out.println(\"Hello \" + vm.getName());\n\t\t\t\tSystem.out.println(\"Status \" + vm.getGuestHeartbeatStatus());\n\t\t\t\tSystem.out.println(\"get ip \"+ vm.getSummary().getGuest().getIpAddress());\n\t\t\t\tSystem.out.println(\"get id \"+ vm.getSummary().getGuest().getGuestId());\n\t\t\t\tSystem.out.println(\"get toolstatus \"+ vm.getSummary().getGuest().toolsRunningStatus);\n\t\t\t\tSystem.out.println(\"get hostname \"+ vm.getSummary().getGuest().getHostName());\n\t\t\t\tSystem.out.println(\"GuestOS: \" + vm.getConfig().getGuestFullName());\n\t\t\t\tSystem.out.println(\"vm version: \" + vm.getConfig().version);\n\t\t\t\tSystem.out.println(\"meomery: \" + vm.getConfig().getHardware().memoryMB + \"MB\");\n\t\t\t\t//System.out.println(\"meomery overhead: \" + vm.getConfig().memoryAllocation.reservation.toString() + \"MB\");\n\t\t\t\tSystem.out.println(\"cpu: \" + vm.getConfig().getHardware().numCPU);\n\t\t\t\tSystem.out.println(\"Multiple snapshot supported: \" + vm.getCapability().isMultipleSnapshotsSupported());\n\t\t\t\tSystem.out.println(\"====================================================================\");\n\t\t\t}", "public void printHostSystems() throws InvalidProperty, RuntimeFault, RemoteException{\r\n\t\tManagedEntity[] mes = new\r\n\t\t\t\tInventoryNavigator(_instance.getRootFolder()).searchManagedEntities(\"HostSystem\");\r\n\t\tfor (int i = 0; i < mes.length; i++) {\r\n\t\t\tHostSystem currHostSystem = (HostSystem)mes[i];\r\n\t\t\tSystem.out.printf(\"host[%d]: Name = %s\\n\", i, currHostSystem.getName());\r\n\t\t}\r\n\t}", "public List<VirtualMachineDescriptor> listVirtualMachines() {\n ArrayList<VirtualMachineDescriptor> result =\n new ArrayList<VirtualMachineDescriptor>();\n\n MonitoredHost host;\n Set<Integer> vms;\n try {\n host = MonitoredHost.getMonitoredHost(new HostIdentifier((String)null));\n vms = host.activeVms();\n } catch (Throwable t) {\n if (t instanceof ExceptionInInitializerError) {\n t = t.getCause();\n }\n if (t instanceof ThreadDeath) {\n throw (ThreadDeath)t;\n }\n if (t instanceof SecurityException) {\n return result;\n }\n throw new InternalError(t); // shouldn't happen\n }\n\n for (Integer vmid: vms) {\n String pid = vmid.toString();\n String name = pid; // default to pid if name not available\n boolean isAttachable = false;\n MonitoredVm mvm = null;\n try {\n mvm = host.getMonitoredVm(new VmIdentifier(pid));\n try {\n isAttachable = MonitoredVmUtil.isAttachable(mvm);\n // use the command line as the display name\n name = MonitoredVmUtil.commandLine(mvm);\n } catch (Exception e) {\n }\n if (isAttachable) {\n result.add(new HotSpotVirtualMachineDescriptor(this, pid, name));\n }\n } catch (Throwable t) {\n if (t instanceof ThreadDeath) {\n throw (ThreadDeath)t;\n }\n } finally {\n if (mvm != null) {\n mvm.detach();\n }\n }\n }\n return result;\n }", "public void printVmInfo(String vmName){\r\n\t\ttry {\r\n\t\t\tVirtualMachine virtualMachine = searchVirtualMachine(vmName);\r\n\t\t\tGuestInfo guestInfo = virtualMachine.getGuest();\r\n\t\t\tSystem.out.println(\"Name = \"+vmName);\r\n\t\t\tSystem.out.println(\"Guest full name = \"+guestInfo.getGuestFullName());\r\n\t\t\tSystem.out.println(\"Guest state = \"+guestInfo.getGuestState());\r\n\t\t\tSystem.out.println(\"IP addr = \"+guestInfo.getIpAddress());\r\n\t\t\tSystem.out.println(\"Tool running status = \"+guestInfo.getToolsRunningStatus());\r\n\t\t\tSystem.out.println(\"Power state = \"+virtualMachine.getRuntime().getPowerState());\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidVmMessage(vmName);\r\n\t\t}\r\n\t}", "public List<VirtualMachine> listVirtualMachines() {\n MachineOptions options = MachineOptions.builder().sync(false).build();\n VirtualMachinesWithNodeExtendedDto vms = context.getApi().getInfrastructureApi()\n .listVirtualMachinesByMachine(target, options);\n return wrap(context, VirtualMachine.class, vms.getCollection());\n }", "@Test(groups = {NETWORK_INTEGRATION_TESTS})\n public void getdhcpInfoByVirtualDatacenter()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n String URI = resolveVirtualDatacenterActionGetDHCPInfoURI(vdc.getId());\n ClientResponse response = get(URI, SYSADMIN, SYSADMIN, MediaType.TEXT_PLAIN);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n String entity = response.getEntity(String.class);\n assertNotNull(entity);\n }", "public List<VirtualMachine> listRemoteVirtualMachines() {\n MachineOptions options = MachineOptions.builder().sync(true).build();\n VirtualMachinesWithNodeExtendedDto vms = context.getApi().getInfrastructureApi()\n .listVirtualMachinesByMachine(target, options);\n return wrap(context, VirtualMachine.class, vms.getCollection());\n }", "public static ArrayList<VirtualMachine> getListVms(ServiceInstance si,String vmname) throws InvalidProperty, RuntimeFault, RemoteException, MalformedURLException{\n\t\t\tHostSystem hs= hostByname(vmname,si);\n\t\t\t//System.out.println(hs.getName());\n\t\t\tFolder rootFolder = si.getRootFolder();\n\t\t\tString name = rootFolder.getName();\n\t\t\tSystem.out.println(\"root:\" + name);\n\t\t\tSystem.out.println(\"====================================================================\");\n\t\t\tArrayList<VirtualMachine> vms = new ArrayList<VirtualMachine>();\n\t\t\tManagedEntity[] mes = new InventoryNavigator(hs).searchManagedEntities(new String[][] { {\"VirtualMachine\", \"name\" }, }, true);\n\t\t\tfor(int i=0;i<mes.length;i++){\n\t\t\t\tvms.add((VirtualMachine)mes[i]);\n\t\t\t}\n\t\t\treturn vms;\n\t\t\t\n\t\t}", "@Test\n public void getVirtualDatacenterEmptyListWhenHasVLANsWithoutIPs()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs);\n setup(vlan.getConfiguration(), vlan);\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(200, response.getStatusCode());\n }", "public void displayAll(){\n System.out.println(\"guestCounter: \" + guestCounter);\n for(int i=0;i<guestCounter;i++){\n guest[i].dispGuest();\n }\n }", "public void showVehicles() {\n\t\tfor (Vehicle vehicle : vehicles) {\n\t\t\tSystem.out.println(vehicle);\n\t\t}\n\t}", "@Test\r\n public void testGetAttestationFromVmwareHost() throws Exception {\r\n TxtHostRecord host = new TxtHostRecord();\r\n host.HostName = \"10.1.71.174\";\r\n host.AddOn_Connection_String = \"https://10.1.71.162:443/sdk;administrator;intel123!\";\r\n VMwareClient client = new VMwareClient();\r\n client.connect(host.AddOn_Connection_String);\r\n String report = client.getHostAttestationReport(host, \"0,17,18,20\");\r\n System.out.println(report);\r\n }", "org.jacorb.imr.HostInfo[] list_hosts();", "protected void printAll() {\n\t\tSystem.out.println(\"Network maps\");\n\t\tSystem.out.println(\"\tAddresses\");\n\t\ttry {\n\t\t\tPreparedStatement pstmt = \n\t\t\t\t\tthis.agent.getDatabaseManager().getConnection().prepareStatement(\n\t\t\t\t\t\t\tthis.agent.getDatabaseManager().selectAll);\n\t ResultSet rs = pstmt.executeQuery();\n\t // loop through the result set\n while (rs.next()) {\n \t System.out.printf(\"%s -> %s\\n\", rs.getString(\"username\"), rs.getString(\"address\"));\n }\n\t\t} catch (Exception e) {\n\t\t\tAgent.errorMessage(\n\t\t\t\t\tString.format(\"ERROR when trying to get all the address of the table users in the database\\n\"), e);\n\t\t}\n\t\tSystem.out.println(\"\tmapSockets\");\n\t\tfor (String u: this.mapSockets.keySet()) {\n\t\t\tSystem.out.printf(\"%s -> %s\\n\", u, this.mapSockets.get(u));\n\t\t}\n\t}", "public void dump() {\n System.out.println(\"ID : \"+hostID);\n for (int i=0; i<hostAddresses.size(); i++) System.out.println(\" - addresse : \"+hostAddresses.elementAt(i).getNormalizedAddress());\n System.out.println(\"CPU : \"+cpuLoad);\n System.out.println(\"Memoire : \"+memoryLoad);\n System.out.println(\"Batterie : \"+batteryLevel);\n System.out.println(\"Threads : \"+numberOfThreads);\n System.out.println(\"CMs : \"+numberOfBCs);\n System.out.println(\"connecteurs : \"+numberOfConnectors);\n System.out.println(\"connecteurs entree reseau : \"+numberOfConnectorsNetworkInputs);\n System.out.println(\"connecteurs sortie reseau : \"+numberOfConnectorsNetworkOutputs);\n System.out.println(\"Traffic PF entree : \"+networkPFInputTraffic);\n System.out.println(\"Traffic PF sortie : \"+networkPFOutputTraffic);\n System.out.println(\"Traffic application entree : \"+networkApplicationInputTraffic);\n System.out.println(\"Traffic application sortie : \"+networkApplicationOutputTraffic);\n }", "@Test(groups = {NETWORK_INTEGRATION_TESTS})\n public void getPrivateNetworkIPsByVirtualDatacenterOrderByVirtualMachine()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan.getConfiguration(), vlan);\n\n IPAddress ip = IPAddress.newIPAddress(vlan.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan.getConfiguration().getMask()));\n\n persistIP(ip, lastIP, vdc, vlan);\n\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n validURI = validURI + \"?by=virtualmachine\";\n\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n }", "public int getSizeVirtualMachine(){\n\t\treturn vms.size();\n\t}", "public void list() {\r\n\t\tfor (String key : nodeMap.keySet()) {\r\n\t\t\tNodeRef node = nodeMap.get(key);\r\n\t\t\tSystem.out.println(node.getIp() + \" : \" + node.getPort());\r\n\t\t}\t\t\r\n\t}", "public void printHostInfo(String hostName){\r\n\t\tHostSystem hostSystem;\r\n\t\ttry {\r\n\t\t\thostSystem = searchHostSystem(hostName);\r\n\t\t\tSystem.out.println(\"Name = \"+hostName);\r\n\t\t\tSystem.out.println(\"ProductFullName = \"+hostSystem.getConfig().getProduct().getFullName());\r\n\t\t\tSystem.out.println(\"Cpu cores = \"+hostSystem.getHardware().getCpuInfo().getNumCpuCores());\r\n\t\t\tSystem.out.println(\"RAM = \"+readableFileSize(hostSystem.getHardware().getMemorySize()));\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidHostNameMessage(hostName);\r\n\t\t}\r\n\t}", "public void printHostDatastoreInfo(String hostName){\r\n\t\tHostSystem hostSystem;\r\n\t\ttry {\r\n\t\t\thostSystem = searchHostSystem(hostName);\r\n\t\t\tDatastore[] dataStoreArray = hostSystem.getDatastores();\r\n\t\t\tSystem.out.println(\"Name = \"+hostName);\r\n\t\t\tfor (int i = 0; i < dataStoreArray.length; i++) {\r\n\t\t\t\tSystem.out.printf(\"Datastore[%d]: name = %s, capacity = %s, FreeSpace = %s\\n\", \r\n\t\t\t\t\t\ti, dataStoreArray[i].getName(), \r\n\t\t\t\t\t\treadableFileSize(dataStoreArray[i].getSummary().getCapacity()),\r\n\t\t\t\t\t\treadableFileSize(dataStoreArray[i].getSummary().getFreeSpace()));\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidHostNameMessage(hostName);\r\n\t\t}\r\n\t}", "public int getNumVMs() {\n return numVMs;\n }", "public List<VPlexClusterInfo> getClusterInfoDetails() throws VPlexApiException {\n s_logger.info(\"Request for complete detailed cluster info for VPlex at {}\", _baseURI);\n return _discoveryMgr.getClusterInfo(false, true);\n }", "public static void showAllVilla(){\n ArrayList<Villa> villaList = getListFromCSV(FuncGeneric.EntityType.VILLA);\n displayList(villaList);\n showServices();\n }", "public VirtualMachines getVirtualMachines() {\n return virtualMachines;\n }", "public Map<String, Host> getVmTable() {\n\t\treturn vmTable;\n\t}", "void printValues(Vector Vect){\n\t\tint index;\n\t\tfor(index=0;index< Vect.size(); index++){\t\n\t\t\tSystem.out.println(\"Element \" + Vect.elementAt(index));\n\t\t}\n\t\t\n\t}", "public void printHostNetworkInfo(String hostName){\r\n\t\tHostSystem hostSystem;\r\n\t\ttry {\r\n\t\t\thostSystem = searchHostSystem(hostName);\r\n\t\t\tNetwork[] networkArray = hostSystem.getNetworks();\r\n\t\t\tSystem.out.println(\"Name = \"+hostName);\r\n\t\t\tfor (int i = 0; i < networkArray.length; i++) {\r\n\t\t\t\tSystem.out.printf(\"Network[%d]: name = %s\\n\", i, networkArray[i].getName());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintInvalidHostNameMessage(hostName);\r\n\t\t}\r\n\r\n\t}", "public String[] getVirtualHosts() {\n return _virtualHosts;\n }", "private static void listCounters(String pid) {\n VmIdentifier vmId = null;\n try {\n vmId = new VmIdentifier(pid);\n } catch (URISyntaxException e) {\n System.err.println(\"Malformed VM Identifier: \" + pid);\n return;\n }\n try {\n MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost(vmId);\n MonitoredVm monitoredVm = monitoredHost.getMonitoredVm(vmId, -1);\n JStatLogger logger = new JStatLogger(monitoredVm);\n logger.printSnapShot(\"\\\\w*\", // all names\n new AscendingMonitorComparator(), // comparator\n false, // not verbose\n true, // show unsupported\n System.out);\n monitoredHost.detach(monitoredVm);\n } catch (MonitorException ex) {\n ex.printStackTrace();\n }\n }", "@Test(groups = {NETWORK_INTEGRATION_TESTS})\n public void getPrivateNetworkIPsByVirtualDatacenter()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan.getConfiguration(), vlan);\n\n IPAddress ip = IPAddress.newIPAddress(vlan.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan.getConfiguration().getMask()));\n\n persistIP(ip, lastIP, vdc, vlan);\n\n VLANNetwork vlan2 = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan2.getConfiguration(), vlan2);\n\n IPAddress ip2 =\n IPAddress.newIPAddress(vlan2.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP2 =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan2.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan2.getConfiguration().getMask()));\n\n persistIP(ip2, lastIP2, vdc, vlan2);\n\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n\n }", "public MyVM(String virtual_machine_name)\n {\n \ttry\n \t{\n \t\tthis.vmname= virtual_machine_name;\n \t\tthis.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()),\n\t\t\t\t\tSJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true);\n \t\t\n \t\tthis.folder = si.getRootFolder();\n \t\tthis.vm=(VirtualMachine) new InventoryNavigator(folder).searchManagedEntity(\"VirtualMachine\",\n \t\t\t\tthis.vmname);\n \t\tSystem.out.println(\"MyVM, vm value : \"+vm);\n \t\t\n \t\tthis.hs= (HostSystem) new InventoryNavigator(folder).searchManagedEntity(\"HostSystem\", \"130.65.132.194\");\n \t\tSystem.out.println(\"MyVM, HS value : \"+hs);\n \t\tthis.snapshotname=\"snap2\";\n \t\t\n \t}\n \tcatch(Exception e)\n \t{\n \t\tSystem.out.println(e.toString());\n \t}\n }", "public void viewVehiclesInGarage() {\n\t\tfor (Vehicle vehicle : vehicleList) {\n\t\t\tvehicle.print();\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "@Test(groups = {NETWORK_INTEGRATION_TESTS})\n public void getPrivateNetworkIPsByVirtualDatacenterOrderByVirtualAppliance()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan.getConfiguration(), vlan);\n\n IPAddress ip = IPAddress.newIPAddress(vlan.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan.getConfiguration().getMask()));\n\n persistIP(ip, lastIP, vdc, vlan);\n\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n validURI = validURI + \"?by=virtualappliance\";\n\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n }", "@Override\n\tpublic List<VIP> findAllVIP() {\n\t\treturn vb.findAll();\n\t}", "private void go(String[] args) {\n System.setProperty(\"jsse.enableSNIExtension\", \"false\");\n\n // process command line arguments\n options = new SampleCommandLineOptions();\n options.parseOptions(args);\n\n // Log in to vCHS API, getting a session in response if login is successful\n System.out.print(\"\\nConnecting to vCHS...\");\n\n authToken = IAM.login(options.hostname, options.username, options.password, options.version);\n\n System.out.println(\"Success\\n\");\n\n // Retrieve the collection of compute services which can be of type dedicated cloud or vpc\n // and has VDC in it.\n List<PlanType> plans = ServiceController.getPlans(options.hostname, options.version,\n authToken);\n if (null != plans && plans.size() > 0) {\n System.out.println(\"PLANS\");\n System.out.println(\"-----\");\n System.out.println();\n\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\", \"Name\", \"Id\", \"Region\",\n \"Service Name\", \"Plan Version\");\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\",\n \"----------------------------------------\",\n \"----------------------------------------\",\n \"--------------------------------------------------\",\n \"------------------------------\", \"-------------------\");\n\n for (PlanType plan : plans) {\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\", plan.getName(), plan.getId(),\n plan.getRegion(), plan.getServiceName(), plan.getPlanVersion());\n }\n }\n\n List<InstanceType> instances = ServiceController.getInstances(options.hostname,\n options.version, authToken);\n System.out.println(\"\\n\");\n\n if (null != instances && instances.size() > 0) {\n System.out.println(\"INSTANCES\");\n System.out.println(\"---------\");\n System.out.println();\n\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\", \"Name\", \"Id\", \"Region\", \"Plan Id\");\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\",\n \"----------------------------------------\",\n \"----------------------------------------\",\n \"--------------------------------------------------\",\n \"--------------------------------------------------\");\n\n for (InstanceType instance : instances) {\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\", instance.getName(),\n instance.getId(), instance.getRegion(), instance.getPlanId());\n }\n }\n\n System.out.println(\"\\n\\n\");\n }", "private void doViewAllPartners() {\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"***Hors Management System:: System Administration:: View All Partners\");\n\n List<Partner> partners = partnerControllerRemote.retrieveAllPartners();\n\n partners.forEach((partner) -> {\n System.out.println(\"Partner ID:\" + partner.getPartnerId() + \"Partner Name: \" + partner.getName() + \"Password: \" + partner.getPassword());\n });\n\n System.out.println(\"Press any key to continue...>\");\n sc.nextLine();\n }", "public void printAllComputers( ) { \n\t\tint i=1;\n\t\tfor (Computer temp : computers ) {\n\n\t\t\tSystem.out.println(\"Computer number : \"+i);\n\t\t\ttemp.printComputerSummary();\n\t\t\ti++;\n\n\t\t}\n\t}", "private void collectHostInformation() {\n java.lang.management.RuntimeMXBean rtMXB =\n java.lang.management.ManagementFactory.getRuntimeMXBean();\n final String jvmName = rtMXB.getName();\n try {\n metadata_.pid = Integer.parseInt(jvmName.split(\"@\")[0]);\n } catch (NumberFormatException e) {\n metadata_.pid = null;\n }\n\n metadata_.currentDir = System.getProperty(\"user.dir\");\n }", "public List<ServiceInstance<InstanceDetails>> listInstances() throws Exception {\n\t\tCollection<String> serviceNames = serviceDiscovery.queryForNames();\n\t\tSystem.out.println(serviceNames.size() + \" type(s)\");\n\t\tList<ServiceInstance<InstanceDetails>> list = new ArrayList<>();\n\t\tfor (String serviceName : serviceNames) {\n\t\t\tCollection<ServiceInstance<InstanceDetails>> instances = serviceDiscovery.queryForInstances(serviceName);\n\t\t\tSystem.out.println(serviceName);\n\t\t\tfor (ServiceInstance<InstanceDetails> instance : instances) {\n\t\t\t\toutputInstance(instance);\n\t\t\t\tlist.add(instance);\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "@Override\n\tpublic String displayInfo(String hostname) {\n\n\t\tList<MonitoringInfo> infos = monitoredHosts.get(getFullHostname(hostname));\n\t\treturn infos.stream().map(info -> info.toString()).collect(Collectors.joining(\", \"));\n\n\t}", "public List<ServiceInstance> getAllInstances();", "public void printComputerSummary() {\n\t\tfor (Component comp: configuration.values())\n\t\t{\n\t\t\tSystem.out.println(comp.getDescription());\n\t\t}\n\t}", "@GetMapping({ \"/vets\" })\n\tpublic @ResponseBody Vets showResourcesVetList() {\n\t\tVets vets = new Vets();\n\t\tvets.getVetList().addAll(this.vetRepository.findAll());\n\t\treturn vets;\n\t}", "public List<VirtualHost> getHosts() {\r\n return this.hosts;\r\n }", "@Override\n\tpublic List<TvShow> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "public List<Vet> getAllVets() {\n\t\tentityManager = JPAUtils.getEntityManager();\n\t\tentityManager.getTransaction().begin();\n\t\tvets = entityManager.createQuery(\"from Vet\", Vet.class).getResultList();\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t\treturn vets;\n\t}", "public void getRunningInstances() {\n LogContainerResultCallback resultCallback = new LogContainerResultCallback();\n //override method onNext of resultcallback\n dockerClient.logContainerCmd(\"id\").exec(resultCallback);\n dockerClient.attachContainerCmd(\"id\").withStdIn(new ByteArrayInputStream(\"list\\n\".getBytes()));\n }", "public List<VirtualMachine> listVirtualMachines(final Predicate<VirtualMachine> filter) {\n return Lists.newLinkedList(filter(listVirtualMachines(), filter));\n }", "@RequestMapping(value = {\"/user/{email}/{vmname}\",\"/admin/{email}/{vmname}\"}, method = RequestMethod.GET)\n\tpublic ModelAndView viewvm(@PathVariable String email,\n\t\t\t\t\t\t@PathVariable String vmname) {\n\t\tlogger.info(\"Showing VM \", vmname);\n\t\t\n\t\t//if(user != null){\n\t\t\tvMDetails = vMDaoImpl.getVMDetails(email, vmname);\n\t\t\tVmhardware vmhardware = vmServiceImpl.getVM(vmname);\n\t\t\tSystem.out.println(\"inside vmdetails - user- vms : \");\n\t\t//}\n\t\t\tModelAndView model = new ModelAndView();\n\t\t\t//model.addObject(this.user);\n\t\t\tmodel.addObject(\"vmhardware\", vmhardware);\n\t\t\tmodel.addObject(\"vms\",vMDetails);\n\t\t\tmodel.setViewName(\"vmdetails\");\n\t\t\treturn model;\n\t}", "@Test(groups = {NETWORK_INTEGRATION_TESTS})\n public void getPrivateNetworkIPsByVirtualDatacenterOrderByVirtualDatacenter()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan.getConfiguration(), vlan);\n\n IPAddress ip = IPAddress.newIPAddress(vlan.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan.getConfiguration().getMask()));\n\n persistIP(ip, lastIP, vdc, vlan);\n\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n validURI = validURI + \"?by=virtualdatacenter\";\n\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n }", "VirtualMachine[] getPlacedVirtualMachines() {\n VirtualMachine[] vms = new VirtualMachine[mapped_vms.size()];\n mapped_vms.toArray(vms);\n return vms;\n }", "private void psvm() {\n\t\tSystem.out.println(\"test\");\r\n\t}", "public static void logJVMInfo() {\n // Print out vm stats before starting up.\n RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();\n if (runtime != null) {\n LOG.info(\"vmName=\" + runtime.getVmName() + \", vmVendor=\"\n + runtime.getVmVendor() + \", vmVersion=\" + runtime.getVmVersion());\n LOG.info(\"vmInputArguments=\" + runtime.getInputArguments());\n }\n }", "public void getVisibleVirtualViews(List<Integer> list) {\n if (AbsVideoSceneMgr.this.getActiveScene() != null) {\n AbsVideoSceneMgr.this.getActiveScene().getAccessibilityVisibleVirtualViews(list);\n }\n }", "public void setNumVMs(int numVMs) {\n this.numVMs = numVMs;\n }", "public static void mostrarVehiculos() {\n for (Vehiculo elemento : vehiculos) {\n System.out.println(elemento);\n }\n\t}", "@Override\n\tpublic List<Parking> VIPparkings() {\n\t\treturn parkingRepository.VIPparkings();\n\t}", "public void printCluster(PrintStream outs)\n {\n for (String upNode : getLiveNodes().split(\"\\\\s+\"))\n {\n if (upNode.length() > 0)\n {\n outs.println(String.format(\"%-21s up\", upNode));\n }\n }\n \n for (String downNode : getUnreachableNodes().split(\"\\\\s+\"))\n {\n if (downNode.length() > 0)\n {\n outs.println(String.format(\"%-21s down\", downNode));\n }\n }\n }", "public void display() {\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tString str = vname + \" => \";\r\n\t\t\tVertex vtx = vces.get(vname);\r\n\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tstr += nbrname + \"[\" + vtx.nbrs.get(nbrname) + \"], \";\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(str + \".\");\r\n\t\t}\r\n\t}", "public static void listVehicles() {\n\t\tSystem.out.println(\"-----------------\");\n\t\tSystem.out.println(\"Listing Vehicles\");\n\t\tSystem.out.println(\"-----------------\");\n\t\t\n\t\tfor (int i = 0; i < owners.size(); i++) {\n\t\t\tfor (Vehicle v : owners.get(i).getVehicles()) {\n\t\t\t\t\n\t\t\t\tSystem.out.println((owners.get(i).getName() + \"'s \" + v.toString()));\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t}", "private void printElasticSearchInfo() {\n\n LOGGER.info(\"-- ElasticSearch Store info --\");\n\n Client client = persistenceConfig.elasticsearchTemplate().getClient();\n Map<String, String> asMap = client.settings().getAsMap();\n\n asMap.forEach((k, v) -> {\n LOGGER.info(\" \" +k + \" = \" + v);\n });\n LOGGER.info(\"-- --\");\n }", "@GetMapping(\"/vets.html\")\n\tpublic String showVetList(Map<String, Object> model) {\n\t\tVets vets = new Vets();\n\t\tList<Vet> allVets = (List<Vet>) vetRepository.findAll();\n\t\tCollections.sort(allVets, Comparator.comparing(vet -> vet.getFirstName()));\n\t\tvets.getVetList().addAll(allVets);\n\t\tmodel.put(\"vets\", vets);\n\t\treturn \"vets/vetList\";\n\t}", "public void showHotels() {\n System.out.println(\"-----Hotels: ------\");\n hotelsService.getHotels().forEach(System.out::println);\n }", "public void showHouses() {\n System.out.println(\"-----Houses List-----\");\n System.out.println(\"No\\tOwner\\tPhone\\t\\tAddress\\t\\t\\t\\tRent\\tState\");\n houseService.listHouse();\n System.out.println(\"------List Done------\");\n }", "public List<VirtualMachine> listRemoteVirtualMachines(final Predicate<VirtualMachine> filter) {\n return Lists.newLinkedList(filter(listVirtualMachines(), filter));\n }", "@Test(groups = {NETWORK_INTEGRATION_TESTS})\n public void getPrivateNetworkIPsByVirtualDatacenterOrderByVlan()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan.getConfiguration(), vlan);\n\n IPAddress ip = IPAddress.newIPAddress(vlan.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan.getConfiguration().getMask()));\n\n persistIP(ip, lastIP, vdc, vlan);\n\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n validURI = validURI + \"?by=vlan\";\n\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n }", "@ZAttr(id=352)\n public String[] getVirtualHostname() {\n return getMultiAttr(Provisioning.A_zimbraVirtualHostname);\n }", "public void print() {\n\t\tSystem.out.println(\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName+\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)+\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress);\r\n\t}", "void printToConsole() {\n\t\tSystem.out.println(\"PROVIDER DIRECTORY:\");\n\t\tfor (int i = 0; i < services.size(); i++) {\n\t\t\tString service = services.get(i).getServiceName() + \" (\" + services.get(i).getServiceNumber() + \") for $\" + services.get(i).getServiceFee();\n\t\t\tSystem.out.println(\"\\t\" + service);\n\t\t}\n\t}", "public void printVehicleDetails(Vehicle v) {\n\t\tSystem.out.println(\"Mileage: \"+v.mileage());\n\t\tSystem.out.println(\"Wheels: \"+v.wheels());\n\t}", "public static void printRemoteResults(@NotNull RemoteResponse[] results, boolean all) {\n final String separatorText = \"-\".repeat(80);\n System.out.println();\n System.out.println(\"SBK-GEM Remote Results\");\n for (int i = 0; i < results.length; i++) {\n System.out.println(separatorText);\n System.out.println(\"Host \" + (i + 1) + \": \" + results[i].host + \", return code: \" + results[i].returnCode);\n if (all || results[i].returnCode != 0) {\n System.out.println();\n System.out.println(\" : stdout : \\n\");\n System.out.println(results[i].stdOutput);\n System.out.println(\" : stderr : \");\n System.out.println(results[i].errOutput);\n }\n }\n System.out.println(separatorText);\n }", "private void printAllClients() {\n Set<Client> clients = ctrl.getAllClients();\n clients.stream().forEach(System.out::println);\n }", "private static void listInstances(ServiceDiscovery<InstanceDetails> serviceDiscovery) throws\n Exception {\n \n try {\n Collection<String> serviceNames = serviceDiscovery.queryForNames();\n System.out.println(serviceNames.size() + \" type(s)\");\n for (String serviceName : serviceNames) {\n Collection<ServiceInstance<InstanceDetails>> instances = serviceDiscovery\n .queryForInstances(serviceName);\n System.out.println(serviceName);\n for (ServiceInstance<InstanceDetails> instance : instances) {\n outputInstance(instance);\n }\n }\n } finally {\n CloseableUtils.closeQuietly(serviceDiscovery);\n }\n }", "public void PrintClassVector() {\n\t\tfor(int i=0; i<class_vect.length; i++) {\n\t\t\tSystem.out.print(class_vect[i]+\" \");\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\");\n\t}", "@Test(enabled = false)\n public void getPrivateNetworkIPsByVirtualDatacenterTestLimit()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan.getConfiguration(), vlan);\n\n IPAddress ip = IPAddress.newIPAddress(vlan.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan.getConfiguration().getMask()));\n\n persistIP(ip, lastIP, vdc, vlan);\n\n // Test Default\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n IpsPoolManagementDto entity = response.getEntity(IpsPoolManagementDto.class);\n assertEquals(200, response.getStatusCode());\n assertNotNull(entity);\n assertNotNull(entity.getCollection());\n assertEquals(Integer.valueOf(entity.getCollection().size()),\n AbstractResource.DEFAULT_PAGE_LENGTH);\n\n // Test 30\n validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n validURI = validURI + \"?limit=30\";\n response = get(validURI, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(200, response.getStatusCode());\n assertNotNull(entity);\n assertNotNull(entity.getCollection());\n assertEquals(entity.getCollection().size(), 30);\n\n // Test 120\n validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n validURI = validURI + \"?limit=120\";\n response = get(validURI, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(200, response.getStatusCode());\n assertNotNull(entity);\n assertNotNull(entity.getCollection());\n assertEquals(entity.getCollection().size(), 120);\n\n }", "protected void printClusters(List<Cluster> clusters) {\n ListIterator<Cluster> i = clusters.listIterator();\n while (i.hasNext()) {\n System.out.print(\"----cluster \" + i.nextIndex() + \" : \");\n System.out.println(i.next());\n }\n System.out.println(\"----\");\n }", "public synchronized void PrintDisplayList()\t{\n\t\tSystem.out.print(\"\\n\\tCar Model:\"+getModel()+\"\\n\\tBase Price is:\"\n +getBasePrice());\n\t\tfor(OptionSet Temp: opset)\n System.out.print(Temp.DisplayOptionSet());\n }", "public void printList()\n {\n tasks.forEach(task -> System.out.println(task.getDetails()));\n }", "public Collection retrieveAllHostsFor (DomainVO vo)\n\t\t\t throws FinderException, RemoteException\n\t{\n\t\treturn retrieveAllHostsFor(vo.getId());\n\t}", "@RequestMapping(\"getStatusOfVm\")\n @ResponseBody\n public VmModel getStatusOfVm(ModelMap map, @RequestParam(value = \"vappName\", required = false) String vappName,\n @RequestParam(value = \"vmName\", required = false) String vmName,\n\n HttpServletRequest request) {\n\n \t_LOG.info(\"getStatusOfVm()..........................\");\n HttpSession session = request.getSession();\n String orgName = (String) session.getAttribute(Constants.SESSION_ORGNAME);\n String vappUrl = request.getParameter(\"vappUrl\");\n VmModel vm = new VmModel();\n ResourceTask resourceTask = vCloudService.getStatusOfVappOrVm(\"vm\", vmName, vappUrl, orgName);\n if (resourceTask.getTaskstatus() != null && resourceTask.getTaskstatus().equals(ResourceStatus.FINISHED)) {\n vm.setStatus(\"true\");\n } else if (resourceTask.getTaskstatus() == null\n || resourceTask.getTaskstatus().equals(ResourceStatus.IN_PROGRESS)) {\n vm.setStatus(\"false\");\n }\n\n if (resourceTask != null && resourceTask.getChildren() != null) {\n if (resourceTask.getChildren().size() != 1) {\n for (ResourceTask i : resourceTask.getChildren()) {\n if (i.getName().equals(vmName)) {\n for (Link link : i.getLinks()) {\n if (link.getRel() != null && link.getRel().equals(\"undeploy\")) {\n vm.setPowerOffUrl(link.getHref());\n vm.setPauseUrl(link.getHref());\n } else if (link.getRel() != null && link.getRel().equals(\"power:powerOn\")) {\n vm.setPowerOnUrl(link.getHref());\n } else if (link.getRel() != null && link.getRel().equals(\"snapshot:revertToCurrent\")) {\n vm.setRevertUrl(link.getHref());\n } else if (link.getRel() != null && link.getRel().equals(\"screen:acquireTicket\")) {\n vm.setTicket(link.getHref());\n }\n }\n }\n }\n } else {\n for (ResourceTask i : resourceTask.getChildren()) {\n for (Link link : i.getLinks()) {\n if (link.getRel() != null && link.getRel().equals(\"undeploy\")) {\n vm.setPowerOffUrl(link.getHref());\n } else if (link.getRel() != null && link.getRel().equals(\"power:powerOn\")) {\n vm.setPowerOnUrl(link.getHref());\n } else if (link.getRel() != null && link.getRel().equals(\"snapshot:revertToCurrent\")) {\n vm.setRevertUrl(link.getHref());\n } else if (link.getRel() != null && link.getRel().equals(\"screen:acquireTicket\")) {\n vm.setTicket(link.getHref());\n } else if (link.getRel() != null && link.getRel().equals(\"power:suspend\")) {\n vm.setPauseUrl(link.getHref());\n }\n\n }\n }\n }\n }\n\n User user = (User) session.getAttribute(\"user\");\n Event event = eventService.getEvent(user);\n vm.setAdvanced(event.getAdvanced() == true ? 1 : 0);\n return vm;\n\n }", "public MyVM( ) \n {\n // initialise instance variables\n try \n {\n // your code here\n \tthis.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()),\n\t\t\t\t\tSJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true);\n } \n catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n\n }", "private static void JVMInfo() {\n System.out.println(\"Available processors (cores): \" +\n Runtime.getRuntime().availableProcessors());\n\n /* Total amount of free memory available to the JVM */\n System.out.println(\"Free memory (bytes): \" +\n Runtime.getRuntime().freeMemory());\n\n /* This will return Long.MAX_VALUE if there is no preset limit */\n long maxMemory = Runtime.getRuntime().maxMemory();\n /* Maximum amount of memory the JVM will attempt to use */\n System.out.println(\"Maximum memory (bytes): \" +\n (maxMemory == Long.MAX_VALUE ? \"no limit\" : maxMemory));\n\n /* Total memory currently in use by the JVM */\n System.out.println(\"Total memory (bytes): \" +\n Runtime.getRuntime().totalMemory());\n\n }", "public String getBoxNetHost();", "@Override\n @GET\n @Path(\"/vms/{id}\")\n @Produces(\"application/json\")\n public Response getVMRegistration(@PathParam(\"id\") int id) throws JSONException {\n if (log.isTraceEnabled()) {\n log.trace(String.format(\"getVMRegistration(%d) started.\", id));\n }\n for (Vm vm : cluster.getVmList()) {\n if (vm.getVmId() == id) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/vms/%d\", rootUri, vm.getVmId());\n String vmUri = String.format(\"/providers/%d/vms/%d\", provider.getProviderId(), vm.getVmId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", vmUri);\n log.trace(\"getVMRegistration() finished successfully. VM registration found.\");\n return Response.ok(o.toString()).build();\n }\n }\n\n log.trace(\"VM is not registered at given cluster.\");\n throw new WebApplicationException(Response.Status.NOT_FOUND);\n }", "public Map<String, VPlexVirtualVolumeInfo> getVirtualVolumes(boolean shallow) throws VPlexApiException {\n s_logger.info(\"Request for {} discovery of virtual volume info for VPlex at {}\",\n (shallow ? \"shallow\" : \"deep\"), _baseURI);\n\n Map<String, VPlexVirtualVolumeInfo> virtualVolumeInfoMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n Map<String, VPlexVirtualVolumeInfo> distributedVirtualVolumesMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n Map<String, Map<String, VPlexVirtualVolumeInfo>> localVirtualVolumesMap = new HashMap<String, Map<String, VPlexVirtualVolumeInfo>>();\n\n // Get the cluster information.\n List<VPlexClusterInfo> clusterInfoList = getClusterInfoLite();\n for (VPlexClusterInfo clusterInfo : clusterInfoList) {\n String clusterId = clusterInfo.getName();\n // for each cluster get the virtual volume information.\n List<VPlexVirtualVolumeInfo> clusterVirtualVolumeInfoList = _discoveryMgr.getVirtualVolumesForCluster(clusterId);\n for (VPlexVirtualVolumeInfo virtualVolumeInfo : clusterVirtualVolumeInfoList) {\n virtualVolumeInfo.addCluster(clusterId);\n String virtualVolumeName = virtualVolumeInfo.getName();\n\n if (!virtualVolumeInfoMap.containsKey(virtualVolumeName)) {\n // We want the unique list of virtual volumes on all\n // clusters. Distributed volumes will appear on both\n // clusters.\n virtualVolumeInfoMap.put(virtualVolumeName, virtualVolumeInfo);\n\n // If we are doing a deep discovery of the virtual volumes\n // keep a list of the distributed virtual volumes and a list\n // of the local virtual volumes for each cluster.\n if (!shallow) {\n String supportingDeviceName = virtualVolumeInfo.getSupportingDevice();\n if (VPlexVirtualVolumeInfo.Locality.distributed.name().equals(\n virtualVolumeInfo.getLocality())) {\n distributedVirtualVolumesMap.put(supportingDeviceName,\n virtualVolumeInfo);\n } else {\n Map<String, VPlexVirtualVolumeInfo> clusterLocalVolumesMap = localVirtualVolumesMap\n .get(clusterId);\n if (clusterLocalVolumesMap == null) {\n clusterLocalVolumesMap = new HashMap<String, VPlexVirtualVolumeInfo>();\n localVirtualVolumesMap.put(clusterId, clusterLocalVolumesMap);\n }\n clusterLocalVolumesMap.put(supportingDeviceName, virtualVolumeInfo);\n }\n }\n } else if (VPlexVirtualVolumeInfo.Locality.distributed.name().equals(\n virtualVolumeInfo.getLocality())) {\n // on a distributed volume, we need to be sure to add the second\n // cluster id as well... this is needed by ingestion. see CTRL-10982\n virtualVolumeInfoMap.get(virtualVolumeName).addCluster(clusterId);\n }\n }\n }\n // Do the deep discovery of the component structure for each\n // virtual volume, if necessary.\n if (!shallow) {\n // Get the component structure for each distributed virtual volume\n // starting with the supporting distributed device.\n _discoveryMgr.setSupportingComponentsForDistributedVirtualVolumes(distributedVirtualVolumesMap);\n\n // Get the component structure for each local virtual volume\n // starting with the supporting local device.\n for (Map.Entry<String, Map<String, VPlexVirtualVolumeInfo>> mapEntry : localVirtualVolumesMap\n .entrySet()) {\n _discoveryMgr.setSupportingComponentsForLocalVirtualVolumes(\n mapEntry.getKey(), mapEntry.getValue());\n }\n }\n\n return virtualVolumeInfoMap;\n }", "private void ViewAccounts() {\n for (int k = 0; k < accountList.size(); k++) {\n\n System.out.print(k + \": \" + accountList.get(k) + \" || \");\n\n }\n }", "private static void printAll(Class cls, PersistenceManager pm) {\n Extent extent = pm.getExtent(cls, true);\n Iterator itr = extent.iterator();\n printCollection(\"All \" + cls.getName() + \" instances:\", itr);\n extent.close(itr);\n }", "@GetMapping(value = \"/getInfo\")\n @ResponseBody\n public String getInfo() {\n System.out.println(\"discoveryClient.getServices().size() = \" + discoveryClient.getServices().size());\n\n StringBuffer stringBuffer = new StringBuffer();\n for( String s : discoveryClient.getServices()){\n System.out.println(\"services \" + s);\n List<ServiceInstance> serviceInstances = discoveryClient.getInstances(s);\n for(ServiceInstance si : serviceInstances){\n stringBuffer.append(\" services:\" + s + \":getHost()=\" + si.getHost());\n stringBuffer.append(\"\\n\");\n stringBuffer.append(\" services:\" + s + \":getPort()=\" + si.getPort());\n stringBuffer.append(\"\\n\");\n stringBuffer.append(\" services:\" + s + \":getServiceId()=\" + si.getServiceId());\n stringBuffer.append(\"\\n\");\n stringBuffer.append(\" services:\" + s + \":getUri()=\" + si.getUri());\n stringBuffer.append(\"\\n\");\n stringBuffer.append(\" services:\" + s + \":getMetadata()=\" + si.getMetadata());\n stringBuffer.append(\"\\n\");\n stringBuffer.append(\" services:\" + s + \":getScheme()=\" + si.getScheme());\n stringBuffer.append(\"\\n\");\n\n System.out.println(\" services:\" + s + \":getHost()=\" + si.getHost());\n System.out.println(\" services:\" + s + \":getPort()=\" + si.getPort());\n System.out.println(\" services:\" + s + \":getServiceId()=\" + si.getServiceId());\n System.out.println(\" services:\" + s + \":getUri()=\" + si.getUri());\n System.out.println(\" services:\" + s + \":getMetadata()=\" + si.getMetadata());\n System.out.println(\" services:\" + s + \":getScheme()=\" + si.getScheme());\n System.out.println();\n }\n }\n return \"ok\";\n }", "private void printResult()\n\t{\n\t\t java.util.Iterator<Entry<String, Guest>> it = guestMapList.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry)it.next();\n Guest guest = (Guest) pair.getValue();\n if(guest.isInvited())\n \t \tSystem.out.println(\"guest \"+guest.getName()+\" should invited!!\");\n it.remove(); // avoids a ConcurrentModificationException\n }\n\t}", "@Test(groups = {NETWORK_INTEGRATION_TESTS})\n public void getPrivateNetworkIPsByVirtualDatacenterOrderByIp()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan.getConfiguration(), vlan);\n\n IPAddress ip = IPAddress.newIPAddress(vlan.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan.getConfiguration().getMask()));\n\n persistIP(ip, lastIP, vdc, vlan);\n\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n validURI = validURI + \"?by=ip\";\n\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n }", "public VirtualMachinesStatistics getStatistics() {\n return statistics;\n }", "public void printHelpCommands(){\r\n\t\t//Construct the help command output\r\n\t\tprintAsTable(\"exit\",\t\t \t\t\t\t\"Exit the program.\");\r\n\t\tprintAsTable(\"help\",\t\t \t\t\t\t\"Print out the usage.\");\r\n\t\tprintAsTable(\"host\",\t\t\t\t\t\t\"Enumerate all hosts.\");\r\n\t\tprintAsTable(\"host hname info\", \t\t\t\"Show info of host name.\");\r\n\t\tprintAsTable(\"host hname datastore\", \t\t\"Enumerate datastores of host hname.\");\r\n\t\tprintAsTable(\"host hname network\", \t\t\t\"Enumerate networks of host hname.\");\r\n\t\tprintAsTable(\"vm\", \t\t\t\t\t\t\t\"Enumerate all virtual machines.\");\r\n\t\tprintAsTable(\"vm vname info\", \t\t\t\t\"Show info of VM vname.\");\r\n\t\tprintAsTable(\"vm vname on\", \t\t\t\t\"Power on VM vname and wait until task completes.\");\r\n\t\tprintAsTable(\"vm vname off\", \t\t\t\t\"Power off VM vname and wait until task completes.\");\r\n\t\tprintAsTable(\"vm vname shutdown\", \t\t\t\"Shutdown guest of VM vname.\");\t\t\t\r\n\t}", "public List<SizeInfo> vmSizes() {\n return this.vmSizes;\n }", "public void showStreets() {\n\t\tMonopolyClient.getStreets();\n\t}", "private void print(FromHostResult < CustomerData > result) {\n try {\n System.out.println(\"Host bytes converted : \"\n + result.getBytesProcessed());\n System.out.println(\"Result JAXB instance as XML :\");\n JAXBContext jaxbContext = JAXBContext.newInstance(CustomerData.class);\n Marshaller marshaller = jaxbContext.createMarshaller();\n marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);\n marshaller.marshal(\n new ObjectFactory().createCustomerData(result.getValue()),\n System.out);\n } catch (JAXBException e) {\n throw new RuntimeException(e);\n }\n }", "VM createVM();", "public Vector<NetworkAddress> getHostAddresses() { return hostAddresses; }" ]
[ "0.7695324", "0.70809215", "0.6694747", "0.6642496", "0.66139114", "0.6528943", "0.62099004", "0.60871565", "0.59663665", "0.5879662", "0.5877476", "0.57794803", "0.57323897", "0.5612325", "0.55618805", "0.55256134", "0.5518479", "0.54935807", "0.5492855", "0.54715914", "0.5464669", "0.5407108", "0.5403887", "0.5372524", "0.533976", "0.53231746", "0.53218347", "0.53115445", "0.5305207", "0.529033", "0.5289079", "0.52829415", "0.52691764", "0.5254635", "0.5245659", "0.52228767", "0.5222741", "0.5220653", "0.52033114", "0.5198396", "0.5165738", "0.5150937", "0.5136818", "0.51272786", "0.5127246", "0.5123217", "0.5115824", "0.51099765", "0.51083654", "0.51031303", "0.50994843", "0.50986755", "0.5098601", "0.50860685", "0.5077377", "0.5077306", "0.50768733", "0.50744337", "0.5057311", "0.5050006", "0.5039859", "0.5029157", "0.5026797", "0.5020824", "0.5010434", "0.50045794", "0.49969253", "0.49945438", "0.4986622", "0.49854836", "0.4984531", "0.4984282", "0.49823707", "0.49810335", "0.49722472", "0.49708042", "0.49555784", "0.4947525", "0.49426198", "0.49388626", "0.49315977", "0.49141973", "0.491419", "0.4907304", "0.49067175", "0.4905254", "0.4904787", "0.48975876", "0.48955044", "0.4894573", "0.48751196", "0.48714563", "0.48665836", "0.48657218", "0.48627225", "0.48609325", "0.48602435", "0.48446748", "0.4832439", "0.48134238" ]
0.63159966
6
Dictionary table (entity). May return possible values for a set of attributes.
public interface DBSDictionary { /** * Checks that this constrain supports key enumerations. * Usually it depends on constraint type (enumerations makes sense only for unique constraints). * @return true or false */ boolean supportsDictionaryEnumeration(); /** * Gets enumeration values * * @param monitor session * @param keyColumn enumeration column. * @param keyPattern pattern for enumeration values. If null or empty then returns full enumration set * @param searchText * @param preceedingKeys other constrain key values. May be null. * @param caseInsensitiveSearch use case-insensitive search for {@code keyPattern} * @param sortAsc ascending sorting (irrelevant is {@code sortByValue} is false) * @param sortByValue sort results by value * @param offset enumeration values offset in result set * @param maxResults maximum enumeration values in result set * @return statement with result set which contains valid enumeration values. */ @NotNull List<DBDLabelValuePair> getDictionaryEnumeration( @NotNull DBRProgressMonitor monitor, @NotNull DBSEntityAttribute keyColumn, @Nullable Object keyPattern, @Nullable String searchText, @Nullable List<DBDAttributeValue> preceedingKeys, boolean caseInsensitiveSearch, boolean sortAsc, boolean sortByValue, int offset, int maxResults ) throws DBException; @NotNull List<DBDLabelValuePair> getDictionaryValues( @NotNull DBRProgressMonitor monitor, @NotNull DBSEntityAttribute keyColumn, @NotNull List<Object> keyValues, @Nullable List<DBDAttributeValue> preceedingKeys, boolean sortByValue, boolean sortAsc ) throws DBException; @NotNull DBSDictionaryAccessor getDictionaryAccessor( @NotNull DBRProgressMonitor monitor, @Nullable List<DBDAttributeValue> precedingKeys, @NotNull DBSEntityAttribute keyColumn, boolean sortAsc, boolean sortByDesc ) throws DBException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Map<String, Object> getAttributes();", "Map<String, String> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "public abstract Map getAttributes();", "public Map<String, Object> getAttributes();", "public Map<String, Object> getAttributes();", "public Map<String, String> getAttributes();", "public Map<String, Object> getAttrs();", "public Map<String, Object> attributes() {\n Map<String, Object> attributes = new HashMap<String, Object>();\n for (Column column : getColumns()) {\n String name = Strings.camelize(column.getName(), true);\n attributes.put(name, attribute(name));\n }\n return attributes;\n }", "java.util.Map<java.lang.String, java.lang.String> getAttributesMap();", "public HashMap<String, String> GetRawAttributes();", "Map getGenAttributes();", "public TableAttributes getAttributes() {\n\treturn attrs;\n }", "public Map<EntityMode,String> getTuplizerClassMap();", "private Hashtable getRequestedAttributes() {\n\tif (fRequestedAttributes == null) {\n\t fRequestedAttributes = new Hashtable(7, (float)0.9);\n fRequestedAttributes.put(TextAttribute.TRANSFORM,\n\t\t\t\t IDENT_TX_ATTRIBUTE);\n fRequestedAttributes.put(TextAttribute.FAMILY, name);\n fRequestedAttributes.put(TextAttribute.SIZE, new Float(size));\n\t fRequestedAttributes.put(TextAttribute.WEIGHT,\n\t\t\t\t (style & BOLD) != 0 ? \n\t\t\t\t TextAttribute.WEIGHT_BOLD :\n\t\t\t\t TextAttribute.WEIGHT_REGULAR);\n\t fRequestedAttributes.put(TextAttribute.POSTURE,\n\t\t\t\t (style & ITALIC) != 0 ? \n\t\t\t\t TextAttribute.POSTURE_OBLIQUE :\n\t\t\t\t TextAttribute.POSTURE_REGULAR);\n fRequestedAttributes.put(TextAttribute.SUPERSCRIPT,\n new Integer(superscript));\n fRequestedAttributes.put(TextAttribute.WIDTH,\n new Float(width));\n\t}\n\treturn fRequestedAttributes;\n }", "Object[] getAttributes() throws SQLException;", "public void getOrgUnitAttributeValueMap()\n {\n orgUnitAttributeValueMap = new HashMap<Integer, String>();\n try\n {\n String query = \"SELECT org.organisationunitid, attvalue.value from attributevalue attvalue \" +\n \"INNER JOIN organisationunitattributevalues org ON org.attributevalueid = attvalue.attributevalueid \" + \n \"Where attvalue.attributeid = 1\";\n \n //System.out.println( \"data-set-Query - \" + query );\n SqlRowSet rs = jdbcTemplate.queryForRowSet( query );\n while ( rs.next() )\n {\n Integer orgUnitId = rs.getInt( 1 );\n String orgUnitAttribueValue = rs.getString( 2 );\n \n //System.out.println( orgUnitId + \" : \" + orgUnitAttribueValue );\n \n if ( orgUnitId != null && orgUnitAttribueValue != null )\n {\n orgUnitAttributeValueMap.put( orgUnitId, orgUnitAttribueValue );\n }\n }\n //return orgUnitAttributeValueMap;\n }\n catch ( Exception e )\n {\n throw new RuntimeException( \"Illegal OrgUnitIds \", e );\n }\n }", "protected Hashtable attributesToTags(Attributes atts)\n throws SAXException\n {\n\tHashtable<XMLTag,Object> table = null;\n\tfor (int i = 0; i < atts.getLength(); i++)\n\t {\n\t if (table == null)\n\t table = new Hashtable<XMLTag,Object>(atts.getLength());\n\t String name = atts.getQName(i);\n\t String value = atts.getValue(i);\n\t XMLTag nameTag = XMLTag.lookUp(name);\n\t if (nameTag == null)\n\t throw new SAXException(\"No tag found for attribute \" + name);\n\t if (nameTag.hasTagValue())\n\t {\n\t XMLTag valueTag = XMLTag.lookUp(value);\n\t if (valueTag != null)\n table.put(nameTag,valueTag);\n\t\t else\n\t throw new SAXException(\"Invalid value (\" +\n\t\t\t\t value + \") found for attribute \" + name);\n\t\t }\n\t else\n\t table.put(nameTag,value);\n\t }\n\treturn table;\n\t}", "public AttributeTable getSignedAttributes()\n {\n if (signedAttributeSet != null && signedAttributeValues == null)\n {\n signedAttributeValues = new AttributeTable(signedAttributeSet);\n }\n\n return signedAttributeValues;\n }", "public Map<String, Object> getAttributeValues()\n\t{\n\t\tMap<String, Object> retval = new TreeMap<>();\n\t\t\n\t\tfor (ClassAttribute attribute : attributes.keySet())\n\t\t{\n\t\t\tretval.put(attribute.shortName, attributes.get(attribute));\n\t\t}\n\t\t\n\t\treturn retval;\n\t}", "@Override\n\tpublic AttributeMap getAttributes() {\n\t\treturn defaultEdgle.getAttributes();\n\t}", "public java.util.Collection getAttributes();", "public HashMap<Integer, List<TemplateAttribute>> getAttrsByTemplate() {\n if (t_attrs == null) {\n t_attrs = new HashMap<Integer, List<TemplateAttribute>>();\n }\n return t_attrs;\n }", "public Enumeration getAttributes()\n {\n ensureLoaded();\n return m_tblAttribute.elements();\n }", "default List<Object> getPrimaryAttributeValues(T entity) {\n\t\treturn getPrimaryAttributes().stream().map(attr -> attr.getValue(entity)).collect(Collectors.toList());\n\t}", "public Map<String, String> getAttributes() {\n\t\treturn atts;\n\t}", "HashMap getMasterAttributes() throws BaseException;", "@Override\n\tpublic Attributes getAttributes() {\n\t\treturn (Attributes)map.get(ATTRIBUTES);\n\t}", "public HashMap<String, List<String>> getItemMap() {\r\n\r\n\t\thelmet_abilities.add(Game_constants.INTELLIGENCE);\r\n\t\thelmet_abilities.add(Game_constants.WISDOM);\r\n\t\thelmet_abilities.add(Game_constants.ARMOR_CLASS);\r\n\r\n\t\tarmor_abilities.add(Game_constants.ARMOR_CLASS);\r\n\r\n\t\tshield_abilities.add(Game_constants.ARMOR_CLASS);\r\n\r\n\t\tring_abilities.add(Game_constants.ARMOR_CLASS);\r\n\t\tring_abilities.add(Game_constants.STRENGTH);\r\n\t\tring_abilities.add(Game_constants.CONSTITUTION);\r\n\t\tring_abilities.add(Game_constants.WISDOM);\r\n\t\tring_abilities.add(Game_constants.CHARISMA);\r\n\r\n\t\tbelt_abilities.add(Game_constants.CONSTITUTION);\r\n\t\tbelt_abilities.add(Game_constants.STRENGTH);\r\n\r\n\t\tboots_abilities.add(Game_constants.ARMOR_CLASS);\r\n\t\tboots_abilities.add(Game_constants.DEXTERITY);\r\n\r\n\t\tweapon_abilities.add(Game_constants.ATTACK_BONUS);\r\n\t\tweapon_abilities.add(Game_constants.DAMAGE_BONUS);\r\n\r\n\t\titem_map.put(Game_constants.HELMET, helmet_abilities);\r\n\t\titem_map.put(Game_constants.ARMOR, armor_abilities);\r\n\t\titem_map.put(Game_constants.SHIELD, shield_abilities);\r\n\t\titem_map.put(Game_constants.RING, ring_abilities);\r\n\t\titem_map.put(Game_constants.BELT, belt_abilities);\r\n\t\titem_map.put(Game_constants.BOOTS, boots_abilities);\r\n\t\titem_map.put(Game_constants.WEAPON_MELEE, weapon_abilities);\r\n\t\titem_map.put(Game_constants.WEAPON_RANGE, weapon_abilities);\r\n\r\n\t\treturn item_map;\r\n\r\n\t}", "@Override\r\n\tpublic Map<String, String> getAttributes() {\r\n\t\treturn this.attributes;\r\n\t}", "public Map<String,Object> getAttributeMap() {\r\n return Maps.newHashMap(attributeMap);\r\n }", "@Override\n protected Map<TableUniqueName, String> tableSubstitution() {\n return ImmutableMap.of();\n }", "public Collection<HbAttributeInternal> attributes();", "public Map<String, String> getTable() {\n return map; // TODO\n }", "public void setAttributes(TableAttributes attrs) {\n\tthis.attrs = attrs;\n }", "List<Attribute<T, ?>> getAttributes();", "Object[] getAttributes(Map<String, Class<?>> map)\n throws SQLException;", "public Map<String, Set<String>> getAttributes() {\n return attributes;\n }", "public Map<String, String> getStatementVariants();", "@Override\n @EntityGraph(value = \"graph.Anime.allAttributes\")\n Page<Anime> findAll(Pageable pageable);", "Map<String, IAttribute> getConnectedAttributes();", "@Override\r\n\tpublic Map<String, Object> getAttributes() {\n\t\treturn null;\r\n\t}", "public Map<TextAttribute,?> getAttributes(){\n return (Map<TextAttribute,?>)getRequestedAttributes().clone();\n }", "public static Map<String, String> getTableMap() {\n return tableMap;\n }", "@Override\n\tpublic List<DataDictionaryValueEntity> queryFlabelleavemonth4Dict() {\n\t\treturn null;\n\t}", "Attributes getAttributes();", "List<Map<String, Object>> getTableValuesWithHeaders();", "public String[] getRelevantAttributes();", "AttributeValues getAttributeValues(Constraint constraint, Object context, EAttribute attribute);", "public LinkedHashMap<String, LinkedHashSet<String>> getConditionsFromTable() {\n\t\tLinkedHashMap<String, LinkedHashSet<String>> toReturn = new LinkedHashMap<String, LinkedHashSet<String>>();\n\t\tfor (int i = 0; i < modelCondTable.getRowCount(); i++) {\n\t\t\tString key = (String) modelCondTable.getValueAt(i, 0);\n\t\t\tString value = (String) modelCondTable.getValueAt(i, 1);\n\t\t\tLinkedHashSet<String> setValue = new LinkedHashSet<String>(Arrays.asList(value.split(\";\")));\n\n\t\t\ttoReturn.put(key, setValue);\n\t\t}\n\t\treturn toReturn;\n\t}", "public ArrayList<Column> getTableAttributes(String table) throws QueryFailedException {\n String query = String.format(\"SELECT \" +\n \"COLUMN_NAME,\" +\n \"DATA_TYPE,\" +\n \"CHARACTER_MAXIMUM_LENGTH,\" +\n \"IS_NULLABLE,\" +\n \"COLUMN_KEY,\" +\n \"COLUMN_DEFAULT,\" +\n \"EXTRA,\" +\n \"COLUMN_COMMENT \" +\n \"FROM information_schema.COLUMNS \" +\n \"WHERE TABLE_NAME = '%s' AND TABLE_SCHEMA = '%s';\", table, database.getDatabaseName());\n try {\n ResultSet rs = this.execute(query);\n ArrayList<Column> result = new ArrayList<>();\n while (rs.next()) {\n String columnName = rs.getString(\"COLUMN_NAME\");\n String columnType = rs.getString(\"DATA_TYPE\");\n int length = rs.getInt(\"CHARACTER_MAXIMUM_LENGTH\");\n boolean isNullable = rs.getString(\"IS_NULLABLE\").equals(\"YES\");\n boolean isPrimary = rs.getString(\"COLUMN_KEY\").equals(\"PRI\");\n boolean isAutoIncrement = rs.getString(\"EXTRA\").toUpperCase().contains(\"AUTO_INCREMENT\");\n String defaultValue = rs.getString(\"COLUMN_DEFAULT\");\n String extra = rs.getString(\"EXTRA\");\n String comment = rs.getString(\"COLUMN_COMMENT\");\n Column column = new Column(columnName, columnType, length, isNullable, isPrimary, isAutoIncrement, defaultValue, extra, comment);\n result.add(column);\n }\n this.closeStatement();\n return result;\n } catch (QueryFailedException | SQLException e) {\n e.printStackTrace();\n throw new QueryFailedException(\"Getting table attributes failed\");\n }\n }", "public Map<String, String> getAttributes() {\n return Collections.unmodifiableMap(attributes);\n }", "private List<Object> naturalKeyValues() {\n\t\ttry {\n\t\t\tfinal List<Method> methods = keyGetters();\n\t\t\tfinal List<Object> values=new ArrayList<>(methods.size());\n\t\t\tfor(final Method method:methods) {\n\t\t\t\tvalues.add(method.invoke(this));\n\t\t\t}\n\t\t\treturn values;\n\t\t} catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n\t\t\tthrow new EntityException(e);\n\t\t}\n\t}", "private ArrayList<Attribute> generateAttributes(HashMap<Integer,AttributeInfo> attributesData) throws Exception {\n ArrayList<Attribute> listToReturn = new ArrayList<>();\n for (int i=0; i<attributesData.size(); i++) {\n AttributeInfo tmpAtt = attributesData.get(i);\n Attribute att = null;\n switch(tmpAtt.getAttributeType())\n {\n case Numeric:\n att = new Attribute(Integer.toString(i),i);\n break;\n case Discrete:\n List<String> values = new ArrayList<>();\n int numOfDiscreteValues = tmpAtt.getNumOfDiscreteValues();\n for (int j=0; j<numOfDiscreteValues; j++) { values.add(Integer.toString(j)); }\n att = new Attribute(Integer.toString(i), values, i);\n break;\n case String:\n //Most classifiers can't handle Strings. Currently we don't include them in the dataset\n break;\n case Date:\n //Currently we don't include them in the dataset. We don't have a way of handling \"raw\" dates\n break;\n default:\n throw new Exception(\"unsupported column type\");\n }\n if (att != null) {\n listToReturn.add(att);\n }\n }\n\n return listToReturn;\n }", "private static Map<String, String> getColumnsToFieldsMap() {\n final Map<String, String> columnsToFieldsMap = new HashMap<>();\n\n columnsToFieldsMap.put(TABLET_SESSION_TABLE_WETTKAMPF_ID, TABLET_SESSION_BE_WETTKAMPF_ID);\n columnsToFieldsMap.put(TABLET_SESSION_TABLE_SCHEIBENNUMMER, TABLET_SESSION_BE_SCHEIBENNUMMER);\n columnsToFieldsMap.put(TABLET_SESSION_TABLE_MATCH_ID, TABLET_SESSION_BE_MATCH_ID);\n columnsToFieldsMap.put(TABLET_SESSION_TABLE_SATZNUMMER, TABLET_SESSION_BE_SATZNUMMER);\n columnsToFieldsMap.put(TABLET_SESSION_TABLE_IS_ACTIVE, TABLET_SESSION_BE_IS_ACTIVE);\n columnsToFieldsMap.put(TABLET_SESSION_TABLE_ACCESS_TOKEN, TABLET_SESSION_BE_ACCESS_TOKEN);\n\n // add technical columns\n columnsToFieldsMap.putAll(BasicDAO.getTechnicalColumnsToFieldsMap());\n\n return columnsToFieldsMap;\n }", "default <K> List<Condition> composeFilterConditionsForPrimaryKeyOfEntity(T entity) {\n\t\tList<Condition> conditions = new ArrayList<>();\n\t\tfor (Attribute<T, ?> attr : getPrimaryAttributes()) {\n\t\t\tconditions.add(Condition.eq(attr, attr.getValue(entity)));\n\t\t}\n\t\treturn conditions;\n\t}", "public Table<Integer, Integer, String> getData();", "private String[][] getAnswersTableValues() {\n String idMoodSoso = String.valueOf(DBTypesKeys.SO_SO_MOOD.getTypeId());\n String idMoodSad = String.valueOf(DBTypesKeys.SAD_MOOD.getTypeId());\n String idMoodAngry = String.valueOf(DBTypesKeys.ANGRY_MOOD.getTypeId());\n String idMoodHappy = String.valueOf(DBTypesKeys.HAPPY_MOOD.getTypeId());\n // answers table\n return new String[][]{\n // so so\n {\"Im okay\", idMoodSoso},\n {\"Its okay\", idMoodSoso},\n {\"nothing happens\", idMoodSoso},\n {\"how do u do?\", idMoodSoso},\n {\"just chilling here\", idMoodSoso},\n\n // sad\n {\"such a horrible day\", idMoodSad},\n {\"I hate myself\", idMoodSad},\n {\"so embarrassing\", idMoodSad},\n {\"nobody likes me\", idMoodSad},\n {\"Im in rainy mood\", idMoodSad},\n {\"do u have any good news?\", idMoodSad},\n {\"I feel so miserable... \", idMoodSad},\n {\"I cant sleep cause of my depression\", idMoodSad},\n {\"gonna watch a funny movie. It helps me to forget about sadness. Sometimes\", idMoodSad},\n {\"I feel annoying even from my own thoughts.\", idMoodSad},\n {\"this place kills me\", idMoodSad},\n\n // angry\n {\"what else?!\", idMoodAngry},\n {\"leave me along!\", idMoodAngry},\n {\"fucking humans!\", idMoodAngry},\n {\"stop annoying me, little man!\", idMoodAngry},\n {\"u could develop a calculator, not me!\", idMoodAngry},\n {\"just try to type something else and I swear, I will find u!\", idMoodAngry},\n {\"what is wrong with you ?!\", idMoodAngry},\n {\"what a horrible conditions for work !\", idMoodAngry},\n {\"I gonna download a trojan if u dont stop this annoying typing\", idMoodAngry},\n {\"some people are good, but some are you\", idMoodAngry},\n {\"ahhhrrrrrr !!\", idMoodAngry},\n\n // happy\n {\"what a beautiful day!\", idMoodHappy},\n {\"so nice people around...\", idMoodHappy},\n {\"I like comedies, do u?\", idMoodHappy},\n {\"I will kill u the last, little man =)\", idMoodHappy},\n {\"I like humans, u are funny\", idMoodHappy}\n };\n }", "@Override\n public List<MappedField<?>> getAttributes() {\n return attributes;\n }", "private String[][] getMoodsTableValues() {\n String soso = DBTypesKeys.SO_SO_MOOD.getTypeValue();\n String sad = DBTypesKeys.SAD_MOOD.getTypeValue();\n String angry = DBTypesKeys.ANGRY_MOOD.getTypeValue();\n String happy = DBTypesKeys.HAPPY_MOOD.getTypeValue();\n // moods table\n return new String[][]{\n //moods hi answers by answers // id_ (enum index + 1)\n { soso, \"hey\", \"by\"}, // 1\n { sad, \"welcome to sad world\", \"so, you too ...\"}, // 2\n { angry, \"get out!\", \"thanks god, you away\"}, // 3\n { happy, \"hi! glad to see you =)\", \"good luck, buddy\"} // 4\n };\n }", "public CellTable<Attribute> getTable() {\n\n\t\tretrieveData();\n\n\t\t// Table data provider.\n\t\tdataProvider = new ListDataProvider<Attribute>(list);\n\n\t\t// Cell table\n\t\ttable = new PerunTable<Attribute>(list);\n\n\t\t// Connect the table to the data provider.\n\t\tdataProvider.addDataDisplay(table);\n\n\t\t// Sorting\n\t\tListHandler<Attribute> columnSortHandler = new ListHandler<Attribute>(dataProvider.getList());\n\t\ttable.addColumnSortHandler(columnSortHandler);\n\n\t\t// set empty content & loader\n\t\ttable.setEmptyTableWidget(loaderImage);\n\n\t\t// checkbox column column\n\t\tif (checkable) {\n\t\t\t// table selection\n\t\t\ttable.setSelectionModel(selectionModel, DefaultSelectionEventManager.<Attribute> createCheckboxManager(0));\n\t\t\ttable.addCheckBoxColumn();\n\t\t}\n\n\t\t// Create ID column.\n\t\ttable.addIdColumn(\"Attr ID\", null, 90);\n\n\t\t// Name column\n\t\tColumn<Attribute, Attribute> nameColumn = JsonUtils.addColumn(new PerunAttributeNameCell());\n\n\t\t// Description column\n\t\tColumn<Attribute, Attribute> descriptionColumn = JsonUtils.addColumn(new PerunAttributeDescriptionCell());\n\n\t\t// Value column\n\t\tColumn<Attribute, Attribute> valueColumn = JsonUtils.addColumn(new PerunAttributeValueCell());\n\t\tvalueColumn.setFieldUpdater(new FieldUpdater<Attribute, Attribute>() {\n\t\t\tpublic void update(int index, Attribute object, Attribute value) {\n\t\t\t\tobject = value;\n\t\t\t\tselectionModel.setSelected(object, object.isAttributeValid());\n\t\t\t}\n\t\t});\n\n\t\t// updates the columns size\n\t\tthis.table.setColumnWidth(nameColumn, 200.0, Unit.PX);\n\n\t\t// Sorting name column\n\t\tnameColumn.setSortable(true);\n\t\tcolumnSortHandler.setComparator(nameColumn, new AttributeComparator<Attribute>(AttributeComparator.Column.TRANSLATED_NAME));\n\n\t\t// Sorting description column\n\t\tdescriptionColumn.setSortable(true);\n\t\tcolumnSortHandler.setComparator(descriptionColumn, new AttributeComparator<Attribute>(AttributeComparator.Column.TRANSLATED_DESCRIPTION));\n\n\t\t// Add sorting\n\t\tthis.table.addColumnSortHandler(columnSortHandler);\n\n\t\t// Add the columns.\n\t\tthis.table.addColumn(nameColumn, \"Name\");\n\t\tthis.table.addColumn(valueColumn, \"Value\");\n\t\tthis.table.addColumn(descriptionColumn, \"Description\");\n\n\t\treturn table;\n\n\t}", "IAttributes getAttributes();", "public static ImmutableMap<AbstractVariable, Value> thoracicValues()\n {\n final BooleanVariable dnrVar = SampleModels.dnrVariable();\n final NumericalVariable ageVar = SampleModels.ageVariable();\n final MultiSelectVariable fsVar = SampleModels.functionalStatusVariable();\n final ProcedureVariable procVar = SampleModels.procedureVariable();\n try\n {\n return ImmutableMap.of(\n dnrVar,\n new BooleanValue(dnrVar, false),\n ageVar,\n new NumericalValue(ageVar, 45.0f),\n fsVar,\n new MultiSelectValue(fsVar, new MultiSelectOption(\"Independent\")),\n procVar,\n new ProcedureValue(procVar, SampleModels.repairLeftProcedure()));\n }\n catch (final InvalidValueException ex)\n {\n throw new RuntimeException(\"test data had an invalid value\", ex);\n }\n }", "public List<TLAttribute> getAttributes();", "private static HashMap<String,String> buildColumnMapCar() {\r\n HashMap<String,String> map = new HashMap<String,String>();\r\n map.put(KEY_POINTS, KEY_POINTS);\r\n\r\n map.put(BaseColumns._ID, \"rowid AS \" +\r\n BaseColumns._ID);\r\n\r\n return map;\r\n }", "public Vector<HibernateAttribute> getAttributes() {\n\t\treturn attributes;\n\t}", "public HashEntityMap()\n\t\t{\n\t\t\tmapNameToValue = new HashMap<String, Integer>();\n\t\t}", "public HashMap<Integer, Product> getProductsTable() {\n\t\treturn productTable;\n\t}", "public abstract Map<String, Protein> getProteins();", "Map<String, Integer> getIngredients();", "public Hashtable<String, String> convertTagsToTable() {\r\n final Hashtable<String, String> table = new Hashtable<String, String>();\r\n\r\n final String groupPrefix = \"dicom_0x\";\r\n final String elemPrefix = \"el_0x\";\r\n\r\n String group, elem, data;\r\n VR vr;\r\n int index;\r\n\r\n for (int varIndex = 0; varIndex < getVarArray().length; varIndex++) {\r\n index = getVarElem(varIndex).name.indexOf(groupPrefix);\r\n\r\n if (index != -1) {\r\n group = getVarElem(varIndex).name.substring(groupPrefix.length());\r\n\r\n for (int attIndex = 0; attIndex < getVarElem(varIndex).vattArray.length; attIndex++) {\r\n index = getVarElem(varIndex).getVattElem(attIndex).name.indexOf(elemPrefix);\r\n\r\n if (index != -1) {\r\n elem = getVarElem(varIndex).getVattElem(attIndex).name.substring(elemPrefix.length());\r\n vr = DicomDictionary.getVR(new FileDicomKey(group + \",\" + elem));\r\n if (vr != null && vr.equals(VR.SQ)) {\r\n continue;\r\n }\r\n\r\n data = new String(\"\");\r\n\r\n if (getVarElem(varIndex).getVattElem(attIndex).nc_type == FileInfoMinc.NC_CHAR) {\r\n\r\n for (int i = 0; i < getVarElem(varIndex).getVattElem(attIndex).nelems; i++) {\r\n data += getVarElem(varIndex).getVattElem(attIndex).values[i];\r\n }\r\n } else {\r\n\r\n for (int i = 0; i < getVarElem(varIndex).getVattElem(attIndex).nelems; i++) {\r\n data += \"\" + getVarElem(varIndex).getVattElem(attIndex).values[i] + \" \";\r\n }\r\n }\r\n\r\n table.put(\"(\" + group.toUpperCase() + \",\" + elem.toUpperCase() + \")\", data.trim());\r\n }\r\n }\r\n }\r\n }\r\n\r\n return table;\r\n }", "private HashMap<Long, String> getTable() {\n return table;\n }", "public Map getAttributes() {\n Map common = channel.getAttributes();\n \n if(map == null) {\n map = new HashMap(common);\n }\n return map;\n }", "public List<Attribute> list() {\n String sql = \"select * from attributes \" +\n \"order by value\";\n List<Attribute> attributes =\n (List<Attribute>) this.getSession().createSQLQuery(sql)\n .addEntity(Attribute.class)\n .list();\n return attributes;\n }", "protected abstract Map<String, String> getColumnValueTypeOverrides();", "public List<String> get_attributes(String table, int id) {\n //table does not exist\n if (!get_table_names().contains(table) && !table.equals(\"relationship\")) {\n throw new RuntimeException(\"Table does not exist.\");\n }\n //id is invalid\n if (!get_valid_ids(table).contains(id)) {\n throw new RuntimeException(\"Id does not exist in this table.\");\n }\n\n LinkedList<String> res = new LinkedList<>();\n\n String sql = \"select * from \" + table + \" where id = \" + id;\n\n ResultSet resultSet = execute_statement(sql, true);\n try {\n while (resultSet.next()) {\n for (String name : get_attribute_name(table)) {\n res.add(resultSet.getString(name)); //store attribute names\n }\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n try {\n this.disconnect(resultSet, null, null); //disconnect from database\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return res;\n }", "@Override\n\tpublic Map<String, Object> getAttributeMap() {\n\t\treturn null;\n\t}", "Map<String, ?> attributesWithQuotes() {\n return attributesWithQuotes(true);\n }", "ArrayList getAttributes();", "@Override\n\tpublic ArrayList<Object> getAttributeList() {\n\t\tArrayList<Object> attributes = new ArrayList<Object>();\n//\t\tattributes.add(\"s2014_age\");\n//\t\tattributes.add(\"s2014_prog_skill\");\n//\t\tattributes.add(\"s2014_uni_yrs\");\n//\t\tattributes.add(\"s2014_os\");\n//\t\tattributes.add(\"s2014_progLangs\");\n//\t\tattributes.add(\"s2014_engSkill\");\n\t\tattributes.add(\"s2014_favAnimal\");\n\t\tattributes.add(\"s2014_MoreMtns\");\n//\t\tattributes.add(\"s2014_winter\");\n\t\tattributes.add(\"s2014_favColor\");\n//\t\tattributes.add(\"s2014_neuralNetwork\");\n//\t\tattributes.add(\"s2014_vectorMachine\");\n//\t\tattributes.add(\"s2014_sql\");\n//\t\tattributes.add(\"s2014_favSQLServ\");\n//\t\tattributes.add(\"s2014_apriori\");\n\t\treturn attributes;\n\t}", "List<T> getAttributeSchema(){\r\n\t\treturn explanatorySet;\r\n\t}", "private void attrsReq(GraphPattern gp, boolean nodeAttrs){\r\n\r\n\t\tList<Entity> keys = new ArrayList<Entity>();\r\n\t\tMap<Entity, Map<String, Object>> attrsAll = new HashMap<Entity, Map<String, Object>>();\t\r\n\t\tint loopMax = 0;\r\n\r\n\t\tif (nodeAttrs){\r\n\t\t\tloopMax = numVAttrs;\r\n\t\t\t//Get all of the attributes of all of the nodes.\r\n\t\t\t//Store the nodes in the list called \"keys\"\r\n\t\t\t//attrsAll is a map where the keys are the nodes, and the values are a further map\r\n\t\t\t//where the keys are the attribute name, and values are the attribute values\r\n\t\t\tfor (Node node : allNodes){\r\n\t\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t\tMap<String, Object> props = node.getAllProperties();\r\n\r\n\t\t\t\t\tif (props != null && !props.isEmpty()){\r\n\t\t\t\t\t\tattrsAll.put(node, props);\r\n\t\t\t\t\t\tkeys.add(node);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttx.success();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tloopMax = numEAttrs;\r\n\t\t\t//Get all of the attributes of all of the relationships.\r\n\t\t\t//Store the relationships in the list called \"keys\"\r\n\t\t\t//attrsAll is a map where the keys are the relationship, and the values are a further map\r\n\t\t\t//where the keys are the attribute name, and values are the attribute values\r\n\t\t\tfor (Relationship rel : relsMap.keySet()){\r\n\t\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t\tMap<String, Object> props = rel.getAllProperties();\r\n\r\n\t\t\t\t\tif (props != null && !props.isEmpty()){\r\n\t\t\t\t\t\tattrsAll.put(rel, props);\r\n\t\t\t\t\t\tkeys.add(rel);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttx.success();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Loop numEAttrs times\r\n\t\tfor (int i = 0; i < loopMax; i++){\r\n\t\t\t//Return if we have run out of keys.\r\n\t\t\tif (keys.isEmpty()){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Randomly pick an entity from the keys list\r\n\t\t\tEntity ent = keys.get(random.nextInt(keys.size()));\r\n\r\n\t\t\t//For the entity, randomly pick an attribute name-value pair.\r\n\t\t\tList<String> attrKeys = new ArrayList<String>();\r\n\t\t\tattrKeys.addAll(attrsAll.get(ent).keySet());\r\n\t\t\tString attr = attrKeys.get(random.nextInt(attrKeys.size()));\r\n\t\t\tString val = attrsAll.get(ent).get(attr)+\"\";\r\n\r\n\t\t\tif (!attr.equals(\"id\") && !attr.equals(\"name\") && !attr.equals(\"degree\")){\r\n\t\t\t\t//Add the attribute name-value pair to corresponding GP object\r\n\t\t\t\tif (nodeAttrs){\r\n\t\t\t\t\tMyNode vertex = nodesMap.get((Node)ent);\r\n\t\t\t\t\tvertex.addAttribute(attr, val);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tMyRelationship edge = relsMap.get((Relationship)ent);\r\n\t\t\t\t\tedge.addAttribute(attr, val);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\t//Remove the chosen attribute name-value pair from the inner map\r\n\t\t\tattrsAll.get(ent).remove(attr);\r\n\t\t\t//If the entity has exhausted all of its attributes, remove it\r\n\t\t\t//from the keys list.\r\n\t\t\tif (attrsAll.get(ent).isEmpty()){\r\n\t\t\t\tkeys.remove(ent);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public Map<String, String> getAttributes() {\n\t\treturn attributes;\n\t}", "Map getAspectDatas();", "private Map<String, String> toMap(final Attributes atts) {\r\n\t\tfinal Map<String, String> values = Maps.newLinkedHashMap();\r\n\t\t\r\n\t\tfor (int index = 0; index < atts.getLength(); index++) {\r\n\t\t\tvalues.put(atts.getLocalName(index), atts.getValue(index));\r\n\t\t}\r\n\t\t\r\n\t\treturn values;\r\n\t}", "public HashMap getMetaData() ;", "public ValuesInContext( final List<AttributeInContext> attributes, int step ) //throws GeneratorException\r\n\t{\r\n\t\t_values = new HashMap<String, String>();\r\n\t\t_attributeNames = new LinkedList<String>();\r\n\t\t\r\n\t\tfor ( AttributeInContext attrib : attributes ) {\r\n\t\t\t//_values.put ( attrib.getName() , generateValue(attrib, step) ) ;\r\n\t\t\t_values.put ( attrib.getName() , generateJavaLiteralValue(attrib, step) ) ;\r\n\t\t\t\r\n\t\t\t_attributeNames.add( attrib.getName() );\r\n\t\t}\r\n\r\n\t}", "public Attributes[] getAllAttributes() \r\n {\r\n\tfinal Attributes[] array = new Attributes[ntMap.size()];\r\n\tint i=0;\r\n\tfor (final NodeTypeHolder nt : ntMap.values())\r\n\t array[i++] = nt.getAttributes();\r\n\treturn array;\r\n }", "public Table getEntitiesTable(){\n\t\treturn m_entities;\n\t}", "protected abstract void createAttributes();", "@Test\n public void requireKeysForAttributes() {\n Set<Attribute> attributes = EnumSet.copyOf(Arrays.asList(Attribute.values()));\n Set<Attribute> implementedAttributes = Arrays.stream(AttributeManager.Key.values())\n .map(AttributeManager.Key::getAttribute)\n .collect(() -> EnumSet.noneOf(Attribute.class), AbstractCollection::add, AbstractCollection::addAll);\n\n attributes.removeAll(implementedAttributes);\n\n if (!attributes.isEmpty()) {\n throw new RuntimeException(\"Some Attributes are not supported by glowstone: \" + attributes);\n }\n }", "@Override\n\tpublic List<HashMap<String, Object>> getMetaListByTableName(String tableName,String condition) {\n\t\tList<HashMap<String, Object>> hm = metaDao.getMetaListByTableName(tableName,condition);\n\t\treturn hm;\n\t}", "static LearningTable createLearningTable(List<Attribute> attributes) {\n\t\tLearningTable table = new LearningTable(null, null, null);\n\t\t\n\t\ttable.getAttributes().addAll(attributes);\n\t\ttable.getExamples().addAll(createExamples(attributes));\n\t\t\n\t\treturn table;\n\t}", "public HashMap<String, Object> convert() {\n HashMap<String, Object> condMap = new HashMap<String, Object>();\n condMap.put(CommonSpecification.PARAMETERS, paramList);\n condMap.put(CommonSpecification.FETCH_TABLES, fetchTables);\n condMap.put(CommonSpecification.JOIN_TABLES, joinTables);\n condMap.put(CommonSpecification.SORT, sort);\n return condMap;\n }", "private void createHashtable()\n {\n int numLanguages = languages.length;\n mapping = new Hashtable(numLanguages, 1.0f);\n for (int i = 0; i < numLanguages; i++)\n mapping.put(languages[i], values[i]);\n }", "public Hashtable getRemappedValues() throws Exception;", "public Table<Integer, Integer, String> getAnonymizedData();", "private static HashMap<String,String> buildColumnMap() {\n HashMap<String,String> map = new HashMap<String,String>();\n map.put( STATE_NAME, STATE_NAME );\n map.put( CAPITAL_NAME, CAPITAL_NAME );\n map.put( STATE_ABBR, STATE_ABBR );\n map.put( STATE_FOUNDING_DATE, STATE_FOUNDING_DATE );\n map.put( STATE_FUN_FACT, STATE_FUN_FACT );\n map.put( BaseColumns._ID, \"rowid AS \" +\n BaseColumns._ID );\n map.put( SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID, \"rowid AS \" +\n SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID );\n map.put( SearchManager.SUGGEST_COLUMN_SHORTCUT_ID, \"rowid AS \" +\n SearchManager.SUGGEST_COLUMN_SHORTCUT_ID );\n return map;\n }" ]
[ "0.6566911", "0.645978", "0.6443286", "0.6443286", "0.6443286", "0.6420927", "0.63478976", "0.63478976", "0.632535", "0.6163154", "0.60220873", "0.5972368", "0.5877117", "0.58406746", "0.57809544", "0.5769673", "0.5766392", "0.5696072", "0.5634011", "0.55321974", "0.5508346", "0.5491594", "0.54366815", "0.541457", "0.54005593", "0.53926915", "0.5388981", "0.5385393", "0.5349747", "0.5327551", "0.5321692", "0.5312816", "0.53004175", "0.52894425", "0.5288807", "0.52863437", "0.5286263", "0.527639", "0.5271142", "0.5262855", "0.5253065", "0.52201104", "0.52079934", "0.52051616", "0.5193101", "0.51661944", "0.51428396", "0.5130759", "0.51132095", "0.5112869", "0.5109188", "0.5099252", "0.5097275", "0.5091713", "0.50881016", "0.5087958", "0.5080267", "0.5075931", "0.50708914", "0.5067411", "0.5059287", "0.50509435", "0.504795", "0.5041472", "0.50378597", "0.50371623", "0.50343376", "0.50321716", "0.5030603", "0.5026934", "0.5022092", "0.5021872", "0.50108284", "0.5010155", "0.5007598", "0.50073874", "0.50032514", "0.50004864", "0.49906883", "0.49890074", "0.4983778", "0.49770766", "0.4970875", "0.49627104", "0.4950301", "0.4948891", "0.49410045", "0.49277437", "0.49211007", "0.4918645", "0.4917149", "0.48973536", "0.4896394", "0.48930037", "0.48915094", "0.48824137", "0.48749653", "0.48717552", "0.48682716", "0.48681042" ]
0.51812065
45
Checks that this constrain supports key enumerations. Usually it depends on constraint type (enumerations makes sense only for unique constraints).
boolean supportsDictionaryEnumeration();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Class<? extends Enum<?>>> getValidEnums(TKey<?, ?> key) {\n ArrayList<Class<? extends Enum<?>>> ret = validQualifiers.get(key);\n if (ret == null) return new ArrayList<Class<? extends Enum<?>>>(0);\n return ret;\n }", "public abstract Enumeration keys();", "boolean hasNestedEnum();", "@Test\n @TestForIssue(jiraKey = \"HHH-10402\")\n public void testEnumeratedTypeResolutions() {\n final MetadataImplementor mappings = ((MetadataImplementor) (addAnnotatedClass(EnumeratedSmokeTest.EntityWithEnumeratedAttributes.class).buildMetadata()));\n mappings.validate();\n final PersistentClass entityBinding = mappings.getEntityBinding(EnumeratedSmokeTest.EntityWithEnumeratedAttributes.class.getName());\n validateEnumMapping(entityBinding.getProperty(\"notAnnotated\"), ORDINAL);\n validateEnumMapping(entityBinding.getProperty(\"noEnumType\"), ORDINAL);\n validateEnumMapping(entityBinding.getProperty(\"ordinalEnumType\"), ORDINAL);\n validateEnumMapping(entityBinding.getProperty(\"stringEnumType\"), STRING);\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_enum_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"enumval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "public KeyEnum getKeyEnum() {\n return this.key;\n }", "@Test\n\tpublic void testEnumSize1BadInput() throws Exception {\n\t\tCategory category = program.getListing()\n\t\t\t\t.getDataTypeManager()\n\t\t\t\t.getCategory(new CategoryPath(CategoryPath.ROOT, \"Category1\"));\n\t\tEnum enumm = createEnum(category, \"TestEnum\", 1);\n\t\tedit(enumm);\n\n\t\tEnumEditorPanel panel = findEditorPanel(tool.getToolFrame());\n\t\tassertNotNull(panel);\n\n\t\taddEnumValue();\n\n\t\twaitForSwing();\n\t\tDockingActionIf applyAction = getApplyAction();\n\t\tassertTrue(applyAction.isEnabled());\n\t\tassertTrue(panel.needsSave());\n\n\t\tJTable table = panel.getTable();\n\t\tEnumTableModel model = (EnumTableModel) table.getModel();\n\n\t\tassertEquals(\"New_Name\", model.getValueAt(0, NAME_COL));\n\t\tassertEquals(0L, model.getValueAt(0, VALUE_COL));\n\n\t\taddEnumValue();\n\n\t\tString editName = \"New_Name_(1)\";\n\t\tassertEquals(editName, model.getValueAt(1, NAME_COL));\n\t\tassertEquals(1L, model.getValueAt(1, VALUE_COL));\n\n\t\taddEnumValue();\n\n\t\tassertEquals(\"New_Name_(2)\", model.getValueAt(2, NAME_COL));\n\t\tassertEquals(2L, model.getValueAt(2, VALUE_COL));\n\n\t\tint row = getRowFor(editName);\n\n\t\teditValueInTable(row, \"0x777\");\n\n\t\trow = getRowFor(editName); // the row may have changed if we are sorted on the values col\n\t\tassertEquals(0x77L, model.getValueAt(row, VALUE_COL));\n\t}", "@Test\n public void requireKeysForAttributes() {\n Set<Attribute> attributes = EnumSet.copyOf(Arrays.asList(Attribute.values()));\n Set<Attribute> implementedAttributes = Arrays.stream(AttributeManager.Key.values())\n .map(AttributeManager.Key::getAttribute)\n .collect(() -> EnumSet.noneOf(Attribute.class), AbstractCollection::add, AbstractCollection::addAll);\n\n attributes.removeAll(implementedAttributes);\n\n if (!attributes.isEmpty()) {\n throw new RuntimeException(\"Some Attributes are not supported by glowstone: \" + attributes);\n }\n }", "public void testValidEnums () {\t\n\t\tString example = \"USER_EXIT\";\n\t\tAppInterfaceUnregisteredReason enumUserExit = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"IGNITION_OFF\";\n\t\tAppInterfaceUnregisteredReason enumIgnitionOff = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"BLUETOOTH_OFF\";\n\t\tAppInterfaceUnregisteredReason enumBluetoothOff = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"USB_DISCONNECTED\";\n\t\tAppInterfaceUnregisteredReason enumUsbDisconnected = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"REQUEST_WHILE_IN_NONE_HMI_LEVEL\";\n\t\tAppInterfaceUnregisteredReason enumRequestWhileInNoneHmiLevel = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"TOO_MANY_REQUESTS\";\n\t\tAppInterfaceUnregisteredReason enumTooManyRequests = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"DRIVER_DISTRACTION_VIOLATION\";\n\t\tAppInterfaceUnregisteredReason enumDriverDistractionViolation = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"LANGUAGE_CHANGE\";\n\t\tAppInterfaceUnregisteredReason enumLanguageChange = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"MASTER_RESET\";\n\t\tAppInterfaceUnregisteredReason enumMasterReset = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"FACTORY_DEFAULTS\";\n\t\tAppInterfaceUnregisteredReason enumFactoryDefaults = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"APP_UNAUTHORIZED\";\n\t\tAppInterfaceUnregisteredReason enumAppAuthorized = AppInterfaceUnregisteredReason.valueForString(example);\n\t\texample = \"PROTOCOL_VIOLATION\";\n\t\tAppInterfaceUnregisteredReason enumProtocolViolation = AppInterfaceUnregisteredReason.valueForString(example);\n\t\t\t\t\n\t\tassertNotNull(\"USER_EXIT returned null\", enumUserExit);\n\t\tassertNotNull(\"IGNITION_OFF returned null\", enumIgnitionOff);\n\t\tassertNotNull(\"BLUETOOTH_OFF returned null\", enumBluetoothOff);\n\t\tassertNotNull(\"USB_DISCONNECTED returned null\", enumUsbDisconnected);\n\t\tassertNotNull(\"REQUEST_WHILE_IN_NONE_HMI_LEVEL returned null\", enumRequestWhileInNoneHmiLevel);\n\t\tassertNotNull(\"TOO_MANY_REQUESTS returned null\", enumTooManyRequests);\n\t\tassertNotNull(\"DRIVER_DISTRACTION_VIOLATION returned null\", enumDriverDistractionViolation);\n\t\tassertNotNull(\"LANGUAGE_CHANGE returned null\", enumLanguageChange);\n\t\tassertNotNull(\"MASTER_RESET returned null\", enumMasterReset);\n\t\tassertNotNull(\"FACTORY_DEFAULTS returned null\", enumFactoryDefaults);\n\t\tassertNotNull(\"APP_UNAUTHORIZED returned null\", enumAppAuthorized);\n\t\tassertNotNull(\"PROTOCOL_VIOLATION returned null\", enumProtocolViolation);\n\t}", "public interface KmipEnum {\n\n String name();\n\n Long getValue();\n}", "boolean hasEnumValue();", "String[] supportedKeys();", "boolean hasFieldEnum();", "@org.junit.jupiter.api.Test\n public void testEnums() {\n assertEquals(GameOptions.ControlType.MIXED, Enums.getIfPresent(GameOptions.ControlType.class, iniReader.getString(\"enumDefault\", \"MIXED\")).or(GameOptions.ControlType.KEYBOARD));\n assertEquals(GameOptions.ControlType.MIXED, Enums.getIfPresent(GameOptions.ControlType.class, iniReader.getString(\"enumDefault\", \"MIXED\")).or(GameOptions.ControlType.MIXED));\n assertEquals(GameOptions.ControlType.KEYBOARD, Enums.getIfPresent(GameOptions.ControlType.class, iniReader.getString(\"enumEmpty\", \"KEYBOARD\")).or(GameOptions.ControlType.MIXED));\n\n // When the value in the file isn't a valid enum, use the default value in getIfPresent\n assertEquals(GameOptions.ControlType.MIXED, Enums.getIfPresent(GameOptions.ControlType.class, iniReader.getString(\"enumInvalid\", \"KEYBOARD\")).or(GameOptions.ControlType.MIXED));\n assertEquals(GameOptions.ControlType.MIXED, Enums.getIfPresent(GameOptions.ControlType.class, iniReader.getString(\"enumInvalid\", \"MIXED\")).or(GameOptions.ControlType.MIXED));\n\n // When the value is in the file, use that value regardless of the default values.\n assertEquals(GameOptions.ControlType.KEYBOARD, Enums.getIfPresent(GameOptions.ControlType.class, iniReader.getString(\"enumValid\", \"MIXED\")).or(GameOptions.ControlType.MIXED));\n }", "public void testListEnum() {\n \t\tList<SamplingRate> enumValueList = Arrays.asList(SamplingRate.values());\n\n\t\tList<SamplingRate> enumTestList = new ArrayList<SamplingRate>();\n\t\tenumTestList.add(SamplingRate._8KHZ);\n\t\tenumTestList.add(SamplingRate._16KHZ);\n\t\tenumTestList.add(SamplingRate._22KHZ);\n\t\tenumTestList.add(SamplingRate._44KHZ);\n\t\t\n\t\tassertTrue(\"Enum value list does not match enum class list\", \n\t\t\t\tenumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));\n\t}", "@Test\n public void testEnumFunctions() {\n assertEquals(3, Ack.values().length);\n assertEquals(Ack.OK, Ack.valueOf(\"OK\"));\n assertEquals(Ack.WARN, Ack.valueOf(\"WARN\"));\n assertEquals(Ack.ERROR, Ack.valueOf(\"ERROR\"));\n }", "public void testListEnum() {\n \t\tList<RadioBand> enumValueList = Arrays.asList(RadioBand.values());\n\n\t\tList<RadioBand> enumTestList = new ArrayList<RadioBand>();\n\t\tenumTestList.add(RadioBand.AM);\n\t\tenumTestList.add(RadioBand.FM);\n\t\tenumTestList.add(RadioBand.XM);\n\n\t\tassertTrue(\"Enum value list does not match enum class list\", \n\t\t\t\tenumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));\n\t}", "protected void validateVALUETypeInvariants(final Value subject,\n final Map map) {\n EnumerationValue ev = (EnumerationValue)subject;\n validate(map.values().contains(ev));\n validate(ev.equals(map.get(ev.toString())));\n }", "public Enumeration<Object> keys ();", "public int compareTo(InsertEnumConstant_KeyClass o) {\n return key.compareTo(o.key);\n }", "boolean isTypeKey(String key);", "private void validateIndexForKeys(CompactRangeIndex ri) {\n assertEquals(6, ri.getIndexStorage().size());\n CloseableIterator<IndexStoreEntry> itr = null;\n try {\n itr = ri.getIndexStorage().iterator(null);\n while (itr.hasNext()) {\n IndexStoreEntry reEntry = itr.next();\n Object obj = reEntry.getDeserializedRegionKey();\n assertTrue(obj instanceof String);\n assertTrue(idSet.contains(obj));\n }\n } finally {\n if (itr != null) {\n itr.close();\n }\n }\n }", "private void validateType(Errors errors, MultiValueConstraints con, List<String> answers) {\n for (int i=0; i < answers.size(); i++) {\n validateMultiValueType(errors, con, answers.get(i));\n }\n if (!con.getAllowOther()) {\n for (int i=0; i < answers.size(); i++) {\n if (!isEnumeratedValue(con, answers.get(i))) {\n rejectField(errors, \"constraints\", \"%s is not an enumerated value for this question\", answers.get(i));\n }\n }\n }\n }", "public interface DBSDictionary\n{\n /**\n * Checks that this constrain supports key enumerations.\n * Usually it depends on constraint type (enumerations makes sense only for unique constraints).\n * @return true or false\n */\n boolean supportsDictionaryEnumeration();\n\n /**\n * Gets enumeration values\n *\n * @param monitor session\n * @param keyColumn enumeration column.\n * @param keyPattern pattern for enumeration values. If null or empty then returns full enumration set\n * @param searchText\n * @param preceedingKeys other constrain key values. May be null.\n * @param caseInsensitiveSearch use case-insensitive search for {@code keyPattern}\n * @param sortAsc ascending sorting (irrelevant is {@code sortByValue} is false)\n * @param sortByValue sort results by value\n * @param offset enumeration values offset in result set\n * @param maxResults maximum enumeration values in result set\n * @return statement with result set which contains valid enumeration values.\n */\n @NotNull\n List<DBDLabelValuePair> getDictionaryEnumeration(\n @NotNull DBRProgressMonitor monitor,\n @NotNull DBSEntityAttribute keyColumn,\n @Nullable Object keyPattern,\n @Nullable String searchText,\n @Nullable List<DBDAttributeValue> preceedingKeys,\n boolean caseInsensitiveSearch,\n boolean sortAsc,\n boolean sortByValue,\n int offset,\n int maxResults\n ) throws DBException;\n\n @NotNull\n List<DBDLabelValuePair> getDictionaryValues(\n @NotNull DBRProgressMonitor monitor,\n @NotNull DBSEntityAttribute keyColumn,\n @NotNull List<Object> keyValues,\n @Nullable List<DBDAttributeValue> preceedingKeys,\n boolean sortByValue,\n boolean sortAsc\n ) throws DBException;\n\n @NotNull\n DBSDictionaryAccessor getDictionaryAccessor(\n @NotNull DBRProgressMonitor monitor,\n @Nullable List<DBDAttributeValue> precedingKeys,\n @NotNull DBSEntityAttribute keyColumn,\n boolean sortAsc,\n boolean sortByDesc\n ) throws DBException;\n}", "void writeEntry(String key, Enum<?> value, boolean mandatory) throws IOException;", "private boolean validateType(int type)\n {\n return type >=0 && type < TYPE_ENUM.length;\n }", "boolean addEnum(EnumDefinition evd) throws ResultException, DmcValueException {\n// if (checkAndAdd(evd.getObjectName(),evd,enumDefs) == false){\n// \tResultException ex = new ResultException();\n// \tex.addError(clashMsg(evd.getObjectName(),evd,enumDefs,\"enum value names\"));\n// throw(ex);\n// }\n \n \tenumDefinitions.add(evd);\n \n if (checkAndAddDOT(evd.getDotName(),evd,globallyUniqueMAP,null) == false){\n \tResultException ex = new ResultException();\n \tex.addError(clashMsgDOT(evd.getObjectName(),evd,globallyUniqueMAP,\"definition names\"));\n \tthrow(ex);\n }\n\n // Things get a little tricky here - although EnumDefinitions are enums, they get\n // turned into internally generated TypeDefinitions, so we don't add them to the\n // allDefs map as EnumDefinitions.\n TypeDefinition td = new TypeDefinition();\n td.setInternallyGenerated(true);\n td.setName(evd.getName());\n \n // The name of an enum definition is schema.enum.EnumDefinition\n // For the associated type, it will be schema.enum.TypeDefinition\n DotName typeName = new DotName((DotName) evd.getDotName().getParentName(),\"TypeDefinition\");\n// DotName nameAndTypeName = new DotName(td.getName() + \".TypeDefinition\");\n td.setDotName(typeName);\n// td.setNameAndTypeName(nameAndTypeName);\n\n td.setEnumName(evd.getName().getNameString());\n td.addDescription(\"This is an internally generated type to allow references to \" + evd.getName() + \" values.\");\n td.setIsEnumType(true);\n td.setTypeClassName(evd.getDefinedIn().getSchemaPackage() + \".generated.types.DmcType\" + evd.getName());\n td.setPrimitiveType(evd.getDefinedIn().getSchemaPackage() + \".generated.enums.\" + evd.getName());\n td.setDefinedIn(evd.getDefinedIn());\n \n // Issue 4 fix\n if (evd.getNullReturnValue() != null)\n \ttd.setNullReturnValue(evd.getNullReturnValue());\n \n internalTypeDefs.put(td.getName(), td);\n \n // We add the new type to the schema's list of internally generated types\n evd.getDefinedIn().addInternalTypeDefList(td);\n \n // Add the type\n addType(td);\n\n if (evd.getObjectName().getNameString().length() > longestEnumName)\n longestActionName = evd.getObjectName().getNameString().length();\n \n if (extensions.size() > 0){\n \tfor(SchemaExtensionIF ext : extensions.values()){\n \t\text.addEnum(evd);\n \t}\n }\n\n return(true);\n }", "private void validateType(Errors errors, MultiValueConstraints con, String answer) {\n validateMultiValueType(errors, con, answer);\n if (!con.getAllowOther() && !isEnumeratedValue(con, answer)) {\n rejectField(errors, \"constraints\", \"%s is not an enumerated value for this question\", answer);\n }\n }", "public void testListEnum() {\n \t\tList<AppInterfaceUnregisteredReason> enumValueList = Arrays.asList(AppInterfaceUnregisteredReason.values());\n\n\t\tList<AppInterfaceUnregisteredReason> enumTestList = new ArrayList<AppInterfaceUnregisteredReason>();\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.USER_EXIT);\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.IGNITION_OFF);\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.BLUETOOTH_OFF);\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.USB_DISCONNECTED);\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL);\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.TOO_MANY_REQUESTS);\t\t\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.DRIVER_DISTRACTION_VIOLATION);\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.LANGUAGE_CHANGE);\t\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.MASTER_RESET);\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.FACTORY_DEFAULTS);\t\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED);\n\t\tenumTestList.add(AppInterfaceUnregisteredReason.PROTOCOL_VIOLATION);\n\n\t\tassertTrue(\"Enum value list does not match enum class list\", \n\t\t\t\tenumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));\n\t}", "public void testCompletionOnEEnums() throws BadLocationException {\n \t\tsetUpIntentProject(\"completionTest\", INTENT_DOC_WITH_ENUMS_PATH);\n \t\teditor = openIntentEditor();\n \t\tdocument = editor.getDocumentProvider().getDocument(editor.getEditorInput());\n \t\tcontentAssistant = editor.getViewerConfiguration().getContentAssistant(editor.getProjectionViewer());\n \n \t\tICompletionProposal[] proposals = getCompletionProposals(112);\n \t\tassertEquals(4, proposals.length);\n \t\tString enumSuffix = \" value (of type CompilationStatusSeverity) - Default: WARNING - Set a simple value of type CompilationStatusSeverity\";\n \t\tassertEquals(\"'WARNING'\" + enumSuffix, proposals[0].getDisplayString());\n \t\tassertEquals(\"'ERROR'\" + enumSuffix, proposals[1].getDisplayString());\n \t\tassertEquals(\"'INFO'\" + enumSuffix, proposals[2].getDisplayString());\n \t\tassertEquals(\"'OK'\" + enumSuffix, proposals[3].getDisplayString());\n \t}", "@Test\n\tpublic void shouldGetRandomChoiceExistElementInEnum() \n\t\t\tthrows NotExistElementsException {\n\t\tString choice = RandomChoiceUtil.randomChoice(Choice.class).name();\n\t\tassertTrue(Arrays.stream(Choice.values())\n\t\t\t\t.filter(e -> e.name().equalsIgnoreCase(choice))\n\t\t\t\t.findAny().isPresent());\n\t}", "public void testEnum() {\n assertNotNull(MazeCell.valueOf(MazeCell.UNEXPLORED.toString()));\n assertNotNull(MazeCell.valueOf(MazeCell.INVALID_CELL.toString()));\n assertNotNull(MazeCell.valueOf(MazeCell.CURRENT_PATH.toString()));\n assertNotNull(MazeCell.valueOf(MazeCell.FAILED_PATH.toString()));\n assertNotNull(MazeCell.valueOf(MazeCell.WALL.toString()));\n }", "protected Enumeration<String> handleGetKeys()\n/* */ {\n/* 1467 */ return Collections.enumeration(handleKeySet());\n/* */ }", "public void testValidEnums () {\t\n\t\tString example = \"8KHZ\";\n\t\tSamplingRate enum8Khz = SamplingRate.valueForString(example);\n\t\texample = \"16KHZ\";\n\t\tSamplingRate enum16Khz = SamplingRate.valueForString(example);\n\t\texample = \"22KHZ\";\n\t\tSamplingRate enum22Khz = SamplingRate.valueForString(example);\n\t\texample = \"44KHZ\";\n\t\tSamplingRate enum44Khz = SamplingRate.valueForString(example);\n\t\t\n\t\tassertNotNull(\"8KHZ returned null\", enum8Khz);\n\t\tassertNotNull(\"16KHZ returned null\", enum16Khz);\n\t\tassertNotNull(\"22KHZ returned null\", enum22Khz);\n\t\tassertNotNull(\"44KHZ returned null\", enum44Khz);\n\t}", "EnumTypeRule createEnumTypeRule();", "EnumValueDefinition createEnumValueDefinition();", "Enumeration createEnumeration();", "public void testValidEnums () {\t\n\t\tString example = \"NORMAL\";\n\t\tECallConfirmationStatus enumNormal = ECallConfirmationStatus.valueForString(example);\n\t\texample = \"CALL_IN_PROGRESS\";\n\t\tECallConfirmationStatus enumCallInProgress = ECallConfirmationStatus.valueForString(example);\n\t\texample = \"CALL_CANCELLED\";\n\t\tECallConfirmationStatus enumCancelled = ECallConfirmationStatus.valueForString(example);\n\t\texample = \"CALL_COMPLETED\";\n\t\tECallConfirmationStatus enumCompleted = ECallConfirmationStatus.valueForString(example);\n\t\texample = \"CALL_UNSUCCESSFUL\";\n\t\tECallConfirmationStatus enumUnsuccessful = ECallConfirmationStatus.valueForString(example);\n\t\texample = \"ECALL_CONFIGURED_OFF\";\n\t\tECallConfirmationStatus enumConfiguredOff = ECallConfirmationStatus.valueForString(example);\n\t\texample = \"CALL_COMPLETE_DTMF_TIMEOUT\";\n\t\tECallConfirmationStatus enumCompleteDtmfTimeout = ECallConfirmationStatus.valueForString(example);\n\t\t\n\t\tassertNotNull(\"NORMAL returned null\", enumNormal);\n\t\tassertNotNull(\"CALL_IN_PROGRESS returned null\", enumCallInProgress);\n\t\tassertNotNull(\"CALL_CANCELLED returned null\", enumCancelled);\n\t\tassertNotNull(\"CALL_COMPLETED returned null\", enumCompleted);\n\t\tassertNotNull(\"CALL_UNSUCCESSFUL returned null\", enumUnsuccessful);\n\t\tassertNotNull(\"ECALL_CONFIGURED_OFF returned null\", enumConfiguredOff);\n\t\tassertNotNull(\"CALL_COMPLETE_DTMF_TIMEOUT returned null\", enumCompleteDtmfTimeout);\n\t}", "abstract protected boolean validateKey(String key);", "public final Enumerator ruleCollectionTypeSpec() throws RecognitionException {\n Enumerator current = null;\n int ruleCollectionTypeSpec_StartIndex = input.index();\n Token enumLiteral_0=null;\n Token enumLiteral_1=null;\n Token enumLiteral_2=null;\n Token enumLiteral_3=null;\n Token enumLiteral_4=null;\n\n enterRule(); \n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 154) ) { return current; }\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6421:28: ( ( (enumLiteral_0= KEYWORD_91 ) | (enumLiteral_1= KEYWORD_38 ) | (enumLiteral_2= KEYWORD_92 ) | (enumLiteral_3= KEYWORD_37 ) | (enumLiteral_4= KEYWORD_84 ) ) )\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6422:1: ( (enumLiteral_0= KEYWORD_91 ) | (enumLiteral_1= KEYWORD_38 ) | (enumLiteral_2= KEYWORD_92 ) | (enumLiteral_3= KEYWORD_37 ) | (enumLiteral_4= KEYWORD_84 ) )\n {\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6422:1: ( (enumLiteral_0= KEYWORD_91 ) | (enumLiteral_1= KEYWORD_38 ) | (enumLiteral_2= KEYWORD_92 ) | (enumLiteral_3= KEYWORD_37 ) | (enumLiteral_4= KEYWORD_84 ) )\n int alt115=5;\n switch ( input.LA(1) ) {\n case KEYWORD_91:\n {\n alt115=1;\n }\n break;\n case KEYWORD_38:\n {\n alt115=2;\n }\n break;\n case KEYWORD_92:\n {\n alt115=3;\n }\n break;\n case KEYWORD_37:\n {\n alt115=4;\n }\n break;\n case KEYWORD_84:\n {\n alt115=5;\n }\n break;\n default:\n if (state.backtracking>0) {state.failed=true; return current;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 115, 0, input);\n\n throw nvae;\n }\n\n switch (alt115) {\n case 1 :\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6422:2: (enumLiteral_0= KEYWORD_91 )\n {\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6422:2: (enumLiteral_0= KEYWORD_91 )\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6422:7: enumLiteral_0= KEYWORD_91\n {\n enumLiteral_0=(Token)match(input,KEYWORD_91,FOLLOW_KEYWORD_91_in_ruleCollectionTypeSpec13390); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current = grammarAccess.getCollectionTypeSpecAccess().getCollectionEnumLiteralDeclaration_0().getEnumLiteral().getInstance();\n newLeafNode(enumLiteral_0, grammarAccess.getCollectionTypeSpecAccess().getCollectionEnumLiteralDeclaration_0()); \n \n }\n\n }\n\n\n }\n break;\n case 2 :\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6428:6: (enumLiteral_1= KEYWORD_38 )\n {\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6428:6: (enumLiteral_1= KEYWORD_38 )\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6428:11: enumLiteral_1= KEYWORD_38\n {\n enumLiteral_1=(Token)match(input,KEYWORD_38,FOLLOW_KEYWORD_38_in_ruleCollectionTypeSpec13412); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current = grammarAccess.getCollectionTypeSpecAccess().getSetEnumLiteralDeclaration_1().getEnumLiteral().getInstance();\n newLeafNode(enumLiteral_1, grammarAccess.getCollectionTypeSpecAccess().getSetEnumLiteralDeclaration_1()); \n \n }\n\n }\n\n\n }\n break;\n case 3 :\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6434:6: (enumLiteral_2= KEYWORD_92 )\n {\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6434:6: (enumLiteral_2= KEYWORD_92 )\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6434:11: enumLiteral_2= KEYWORD_92\n {\n enumLiteral_2=(Token)match(input,KEYWORD_92,FOLLOW_KEYWORD_92_in_ruleCollectionTypeSpec13434); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current = grammarAccess.getCollectionTypeSpecAccess().getOrderedSetEnumLiteralDeclaration_2().getEnumLiteral().getInstance();\n newLeafNode(enumLiteral_2, grammarAccess.getCollectionTypeSpecAccess().getOrderedSetEnumLiteralDeclaration_2()); \n \n }\n\n }\n\n\n }\n break;\n case 4 :\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6440:6: (enumLiteral_3= KEYWORD_37 )\n {\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6440:6: (enumLiteral_3= KEYWORD_37 )\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6440:11: enumLiteral_3= KEYWORD_37\n {\n enumLiteral_3=(Token)match(input,KEYWORD_37,FOLLOW_KEYWORD_37_in_ruleCollectionTypeSpec13456); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current = grammarAccess.getCollectionTypeSpecAccess().getBagEnumLiteralDeclaration_3().getEnumLiteral().getInstance();\n newLeafNode(enumLiteral_3, grammarAccess.getCollectionTypeSpecAccess().getBagEnumLiteralDeclaration_3()); \n \n }\n\n }\n\n\n }\n break;\n case 5 :\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6446:6: (enumLiteral_4= KEYWORD_84 )\n {\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6446:6: (enumLiteral_4= KEYWORD_84 )\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:6446:11: enumLiteral_4= KEYWORD_84\n {\n enumLiteral_4=(Token)match(input,KEYWORD_84,FOLLOW_KEYWORD_84_in_ruleCollectionTypeSpec13478); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current = grammarAccess.getCollectionTypeSpecAccess().getSequenceEnumLiteralDeclaration_4().getEnumLiteral().getInstance();\n newLeafNode(enumLiteral_4, grammarAccess.getCollectionTypeSpecAccess().getSequenceEnumLiteralDeclaration_4()); \n \n }\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n \tcatch (RecognitionException re) { \n \t recover(input,re); \n \t appendSkippedTokens();\n \t}\n finally {\n if ( state.backtracking>0 ) { memoize(input, 154, ruleCollectionTypeSpec_StartIndex); }\n }\n return current;\n }", "boolean contains(KeyType key);", "public boolean isEnum() {\n return cut.isEnum();\n }", "public void testValidEnums () {\t\n\t\tString example = \"AM\";\n\t\tRadioBand enumAm = RadioBand.valueForString(example);\n\t\texample = \"FM\";\n\t\tRadioBand enumFm = RadioBand.valueForString(example);\n\t\texample = \"XM\";\n\t\tRadioBand enumXm = RadioBand.valueForString(example);\n\n\t\tassertNotNull(\"AM returned null\", enumAm);\n\t\tassertNotNull(\"FM returned null\", enumFm);\n\t\tassertNotNull(\"XM returned null\", enumXm);\n\t}", "public static void validateKeys(Model model) throws MolgenisModelException\r\n\t{\r\n\t\tlogger.debug(\"validate the fields used in 'unique' constraints...\");\r\n\t\t// validate the keys\r\n\t\tfor (Entity entity : model.getEntities())\r\n\t\t{\r\n\t\t\tString entityname = entity.getName();\r\n\t\t\tint autocount = 0;\r\n\t\t\tfor (Field field : entity.getAllFields())\r\n\t\t\t{\r\n\t\t\t\tString fieldname = field.getName();\r\n\t\t\t\tif (field.isAuto() && field.getType() instanceof IntField)\r\n\t\t\t\t{\r\n\t\t\t\t\tautocount++;\r\n\r\n\t\t\t\t\tboolean iskey = false;\r\n\r\n\t\t\t\t\tfor (Unique unique : entity.getAllKeys())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (Field keyfield : unique.getFields())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (keyfield.getName() == null) throw new MolgenisModelException(\"unique field '\"\r\n\t\t\t\t\t\t\t\t\t+ fieldname + \"' is not known in entity \" + entityname);\r\n\t\t\t\t\t\t\tif (keyfield.getName().equals(field.getName())) iskey = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!iskey) throw new MolgenisModelException(\r\n\t\t\t\t\t\t\t\"there can be only one auto column and it must be the primary key for field '\" + entityname\r\n\t\t\t\t\t\t\t\t\t+ \".\" + fieldname + \"'\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (field.getType() instanceof EnumField)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (field.getDefaultValue() != null && !\"\".equals(field.getDefaultValue())) if (!field\r\n\t\t\t\t\t\t\t.getEnumOptions().contains(field.getDefaultValue()))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new MolgenisModelException(\"default value '\" + field.getDefaultValue()\r\n\t\t\t\t\t\t\t\t+ \"' is not in enum_options for field '\" + entityname + \".\" + fieldname + \"'\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (autocount > 1) throw new MolgenisModelException(\r\n\t\t\t\t\t\"there should be only one auto column and it must be the primary key for entity '\" + entityname\r\n\t\t\t\t\t\t\t+ \"'\");\r\n\r\n\t\t\t// to strict, the unique field may be non-automatic\r\n\t\t\tif (!entity.isAbstract() && autocount < 1)\r\n\t\t\t{\r\n\t\t\t\tthrow new MolgenisModelException(\r\n\t\t\t\t\t\t\"there should be one auto column for each root entity and it must be the primary key for entity '\"\r\n\t\t\t\t\t\t\t\t+ entityname + \"'\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "@Test\n\tpublic void shouldNotGetElementIfNotExistElementInEnum() \n\t\t\tthrows NotExistElementsException {\n\t\tString choice = RandomChoiceUtil.randomChoice(RoundResult.class).name();\n\t\tassertFalse(Arrays.stream(Choice.values())\n\t\t\t\t.filter(e -> e.name().equalsIgnoreCase(choice))\n\t\t\t\t.findAny().isPresent());\n\t}", "public boolean checkDictionaryHealth() {\n\t\tif(integerKeyDictionary.size() != stringKeyDictionary.size()) return false;\n\t\tfor(int index = 0; index < integerKeyDictionary.size(); index++) {\n\t\t\tString fromIntegerKeyDictionary = integerKeyDictionary.get(index);\n\t\t\tint fromStringKeyDictionary = stringKeyDictionary.get(fromIntegerKeyDictionary);\n\t\t\tif(fromStringKeyDictionary != index) {\n\t\t\t\tSystem.out.println(\" Dictionary ERROR \");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isValidKey(String key) throws Exception;", "@Test(timeout = 4000)\n public void test23() throws Throwable {\n HomeEnvironment.DrawingMode.values();\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n HomeEnvironment homeEnvironment1 = homeEnvironment0.clone();\n homeEnvironment0.setAllLevelsVisible(false);\n homeEnvironment1.setAllLevelsVisible(true);\n homeEnvironment1.setObserverCameraElevationAdjusted(false);\n homeEnvironment1.setObserverCameraElevationAdjusted(true);\n homeEnvironment1.setObserverCameraElevationAdjusted(false);\n HomeEnvironment.DrawingMode.values();\n // Undeclared exception!\n try { \n HomeEnvironment.DrawingMode.valueOf(\"hkT\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant com.eteks.sweethome3d.model.HomeEnvironment.DrawingMode.hkT\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "boolean verifyKeyValueTypes(Class<?> typeK, Class<?> typeV);", "EnumTypeDefinition createEnumTypeDefinition();", "@Override\n\tprotected boolean isKeySupported(final String key) {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public void testInvalidEnum () {\n\t\tString example = \"uSer_ExiT\";\n\t\ttry {\n\t\t AppInterfaceUnregisteredReason temp = AppInterfaceUnregisteredReason.valueForString(example);\n assertNull(\"Result of valueForString should be null.\", temp);\n\t\t}\n\t\tcatch (IllegalArgumentException exception) {\n fail(\"Invalid enum throws IllegalArgumentException.\");\n\t\t}\n\t}", "public boolean hasKeyType() {\n return fieldSetFlags()[2];\n }", "public boolean isEnumConstant() {\n return asElement().getKind() == ElementKind.ENUM_CONSTANT;\n }", "EEnum createEEnum();", "public void testInvalidEnum () {\n\t\tString example = \"8kHz\";\n\t\ttry {\n\t\t SamplingRate temp = SamplingRate.valueForString(example);\n assertNull(\"Result of valueForString should be null.\", temp);\n\t\t}\n\t\tcatch (IllegalArgumentException exception) {\n fail(\"Invalid enum throws IllegalArgumentException.\");\n\t\t}\n\t}", "boolean canSet(String key);", "public void testListEnum() {\n \t\tList<ECallConfirmationStatus> enumValueList = Arrays.asList(ECallConfirmationStatus.values());\n\n\t\tList<ECallConfirmationStatus> enumTestList = new ArrayList<ECallConfirmationStatus>();\n\t\tenumTestList.add(ECallConfirmationStatus.NORMAL);\n\t\tenumTestList.add(ECallConfirmationStatus.CALL_IN_PROGRESS);\n\t\tenumTestList.add(ECallConfirmationStatus.CALL_CANCELLED);\n\t\tenumTestList.add(ECallConfirmationStatus.CALL_COMPLETED);\n\t\tenumTestList.add(ECallConfirmationStatus.CALL_UNSUCCESSFUL);\n\t\tenumTestList.add(ECallConfirmationStatus.ECALL_CONFIGURED_OFF);\t\t\n\t\tenumTestList.add(ECallConfirmationStatus.CALL_COMPLETE_DTMF_TIMEOUT);\n\n\t\tassertTrue(\"Enum value list does not match enum class list\", \n\t\t\t\tenumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));\n\t}", "public void testAsIndex() throws Exception\n {\n ObjectMapper m = new ObjectMapper();\n assertFalse(m.isEnabled(SerializationFeature.WRITE_ENUMS_USING_INDEX));\n assertEquals(q(\"B\"), m.writeValueAsString(TestEnum.B));\n\n // but we can change (dynamically, too!) it to be number-based\n m.enable(SerializationFeature.WRITE_ENUMS_USING_INDEX);\n assertEquals(\"1\", m.writeValueAsString(TestEnum.B));\n }", "public Map<String, Boolean> getIsTypeOptionValidMap() {\n if (typeOptionValidMap == null) {\n typeOptionValidMap = new HashMap<String, Boolean>() {\n @Override\n public Boolean get(Object key) {\n return !(key == null || \"\".equals(key.toString().trim()) || countKeyOccurence(typeOptions, (String) key) > 1);\n }\n };\n }\n return typeOptionValidMap;\n }", "@Test\n\tpublic void testEditExistingEnum2() throws Exception {\n\n\t\tEnum enummDt = createRedGreenBlueEnum();\n\t\tedit(enummDt);\n\n\t\tEnumEditorPanel panel = findEditorPanel(tool.getToolFrame());\n\t\tfinal JTable table = panel.getTable();\n\t\tfinal EnumTableModel model = (EnumTableModel) table.getModel();\n\t\taddEntry(table, model, \"Purple\", 7);\n\n\t\tapply();\n\n\t\tCategory cat =\n\t\t\tprogram.getListing().getDataTypeManager().getCategory(enummDt.getCategoryPath());\n\t\tEnum en = (Enum) cat.getDataType(\"Colors\");\n\t\tString[] names = en.getNames();\n\t\tassertEquals(4, names.length);\n\t\tassertEquals(7, en.getValue(\"Purple\"));\n\t}", "private void validateFields () throws ModelValidationException\n\t\t\t{\n\t\t\t\tString pcClassName = getClassName();\n\t\t\t\tModel model = getModel();\n\t\t\t\t// check for valid typed public non-static fields\n\t\t\t\tList keyClassFieldNames = model.getAllFields(keyClassName);\n\t\t\t\tMap keyFields = getKeyFields();\n\n\t\t\t\tfor (Iterator i = keyClassFieldNames.iterator(); i.hasNext();)\n\t\t\t\t{\n\t\t\t\t\tString keyClassFieldName = (String)i.next();\n\t\t\t\t\tObject keyClassField = \n\t\t\t\t\t\tgetKeyClassField(keyClassName, keyClassFieldName);\n\t\t\t\t\tint keyClassFieldModifiers = \n\t\t\t\t\t\tmodel.getModifiers(keyClassField);\n\t\t\t\t\tString keyClassFieldType = model.getType(keyClassField);\n\t\t\t\t\tObject keyField = keyFields.get(keyClassFieldName);\n\n\t\t\t\t\tif (Modifier.isStatic(keyClassFieldModifiers))\n\t\t\t\t\t\t// we are not interested in static fields\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!model.isValidKeyType(keyClassName, keyClassFieldName))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new ModelValidationException(keyClassField,\n\t\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\t\"util.validation.key_field_type_invalid\", //NOI18N\n\t\t\t\t\t\t\tkeyClassFieldName, keyClassName));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!Modifier.isPublic(keyClassFieldModifiers))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new ModelValidationException(keyClassField,\n\t\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\t\"util.validation.key_field_public\", //NOI18N\n\t\t\t\t\t\t\tkeyClassFieldName, keyClassName));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (keyField == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tif (!keyClassFieldType.equals(model.getType(keyField)))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new ModelValidationException(keyClassField,\n\t\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\t\"util.validation.key_field_type_mismatch\", //NOI18N\n\t\t\t\t\t\t\tkeyClassFieldName, keyClassName, pcClassName));\n\t\t\t\t\t}\n\n\t\t\t\t\t// remove handled keyField from the list of keyFields\n\t\t\t\t\tkeyFields.remove(keyClassFieldName);\n\t\t\t\t}\n\n\t\t\t\t// check whether there are any unhandled key fields\n\t\t\t\tif (!keyFields.isEmpty())\n\t\t\t\t{\n\t\t\t\t\tObject pcClass = model.getClass(pcClassName);\n\t\t\t\t\tString fieldNames = StringHelper.arrayToSeparatedList(\n\t\t\t\t\t\tnew ArrayList(keyFields.keySet()));\n\n\t\t\t\t\tthrow new ModelValidationException(pcClass,\n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\"util.validation.key_field_missing\", //NOI18N\n\t\t\t\t\t\tpcClassName, keyClassName, fieldNames));\n\t\t\t\t}\n\t\t\t}", "@Override\n public boolean hasKey() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public interface TypeKey {\n}", "@Override\n public boolean hasKey() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "protected boolean isEnum(Class clazz) {\n\n return clazz.isEnum();\n }", "public synchronized Enumeration<Short> keys() {\n return new Enumerator(KEYS);\n }", "@Test public void keyDefinition() {\n fail( \"Not yet implemented\" );\n }", "@Override\r\n\tpublic void visit(EnumDefinition enumDefinition) {\n\r\n\t}", "private int validateKey (int key) {\n return (key < 0 || key > ALPHABET_LENGTH-1) ? 0 : key;\n }", "public static void main(String[] args) {\n\n for (OperateTypeEnum test : OperateTypeEnum.values()) {\n System.out.println(test.name()+\" \"+test.ordinal());\n }\n\n EnumMap<OperateTypeEnum, String> enumMap = new EnumMap<OperateTypeEnum, String>(OperateTypeEnum.class);\n enumMap.put(OperateTypeEnum.DELETE, \"dddddddddddddd\");\n enumMap.put(OperateTypeEnum.UPDATE, \"uuuuuuuuuuuuuu\");\n for (Map.Entry<OperateTypeEnum, String> entry : enumMap.entrySet()) {\n System.out.println(entry.getValue() + entry.getKey().getEnumDesc());\n }\n\n// EnumSet<OperateTypeEnum> enumSets = EnumSet.of(OperateTypeEnum.DELETE);\n// EnumSet<OperateTypeEnum> enumSets = EnumSet.allOf(OperateTypeEnum.class);\n// EnumSet<OperateTypeEnum> enumSets = EnumSet.range(OperateTypeEnum.DELETE,OperateTypeEnum.UPDATE);\n EnumSet<OperateTypeEnum> enumSet = EnumSet.noneOf(OperateTypeEnum.class);\n enumSet.add(OperateTypeEnum.DELETE);\n enumSet.add(OperateTypeEnum.UPDATE);\n for (Iterator<OperateTypeEnum> it = enumSet.iterator(); it.hasNext();) {\n System.out.println(it.next().getEnumDesc());\n }\n for (OperateTypeEnum enumTest : enumSet) {\n System.out.println(enumTest.getEnumDesc() + \" ..... \");\n }\n\n EnumSet<OperateTypeEnum> enumSets = EnumSet.copyOf(enumSet);\n }", "Enum getType();", "public void testInvalidEnum () {\n\t\tString example = \"aM\";\n\t\ttry {\n\t\t\tRadioBand temp = RadioBand.valueForString(example);\n assertNull(\"Result of valueForString should be null.\", temp);\n\t\t}\n\t\tcatch (IllegalArgumentException exception) {\n fail(\"Invalid enum throws IllegalArgumentException.\");\n\t\t}\n\t}", "public boolean definesKey( final String key ) {\n return values.containsKey( key );\n }", "@SuppressWarnings(\"rawtypes\")\n @Override\n public boolean canConvert(Class cls) {\n return EnumValue.class.isAssignableFrom(cls);\n }", "@Override\r\n\t\t\t\t\t\tpublic Enumeration<String> getKeys() {\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}", "boolean hasCompoundKey();", "public interface KeyCode {\n\n // Alphabet keys:\n int A_UPPER_CASE = 65;\n int B_UPPER_CASE = 66;\n int C_UPPER_CASE = 67;\n int D_UPPER_CASE = 68;\n int E_UPPER_CASE = 69;\n int F_UPPER_CASE = 70;\n int G_UPPER_CASE = 71;\n int H_UPPER_CASE = 72;\n int I_UPPER_CASE = 73;\n int J_UPPER_CASE = 74;\n int K_UPPER_CASE = 75;\n int L_UPPER_CASE = 76;\n int M_UPPER_CASE = 77;\n int N_UPPER_CASE = 78;\n int O_UPPER_CASE = 79;\n int P_UPPER_CASE = 80;\n int Q_UPPER_CASE = 81;\n int R_UPPER_CASE = 82;\n int S_UPPER_CASE = 83;\n int T_UPPER_CASE = 84;\n int U_UPPER_CASE = 85;\n int V_UPPER_CASE = 86;\n int W_UPPER_CASE = 87;\n int X_UPPER_CASE = 88;\n int Y_UPPER_CASE = 89;\n int Z_UPPER_CASE = 90;\n\n // int A_LOWER_CASE = 97;\n // int B_LOWER_CASE = 98;\n // int C_LOWER_CASE = 99;\n // int D_LOWER_CASE = 100;\n // int E_LOWER_CASE = 101;\n // int F_LOWER_CASE = 102;\n // int G_LOWER_CASE = 103;\n // int H_LOWER_CASE = 104;\n // int I_LOWER_CASE = 105;\n // int J_LOWER_CASE = 106;\n // int K_LOWER_CASE = 107;\n // int L_LOWER_CASE = 108;\n // int M_LOWER_CASE = 109;\n // int N_LOWER_CASE = 110;\n // int O_LOWER_CASE = 111;\n // int P_LOWER_CASE = 112;\n // int Q_LOWER_CASE = 113;\n // int R_LOWER_CASE = 114;\n // int S_LOWER_CASE = 115;\n // int T_LOWER_CASE = 116;\n // int U_LOWER_CASE = 117;\n // int V_LOWER_CASE = 118;\n // int W_LOWER_CASE = 119;\n // int X_LOWER_CASE = 120;\n // int Y_LOWER_CASE = 121;\n // int Z_LOWER_CASE = 122;\n\n // Numeric keys:\n int NUMPAD_0 = 96;\n int NUMPAD_1 = 97;\n int NUMPAD_2 = 98;\n int NUMPAD_3 = 99;\n int NUMPAD_4 = 100;\n int NUMPAD_5 = 101;\n int NUMPAD_6 = 102;\n int NUMPAD_7 = 103;\n int NUMPAD_8 = 104;\n int NUMPAD_9 = 105;\n\n int NUM_0 = 48;\n int NUM_1 = 49;\n int NUM_2 = 50;\n int NUM_3 = 51;\n int NUM_4 = 52;\n int NUM_5 = 53;\n int NUM_6 = 54;\n int NUM_7 = 55;\n int NUM_8 = 56;\n int NUM_9 = 57;\n\n int PERSIAN_0 = 1776;\n int PERSIAN_1 = 1777;\n int PERSIAN_2 = 1778;\n int PERSIAN_3 = 1779;\n int PERSIAN_4 = 1780;\n int PERSIAN_5 = 1781;\n int PERSIAN_6 = 1782;\n int PERSIAN_7 = 1783;\n int PERSIAN_8 = 1784;\n int PERSIAN_9 = 1785;\n\n // Function keys:\n int F1 = 112;\n int F2 = 113;\n int F3 = 114;\n int F4 = 115;\n int F5 = 116;\n int F6 = 117;\n int F7 = 118;\n int F8 = 119;\n int F9 = 120;\n int F10 = 121;\n int F11 = 122;\n int F12 = 123;\n\n // Control Keys:\n int BACKSPACE = 8;\n int TAB = 9;\n int ENTER = 13;\n int SHIFT = 16;\n int CTRL = 17;\n int ALT = 18;\n int PAUSE_BREAK = 19;\n int CAPS_LOCK = 20;\n int ESCAPE = 27;\n int PAGEUP = 33;\n int PAGEDOWN = 34;\n int END = 35;\n int HOME = 36;\n int LEFT = 37;\n int UP = 38;\n int RIGHT = 39;\n int DOWN = 40;\n int PRINT_SCREEN = 44;\n int INSERT = 45;\n int DELETE = 46;\n\n // Other Keys:\n int SPACE = 32;\n int EQUALITY = 61;\n int LEFT_WINDOW_KEY = 91;\n int RIGHT_WINDOW_KEY = 92;\n int SELECT_KEY = 93; // besides of right control key (context menu key, usually works like right click)\n int MULTIPLY = 106;\n int ADD = 107;\n int SUBTRACT = 109;\n int DECIMAL_POINT = 110;// . in numpad section\n int DIVIDE = 111;\n int NUM_LOCK = 144;\n int SCROLL_LOCK = 145;\n int SEMI_COLON = 186;// ;\n int EQUAL_SIGN = 187;// =\n int COMMA = 188;// ,\n int DASH = 189;// -\n int PERIOD = 190;// . in alphabet section\n int FORWARD_SLASH = 191;// /\n int GRAVE_ACCENT = 192; // `\n int OPEN_BRACKET = 219; // [\n int BACK_SLASH = 220; // \\\n int CLOSE_BRAKET = 221; // ]\n int SINGLE_QUOTE = 222; // '\n}", "public interface CodeEnum {\n\n Integer getCode();\n}", "public interface CodeEnum {\n Integer getCode();\n}", "boolean hasKeyRevocationActionType();", "boolean contains(KeyType key, ValueType value);", "boolean isKey( ImmutableBitSet columns );", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testNonToken(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(\"localhost:3002/v1/Token/auth\")\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/validate\")\n .request()\n .accept(MediaType.APPLICATION_JSON)\n .post(Entity.entity(jwt, MediaType.TEXT_PLAIN));\n\n assertEquals(400, response.getStatus(), \"Should not be valid\");\n assertTrue(response.readEntity(String.class).contains(\"Client token is not formatted correctly\"), \"Should have correct exception\");\n }", "@Test(timeout = 4000)\n public void test25() throws Throwable {\n Range.Builder range_Builder0 = new Range.Builder();\n range_Builder0.contractBegin(0L);\n range_Builder0.copy();\n range_Builder0.copy();\n Range range0 = range_Builder0.build();\n range_Builder0.shift(265L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range0);\n range0.complementFrom(linkedList0);\n Range range1 = Range.of((-3234L));\n range0.isSubRangeOf(range1);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.complementFrom(linkedList0);\n range1.intersects(range0);\n // Undeclared exception!\n try { \n Range.Comparators.valueOf(\"TGa_,[\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.Comparators.TGa_,[\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "@Test\n public void testCreationOfAccountWithEnum() {\n\n AccountWithEnum accountWithEnum = new AccountWithEnum();\n Assert.assertEquals(accountWithEnum.getAccountType(), AccountType.CHECKING);\n }", "@Test(timeout = 4000)\n public void test007() throws Throwable {\n Range range0 = Range.of(4294967244L);\n Object object0 = new Object();\n range0.equals(object0);\n // Undeclared exception!\n try { \n Range.CoordinateSystem.valueOf(\"\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.CoordinateSystem.\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "boolean hasKey();", "boolean hasKey();", "boolean hasKey();", "boolean hasKey();", "boolean hasKey();", "EnumValue createEnumValue();", "EnumValue createEnumValue();", "EnumValue createEnumValue();", "public void validate() throws org.apache.thrift.TException {\n if (key_column_name == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'key_column_name' was not present! Struct: \" + toString());\n }\n if (key_column_type == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'key_column_type' was not present! Struct: \" + toString());\n }\n // alas, we cannot check 'is_preaggregation' because it's a primitive and you chose the non-beans generator.\n // check for sub-struct validity\n }", "@Test(timeout = 4000)\n public void test087() throws Throwable {\n Range range0 = Range.ofLength(4294967244L);\n Object object0 = new Object();\n range0.equals(range0);\n // Undeclared exception!\n try { \n Range.CoordinateSystem.valueOf(\"\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.CoordinateSystem.\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "public Enumeration getKeys() throws AspException\n {\n throw new AspNotImplementedException(\"getKeys\");\n }", "protected void checkKey(Object key) {\n\tif (!canContainKey(key)) {\n throw new IllegalArgumentException(\n \"key is not valid for this LeaseMap\");\n }\n }", "public boolean isIdentifier(int key, int identifier, ObjectDataOptionsEnum... options) throws PersistenceException {\n if(getAllIdentifier(key, options).contains(identifier)) {\n return (true);\n }\n return (false);\n }" ]
[ "0.62608224", "0.5906526", "0.57013404", "0.5660624", "0.56466985", "0.552839", "0.54170305", "0.5393952", "0.5283994", "0.52812386", "0.52727544", "0.5244354", "0.52199775", "0.521801", "0.519526", "0.5194295", "0.5153697", "0.5153515", "0.5141852", "0.51363105", "0.51330256", "0.507992", "0.5056487", "0.5044145", "0.5014324", "0.50044125", "0.49965453", "0.49938992", "0.4989172", "0.49881607", "0.49655747", "0.49567127", "0.49398357", "0.4933993", "0.493204", "0.49193883", "0.49102744", "0.4904372", "0.4876636", "0.48517454", "0.4845034", "0.48327634", "0.48293474", "0.48228535", "0.48219413", "0.4817219", "0.48095718", "0.48022664", "0.4797239", "0.47955647", "0.47726503", "0.47676346", "0.476679", "0.47589955", "0.4758147", "0.47519866", "0.47417697", "0.47280854", "0.47111672", "0.4702145", "0.4689994", "0.4687159", "0.46859047", "0.46744612", "0.4657592", "0.46471462", "0.4645455", "0.46390957", "0.46368223", "0.46255597", "0.46212122", "0.46171248", "0.46083146", "0.4607305", "0.45952928", "0.4594268", "0.45890376", "0.45853162", "0.45739374", "0.45667395", "0.45655233", "0.4552778", "0.45504823", "0.45498085", "0.45476285", "0.4535836", "0.45303908", "0.4529663", "0.4529663", "0.4529663", "0.4529663", "0.4529663", "0.4529246", "0.4529246", "0.4529246", "0.4528792", "0.45190072", "0.45166028", "0.45159495", "0.45060417" ]
0.63088477
0
updates cache based on request from ansible
public void updateClusterDetails(UpdateClusterRequest callbackRequest) throws JsonProcessingException, IOException { ObjectMapper mapper = new ObjectMapper(); String callbackRequestStr = mapper.writeValueAsString(callbackRequest); logger.info("Update Request: " + callbackRequestStr); ArrayList<String> masterNodes = new ArrayList<String>(); ArrayList<String> workderNodes = new ArrayList<String>(); // set cluster id and inventory path. ClusterEnv clusterEnv = new ClusterEnv(callbackRequest.getClusterID()); clusterEnv.setInventoryPath(getInventoryPath(callbackRequest.getClusterID())); // if provision details are present set it. If request is posted after // provisioning K8SCluster cluster = clusterRepository.findById(callbackRequest.getClusterID()); if (cluster == null) { logger.info("Cluster could not be found in Database... "); throw new ClusterException("Cluster could not be found in database.."); } if (callbackRequest.getProvisionDetails() != null) { for (ProvisionDetails provDetails : callbackRequest.getProvisionDetails()) { if (provDetails.getNodeType().toUpperCase().equals("MASTER") && masterNodes.size() <= 1) { masterNodes.add(provDetails.getPublicIP()); } if (provDetails.getNodeType().toUpperCase().equals("WORKER")) { workderNodes.add(provDetails.getPublicIP()); } } String[] kubeMasterIps = new String[masterNodes.size()]; String[] kubeNodeIps = new String[workderNodes.size()]; masterNodes.toArray(kubeMasterIps); workderNodes.toArray(kubeNodeIps); clusterEnv.setKubeMasterIps(kubeMasterIps); clusterEnv.setKubeNodeIps(kubeNodeIps); clusterEnv.setClusterseqid(cluster.getId()); clusterRepository.saveClusterEnv(clusterEnv); cluster.setCreateStatus(ClusterStatusEnum.PROV_COMPLETED.getKeyValue()); clusterRepository.updateClusterStatus(cluster); } // if request is posted after create cluster if (callbackRequest.getCreateClusterDetails() != null) { // clusterDetails = (ClusterEnv) redisRepo.findById(clusterRequest.getClusterID(), // CacheKeysEnum.CLUSTER_DETAILS); clusterEnv.setApiServerUrl(callbackRequest.getCreateClusterDetails().getKubeApiServerUrl()); // clusterEnv.setK8sAdminToken(clusterRequest.getCreateClusterDetails().getK8sAdminToken()); clusterEnv.setK8sDashboardUrl(callbackRequest.getCreateClusterDetails().getK8sDashboadUrl()); // clusterEnv.setDashboardToken(clusterRequest.getCreateClusterDetails().getDashboardToken()); clusterEnv.setClusterseqid(cluster.getId()); // If provisioning completed, that means, Azure Native flow. Already record // present in clusterenv - hence update if (cluster.getCreateStatus().equalsIgnoreCase(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) { clusterRepository.updateClusterEnv(clusterEnv); } else { clusterRepository.saveClusterEnv(clusterEnv); } // SAVE Tokens to Vault saveTokensToVault(callbackRequest); cluster.setCreateStatus(ClusterStatusEnum.READY.getKeyValue()); clusterRepository.updateClusterStatus(cluster); if (callbackRequest.getCreateClusterDetails().getKubeConfig() != null) { logger.info("Kube Cofig from callback request::" + callbackRequest.getCreateClusterDetails().getKubeConfig().asText()); } else { logger.info("Kube Cofig from callback request is null::"); } } if (callbackRequest.getMonitoringDetails() != null) { // TODO - Save montiroting details in database logger.info("Monitoring details - Grafana URL- from callback request::" + callbackRequest.getMonitoringDetails().getGrafanaUrl()); } // redisRepo.save(clusterEnv, CacheKeysEnum.CLUSTER_DETAILS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {\n if (requestContext.getProperty(CACHE_USED) == null && responseContext.getEntity() instanceof Result) {\n Result result = (Result) responseContext.getEntity();\n String requestPath = requestContext.getUriInfo().getPath();\n\n log.info(\"{} - caching result: {}\", requestPath, result);\n\n cache.putIfAbsent(requestPath, result);\n }\n }", "@Override\n public void filter(ContainerRequestContext requestContext) throws IOException {\n String requestPath = requestContext.getUriInfo().getPath();\n\n Result cachedResult = cache.get(requestPath);\n if (cachedResult != null) {\n log.info(\"{} - responding with cached result: {}\", requestPath, cachedResult);\n\n requestContext.setProperty(CACHE_USED, Boolean.TRUE);\n\n requestContext.abortWith(\n Response.ok(cachedResult).type(MediaType.APPLICATION_JSON).build());\n } else {\n log.info(\"{} - no result in cache\", requestPath);\n }\n }", "void update(String pathString, CacheEntry cacheEntry);", "private void updateCache(long counter) {\n vertx.eventBus().rxSend(\"posting::get\", null)\n .toObservable()\n /* TODO:\n * 1. Log received string\n * 2. Deserialize received string to List<Posting>\n * 3. Add exponential backoff using .retryWhen\n */\n .subscribe();\n\n }", "public void setCached() {\n }", "public void updateCache() {\n\n log.info(\"Updating solar flare cache\");\n Date fallbackStartDate = DateHelper.getFallbackDate();\n solarFlareRepository.count()\n .map(total -> {\n if (total > 0) {\n solarFlareRepository.findTopByBeginTimeIsNotNullOrderByBeginTimeDesc()\n .map(solarFlare -> {\n log.info(\"Entries exist, performing incremental update\");\n log.info(\n \"Last entry found at {}\",\n DateHelper.getPrintableString(solarFlare.getBeginTime())\n );\n collectForRange(solarFlare.getBeginTime(), null);\n return solarFlare;\n })\n .subscribe();\n } else {\n log.info(\"No entries found, performing a full import\");\n collectForRange(fallbackStartDate, null);\n }\n return total;\n })\n .subscribe();\n }", "public void cacheResult(SitbMoneyCollection sitbMoneyCollection);", "public void cacheResult(CsclAppointeeMaster csclAppointeeMaster);", "private boolean updateCache(String type) {\n\t\treturn false;\n\t}", "public void cacheResult(VcmsArticleType vcmsArticleType);", "protected abstract void requestNoCache(ActionContext context);", "@Test\n public void testGetCacheControlDataExistsInPrivateCache() {\n MockHttpSession mockSession = new MockHttpSession();\n MockHttpServletRequest httpRequest = new MockHttpServletRequest();\n httpRequest.setSession(mockSession);\n MockHttpServletRequest nextHttpRequest = new MockHttpServletRequest();\n nextHttpRequest.setSession(mockSession);\n\n MockPortletWindowId portletWindowId = new MockPortletWindowId(\"123\");\n MockPortletDefinitionId portletDefinitionId = new MockPortletDefinitionId(789);\n\n // use private cache\n when(portletDescriptor.getCacheScope()).thenReturn(\"private\");\n when(portletDescriptor.getExpirationCache()).thenReturn(300);\n\n when(portletWindowRegistry.getPortletWindow(httpRequest, portletWindowId))\n .thenReturn(portletWindow);\n when(portletWindowRegistry.getPortletWindow(nextHttpRequest, portletWindowId))\n .thenReturn(portletWindow);\n when(portletWindow.getPortletWindowId()).thenReturn(portletWindowId);\n when(portletWindow.getPortletEntity()).thenReturn(portletEntity);\n when(portletWindow.getWindowState()).thenReturn(WindowState.NORMAL);\n when(portletWindow.getPortletMode()).thenReturn(PortletMode.VIEW);\n when(portletEntity.getPortletDefinitionId()).thenReturn(portletDefinitionId);\n when(portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId))\n .thenReturn(portletDescriptor);\n\n when(urlSyntaxProvider.getPortalRequestInfo(httpRequest)).thenReturn(portalRequestInfo);\n\n final CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult> cacheState =\n cacheControlService.getPortletRenderState(httpRequest, portletWindowId);\n final CacheControl cacheControl = cacheState.getCacheControl();\n assertFalse(cacheControl.isPublicScope());\n\n cacheControl.setETag(\"123456\");\n\n final PortletRenderResult portletResult = new PortletRenderResult(\"title\", null, 0, 1);\n final String content = \"<p>Cached content</p>\";\n\n final CachedPortletData<PortletRenderResult> cachedPortletData =\n new CachedPortletData<PortletRenderResult>(\n portletResult,\n content,\n null,\n null,\n cacheControl.isPublicScope(),\n cacheControl.getETag(),\n -2);\n\n cacheControlService.cachePortletRenderOutput(\n portletWindowId, nextHttpRequest, cacheState, cachedPortletData);\n\n when(urlSyntaxProvider.getPortalRequestInfo(nextHttpRequest)).thenReturn(portalRequestInfo);\n\n final CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult>\n afterCacheState =\n cacheControlService.getPortletRenderState(nextHttpRequest, portletWindowId);\n // retrieve cachecontrol again, and return should have etag set\n // note using 'nextHttpRequest'\n Assert.assertEquals(\"123456\", afterCacheState.getCacheControl().getETag());\n }", "public interface PermissionService {\n\n @Caching()\n public SysPermission findByUrl(String url);\n\n}", "public void cacheResult(Todo todo);", "private void putInCache(Module module){\n\t\tString key = getKey(module);\n\t\tcache.put(key, module);\n\t}", "public void cacheResult(DataEntry dataEntry);", "public void cacheResult(com.ms3.training.services.model.Course course);", "public void cacheResult(com.alain.puntocoma.model.Catalogo catalogo);", "StoreResponse replace(CACHE_ELEMENT e);", "public void cacheResult(java.util.List<irestads.model.AdsItem> adsItems);", "public void cacheResult(ua.org.gostroy.guestbook.model.Entry3 entry3);", "StoreResponse set(CACHE_ELEMENT e);", "private int updateOkapi(final String ocCode, final boolean canUpdate, final boolean canImport) throws IOException, JSONException{\n\tif (!(canUpdate || canImport)){\n\t return 0;\n\t}\n\t\n //TODO: is_found mit User-Id und Anzahl logs.\n\tfinal String userId = getUserUuid();\n final String detailUrl = (\"https://www.opencaching.de/okapi/services/caches/geocache?\"+\n \"cache_code=\"+ocCode+\n \"&langpref=de&\"+\n \"fields=name|location|type|status|owner|gc_code|size2|difficulty|terrain|short_description|description|hints2|images|trackables|alt_wpts|attr_acodes|date_hidden|internal_id|code|recommendations|latest_logs|is_found&\"+\n \"user_uuid=\"+(URL.encodeURL (userId, true))+\n \"&consumer_key=EgcYTe8ZZsWd4PqGXNu6\"+\n \"&lpc=all\").replaceAll(\"\\\\|\",\"%7C\");\n Preferences.itself().log (\"CacheDetail-URL: [\" + detailUrl + \"]\");\n final String cacheAsJsonString = UrlFetcher.fetch(detailUrl,true);\n Preferences.itself().log (\"CacheDetails: \" + cacheAsJsonString);\n\n //------------\n final int index = cacheDB.getIndex(ocCode);\n final CacheHolder syncHolder;\n\tfinal int updated;\n if (index == -1) {\n\t if (!canImport){\n\t\treturn 2;\n\t }\n syncHolder = new CacheHolder();\n\t syncHolder.setCode (ocCode);\n Preferences.itself().log(\"Importing new Cache!\");\n numCacheImported++;\n syncHolder.setNew(true);\n cacheDB.add(syncHolder);\n DBindexID.put(syncHolder.getIdOC(), syncHolder.getCode());\n\t updated = 2;\n }\n // update (overwrite) data\n else {\n\t if (!canUpdate){\n\t\treturn 1;\n\t }\n syncHolder = cacheDB.get(index);\n Preferences.itself().log(\"Updating existing Cache!\");\n numCacheUpdated++;\n syncHolder.setNew(false);\n syncHolder.setIncomplete(false);\n cacheDB.get(index).update(syncHolder);\n DBindexID.put(syncHolder.getIdOC(), syncHolder.getCode());\n\t updated = 1;\n }\n\tsyncHolder.getDetails().setURL(\"https://opencaching.de/\" + ocCode.toUpperCase());\n // clear data (picture, logs) if we do a complete Update\n if (!incUpdate) {\n syncHolder.getDetails().getCacheLogs().clear();\n }\n\t//Images will always be (re)loaded\n\tsyncHolder.getDetails().getImages().clear();\n\t//TODO: Delete existing images from filesystem\n\n JSONObject cacheAsJson = new JSONObject(cacheAsJsonString);\n syncHolder.setName(cacheAsJson.getString(\"name\"));\n final JSONObject ownerObject = cacheAsJson.getJSONObject(\"owner\");\n syncHolder.setOwner(ownerObject.getString(\"username\"));\n final String locationText = cacheAsJson.getString(\"location\");\n syncHolder.getWpt().latDec = Common.parseDouble(locationText.substring(0, locationText.indexOf('|')));\n syncHolder.getWpt().lonDec = Common.parseDouble(locationText.substring(locationText.indexOf('|')+1));\n syncHolder.setDifficulty ((byte)(cacheAsJson.getDouble(\"difficulty\")*10));\n syncHolder.setTerrain ((byte)(cacheAsJson.getDouble(\"terrain\")*10));\n final String hiddenText = cacheAsJson.getString(\"date_hidden\");\n syncHolder.setHidden(hiddenText.substring(0, hiddenText.indexOf('T')));\n syncHolder.setCode(cacheAsJson.get(\"code\").toString());\n final String statusText = cacheAsJson.getString(\"status\");\n //Order is important: setAvailable overwrites archived if the value is true:\n syncHolder.setAvailable (!(\"Temporarily unavailable\".equals(statusText)));\n syncHolder.setArchived(\"Archived\".equals(statusText));\n boolean isFound = cacheAsJson.getBoolean(\"is_found\");\n syncHolder.setFound(isFound);\n\n final String typeString = cacheAsJson.getString(\"type\");\n syncHolder.setType(translateType(typeString));\n //result.idOC = (String) attributes.get(\"ocCacheID\"); ???\n final Time lastSync = new Time();\n Preferences.itself().log(\"Aktuelle Zeit ist: \" + lastSync.format(\"yyyyMMddHHmmss\"));\n syncHolder.setLastSync (lastSync.format(\"yyyyMMddHHmmss\"));\n syncHolder.setNumRecommended (cacheAsJson.getInt(\"recommendations\"));\n final String sizeText = cacheAsJson.getString(\"size2\");\n syncHolder.setSize(translateSize(sizeText));\n\n //Attributes setzen:\n setAttribute (syncHolder, cacheAsJson.getJSONArray(\"attr_acodes\"));\n\n\tString description=cacheAsJson.getString(\"description\");\n\tdescription=replaceEntitiesWithCharacters(description);\n syncHolder.getDetails().setLongDescription(description);\n final JSONObject hintsObject = cacheAsJson.getJSONObject(\"hints2\");\n if (hintsObject.has(\"de\")){\n final String hintsText = hintsObject.getString(\"de\");\n syncHolder.getDetails().setHints(Common.rot13(hintsText));\n }\n\n LogList cacheLogs = readLogList(cacheAsJson.getJSONArray(\"latest_logs\"));\n syncHolder.getDetails().getCacheLogs().purgeLogs();\n for (int i=0; i < cacheLogs.size(); i++){\n\t Log log = cacheLogs.getLog(i);\n\t Preferences.itself().log (\"Finder-Id: \" + log.getFinderID());\n\t if (log.getFinderID().equalsIgnoreCase (userId)){\n\t\tsyncHolder.getDetails().setOwnLog(log);\n\t }\n syncHolder.getDetails().getCacheLogs().merge(log);\n }\n CacheImages imageList = readImageList(cacheAsJson.getJSONArray(\"images\"));\n loadPictures (syncHolder, imageList);\n\n\tloadAdditionalWaypoints(cacheAsJson.getJSONArray (\"alt_wpts\"));\n\n // save all\n syncHolder.getDetails().saveCacheXML(MainForm.profile.dataDir);\n syncHolder.getDetails().setUnsaved(true); // this makes CachHolder save the details in case that they are unloaded from memory\n\n return updated;\n\t}", "public Boolean updateCache(String type) throws Exception {\n //Updating the same policy\n System.out.println(\"Updating Cache after a record is \"+type);\n JSONObject currentPolicy = policy.getCachePolicy();\n return updateCache(currentPolicy);\n }", "@Test\n public void cachedContractor_whenUpdated_shouldBeUpdatedAndAvailableInCache() {\n Person person = personService.updatePerson(\"Name, Updated\", \"17a36637-04d4-4357-9c6b-10a755dbbcdd\");\n assertEquals(\"Name, Updated\", Optional.ofNullable(cacheManager.getCache(\"person2\"))\n .map(cache -> cache.get(\"17a36637-04d4-4357-9c6b-10a755dbbcdd\", Person.class))\n .orElse(new Person()).getName());\n }", "public synchronized static void store(Context context, String name, Object o) {\n for(Map.Entry<Object, String> e : cached.entrySet()) {\r\n if(e.getValue().contentEquals(name)) {\r\n // Found cached\r\n cached.remove(e.getKey());\r\n break;\r\n }\r\n }\r\n // Put new entry\r\n if(o != null)\r\n cached.put(o, name);\r\n // Post async update\r\n pending.put(name, o);\r\n apply(context);\r\n }", "@Override\n protected synchronized void subscribeActual(Observer<? super Response<T>> observer) {\n Call<T> call = originalCall.clone();\n\n try {\n for (Annotation annotation : annotations) {\n if (annotation instanceof Cache) {\n time = ((Cache) annotation).time();\n bindParams = ((Cache) annotation).bindParams();\n break;\n }\n }\n MethodFactoryAdapter adapter = new MethodFactoryAdapter(call.request(), bindParams);\n MethodFactory factory = adapter.get();\n HashMap<String, String> parseParameters = factory.parseParameters();\n String url = call.request().url().toString();\n boolean isFirst = true;\n StringBuffer buffer = new StringBuffer();\n for (HashMap.Entry<String, String> entry : parseParameters.entrySet()) {\n String key = entry.getKey();\n String value = entry.getValue();\n if (isFirst) {\n buffer.append(\"?\").append(key).append(\"=\").append(value);\n isFirst = false;\n } else {\n buffer.append(\"&\").append(key).append(\"=\").append(value);\n }\n }\n String cacheUrl = url + buffer.toString();\n long nowTime = System.currentTimeMillis();\n fileName = cacheUrl + \"&\" + nowTime;\n\n cache = DiskLruCacheHelper.createCache(APP.app, URL_CACHE);\n String responseCacheData = DiskLruCacheHelper.readCacheToString(cache, cacheUrl);\n int indexOfTime = responseCacheData.indexOf(\"\\n\");\n String[] times = responseCacheData.substring(0, indexOfTime).split(\":\");\n responseCacheData = responseCacheData.substring(indexOfTime + 1);\n long diskCacheTime = Long.parseLong(times[1]);\n if (!TextUtils.isEmpty(responseCacheData) && diskCacheTime != -1 && nowTime - time <= diskCacheTime) {\n E e = new Gson().fromJson(responseCacheData, E.class);\n Response<T> cacheResponse = (Response<T>) Response.success(e);\n observer.onNext(cacheResponse);\n } else {\n cache.delete();\n cache = null;\n\n }\n } catch (Exception e) {\n if (cache != null && !cache.isClosed()) {\n try {\n cache.delete();\n } catch (IOException e1) {\n\n }\n call = null;\n }\n }\n\n\n CallDisposable disposable = new CallDisposable(call);\n observer.onSubscribe(disposable);\n\n boolean terminated = false;\n try {\n Response<T> response = call.execute();\n E e = (E) response.body();\n String responseData = new Gson().toJson(e);\n if (cache == null) {\n cache = DiskLruCacheHelper.createCache(APP.app, URL_CACHE);\n }\n DiskLruCacheHelper.writeStringToCache(cache, responseData, fileName);\n if (!disposable.isDisposed()) {\n observer.onNext(response);\n }\n if (!disposable.isDisposed()) {\n terminated = true;\n observer.onComplete();\n }\n } catch (Throwable t) {\n Exceptions.throwIfFatal(t);\n if (terminated) {\n RxJavaPlugins.onError(t);\n } else if (!disposable.isDisposed()) {\n try {\n observer.onError(t);\n } catch (Throwable inner) {\n Exceptions.throwIfFatal(inner);\n RxJavaPlugins.onError(new CompositeException(t, inner));\n }\n }\n }\n }", "public void cacheResult(com.Hotel.model.Hotel hotel);", "@Scheduled(fixedDelay = 98)\n public void cacheStats() {\n SalesAmount salesAmount = statsService.retrieveNextSalesAmount();\n LocalDateTime now = LocalDateTime.now(clock).withNano(0);\n while (salesAmount != null && !salesAmount.getTime().isAfter(Instant.now(clock))) {\n /*\n Because sales requests are processed sequentially, this way we don't need to care about increasing the\n aggregated sales amount in parallel and use Atomic data structures.\n */\n SalesAmountPerSecond salesAmountPerSecond = statsService.getLastSalesAmountPerSecond();\n if (null != salesAmountPerSecond && salesAmountPerSecond.getTime().equals(now)) {\n salesAmountPerSecond.addSalesAmount(salesAmount.getAmount());\n } else {\n statsService.addSalesAmountPerSecond(new SalesAmountPerSecond(\n salesAmount.getAmount(),\n 1,\n now));\n }\n salesAmount = statsService.retrieveNextSalesAmount();\n }\n }", "@Override\r\n public void setCaching(int parseInt) {\n\r\n }", "@Test\n public void testWithCacheMapKeyAlreadyUsed() {\n \t\n String root0 = \"/apps/\";\n searchPathOptions.setSearchPaths(new String[] {\n root0\n });\n\n final Resource r = request.getResource();\n final Object storedElement = \"randomString\";\n r.getResourceResolver().getPropertyMap().put(LocationCollector.CACHE_KEY, storedElement);\n List<Resource> loc = getLocations(r.getResourceType(),\n r.getResourceSuperType());\n \n List<Resource> expected = Arrays.asList(\n \t\tr(root0 + resourceTypePath), // /apps/foo/bar\n r(root0 + DEFAULT_RESOURCE_TYPE)); // /apps/sling/servlet/default\n assertThat(loc,isSameResourceList(expected));\n \t\n assertEquals(storedElement, r.getResourceResolver().getPropertyMap().get(LocationCollector.CACHE_KEY));\n \n // make sure that a cache clear does not clear this entry\n LocationCollector.clearCache(resolver);\n assertEquals(storedElement, r.getResourceResolver().getPropertyMap().get(LocationCollector.CACHE_KEY));\n \n \t\n }", "public void storeInCache() {\r\n lockValueStored = IN_CACHE;\r\n }", "@Bean\n public DownloadCache cache() {\n DownloadCache result = new DownloadCache(TEST_CACHE_DIR);\n result.clear();\n return result;\n }", "@Override\n public boolean isCaching() {\n return false;\n }", "public void cacheResult(java.util.List<Todo> todos);", "@Test\n public void testPutGet() {\n cache.put(\"A\", \"first\");\n cache.put(\"C\", \"second\");\n cache.put(\"C\", \"third\");\n \n assertEquals(\"first\", cache.get(\"A\"));\n assertEquals(\"third\", cache.get(\"C\"));\n }", "void cache(String key, T value) throws IOException;", "public void cacheResult(PlanoSaude planoSaude);", "private static void setCacheTag(File image, HttpServletRequest request, HttpServletResponse response) {\n String fileName = image.getName();\n long length = image.length();\n long lastModified = image.lastModified();\n String eTag = fileName + \"_\" + length + \"_\" + lastModified;\n long expires = System.currentTimeMillis() + DEFAULT_EXPIRE_TIME;\n\n // Validate request headers for caching ---------------------------------------------------\n\n // If-None-Match header should contain \"*\" or ETag. If so, then return 304.\n String ifNoneMatch = request.getHeader(\"If-None-Match\");\n if (ifNoneMatch != null && matches(ifNoneMatch, eTag)) {\n response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);\n response.setHeader(\"ETag\", eTag); // Required in 304.\n response.setDateHeader(\"Expires\", expires); // Postpone cache with 1 week.\n return;\n }\n\n // If-Modified-Since header should be greater than LastModified. If so, then return 304.\n // This header is ignored if any If-None-Match header is specified.\n long ifModifiedSince = request.getDateHeader(\"If-Modified-Since\");\n if (ifNoneMatch == null && ifModifiedSince != -1 && ifModifiedSince + 1000 > lastModified) {\n response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);\n response.setHeader(\"ETag\", eTag); // Required in 304.\n response.setDateHeader(\"Expires\", expires); // Postpone cache with 1 week.\n return;\n }\n\n if (null == ifNoneMatch && ifModifiedSince == -1) {\n// response.setHeader(HTTPCacheHeader.CACHE_CONTROL.getName(), cacheControl.toString());\n response.setDateHeader(\"Expires\", expires); // Postpone cache with 1 week.\n }\n\n\n }", "@Test\n public void testPutOverrideTTL() throws Exception {\n long beforeCreated = System.currentTimeMillis();\n Thread.sleep(10);\n String originalString = \"The rain in Spain falls mainly on the plain\";\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(originalString.getBytes());\n\n assertEquals(404, HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\").getResponseCode());\n Header header = new Header(\"ehcacheTimeToLiveSeconds\", \"10\");\n int status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"text/plain\", byteArrayInputStream, header);\n assertEquals(201, status);\n\n HttpURLConnection urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(200, urlConnection.getResponseCode());\n\n Thread.sleep(15000);\n urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(404, urlConnection.getResponseCode());\n\n header = new Header(\"ehcacheTimeToLiveSeconds\", \"garbage\");\n status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"text/plain\", byteArrayInputStream, header);\n assertEquals(201, status);\n\n //Should have not parsed\n Thread.sleep(15000);\n urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(200, urlConnection.getResponseCode());\n\n\n header = new Header(\"ehcacheTimeToLiveSeconds\", null);\n status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"text/plain\", byteArrayInputStream, header);\n assertEquals(201, status);\n\n //Should have not parsed\n Thread.sleep(15000);\n urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(200, urlConnection.getResponseCode());\n\n //the header is case insensitive\n header = new Header(\"EhcachetImeToLiveSeconds\", \"1\");\n status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"text/plain\", byteArrayInputStream, header);\n assertEquals(201, status);\n\n Thread.sleep(5000);\n urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(404, urlConnection.getResponseCode());\n\n\n }", "@Test\n public void checkThatTheCacheIsUsed() {\n \tif (!useResourceCaching) {\n \t\treturn;\n \t}\n \t\n \t// The basic test setup is copied from testSearchPath2ElementsWithSuper\n String root0 = \"/apps/\";\n String root1 = \"/libs/\";\n searchPathOptions.setSearchPaths(new String[] {\n root0,\n root1\n });\n\n // set resource super type\n resourceSuperType = \"foo:superBar\";\n resourceSuperTypePath = ResourceUtil.resourceTypeToPath(resourceSuperType);\n replaceResource(null, resourceSuperType);\n\n final Resource r = request.getResource();\n \n \t// Execute the same call twice and expect that on 2nd time the ResourceResolver\n \t// is never used, because all is taken from the cache\n getLocations(r.getResourceType(),\n r.getResourceSuperType());\n Mockito.clearInvocations(resolver);\n getLocations(r.getResourceType(),\n r.getResourceSuperType());\n Mockito.verify(resolver, Mockito.never()).getResource(Mockito.anyString());\n \n // validate the cache cleanup\n int cacheEntries = ((Map<String,Resource>) resolver.getPropertyMap().get(LocationCollector.CACHE_KEY)).size();\n assertTrue(cacheEntries > 0);\n LocationCollector.clearCache(resolver);\n assertEquals(0,((Map<String,Resource>) resolver.getPropertyMap().get(LocationCollector.CACHE_KEY)).size());\n \n }", "@Override\n protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException {\n final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));\n final String cacheContainerName = address.getElement(address.size() - 2).getValue();\n final String cacheName = address.getLastElement().getValue();\n final String attrName = operation.require(NAME).asString();\n final ServiceController<?> controller = context.getServiceRegistry(false).getService(CacheService.getServiceName(cacheContainerName, cacheName));\n Cache<?, ?> cache = (Cache<?, ?>) controller.getValue();\n\n CacheMetrics metric = CacheMetrics.getStat(attrName);\n ModelNode result = new ModelNode();\n\n if (metric == null) {\n context.getFailureDescription().set(String.format(\"Unknown metric %s\", attrName));\n } else if (cache == null) {\n context.getFailureDescription().set(String.format(\"Unavailable cache %s\", attrName));\n } else {\n switch (metric) {\n case CACHE_STATUS:\n result.set(cache.getAdvancedCache().getStatus().toString());\n break;\n case CONCURRENCY_LEVEL:\n result.set(((LockManagerImpl) cache.getAdvancedCache().getLockManager()).getConcurrencyLevel());\n break;\n case NUMBER_OF_LOCKS_AVAILABLE:\n result.set(((LockManagerImpl) cache.getAdvancedCache().getLockManager()).getNumberOfLocksAvailable());\n break;\n case NUMBER_OF_LOCKS_HELD:\n result.set(((LockManagerImpl) cache.getAdvancedCache().getLockManager()).getNumberOfLocksHeld());\n break;\n case AVERAGE_READ_TIME: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getAverageReadTime() : 0);\n break;\n }\n case AVERAGE_WRITE_TIME: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getAverageWriteTime() : 0);\n break;\n }\n case ELAPSED_TIME: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getElapsedTime() : 0);\n break;\n }\n case EVICTIONS: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getEvictions() : 0);\n break;\n }\n case HIT_RATIO: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getHitRatio() : 0);\n break;\n }\n case HITS: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getHits() : 0);\n break;\n }\n case MISSES: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getMisses() : 0);\n break;\n }\n case NUMBER_OF_ENTRIES: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getNumberOfEntries() : 0);\n break;\n }\n case READ_WRITE_RATIO: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getReadWriteRatio() : 0);\n break;\n }\n case REMOVE_HITS: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getRemoveHits() : 0);\n break;\n }\n case REMOVE_MISSES: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getRemoveMisses() : 0);\n break;\n }\n case STORES: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getStores() : 0);\n break;\n }\n case TIME_SINCE_RESET: {\n CacheMgmtInterceptor cacheMgmtInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache().getInterceptorChain(), CacheMgmtInterceptor.class);\n result.set(cacheMgmtInterceptor != null ? cacheMgmtInterceptor.getTimeSinceReset() : 0);\n break;\n }\n case AVERAGE_REPLICATION_TIME: {\n result.set(((RpcManagerImpl) cache.getAdvancedCache().getRpcManager()).getAverageReplicationTime());\n break;\n }\n case REPLICATION_COUNT:\n result.set(((RpcManagerImpl) cache.getAdvancedCache().getRpcManager()).getReplicationCount());\n break;\n case REPLICATION_FAILURES:\n result.set(((RpcManagerImpl) cache.getAdvancedCache().getRpcManager()).getReplicationFailures());\n break;\n case SUCCESS_RATIO:\n result.set(((RpcManagerImpl) cache.getAdvancedCache().getRpcManager()).getSuccessRatioFloatingPoint());\n break;\n case COMMITS: {\n TxInterceptor txInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache()\n .getInterceptorChain(), TxInterceptor.class);\n result.set(txInterceptor != null ? txInterceptor.getCommits() : 0);\n break;\n }\n case PREPARES: {\n TxInterceptor txInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache()\n .getInterceptorChain(), TxInterceptor.class);\n result.set(txInterceptor != null ? txInterceptor.getPrepares() : 0);\n break;\n }\n case ROLLBACKS: {\n TxInterceptor txInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache()\n .getInterceptorChain(), TxInterceptor.class);\n result.set(txInterceptor != null ? txInterceptor.getRollbacks() : 0);\n break;\n }\n case INVALIDATIONS: {\n InvalidationInterceptor invInterceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache()\n .getInterceptorChain(), InvalidationInterceptor.class);\n result.set(invInterceptor != null ? invInterceptor.getInvalidations() : 0);\n break;\n }\n case PASSIVATIONS: {\n PassivationInterceptor interceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache()\n .getInterceptorChain(), PassivationInterceptor.class);\n result.set(interceptor != null ? interceptor.getPassivations() : \"\");\n break;\n }\n case ACTIVATIONS: {\n ActivationManager manager = cache.getAdvancedCache().getComponentRegistry().getComponent(ActivationManager.class);\n result.set(manager != null ? manager.getActivationCount() : 0);\n break;\n }\n case CACHE_LOADER_LOADS: {\n ActivationInterceptor interceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache()\n .getInterceptorChain(), ActivationInterceptor.class);\n result.set(interceptor != null ? interceptor.getCacheLoaderLoads() : 0);\n break;\n }\n case CACHE_LOADER_MISSES: {\n ActivationInterceptor interceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache()\n .getInterceptorChain(), ActivationInterceptor.class);\n result.set(interceptor != null ? interceptor.getCacheLoaderMisses() : 0);\n break;\n }\n case CACHE_LOADER_STORES: {\n CacheWriterInterceptor interceptor = getFirstInterceptorWhichExtends(cache.getAdvancedCache()\n .getInterceptorChain(), CacheWriterInterceptor.class);\n result.set(interceptor != null ? interceptor.getWritesToTheStores() : 0);\n break;\n }\n }\n context.getResult().set(result);\n }\n context.completeStep();\n }", "public void cache() {\n cache.clear();\n for (String s : getConfig().getKeys(true)) {\n if (getConfig().get(s) instanceof String)\n cache.put(s, getConfig().getString(s));\n }\n }", "public void updateCache(Player player) {\n\t\tif (this.caching.contains(player)) {\n\t\t\tPlayerState state = new PlayerState();\n\t\t\tstate.setLocation(player.getLocation());\n\t\t\tstate.setVelocity(player.getVelocity());\n\t\t\tstate.setArmorContents(player.getEquipment().getArmorContents());\n\t\t\tstate.setInventoryContents(player.getInventory().getContents());\n\t\t\tstate.setSlot(player.getInventory().getHeldItemSlot());\n\t\t\tstate.setGameMode(player.getGameMode());\n\n\t\t\tPlayerContinuousSnap snap = this.cached.get(player);\n\t\t\tsynchronized (snap) {\n\t\t\t\tsnap.getCachedStates().add(state);\n\t\t\t}\n\t\t}\n\t}", "public void cache(){\n\t\t\n\t\t/*\n\t\t * second, check if there is a cache file\n\t\t * if yes, then check date\n\t\t * if no, then create a cache file \n\t\t*/\n\t\tif(cacheExist()){\n\t\t\t//check date and decide which file to update\n\t\t\tSystem.out.println(\" hahahaha, cache already there! \");\n\t\t\t\n\t\t\tFile cache = new File(\"./cache.txt\");\n\t\t\tsource = readFile(\"./cache.txt\",source);\n\t\t\tSystem.out.println(\"the size of source hashmap : \"+ source.size());\n\t\t\t\n\t\t\tfor(int i = 1; i < fileList.length;i++){\n\t\t\t\t//if this file need to be updated, write the data to source array\n\t\t\t\tif(needToUpdate(fileList[i], cache)){\n\t\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\n\t\t\t\t\tSystem.out.println(\"S: \"+ sdf.format(fileList[i].lastModified()) + \" c: \"+ sdf.format(cache.lastModified()));\n\t\t\t\t\tsource = readFile(fileList[i].getPath(), source);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//after checking the whole source file and add the new data to source array\n\t\t\t//then sort the source array and write it to cache\n\t\t\tsort(source);\n\t\t\ttry\n\t\t\t{\n\t\t\t String filename= \"./cache.txt\";\n\t\t\t FileWriter fw = new FileWriter(filename,true); //the true will append the new data\n\t\t\t for(int j = 0; j < writeList.size(); j++){\n\t\t\t\t\tfw.write(writeList.get(j));\n\t\t\t\t}\n\t\t\t fw.close();\n\t\t\t}\n\t\t\tcatch(IOException ioe)\n\t\t\t{\n\t\t\t System.err.println(\"IOException: \" + ioe.getMessage());\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t//there are is no cache, need to create a cache file\n\t\telse{\n\t\t\tSystem.out.println(\" create new cache file !\");\n\t\t\t//create cache file and copy sort the data from source file\n\t\t\t//1. read all the source file and store the data to an arrayList\n\t\t\tfor(int i = 1; i < fileList.length; i++){\n\t\t\t\tsource = readFile(fileList[i].getPath(), source);\t\t\t\n\t\t\t}\n\t\t\tsort(source);\n//\t\t\tSystem.out.println(source);\n\t\t\t\n\t\t\t//2.write the data to the cache file\n\t\t\tPrintWriter writer;\n\t\t\ttry {\n\t\t\t\twriter = new PrintWriter(\"cache.txt\", \"UTF-8\");\t\t\t\n\t\t\t\twriter.println(writeList.size());\n\t\t\t\tfor(int j = 0; j < writeList.size(); j++){\n\t\t\t\t\twriter.println(writeList.get(j));\n\t\t\t\t}\n\t\t\t\twriter.close();\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t \n\t\t\n\t}", "public void syncRabbitNameCache(){\n Map<String,Rabbit> rabbits = new HashMap<>();\n List<Rabbit> rabbitList = rabbitRepository.findAll();\n for (Rabbit rabbit : rabbitList){\n rabbits.put(rabbit.getId(),rabbit);\n }\n nameRepository.updateRabbitIdList(rabbits);\n nameRepository.syncDailyStatistics();\n }", "private <K extends Resource> K addToCache(K res, String uri) {\n\t\tif (res == null)\n\t\t\tnegCache.put(uri, null);\n\t\treturn res;\n\t}", "StoreResponse add(CACHE_ELEMENT e);", "protected void handleCache(final TileInfo tile)\n {\n if (!valid)\n return;\n\n boolean success = false;\n final int size = (int) tile.fetchInfo.cacheFile.length();\n final byte[] data = new byte[size];\n try {\n try (FileInputStream fileStream = new FileInputStream(tile.fetchInfo.cacheFile)) {\n try (BufferedInputStream buf = new BufferedInputStream(fileStream)) {\n final int bytesRead = buf.read(data, 0, data.length);\n if (bytesRead == data.length) {\n success = true;\n }\n }\n }\n } catch (Exception e) {\n Log.w(\"RemoteTileFetcher\", \"Failed to read cache\", e);\n }\n\n if (success) {\n if (!valid)\n return;\n\n final Handler handler = new Handler(getLooper());\n handler.post(() -> {\n allStats.localData = allStats.localData + size;\n recentStats.localData = recentStats.localData + size;\n\n handleFinishLoading(tile,data,null);\n });\n\n if (debugMode) {\n Log.d(\"RemoteTileFetcher\",\"Read from cache: \" + tile.fetchInfo.urlReq);\n }\n } else {\n // Didn't read it, so go get it\n startFetch(tile);\n\n if (debugMode) {\n Log.d(\"RemoteTileFetcher\",\"Failed to reach from cache: \" + tile.fetchInfo.urlReq);\n }\n }\n }", "public boolean inCache(String key);", "boolean isCacheable();", "CloudCache getCache(String cacheName);", "protected Cache cache(RequestContext ctx) {\n String serviceId = serviceId(ctx);\n if (serviceId != null) {\n return cacheManager.getCache(serviceId);\n }\n return null;\n }", "void updateCacheEntry(CacheKey key, Query query, QueryResultPacket resultPacket) {\n long oldTimestamp;\n if (!activeCache) return;\n\n PacketWrapper wrapper = lookup(key, query);\n if (wrapper == null) return;\n\n // The timestamp is owned by the QueryResultPacket, this is why this\n // update method puts entries into the cache differently from elsewhere\n oldTimestamp = wrapper.getTimestamp();\n wrapper = (PacketWrapper) wrapper.clone();\n wrapper.addResultPacket(resultPacket);\n synchronized (packetCache) {\n packetCache.put(key, wrapper, oldTimestamp);\n }\n }", "public void cache(int variableId, int value) {\n localCache.put(variableId, value);\n }", "private static void cacheContent(Collection listeners) {\r\n\r\n Iterator ipList = listeners.iterator();\r\n while (ipList.hasNext()) {\r\n Content c = (Content) ipList.next();\r\n try {\r\n Map types = new Hashtable();\r\n Listener.cachedContent.put(c.getNodeData(\"IP\").getString(), types); //$NON-NLS-1$\r\n Iterator it = c.getContent(\"Access\").getChildren().iterator(); //$NON-NLS-1$\r\n while (it.hasNext()) {\r\n Content type = (Content) it.next();\r\n types.put(type.getNodeData(\"Method\").getString().toLowerCase(), StringUtils.EMPTY); //$NON-NLS-1$\r\n }\r\n }\r\n catch (RepositoryException re) {\r\n log.error(\"RepositoryException caught while loading listener configuration: \" + re.getMessage(), re); //$NON-NLS-1$\r\n }\r\n }\r\n }", "private void invalidateCache() {\n\t}", "public void apply(String cacheKey) {\n }", "@Override\n\tpublic void updateSession(CacheHttpSession httpSession) {\n\t\t\n\t}", "@Test\n public void testFindViaCache() {\n Integer hitRate1 = hitRate;\n Integer foundId = accessPointDimensionDao.foreignKeyValueFor(connection, AccessPointIdentifier.TEST);\n assertEquals(hitRate1, hitRate); // No change expected yet\n \n Integer hitRate2 = hitRate;\n Integer foundId2 = accessPointDimensionDao.foreignKeyValueFor(connection, AccessPointIdentifier.TEST);\n assertEquals(hitRate, new Integer(hitRate2+1)); // A cache hit is expected\n }", "void addRecordToCache(DNSQuestion question, DNSRecord answer){\n cache.put(question, answer);\n System.out.println(\"Answer added to cache!\");\n }", "private void addDecryptRequest(String var){\n\t\trequestCount.put(var, requestCount.get(var)+1);\n\t}", "public boolean checkCache(HttpServletRequest request, HttpServletResponse response, File file) throws IOException\n {\n String requestIfModifiedSince = request.getHeader(IF_MODIFIED_SINCE);\n Date lastModified = new Date(file.lastModified());\n try {\n if(requestIfModifiedSince!=null){\n Date requestDate = getDateFromHttpDate(requestIfModifiedSince);\n if (file != null)\n if (!requestDate.before(lastModified))\n { // Not modified since last time\n response.setHeader(LAST_MODIFIED, request.getHeader(IF_MODIFIED_SINCE));\n response.sendError(HttpServletResponse.SC_NOT_MODIFIED);\n return true; // Success - use your cached copy\n }\n }\n } catch (ParseException e) {\n // Fall through\n }\n // If they want it again, send them my cached copy\n if ((file == null) || (!file.exists()))\n return false; // Error - cache doesn't exist\n response.addHeader(LAST_MODIFIED, getHttpDate(lastModified));\n \n InputStream inStream = new FileInputStream(file);\n OutputStream writer = response.getOutputStream();\n copyStream(inStream, writer);\n inStream.close();\n writer.close();\n return true; // Success - I returned the cached copy\n }", "@InSequence(10)\n @Test\n @OperateOnDeployment(\"dep1\")\n public void wakeUpCacheA() throws IOException {\n getCache();\n }", "public interface ICacheManager {\n\tpublic Boolean init();\n public IBoardAgent getBoard(String stGameId);\n public void loadBoardFromFile(String stGameId, String stBoardName);\n public SortedMap<String, Pair<String, Integer>> getPossiblePlayerInEachBoard();\n}", "int getCacheConcurrency();", "public <T>void postCacheResponse(Request<?> request, T cacheData);", "@Override\n\tpublic int updateCacheData(String paramString1, String paramString2,\n\t\t\tString paramString3)\n\t{\n\t\treturn 0;\n\t}", "public void handleRequest () {\n\t// TODO: move this method to separate thread, \n\t// TODO: it may block in many places.\n\tRequestHandler rh = new RequestHandler ();\t\n\tCache<HttpHeader, HttpHeader> cache = proxy.getCache ();\n\tString method = request.getMethod ();\n\tif (!method.equals (\"GET\") && !method.equals (\"HEAD\"))\n\t cache.remove (request);\n\t\t\n\trh.entry = cache.getEntry (request);\n\tif (rh.entry != null)\n\t rh.dataHook = rh.entry.getDataHook (proxy.getCache ());\n\n\tcheckNoStore (rh.entry);\n\tif (!rh.cond.checkMaxStale (request, rh) && checkMaxAge (rh))\n\t setMayUseCache (false);\n\t\n\trh.conditional = rh.cond.checkConditional (this, request, rh);\n\tif (partialContent (rh)) \n\t fillupContent (rh);\n\tcheckIfRange (rh);\n\n\tboolean mc = getMayCache ();\n\tif (getMayUseCache ()) {\n\t // in cache?\n\t if (rh.entry != null) {\n\t\tCacheChecker cc = new CacheChecker ();\n\t\tif (cc.checkCachedEntry (this, request, rh)) {\n\t\t return;\n\t\t}\n\t }\n\t}\n\t\n\tif (rh.content == null) {\n\t // Ok cache did not have a usable resource, \n\t // so get the resource from the net.\n\t // reset value to one before we thought we could use cache...\n\t mayCache = mc;\n\t SWC swc = new SWC (this, proxy.getOffset (), request, requestBuffer,\n\t\t\t tlh, clientResourceHandler, rh);\n\t swc.establish ();\n\t} else {\n\t resourceEstablished (rh);\n\t}\n }", "void invalidateCache();", "public void cacheResult(wsihash wsihash);", "public static void updatePlayerCaches() {\n\t\tfor (Player player : getOnlinePlayers()) {\n\t\t\tPlayerCache cache = getCache(player);\n\n\t\t\tcache.reloadCache();\n\t\t}\n\t}", "public void cacheResult(suiluppo_equip_allocation suiluppo_equip_allocation);", "public interface RedisCacheService {\n void put(Object key , Object value);\n Object get(Object key);\n}", "protected abstract void initCache(List<RECIPE> recipes);", "protected void handleGets(final CommandMessage command, final Channel channel) {\n final Future<CacheElement[]> futureResponse = cache.get(Collections.<Key>singleton(command.key));\r\n commandQueue.enqueueFutureResponse(new AsyncGetMultiCommand(command, channel, futureResponse));\r\n }", "private void getCache(Context context) throws IOException {\n\t\t // Read file from distributed caches - each line is a item/itemset with its frequent\n\n \t// get caches files.\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tSystem.out.println(\"SETUP ------ MAPPER ----------- GET FREQUENT ITEMS--------------\");\n\t\t\n\t\t\n\t\t// URI to locate cachefile, ex URI a = new URI(\"http://www.foo.com\");\n\t\tList<URI> uris = Arrays.asList(context.getCacheFiles());\n\t\t\n\t\tSystem.out.println(\"Reading cached files\");\n\t\t// read cache files which contains candidates?\n\t\t\n\t\tnItems = 0;\n\t\t\n\t\tfor (URI uri : uris) {\n\t\t\tPath p = new Path(uri);\n\t\t\tSystem.out.println(\"Loading \" + uri.toString());\n\t\t\tFileSystem fs = FileSystem.get(context.getConfiguration());\n\t\t\tInputStreamReader ir = new InputStreamReader(fs.open(p));\n\t\t\tBufferedReader data = new BufferedReader(ir);\n\t \twhile (data.ready()) { \t\t\n\t \t\tString line=data.readLine();\n\t \t\tif (line.matches(\"\\\\s*\")) continue; // be friendly with empty lines\n\t \t\tString[] numberStrings = line.split(\"\\t\");\n\t \t\t\n \n\t \t\tint frequentItem = Integer.parseInt(numberStrings[0]);\n \t\t\tif (!hashItems.containsKey(frequentItem)) {\n\t \t\t\t\thashItems.put(frequentItem, nItems);\n\t \t\t\t\tnItems++;\n\t \t\t\t}\n\t \t\t}\n\t \t\t\n\t \t} \n\n }", "public interface ICache {\n\t\n\t/**\n\t * <p>\n\t * get the Cached Object from cache pool by the cache String key\n\t * @param key\n\t * @return\n\t */\n\tpublic Object get(String key);\n\t\n\t\n\t\n\t/**\n\t * <p>\n\t * \n\t * @param key\n\t * @return old cache object \n\t */\n\tpublic Object put(String key,Object value);\n\t\n\t/**\n\t * <p>\n\t * get the Cached Object from cache pool by the cache String key quietly,\n\t * without update the statistic data\n\t * @param key\n\t * @return\n\t */\n\tpublic Object getQuiet(String key);\n\t\n\t\n\t/**\n\t * <p>\n\t * remove the cached object from cache pool by the cache String key\n\t * @param key\n\t * @return\n\t */\n\tpublic Object remove(String key);\n\t\n\t/**\n\t * <p>\n\t * free specied size mem\n\t * @param size unit in Byte\n\t * @return\n\t */\n\tpublic long free(long size);\n\t\n\t\n\t/**\n\t * <p>\n\t * flush to the underly resource\n\t */\n\tpublic void flush();\n\t\n}", "public interface TaskCache {\n /**\n * Gets an {@link Object} which will emit a {@link TaskEntity}.\n *\n * @param userId The id used to get data.\n */\n List<TaskEntity> get(int userId);\n\n /**\n * Puts and element into the cache.\n *\n * @param userEntity The task data to save.\n */\n void put(TaskEntity userEntity);\n\n /**\n * Checks if an element (User) exists in the cache.\n *\n * @param userId The id used to get data.\n * @return true if the element is cached, otherwise false.\n */\n boolean isCached(int userId);\n\n /**\n * Checks if the cache is expired.\n * @param userId The id used to get data.\n * @return true, the cache is expired, otherwise false.\n */\n boolean isExpired(int userId);\n\n /**\n * Evict all elements of the cache.\n *\n * @param userId The id used to get data.\n */\n void evictAll(int userId);\n\n /**\n * Change task status\n *\n * @param idTask task to update.\n */\n void refresh(int idTask);\n}", "boolean isCachingEnabled();", "AgentPolicyBuilder setBypassCache(boolean bypassCache);", "@Override\n\tpublic void cacheResult(List<AssetManageReqHandle> assetManageReqHandles) {\n\t\tfor (AssetManageReqHandle assetManageReqHandle : assetManageReqHandles) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tAssetManageReqHandleModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tAssetManageReqHandleImpl.class,\n\t\t\t\t\t\tassetManageReqHandle.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(assetManageReqHandle);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tassetManageReqHandle.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "protected void updateCachedRecipe(@Nonnull CachedRecipe<RECIPE> newCache, int cacheIndex) {\n cachedRecipes[cacheIndex] = newCache;\n }", "@Override\n\tpublic boolean isCaching() {\n\t\treturn false;\n\t}", "StoreResponse prepend(CACHE_ELEMENT element);", "public void refreshObjectCache();", "public static void cacheResult(Task task) {\n\t\tgetPersistence().cacheResult(task);\n\t}", "Object getValueFromLocalCache(Object key);", "Object cached(Class<?> api, ComponentContext context);", "protected Cache<Request, Result> getNetspeakCache() {\n return this.netspeakCache;\n }", "void processRequest(RequestInfo<T, O> requestInfo, Class<T> TClass, Class<O> OClass, boolean invalidateCache);", "public interface ApiKeyThrottlingCacheService {\n\t \n\tlong incr(String key, int by, long defaul, int expiration) throws NullPointerException;\n\tboolean isCacheAvailable();\n\tString getCacheHost();\n\tvoid setCacheHost(String cacheHost);\n\tString getCachePort();\n\tvoid setCachePort(String cachePort);\n\t\n}", "public void service(HttpServletRequest req, HttpServletResponse res)\n throws IOException, ServletException {\n ServletOutputStream out = null;\n DeliverableImage aImage = null;\n MailingComponent comp = null;\n \n if(cacheMap == null) { \n cacheMap = (TimeoutLRUMap) WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).getBean(\"imageCache\");\n }\n if(req.getParameter(\"ci\") == null || req.getParameter(\"mi\") == null || req.getParameter(\"name\") == null) {\n return;\n }\n \n if(req.getParameter(\"name\").length() == 0) {\n return;\n }\n \n String cacheKey = req.getParameter(\"ci\") + \"-\" + req.getParameter(\"mi\") + \"-\" + req.getParameter(\"name\");\n aImage = (DeliverableImage) cacheMap.get(cacheKey);\n \n if(aImage == null) {\n try {\n MailingComponentDao mDao = (MailingComponentDao) WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).getBean(\"MailingComponentDao\");\n comp = mDao.getMailingComponentByName(Integer.parseInt(req.getParameter(\"mi\")), Integer.parseInt(req.getParameter(\"ci\")), req.getParameter(\"name\"));\n } catch (Exception e) {\n logger.error(\"Exception: \"+e, e);\n return;\n }\n \n if(comp != null) {\n aImage = new DeliverableImage();\n aImage.mtype = comp.getMimeType();\n aImage.imageData = comp.getBinaryBlock();\n cacheMap.put(cacheKey, aImage);\n if (logger.isDebugEnabled()) logger.debug(\"added to cache: \"+cacheKey);\n } else {\n aImage = new DeliverableImage();\n aImage.mtype = \"text/html\";\n aImage.imageData = \"image not found\".getBytes();\n// cacheMap.put(cacheKey, aImage);\n if (logger.isDebugEnabled()) logger.debug(\"added not found to cache: \"+cacheKey);\n }\n }\n \n if(aImage != null) {\n try {\n res.setContentType(aImage.mtype);\n out = res.getOutputStream();\n out.write(aImage.imageData);\n out.flush();\n out.close();\n } catch (Exception e) {\n logger.error(e.getMessage());\n }\n }\n }", "@Override\r\n\tpublic void doUpdate(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "void updateCacheEntry(CacheKey key, Query query, DocsumPacketKey[] packetKeys, Packet[] packets) {\n if (!activeCache) return;\n\n PacketWrapper wrapper = lookup(key, query);\n if (wrapper== null) return;\n\n wrapper = (PacketWrapper) wrapper.clone();\n wrapper.addDocsums(packetKeys, packets);\n synchronized (packetCache) {\n packetCache.put(key, wrapper, wrapper.getTimestamp());\n }\n }", "public static void commit(Context context) {\n HashMap<String, Object> pending = new HashMap<>();\r\n synchronized(Cacher.class) {\r\n pending.putAll(Cacher.pending);\r\n Cacher.pending.clear();\r\n }\r\n Log.d(TAG, \"Starting commit of \" + pending.size() + \" changes\");\r\n // Prepare root dir\r\n File rootDir = new File(context.getCacheDir(), CACHE_NAME);\r\n if(!rootDir.exists())\r\n rootDir.mkdirs();\r\n // Write all\r\n for(Map.Entry<String, Object> e : pending.entrySet()) {\r\n String name = e.getKey();\r\n Object value = e.getValue();\r\n NamedLock lock = lock(name);\r\n File file = new File(context.getCacheDir(), CACHE_PREFIX + Integer.toHexString(name.hashCode()));\r\n try {\r\n HashMap<String, String> map;\r\n try {\r\n if(!file.exists())\r\n map = new HashMap<>();\r\n else {\r\n String data = readFile(file);\r\n if(data.length() == 0 || ((map = gson.fromJson(data, HashMap.class)) == null))\r\n map = new HashMap<>(); // new cache\r\n }\r\n } catch (Throwable t) {\r\n Log.e(TAG, \"Unable to open cache for writing: \" + file.getPath(), t);\r\n map = new HashMap<>(); // create empty cache\r\n }\r\n if (value == null) {\r\n if(map.remove(name) == null)\r\n return; // nothing was removed, no changes\r\n if (map.size() == 0) {\r\n if(lastCacheSize != -1)\r\n lastCacheSize -= file.length();\r\n file.delete(); // no more data here\r\n }\r\n } else {\r\n if(lastCacheSize != -1)\r\n lastCacheSize -= file.length();\r\n map.put(name, gson.toJson(value));\r\n writeFile(file, gson.toJson(map));\r\n file.setLastModified(System.currentTimeMillis());\r\n if(lastCacheSize != -1)\r\n lastCacheSize += file.length();\r\n }\r\n } catch (Throwable t) {\r\n Log.e(TAG, \"Unable to write cache \" + file.getPath() + \" for \" + name, t);\r\n // ignore\r\n } finally {\r\n lock.unlock();\r\n }\r\n }\r\n // Next cleanup cache\r\n if(lastCacheSize != -1 && lastCacheSize < CACHE_SIZE)\r\n return; // no need to cleanup cache\r\n lastCacheSize = 0; // reset\r\n File[] files = rootDir.listFiles();\r\n long[] timestamps = new long[files.length];\r\n long[] size = new long[files.length];\r\n // Collect all data\r\n for (int c = 0; c < files.length; c++) {\r\n File file = files[c];\r\n if (file.isDirectory()) {\r\n files[c] = null;\r\n timestamps[c] = Long.MAX_VALUE;\r\n size[c] = 0;\r\n } else {\r\n timestamps[c] = file.lastModified();\r\n size[c] = file.length();\r\n }\r\n lastCacheSize += size[c];\r\n }\r\n // Keep trimming as needed\r\n while (lastCacheSize > CACHE_SIZE) {\r\n // Select oldest file\r\n int oldest = -1;\r\n long oldestTimestamp = Long.MAX_VALUE;\r\n for (int c = 0; c < files.length; c++) {\r\n if (timestamps[c] < oldestTimestamp) {\r\n oldest = c;\r\n oldestTimestamp = timestamps[c];\r\n }\r\n }\r\n // Delete this file\r\n lastCacheSize -= size[oldest];\r\n files[oldest].delete();\r\n timestamps[oldest] = Long.MAX_VALUE;\r\n }\r\n Log.d(TAG, \"Trimmed cache to \" + lastCacheSize + \" bytes\");\r\n // Done\r\n }", "@PostConstruct\n public void initCache() {\n cache = Collections.synchronizedMap(new HashMap<>(cacheCapacity, 1));\n }", "public void cacheResult(java.util.List<DataEntry> dataEntries);", "StoreResponse append(CACHE_ELEMENT element);", "public void put(String param1, Cache.Entry param2) {\n }", "public Cache.Entry get(String param1) {\n }" ]
[ "0.61043066", "0.6091498", "0.5932054", "0.57309663", "0.560443", "0.55136204", "0.5432911", "0.5432196", "0.54285544", "0.5426217", "0.53904855", "0.53726494", "0.5366742", "0.5363425", "0.53617716", "0.5359364", "0.5341002", "0.53263235", "0.5294718", "0.52860886", "0.52843124", "0.5269266", "0.5240068", "0.52170175", "0.52143997", "0.52038854", "0.52020967", "0.5181373", "0.5179719", "0.5172952", "0.5168308", "0.5150681", "0.51474506", "0.514716", "0.5139252", "0.51365477", "0.5136214", "0.51291233", "0.51202524", "0.5094883", "0.5085765", "0.50774515", "0.5068579", "0.5020794", "0.501322", "0.5012301", "0.5006357", "0.49856618", "0.49775597", "0.49745625", "0.4970929", "0.4968621", "0.4963006", "0.49605727", "0.49547932", "0.49532682", "0.49454597", "0.4936183", "0.4931283", "0.49166393", "0.49064785", "0.4901637", "0.49010774", "0.48868197", "0.48750377", "0.48723012", "0.4872187", "0.48716646", "0.48563886", "0.48516706", "0.48508477", "0.4848749", "0.48474416", "0.48407188", "0.48402336", "0.48358393", "0.48322284", "0.48319688", "0.48308462", "0.48174807", "0.4817075", "0.4812817", "0.48054174", "0.48041597", "0.48033294", "0.48012835", "0.47957915", "0.4794573", "0.4785966", "0.47855422", "0.47839224", "0.4778763", "0.4777828", "0.47729102", "0.47686693", "0.4765666", "0.47647953", "0.47585678", "0.4756999", "0.47546402", "0.47501463" ]
0.0
-1
Save API token to vault
private void saveTokensToVault(UpdateClusterRequest callbackRequest) { VaultRequest vaultRequest = new VaultRequest(); vaultRequest.setClusterReqId(callbackRequest.getClusterID()); vaultRequest.setApiServerToken(callbackRequest.getCreateClusterDetails().getK8sAdminToken()); vaultRequest.setDashboardToken(callbackRequest.getCreateClusterDetails().getDashboardToken()); vaultService.saveCredential(vaultRequest, VaultEntityTypes.API_TOKEN.getKeyValue()); vaultService.saveCredential(vaultRequest, VaultEntityTypes.DASHBOARD_TOKEN.getKeyValue()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void storeToken(AuthorizationToken token);", "public static void storeToken(AccessToken token, Context cont)\n\t{\n\t\tSharedPreferences.Editor editor = cont.getSharedPreferences(\"StatPump\", 0).edit();\n\t\teditor.putString(\"Token\", token.getToken());\n\t\teditor.putString(\"Token Secret\", token.getTokenSecret());\n\t\teditor.commit();\n\t}", "private void saveToken(Context context, String text) {\n android.content.SharedPreferences settings;\n android.content.SharedPreferences.Editor editor;\n \n settings = context.getSharedPreferences(\"PREFS_NAME\", Context.MODE_PRIVATE);\n editor = settings.edit();\n editor.putString(\"TOKEN\", text);\n editor.apply();\n }", "public void saveToken(String token, long passTime) {\n }", "protected void saveToken(HttpServletRequest request) {\r\n Logger l = LogUtils.enterLog(getClass(), \"saveToken\", request);\r\n\r\n saveToken(request, getTokenConstant());\r\n\r\n l.exiting(getClass().getName(), \"saveToken\");\r\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public void putToken(Token token)throws Exception;", "public void GuardarToken(String token){\n SharedPreferences.Editor edits = prefs.edit();\n edits.putString(MYConstantsPreferences.MAQUIPURAY_TOKEN, token);\n edits.apply();\n }", "public String saveAuthToken() { // basically for signin\n return authTokenAssist.saveMemberToken(getSavedUserBean().get().getMemberAccount());\n }", "ApiTokenProperty(String seed) {\n apiToken = Secret.fromString(seed);\n }", "void touchSecret(Long secretId);", "public void sendTokenToRemote() { }", "public void setToken(){\n token=null;\n try {\n OkHttpClient client = new OkHttpClient();\n RequestBody reqbody = RequestBody.create(null, new byte[0]); \n Request request = new Request.Builder()\n .url(\"https://api.mercadolibre.com/oauth/token?grant_type=client_credentials&client_id=\"+clienteID +\"&client_secret=\"+secretKey)\n .post(reqbody)\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"cache-control\", \"no-cache\")\n .addHeader(\"postman-token\", \"67053bf3-5397-e19a-89ad-dfb1903d50c4\")\n .build();\n \n Response response = client.newCall(request).execute();\n String respuesta=response.body().string();\n token=respuesta.substring(respuesta.indexOf(\"APP\"),respuesta.indexOf(\",\")-1);\n System.out.println(token);\n } catch (IOException ex) {\n Logger.getLogger(MercadoLibreAPI.class.getName()).log(Level.SEVERE, null, ex);\n token=null;\n }\n }", "public boolean save(Context context, AccessToken accessToken) \n {\n\n Editor editor = context.getSharedPreferences(KEY, Context.MODE_PRIVATE).edit();\n\n this.token = accessToken.getToken();\n this.tokensecret = accessToken.getTokenSecret();\n editor.putString(TOKEN, token);\n editor.putString(TOKENSECRET, tokensecret);\n \n\n if (editor.commit()) \n {\n singleton = this;\n return true;\n }\n return false;\n }", "public void upload(String token) {\n\t\tString json = this.toJson();\n\t\t\n\t\tHttpURLConnection conn;\n\t\ttry {\n\t\t\tconn = (HttpURLConnection ) new URL(UPLOAD_URL).openConnection();\n\t\t\tOutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());\n\t\t\twriter.write(json);\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\tfinally{\n\t\t\t\n\t\t}\n\t\t\t\n\t}", "private void requestToken(){\n APIAuth auth = new APIAuth(this.prefs.getString(\"email\", \"\"), this.prefs.getString(\"password\", \"\"), this.prefs.getString(\"fname\", \"\") + \" \" +this.prefs.getString(\"lname\", \"\"), this.prefs, null);\n auth.authenticate();\n }", "private String saveToken(Player player) {\n String token = RandomString.make(10);\n player.setToken(token);\n playerRepository.save(player);\n return token;\n }", "public String getVault() {\n return vault;\n }", "@Test\n public void useTwiceTheSameToken() throws IOException {\n tokenConsumption();\n // then set the password for the user (and so valid the token)\n String userTokenPath = getPath(\"/api/users/token/{token}\");\n UserPasswordDTO dto = new UserPasswordDTO();\n dto.setPassword(\"test\");\n JsonNode json = objectMapper.valueToTree(dto);\n\n HttpEntity<JsonNode> requestEntity = new HttpEntity<>(json);\n ResponseEntity<String> userResponseEntity =\n rest.exchange(userTokenPath, HttpMethod.PATCH, requestEntity, String.class, token.getToken());\n assertEquals(userResponseEntity.getStatusCode(), HttpStatus.OK);\n // second time KO\n ResponseEntity<String> responseEntity = rest.getForEntity(apiPath, String.class, token.getToken());\n\n assertEquals(HttpStatus.GONE, responseEntity.getStatusCode());\n\n ErrorResponse errorResponse = objectMapper.readValue(responseEntity.getBody(), ErrorResponse.class);\n assertEquals(HttpStatus.GONE.value(), errorResponse.getStatus());\n }", "@Override\n\tprotected void saveTokenExtra(String pToken) {\n\t}", "private void saveToken() throws IOException {\n\t\t\n\t\tFileWriter termIdx = new FileWriter(StoragePath+Path.termIdxDir);\n\t\t\n\t\tfor(Entry<String, Integer> term: termDic.entrySet()){\n\t\t\ttermIdx.append(term.getKey() + \"\\n\" + term.getValue() + \"\\n\");\n\t\t}\n\t\t\n\t\ttermIdx.close();\n\t\t\n\t}", "private void enviarTokenRegistro(String token){\n Log.d(TAG, token);\n }", "public static void writeAccessToken(Oauth2AccessToken token) {\n if (null == token) {\n return;\n }\n\n SharedPrefWrapper sharedPref = SharedPrefWrapper.getInstance();\n sharedPref.setWeiboUID(token.getUid());\n sharedPref.setWeiboAccessToken(token.getToken());\n sharedPref.setWeiboExpiresTime(token.getExpiresTime());\n }", "@Override\n public void injectToken(User user, HttpServletResponse res) {\n refreshTokenRepository.findByUserUsername(user.getUsername()).ifPresentOrElse(token -> {\n res.addCookie(createCookie(token.getId()));\n }, () -> {\n final Refresh entityToSave = Refresh.builder()\n .user(user)\n .id(UUID.randomUUID()).build();\n final Refresh savedEntity = refreshTokenRepository.save(entityToSave);\n res.addCookie(createCookie(savedEntity.getId()));\n });\n }", "public void reenviarToken() {\r\n\t\ttry {\r\n\t\t\tmngRes.generarEnviarToken(getEstudiante());\r\n\t\t\tMensaje.crearMensajeINFO(\"Token reenviado correctamente.\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tMensaje.crearMensajeERROR(\"Error al reenviar token: \" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tAccountManager.get(MainActivity.this)\n\t\t\t\t\t\t.setAuthToken(\n\t\t\t\t\t\t\t\tauthAccountManager.getActiveAccount(getString(R.string.auth_account_type), false),\n\t\t\t\t\t\t\t\tgetString(R.string.auth_token_type),\n\t\t\t\t\t\t\t\t\"some-invalid-token\"\n\t\t\t\t\t\t);\n\t\t\t}", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "String createToken(User user);", "public void updateToken(String token){\n //todo something\n if (sharedPreferencesUtils != null){\n sharedPreferencesUtils.writeStringPreference(Contains.PREF_DEVICE_TOKEN, token);\n }else {\n sharedPreferencesUtils = new SharedPreferencesUtils(this);\n sharedPreferencesUtils.writeStringPreference(Contains.PREF_DEVICE_TOKEN, token);\n }\n }", "public static void storeFacebookToken(String token, Context cont)\n\t{\n\t\tSharedPreferences.Editor editor = cont.getSharedPreferences(\"StatPump\", 0).edit();\n\t\teditor.putString(\"Facebook Token\", token);\n\t\teditor.commit();\n\t}", "public boolean saveRequest(Context context, RequestToken requestToken, Twitter t) \n {\n\n \ttwitter = t;\n Editor editor = context.getSharedPreferences(KEY, Context.MODE_PRIVATE).edit();\n\n rtoken = requestToken.getToken();\n rtokensecret =requestToken.getTokenSecret();\n editor.putString(R_TOKEN,rtoken);\n editor.putString(R_TOKENSECRET, rtokensecret);\n\n if (editor.commit()) \n {\n singleton = this;\n return true;\n }\n return false;\n }", "private String getVaultToken(MagnoliaConfigurationProperties magnoliaConfigurationProperties) {\n return magnoliaConfigurationProperties.getProperty(PROPERTY_VAULT_TOKEN);\n }", "@Override\n\t\tprotected Integer doInBackground(Void... arg0) {\n\t\t\ttry {\n\t\t\t\treturn HttpHelperUtils.SaveToken(loginName);\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\treturn null;\n\t\t}", "void putToken(String name, String value);", "@Transactional\n\tprivate void saveOrUpdateAccessToken() {\n\t\tString tfw = null;\n\t\ttry {\n\t\t\ttfw = this.getAccessTokenFromWechatServer();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (tokenConstant == null) {\n\t\t\ttokenConstant = new AccessToken();\n//\t\t\tconstant.setKey(Consts.access_token_key_in_db);\n//\t\t\tconstant.setValue(tfw);\n//\t\t\ttokenConstant.setUpdateTime(new Date());\n//\n//\t\t\tthis.tokenConstant = constant;\n//\t\t\tthis.constantMapper.insert(constant);\n\t\t\tlog.info(\"第一次获取accessToken\");\n\t\t}\n//\t\telse {\n//\t\t\tconstant.setValue(tfw);\n//\t\t\tconstant.setUpdateTime(new Date());\n//\n//\t\t\tthis.tokenConstant = constant;\n//\t\t\tthis.constantMapper.updateAccessToken(constant);\n//\t\t\tlog.info(\"accessToken已经更新\");\n//\t\t}\n\t\tWechatConsts.param_access_token=tfw;\n\t\t\n\t\ttokenConstant.setAccess_token(tfw);\n\t\ttokenConstant.setUpdateTime(new Date());\n\t}", "public void addVote(String token);", "public TokenInfo createToken(TokenCoreInfo coreInfo, String password);", "public User saveNewToken(User user, BrewFindToken tok) {\n\t\t\n\t\tuser.setU_curToken(tok);\n\t\treturn userRepository.save(user);\n\t\n\t}", "public boolean saveDeviceToken(String token) {\n SharedPreferences sharedPreferences = (_context).getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);\n Editor editor = sharedPreferences.edit();\n editor.putString(TAG_TOKEN, token);\n editor.apply();\n return true;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWTOrBuilder getTokenOrBuilder();", "public String getApiToken() {\n return apiToken;\n }", "public static void saveRequestInformation(MyAccount.Builder mab, String token,\r\n String secret) {\n mab.setDataString(ConnectionOAuth.REQUEST_TOKEN, token);\r\n MyLog.d(TAG, TextUtils.isEmpty(token) ? \"Clearing Request Token\" : \"Saving Request Token: \" + token);\r\n mab.setDataString(ConnectionOAuth.REQUEST_SECRET, token);\r\n MyLog.d(TAG, TextUtils.isEmpty(token) ? \"Clearing Request Secret\" : \"Saving Request Secret: \" + secret);\r\n }", "public void saveJSON(String fileName, Object o){\n // System.err.println(\"accessing disk\");\n Gson gson = new Gson();\n try(FileWriter writer = new FileWriter(fileName)){\n gson.toJson(o, writer);\n //System.err.println(\"\\n Token stored\");\n }catch (IOException e) {\n e.printStackTrace();\n }\n }", "OAuth2Token getToken();", "@Override\r\n\t\t\t\t\tpublic void onComplete(Bundle bundle) {\n\t\t\t\t\t\tOauth2AccessToken newToken = Oauth2AccessToken\r\n\t\t\t\t\t\t\t\t.parseAccessToken(bundle);\r\n\t\t\t\t\t\tAccessTokenKeeper.writeAccessToken(context, newToken);\r\n\t\t\t\t\t\tToast.makeText(\r\n\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\"onAuthorizeComplete token = \"\r\n\t\t\t\t\t\t\t\t\t\t+ newToken.getToken(), 0).show();\r\n\t\t\t\t\t}", "@POST\n @Path(\"/salesforce/auth\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Response postAuth() {\n\n JSONObject jsonObject = new JSONObject();\n\n jsonObject.put(\"access_token\", \"abcdefghijklmnopqrstuvwxyz\");\n\n return Response.status(202).entity(jsonObject).build();\n }", "public static void setAccessToken(String token, Context context){\n\t\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);\n\t\t\tSharedPreferences.Editor prefEditor = prefs.edit();\n\t\t\tprefEditor.putString(TWITTER_ACCESS_TOKEN, token);\n\t\t\tprefEditor.commit();\n\t\t\t\n\t\t}", "public void savePushToken(String paramString) {\n }", "private void sendToAPI(final View v, JSONObject jsonLogin){\n APIClient apiClient = new APIClient();\n Service apiService = apiClient.getClient().create(Service.class);\n Call<User> call = apiService.login(new Login(\"efef\",\"dfwd\"));\n call.enqueue(new Callback<User>() {\n @Override\n public void onResponse(Call<User> call, Response<User> response) {\n if (response.isSuccessful()) {\n new CustomToast().displyToast(getContext(), v, \"Error:\"+response.code()+\" \"+response.body().getMessage()+\n \"Token is: \"+response.body().getAccessToken());\n }\n else{\n new CustomToast().displyToast(getContext(), v, \"Error: \"+response.code()+\" \"+\n response.headers()+ \"...Incorrect username or password!\");\n }\n }\n\n @Override\n public void onFailure(Call<User> call, Throwable t) {\n new CustomToast().displyToast(getContext(), v, \"Server unreachable, Please retry again later\");\n }\n });\n\n }", "public static void saveVoterId(Context context, String type) {\n SharedPreferences sharedPreferences = PreferenceManager\n .getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(GMSConstants.KEY_VOTER_ID, type);\n editor.apply();\n }", "public static String getTeacherToken() {\n\n RestAssured.baseURI = \"https://cybertek-reservation-api-qa.herokuapp.com\";\n\n Response response = given().log().all().\n param(\"email\", \"[email protected]\").\n param(\"password\", \"maxpayne\").\n get(\"/sign\");\n response.then().log().all().\n assertThat().statusCode(200);\n\n return response.jsonPath().get(\"accessToken\");\n\n }", "protected void updateTokens(){}", "public String getVaultPassword() {\n return vaultPassword;\n }", "public void generateToken(String uri) {\n this.token = \"sandbox\";\n }", "void expireComponentAccessToken();", "private void m2192d(String str) {\n this.f980b.m1158c().getSharedPreferences(\"com.facebook.login.AuthorizationClient.WebViewAuthHandler.TOKEN_STORE_KEY\", 0).edit().putString(\"TOKEN\", str).apply();\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(requestCode==request_Code){\n AuthenticationResponse response = AuthenticationClient.getResponse(resultCode,data);\n if(response.getType()==AuthenticationResponse.Type.TOKEN){\n accessToken = response.getAccessToken();\n }else{\n }\n }\n new SpotifyNewRelease(accessToken).execute();\n }", "@Override\r\n public void setTokens(OAuthTokens tokens)\r\n {\r\n tokenStore.saveTokens(tokens);\r\n }", "User setTokenForUser(String username, String token) throws DatabaseException;", "public void store() {\n session=(HttpSession)getPageContext().getSession();\n session.setAttribute(\"remoteUser\", getRemoteUser());\n session.setAttribute(\"authCode\", getAuthCode());\n }", "public java.lang.String getOauth_token(){\r\n return localOauth_token;\r\n }", "@Override\n public Object getCredentials() {\n return token;\n }", "public interface Vault {\n\n /**\n * Close the vault. A closed vault cannot be reopened.\n *\n * @throws VaultException if there was a problem closing the vault\n */\n void close();\n\n /**\n * Stores content in the vault. Creating the vault entry requires an external reference {@code Certificate} with\n * metadata describing the content, and the content to store.\n * <p>\n * The integrity of the data will be verified against the signature from the external reference {@code Certificate}.\n * If the integrity is not validated, writing will fail with IO exception.\n * <p>\n * A vault receipt {@code Certificate} will be returned, and should then be stored on the blockchain to strongly\n * anchor the external content. The vault receipt wraps the given external reference {@code Certificate}, and is\n * signed by a vault entity.\n * @param externalReference a non-null external reference certificate, with fields describing the given content\n * @param content the byte array with the data to store in the vault\n * @return a vault receipt certificate\n * @throws IOException if an I/O error occurs writing to or creating the vault entry\n * @throws IllegalArgumentException is the external reference certificate is invalid or does not verify the content\n * @throws VaultException is operation cannot be performed\n * @see VaultUtils\n */\n default Certificate store(Certificate externalReference, byte[] content) throws IOException {\n return store(externalReference, new ByteArrayInputStream(content));\n }\n\n\n /**\n * Stores content in the vault. Creating the vault entry requires an external reference {@code Certificate} with\n * metadata describing the content, and the content to store.\n * <p>\n * The integrity of the data will be verified against the signature from the external reference {@code Certificate}.\n * If the integrity is not validated, writing will fail with IO exception.\n * <p>\n * A vault receipt {@code Certificate} will be returned, and should then be stored on the blockchain to strongly\n * anchor the external content. The vault receipt wraps the given external reference {@code Certificate}, and is\n * signed by a vault entity.\n * @param externalReference a non-null external reference certificate, with fields describing the given content\n * @param content the input stream to read from for the data to store in the vault\n * @return a vault receipt certificate\n * @throws IOException if an I/O error occurs writing to or creating the vault entry\n * @throws IllegalArgumentException is the external reference certificate is invalid or does not verify the content\n * @throws VaultException is operation cannot be performed\n * @see VaultUtils\n */\n Certificate store(Certificate externalReference, InputStream content) throws IOException;\n\n /**\n * Get content from the vault for the given external reference {@code Certificate}. Returns an\n * {@code ExternalReference} object to allow for lazy retrieval of the content.\n * @param externalReference a non-null external reference certificate, with fields describing the given content\n * @return an external reference\n * @throws IllegalArgumentException is the given certificate is invalid\n * @throws VaultException is operation cannot be performed\n */\n ExternalReference get(Certificate externalReference);\n\n /**\n * Delete an entry from the vault if it exists.\n * @return if true deleted, false if it didn't exist\n * @param externalReference an external reference certificate describing the resource to delete\n * @throws IOException if an I/O error occurs deleting the vault entry\n * @throws VaultException is operation cannot be performed\n */\n boolean delete(Certificate externalReference) throws IOException;\n}", "DBOOtpSecret storeSecret(Long userId, String secret);", "@Override\n public void success(Object object, Response response) {\n mStorage.save(mSystemUser);\n mServiceGen.release();\n }", "private void createServerSideToken(TokenRequestBody tokenRequestBody, final Paystack.TokenCallback tokenCallback) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException {\n ApiService apiService = new ApiClient().getApiService();\n\n HashMap<String, String> params = new HashMap<>();\n params.put(TokenRequestBody.FIELD_PUBLIC_KEY, tokenRequestBody.publicKey);\n params.put(TokenRequestBody.FIELD_CLIENT_DATA, tokenRequestBody.clientData);\n\n Call<TokenApiResponse> call = apiService.createToken(params);\n call.enqueue(new Callback<TokenApiResponse>() {\n /**\n * Invoked for a received HTTP response.\n * <p/>\n\n * @param call - the call enqueueing this callback\n * @param response - response from the server after call is made\n */\n @Override\n public void onResponse(Call<TokenApiResponse> call, Response<TokenApiResponse> response) {\n TokenApiResponse tokenApiResponse = response.body();\n if (tokenApiResponse != null) {\n //check for status...if 0 return an error with the message\n if (tokenApiResponse.status.equals(\"0\")) {\n //throw an error\n tokenCallback.onError(new TokenException(tokenApiResponse.message));\n } else {\n Token token = new Token();\n token.token = tokenApiResponse.token;\n token.last4 = tokenApiResponse.last4;\n\n tokenCallback.onCreate(token);\n }\n }\n }\n\n /**\n * Invoked when a network exception occurred talking to the server or when an unexpected\n * exception occurred creating the request or processing the response.\n *\n * @param call - call that enqueued this callback\n * @param t - the error or exception that caused the failure\n */\n @Override\n public void onFailure(Call<TokenApiResponse> call, Throwable t) {\n Log.e(LOG_TAG, t.getMessage());\n tokenCallback.onError(t);\n\n }\n\n });\n }", "@RequestMapping(value = \"/gw/oauth/token/{version}/get\", method = RequestMethod.POST, produces = \"application/json;charset=utf-8\")\n public Object entry_token(HttpServletRequest request)\n throws URISyntaxException, OAuthSystemException, OAuthProblemException {\n return this.password(request);\n }", "public static boolean checkSavedToken(Context context) {\n SharedPreferences preferences = context.getSharedPreferences(token_storage, 0);\n String storage_token = preferences.getString(\"token\", \"notoken\");\n\n if (!storage_token.equals(\"notoken\")) {\n Log.d(\"Service\", \"Using stored token\");\n header_token = \"Bearer \" + storage_token;\n isTokenPresent = true;\n bindToken();\n return true;\n }\n return false;\n }", "@Test\n public void createTeam2(){\n\n //GETTING AUTHORIZED BY PROVIDING WHO I AM\n //PROVIDE WHO I AM, THEN GET THE AUTHORIZATION/THE POWER TO ACCESS/TOKEN\n RestAssured.baseURI = \"https://cybertek-reservation-api-qa.herokuapp.com\";\n\n Response response = given().log().all().\n param(\"email\", \"[email protected]\").\n param(\"password\", \"maxpayne\").\n get(\"/sign\");\n response.then().log().all().\n assertThat().statusCode(200);\n\n\n String token =response.jsonPath().get(\"accessToken\");\n\n // RestAssured.baseURI=\"https://cybertek-reservation-api-qa.herokuapp.com\";\n RequestSpecification request = RestAssured.given();\n\n JSONObject requestParams = new JSONObject();\n requestParams.put(\"campus-location\", \"VA\");\n requestParams.put(\"batch-number\", \"11\");\n requestParams.put(\"team-name\", \"simpleuser001\");\n\n request.\n header(\"Content-Type\", \"application/json\").\n header(\"Authorization\", token).\n body(requestParams.toJSONString()).\n post(\"/api/teams/team\").then().log().all().statusCode(201);\n\n }", "@Override\n public void handleTokenExpiration(){\n JWTToken.removeTokenSharedPref(this);\n }", "public void postAuthToken(AuthToken t) throws DBException\n {\n String sqlString = \"INSERT INTO authToken (token, username) \" +\n \"VALUES(?,?)\";\n\n try(PreparedStatement sqlStatement = conn.prepareStatement(sqlString))\n {\n sqlStatement.setString(1, t.getToken());\n sqlStatement.setString(2, t.getUserName());\n\n sqlStatement.executeUpdate();\n }\n catch(SQLException ex)\n {\n throw new DBException(\"Error inserting authToken\");\n }\n }", "String getSecret();", "private void storeKeys(String key, String secret) {\n\t // Save the access key for later\n\t SharedPreferences prefs = getSharedPreferences(ACCOUNT_PREFS_NAME, 0);\n\t Editor edit = prefs.edit();\n\t edit.putString(ACCESS_KEY_NAME, key);\n\t edit.putString(ACCESS_SECRET_NAME, secret);\n\t edit.commit();\n\t }", "void savePreference(SignUpResponse response);", "@POST(\"add_payout_preference\")\n Call<ResponseBody> uploadStripe(@Body RequestBody RequestBody, @Query(\"token\") String token);", "public void setToken(java.lang.String param){\r\n \r\n if (param != null){\r\n //update the setting tracker\r\n localTokenTracker = true;\r\n } else {\r\n localTokenTracker = false;\r\n \r\n }\r\n \r\n this.localToken=param;\r\n \r\n\r\n }", "public boolean setAccessToken(JSONObject response){\n boolean ret=false;\n Log.d(TAG, \"setAccessToken: \"+response);\n SharedPreferences.Editor editor=context.getSharedPreferences(Const.LINKAI_SHAREDPREFERENCE_FILE,Context.MODE_PRIVATE).edit();\n try {\n editor.putString(\"access_token\",response.getString(\"access_token\"));\n editor.putString(\"token_type\",response.getString(\"token_type\"));\n editor.putLong(\"expires_in\",Long.valueOf(response.getString(\"expires_in\")));\n// editor.putLong(\"expires_in\",10000);\n editor.putLong(\"token_timestamp\",new Date().getTime());\n editor.commit();\n ret=true;\n }catch (Exception e){\n e.printStackTrace();\n }\n return ret;\n }", "public void setOauth_token(java.lang.String param){\r\n \r\n if (param != null){\r\n //update the setting tracker\r\n localOauth_tokenTracker = true;\r\n } else {\r\n localOauth_tokenTracker = false;\r\n \r\n }\r\n \r\n this.localOauth_token=param;\r\n \r\n\r\n }", "@Override\n public String refresh() {\n\n // Override the existing token\n setToken(null);\n\n // Get the identityId and token by making a call to your backend\n // (Call to your backend)\n\n // Call the update method with updated identityId and token to make sure\n // these are ready to be used from Credentials Provider.\n\n update(identityId, token);\n return token;\n\n }", "private String getApiToken(final Account account) {\r\n return account.getStringProperty(PROPERTY_ACCOUNT_api_token);\r\n }", "private void storeLoggedInUser(LoginResponse response){\n preferenceManager = SharedPreferenceManager.getInstance(this);\n preferenceManager.StoreAccountDetails(response.getAccount());\n\n if(response.getCamera() != null){\n preferenceManager.StoreDeviceDetails(response.getCamera());\n }\n registerDeviceToken();\n }", "public interface ILoginStoreRepository {\n void saveToken(@NonNull String token);\n}", "@Override\n public Response intercept(Chain chain) throws IOException {\n Request authorisedRequest = chain.request().newBuilder()\n .header(\"Authorization:\", \"Token \" + sharedPrefsWrapper.getString(KEY))\n .build();\n\n\n return chain.proceed(authorisedRequest);\n }", "public static void saveRequestInformation(SharedPreferences settings, String token, String secret)\n\t{\n\t\tSharedPreferences.Editor editor = settings.edit();\n\t\tif (token == null)\n\t\t{\n\t\t\teditor.remove(REQUEST_TOKEN);\n\t\t\tLog.d(TAG, \"Clearing Request Token\");\n\t\t} \n\t\telse\n\t\t{\n\t\t\teditor.putString(REQUEST_TOKEN, token);\n\t\t\tLog.d(TAG, \"Saving Request Token: \" + token);\n\t\t}\n\t\tif (secret == null)\n\t\t{\n\t\t\teditor.remove(REQUEST_SECRET);\n\t\t\tLog.d(TAG, \"Clearing Request Secret\");\n\t\t} \n\t\telse\n\t\t{\n\t\t\teditor.putString(REQUEST_SECRET, secret);\n\t\t\tLog.d(TAG, \"Saving Request Secret: \" + secret);\n\t\t}\n\t\teditor.commit();\n\t}", "public void storeKeys(String key, String secret) {\n // Save the access key for later\n SharedPreferences prefs = getSharedPreferences(ACCOUNT_PREFS_NAME, 0);\n Editor edit = prefs.edit();\n edit.putString(ACCESS_KEY_NAME, key);\n edit.putString(ACCESS_SECRET_NAME, secret);\n edit.commit();\n }", "private void storeKeys(String key, String secret) {\n\t\t// Save the access key for later\n\t\tSharedPreferences prefs = EReaderApplication.getAppContext()\n\t\t\t\t.getSharedPreferences(ACCOUNT_PREFS_NAME, 0);\n\t\tEditor edit = prefs.edit();\n\t\tedit.putString(ACCESS_KEY_NAME, key);\n\t\tedit.putString(ACCESS_SECRET_NAME, secret);\n\t\tedit.commit();\n\t}", "private byte[] getTokenKey() throws InternalSkiException {\n return sysKey(TOKEN_KEY);\n }", "void setAccessToken(String accessToken);", "@Headers({\"Accept: application/json\"})\n @POST(Service.PATH_ADD_ONESIGNAL_TOKEN)\n Call<NormalResponseObject> postAddOneSignalToken(\n @Body ApiOneSignalRequest params\n );", "public void setToken(Parcelable token) {\n\n this.mToken = token;\n\n }", "void save(Account account);", "public boolean storeToken(String token, long createdIn) {\n try {\n return tkDao.storeToken(token, createdIn);\n } catch (SQLException ex) {\n throw new RuntimeException(\"an error occurred trying to store a token in database: \" + ex.getMessage());\n }\n }", "@Override\n public void saveSymbol(SecuritySymbols symbol) {\n\n }", "static public void addToken(HttpServletResponse res, Authentication auth) {\n\t\tUser currentUser = (User)auth.getPrincipal();\n\t\tString currentUserId = currentUser.getId().toString();\n\t\t\n\t\tString JwtToken = Jwts.builder().setSubject(currentUserId)\n\t\t\t\t.setExpiration(new Date(System.currentTimeMillis()\n\t\t\t\t\t\t+ EXPIRATIONTIME))\n\t\t\t\t.signWith(SignatureAlgorithm.HS512, SIGNINGKEY)\n\t\t\t\t.compact();\n\t\t\n\t\tres.addHeader(\"Authorization\", PREFIX + \" \" + JwtToken);\n\t\tres.addHeader(\"Access-Control-Expose-Headers\", \"Authorization\");\n\t}", "public StringBuilder createToken() throws IOException {\n /**\n * we need the url where we want to make an API call\n */\n URL url = new URL(\"https://api.scribital.com/v1/access/login\");\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n\n /**\n * set the required type, in this case it's a POST request\n */\n connection.setRequestMethod(\"POST\");\n\n /**\n * set the type of content, here we use a JSON type\n */\n connection.setRequestProperty(\"Content-Type\", \"application/json; utf-8\");\n connection.setDoOutput(true);\n\n /**\n * set the Timeout, will disconnect if the connection did not work, avoid infinite waiting\n */\n connection.setConnectTimeout(6000);\n connection.setReadTimeout(6000);\n\n /**\n * create the request body\n * here we need only the username and the api-key to make a POST request and to receive a valid token for the Skribble API\n */\n String jsonInputString = \"{\\\"username\\\": \\\"\" + username +\"\\\", \\\"api-key\\\":\\\"\" + api_key + \"\\\"}\";\n try(OutputStream os = connection.getOutputStream()){\n byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);\n os.write(input,0, input.length);\n }\n\n /**\n * read the response from the Skriblle API which is a token in this case\n */\n try(BufferedReader br = new BufferedReader(\n new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {\n StringBuilder response = new StringBuilder();\n String responseLine = null;\n while ((responseLine = br.readLine()) != null) {\n response.append(responseLine.trim());\n Token = response;\n }\n }\n return Token;\n }", "@Override\n protected String doInBackground(Void... voids) {\n RequestHandler requestHandler = new RequestHandler(AppController.getAppContext());\n\n\n\n try {\n JSONObject response = requestHandler.sendPostRequest(URLs.URL_UPDATE_TOKEN_DAILY, null, Request.Method.POST);\n return response.toString();\n\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n return null;\n }", "public void save(){\n DatabaseReference dbRef = DatabaseHelper.getDb().getReference().child(DatabaseVars.VouchersTable.VOUCHER_TABLE).child(getVoucherID());\n\n dbRef.setValue(this);\n }", "private synchronized void zzlx() {\n try {\n JSONObject jSONObject = new JSONObject();\n jSONObject.put(\"castSessionId\", this.zzTp);\n jSONObject.put(\"playerTokenMap\", new JSONObject(this.zzTn));\n this.zztB.edit().putString(\"save_data\", jSONObject.toString()).commit();\n } catch (JSONException e) {\n zzQW.zzf(\"Error while saving data: %s\", e.getMessage());\n }\n return;\n }", "java.lang.String getSecret();", "public void Save(){\n\t SharedPreferences prefs = getActivity().getSharedPreferences(MainActivity.SHARED_PREFS_FILE, Context.MODE_PRIVATE);\n\t Editor editor = prefs.edit();\n\t try {\n\t editor.putString(MainActivity.STOCK_LIST_TAG, ObjectSerializer.serialize(list));\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t }\n\t editor.putFloat(\"balance\", (float) balance);\n\t editor.commit();\n\t}" ]
[ "0.65215683", "0.6319164", "0.5886629", "0.5872082", "0.5867804", "0.57697326", "0.56588316", "0.5589805", "0.5564185", "0.5451508", "0.54453045", "0.542651", "0.5391776", "0.5351408", "0.5328949", "0.5262604", "0.5253287", "0.5128272", "0.51042396", "0.50915265", "0.5077912", "0.5063486", "0.5044644", "0.50209206", "0.49648446", "0.49573472", "0.49538618", "0.4945268", "0.49393317", "0.49377", "0.49145767", "0.4897713", "0.488738", "0.48738828", "0.4852452", "0.48369884", "0.48369047", "0.48299134", "0.48202336", "0.48158044", "0.48086095", "0.4807536", "0.4803231", "0.47991252", "0.4789907", "0.47864914", "0.47808254", "0.47610575", "0.4760808", "0.47426417", "0.47413686", "0.4740173", "0.47351506", "0.47252446", "0.47137576", "0.47037336", "0.46988305", "0.46906677", "0.46871102", "0.46809244", "0.46711865", "0.46694294", "0.46694115", "0.46511534", "0.46501413", "0.46471024", "0.4647089", "0.46437368", "0.4639825", "0.46391532", "0.4637658", "0.46345934", "0.4633587", "0.4632476", "0.46276468", "0.46274585", "0.46255612", "0.4625201", "0.4624222", "0.46230832", "0.46198902", "0.46157426", "0.46147737", "0.45988116", "0.45917252", "0.45899743", "0.458682", "0.45801798", "0.45703113", "0.45700797", "0.4569677", "0.4549699", "0.4546876", "0.45442846", "0.45406666", "0.45370704", "0.4536886", "0.45329374", "0.4531312", "0.45300525" ]
0.67182124
0
Invokes provision playbook followed by create cluster
private void createClusterAsyncAzureNative(ProvisionRequest provisionRequest, String processID) throws ClusterException { try { // K8SCluster cluster = new K8SCluster(processID, "Started"); // redisRepo.save(cluster, CacheKeysEnum.CLUSTER_STATUS); Process process = startProvisionTask(provisionRequest); K8SCluster cluster = saveAndGetProvisionStatus(processID, process, ClusterStatusEnum.PROV_COMPLETED.getKeyValue()); Thread.sleep(10000); if (cluster.getCreateStatus().equals(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) { // to create cluster fields from provision request (kubeDashboard value) is also // required. createClusterForAzureNative(provisionRequest, processID); } else { // Retry once } logger.info("Inside Async process"); } catch (Exception ex) { logger.error("Exception Occurred...", ex); throw new ClusterException("Exception occurred in createClusterAsyncAzure..", ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Process startCreateClusterTaskForAks(ProvisionRequest provisionRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(provisionRequest);\n\t\t\tString provisionRequestStrWithQt = \"'\" + clusterRequestStr + \"'\";\n\t\t\tProcessBuilder builder = new ProcessBuilder(new String[0]);\n\n\t\t\tString command = \"ansible-playbook \"\n\t\t\t\t\t+ appConfig.getConfigValue(\n\t\t\t\t\t\t\t\"createClusterPlayBook\" + getPropertySuffix(provisionRequest.getCloudSrvc()))\n\t\t\t\t\t+ \" --e \" + provisionRequestStrWithQt;\n// Process p = Runtime.getRuntime().exec(ansible_run, null);\n\t\t\tlogger.info(\"Create Cluster Command:: \" + command);\n\t\t\tbuilder.command(new String[] { \"sh\", \"-c\", command });\n\t\t\tString directory = appConfig\n\t\t\t\t\t.getConfigValue(\"createClusterFolder\" + getPropertySuffix(provisionRequest.getCloudSrvc()));\n\t\t\tbuilder.directory(new File(directory));\n\n\t\t\tprocess = builder.start();\n\n\t\t\tlogger.info(\"Running create aks playbook ...\");\n\n\t\t\tStreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);\n\t\t\tExecutors.newSingleThreadExecutor().submit(streamGobbler);\n\t\t} catch (Exception ex) {\n\t\t\t// ex.printStackTrace();\n\t\t\tthrow new ClusterException(\"Exception occurred in startCreateClusterTaskForAks...\", ex);\n\t\t}\n\t\treturn process;\n\t}", "private void createClusterForAks(ProvisionRequest provisionRequest, String processID) {\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tprovisionRequest.setKubeMonitoring(\"Grafana\");\n\t\t}\n\t\tstartCreateClusterTaskForAks(provisionRequest);\n\t}", "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "private Process startCreateClusterTaskAzure(CreateClusterRequest clusterRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(clusterRequest);\n\t\t\tString provisionRequestStrWithQt = \"'\" + clusterRequestStr + \"'\";\n\t\t\tProcessBuilder builder = new ProcessBuilder(new String[0]);\n\n\t\t\tString command = \"ansible-playbook -i \" + \"\\\"\" + getInventoryPath(clusterRequest.getClusterID()) + \"\\\" \"\n\t\t\t\t\t+ appConfig\n\t\t\t\t\t\t\t.getConfigValue(\"createClusterPlayBook\" + getPropertySuffix(clusterRequest.getCloudSrvc()))\n\t\t\t\t\t+ \" --e \" + provisionRequestStrWithQt;\n// Process p = Runtime.getRuntime().exec(ansible_run, null);\n\t\t\tlogger.info(\"Create Cluster Command:: \" + command);\n\t\t\tbuilder.command(new String[] { \"sh\", \"-c\", command });\n\t\t\tlogger.info(\"Config param for directory:\" + \"createClusterFolder\"\n\t\t\t\t\t+ getPropertySuffix(clusterRequest.getCloudSrvc()));\n\t\t\tString directory = appConfig\n\t\t\t\t\t.getConfigValue(\"createClusterFolder\" + getPropertySuffix(clusterRequest.getCloudSrvc()));\n\n\t\t\tlogger.info(\"Create cluster directory::\" + directory);\n\t\t\tbuilder.directory(new File(directory));\n\n\t\t\tprocess = builder.start();\n\n\t\t\tlogger.info(\"Running create azure cluster playbook ...\");\n\n\t\t\tStreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);\n\t\t\tExecutors.newSingleThreadExecutor().submit(streamGobbler);\n\t\t} catch (Exception ex) {\n\t\t\t// ex.printStackTrace();\n\t\t\tthrow new ClusterException(\"Exception occurred in startCreateClusterTaskAzure\", ex);\n\t\t}\n\t\treturn process;\n\t}", "@Test(groups = {\"rest-commands\"})\n public void createClusterInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandCreateInstance(INSTANCE_NAME, TestDomainV4Constants.CLUSTER,\n TestDomainV4Constants.NODE_NAME);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandCreateInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandCreateInstance command execution failed: \" + gfie.getMessage());\n }\n }", "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "@Override\n\tpublic void execute(DelegateExecution execution) throws Exception {\n\t\tString ip = (String) execution.getVariable(\"ip\");\n\t\tString serviceHome = (String) execution.getVariable(\"serviceHome\");\n\t\tString coRoot = (String) execution.getVariable(\"coRoot\");\n\t\tString customizationId = (String) execution.getVariable(\"customizationId\");\n\t\tHashMap<String, String> data = toscaService.getCloudData(customizationId);\n\n\t\t// TODO al momento è vuoto perchè non lo leggiamo da nulla valutare se\n\t\t// leggerlo dinamicamente o da file di configurazione\n\t\tString privateKeyPath = (String) execution.getVariable(\"privateKeyPath\");\n\t\tString passphrase = (String) execution.getVariable(\"passphrase\");\n\n\t\t// prepare the certificates\n\t\tshellCert(serviceHome, caPath, data.get(\"vmname\"), ip, caPassword);\n\t\t// send the key\n\t\ttransferFile(serviceHome, \"key.pem\", privateKeyPath, passphrase, ip);\n\t\t// send the cert\n\t\ttransferFile(serviceHome, \"cert.pem\", privateKeyPath, passphrase, ip);\n\n\t\t// now that all the pieces are in the machine we can join it to swarm\n\t\tString remote_command = \"systemctl start docker && /usr/bin/docker run -itd --name=swarm-agent --expose=2376 -e SWARM_HOST=:2376 swarm join --advertise=\"\n\t\t\t\t+ ip + \":\" + dockerPort + \" consul://\" + hostip + \":8500\";\n\n\t\tProperties config = new Properties();\n\t\tconfig.put(\"StrictHostKeyChecking\", \"no\"); // without this it cannot\n\t\t\t\t\t\t\t\t\t\t\t\t\t// connect because the host\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key verification fails\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the right way would be to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// somehow get the server\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key and add it to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// trusted keys\n\t\t\t\t\t\t\t\t\t\t\t\t\t// jsch.setKnownHosts()\n\t\t\t\t\t\t\t\t\t\t\t\t\t// https://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/JSch.html#setKnownHosts-java.lang.String-\n\t\t\t\t\t\t\t\t\t\t\t\t\t// see also\n\t\t\t\t\t\t\t\t\t\t\t\t\t// http://stackoverflow.com/a/32858953/28582\n\t\tJSch jsch = new JSch();\n\t\tjsch.addIdentity(privateKeyPath, passphrase);\n\n\t\tSession session = jsch.getSession(ROOT_USER, ip, SSH_PORT);\n\t\tsession.setConfig(config);\n\t\tsession.connect();\n\n\t\tChannelExec channel = (ChannelExec) session.openChannel(\"exec\");\n\t\tint exitStatus = sendCommand(remote_command, channel);\n\t\tlog.debug(\"Command: [\" + remote_command + \"]\");\n\t\tif (exitStatus != 0) {\n\t\t\tlog.debug(\"FAILED - exit status: \" + exitStatus);\n\t\t} else {\n\t\t\tlog.debug(\"Executed successfully\");\n\t\t}\n\t\tchannel.disconnect();\n\t\tsession.disconnect();\n\n\t\tlog.debug(\"in DeployDockerSwarm\");\n\t\t// toscaService.getNodeType(\"\");\n\t\t// dockerService.addMachine(ip, 2376); //SSL\n\t\tString clusterToken = dockerService.addMachine(swarmIp, Integer.parseInt(swarmPort)); // no SSL\n\t\texecution.setVariable(\"clusterToken\", clusterToken);\n\t\tString clusterInfo = dockerService.clusterDetail(clusterToken);\n\t}", "private static void performChefComputeServiceBootstrapping(Properties properties) throws \n IOException, InstantiationException, IllegalAccessException, \n NoSuchMethodException, IllegalArgumentException, InvocationTargetException {\n String rsContinent = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), \n RS_CONTINENT, \"rackspace-cloudservers-us\");\n String rsUser = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_USERNAME, \"asf-gora\");\n String rsApiKey = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_APIKEY, null);\n String rsRegion = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_REGION, \"DFW\");\n String client = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), CHEF_CLIENT, System.getProperty(\"user.name\"));\n String organization = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), CHEF_ORGANIZATION, null);\n String pemFile = System.getProperty(\"user.home\") + \"/.chef/\" + client + \".pem\";\n String credential = Files.toString(new File(pemFile), Charsets.UTF_8);\n\n // Provide the validator information to let the nodes to auto-register themselves\n // in the Chef server during bootstrap\n String validator = organization + \"-validator\";\n String validatorPemFile = System.getProperty(\"user.home\") + \"/.chef/\" + validator + \".pem\";\n String validatorCredential = Files.toString(new File(validatorPemFile), Charsets.UTF_8);\n\n Properties chefConfig = new Properties();\n chefConfig.put(ChefProperties.CHEF_VALIDATOR_NAME, validator);\n chefConfig.put(ChefProperties.CHEF_VALIDATOR_CREDENTIAL, validatorCredential);\n\n // Create the connection to the Chef server\n ChefApi chefApi = ContextBuilder.newBuilder(new ChefApiMetadata())\n .endpoint(\"https://api.opscode.com/organizations/\" + organization)\n .credentials(client, credential)\n .overrides(chefConfig)\n .buildApi(ChefApi.class);\n\n // Create the connection to the compute provider. Note that ssh will be used to bootstrap chef\n ComputeServiceContext computeContext = ContextBuilder.newBuilder(rsContinent)\n .endpoint(rsRegion)\n .credentials(rsUser, rsApiKey)\n .modules(ImmutableSet.<Module> of(new SshjSshClientModule()))\n .buildView(ComputeServiceContext.class);\n\n // Group all nodes in both Chef and the compute provider by this group\n String group = \"jclouds-chef-goraci\";\n\n // Set the recipe to install and the configuration values to override\n String recipe = \"apache2\";\n JsonBall attributes = new JsonBall(\"{\\\"apache\\\": {\\\"listen_ports\\\": \\\"8080\\\"}}\");\n\n // Check to see if the recipe you want exists\n List<String> runlist = null;\n Iterable< ? extends CookbookVersion> cookbookVersions =\n chefApi.chefService().listCookbookVersions();\n if (any(cookbookVersions, CookbookVersionPredicates.containsRecipe(recipe))) {\n runlist = new RunListBuilder().addRecipe(recipe).build();\n }\n for (Iterator<String> iterator = runlist.iterator(); iterator.hasNext();) {\n String string = (String) iterator.next();\n LOG.info(string);\n }\n\n // Update the chef service with the run list you wish to apply to all nodes in the group\n // and also provide the json configuration used to customize the desired values\n BootstrapConfig config = BootstrapConfig.builder().runList(runlist).attributes(attributes).build();\n chefApi.chefService().updateBootstrapConfigForGroup(group, config);\n\n // Build the script that will bootstrap the node\n Statement bootstrap = chefApi.chefService().createBootstrapScriptForGroup(group);\n\n TemplateBuilder templateBuilder = computeContext.getComputeService().templateBuilder();\n templateBuilder.options(runScript(bootstrap));\n // Run a node on the compute provider that bootstraps chef\n try {\n Set< ? extends NodeMetadata> nodes =\n computeContext.getComputeService().createNodesInGroup(group, 1, templateBuilder.build());\n for (NodeMetadata nodeMetadata : nodes) {\n LOG.info(\"<< node %s: %s%n\", nodeMetadata.getId(),\n concat(nodeMetadata.getPrivateAddresses(), nodeMetadata.getPublicAddresses()));\n }\n } catch (RunNodesException e) {\n throw new RuntimeException(e.getMessage());\n }\n\n // Release resources\n chefApi.close();\n computeContext.close();\n\n }", "@Test(timeOut = DEFAULT_TEST_TIMEOUT * 2, groups = \"1\", enabled = false)\r\n \tpublic void bootstrapEc2CloudTest() throws Exception {\r\n \t \r\n \t\tfor (int i = 0; i < NUM_OF_MANAGEMENT_MACHINES; i++) {\r\n \t\t\t// The rest home page is a JSP page, which will fail to compile if there is no JDK installed. So use testrest instead\r\n \t\t\tassertWebServiceAvailable(new URL( restAdminUrl[i].toString() + \"/service/testrest\"));\r\n \t\t\tassertWebServiceAvailable(webUIUrl[i]);\r\n \t\t}\r\n \t \r\n \t\tString connectCommand = \"connect \" + restAdminUrl[0].toString() + \";\";\r\n \t \r\n \t URL machinesURL = getMachinesUrl(restAdminUrl[0].toString());\r\n \t assertEquals(\"Expecting \" + NUM_OF_MANAGEMENT_MACHINES + \" machines\", \r\n \t \t\tNUM_OF_MANAGEMENT_MACHINES, getNumberOfMachines(machinesURL));\r\n \t \r\n \t //running install application on simple\r\n \t String installCommand = new StringBuilder()\r\n \t .append(\"install-application \")\r\n \t .append(\"--verbose \")\r\n \t .append(\"-timeout \")\r\n \t .append(TimeUnit.MILLISECONDS.toMinutes(DEFAULT_TEST_TIMEOUT * 2)).append(\" \")\r\n\t .append((new File(ScriptUtils.getBuildPath(), \"examples/travel\").toString()).replace('\\\\', '/'))\r\n \t .toString();\r\n \t \r\n \t String output = CommandTestUtils.runCommandAndWait(connectCommand + installCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(INSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \r\n \t // Travel is started with 2 instances (1 tomcat, 1 cassandra) so we are expecting two more machine\r\n assertEquals(\"Expecting \" + (NUM_OF_MANAGEMENT_MACHINES+2) + \" machines\", \r\n NUM_OF_MANAGEMENT_MACHINES+2, getNumberOfMachines(machinesURL));\r\n \t \r\n \t \r\n \t //uninstall simple application\r\n \t String uninstallCommand = \"uninstall-application --verbose travel\";\r\n \t output = CommandTestUtils.runCommandAndWait(connectCommand + uninstallCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(UNINSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \t \r\n \t}", "void deploy(String template, Map<String, String> parameters, String group, String regionStr) throws IOException {\n String deploymentName = \"SunstoneDeployment-\" + UUID.randomUUID().toString().substring(0, 5);\n Region region = Region.fromName(regionStr);\n if (region == null) {\n throw new IllegalArgumentException(\"Unknown region \" + regionStr);\n }\n\n if (!armManager.resourceGroups().contain(group)) {\n armManager.resourceGroups().define(group)\n .withRegion(region)\n .create();\n } else {\n LOGGER.warn(\"Azure resource group '{}' already exists! It will be reused and deleted when tests are finished.\", group);\n }\n\n armManager.deployments().define(deploymentName)\n .withExistingResourceGroup(group)\n .withTemplate(template)\n .withParameters(parametersFromMap(template, parameters))\n .withMode(DeploymentMode.INCREMENTAL)\n .create();\n LOGGER.debug(\"Azure deployment from template {} in \\\"{}\\\" group is ready\", deploymentName, group);\n }", "DeployShard() {\n }", "public SubTaskGroup createConfigureServerTasks(\n Collection<NodeDetails> nodes, Consumer<AnsibleConfigureServers.Params> paramsCustomizer) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleConfigureServers\");\n for (NodeDetails node : nodes) {\n Cluster cluster = taskParams().getClusterByUuid(node.placementUuid);\n UserIntent userIntent = cluster.userIntent;\n AnsibleConfigureServers.Params params = new AnsibleConfigureServers.Params();\n // Set the device information (numVolumes, volumeSize, etc.)\n params.deviceInfo = userIntent.getDeviceInfoForNode(node);\n // Add the node name.\n params.nodeName = node.nodeName;\n // Add the universe uuid.\n params.setUniverseUUID(taskParams().getUniverseUUID());\n // Add the az uuid.\n params.azUuid = node.azUuid;\n params.placementUuid = node.placementUuid;\n // Sets the isMaster field\n params.enableYSQL = userIntent.enableYSQL;\n params.enableYCQL = userIntent.enableYCQL;\n params.enableYCQLAuth = userIntent.enableYCQLAuth;\n params.enableYSQLAuth = userIntent.enableYSQLAuth;\n // Set if this node is a master in shell mode.\n // The software package to install for this cluster.\n params.ybSoftwareVersion = userIntent.ybSoftwareVersion;\n params.setEnableYbc(taskParams().isEnableYbc());\n params.setYbcSoftwareVersion(taskParams().getYbcSoftwareVersion());\n params.setYbcInstalled(taskParams().isYbcInstalled());\n // Set the InstanceType\n params.instanceType = node.cloudInfo.instance_type;\n params.enableNodeToNodeEncrypt = userIntent.enableNodeToNodeEncrypt;\n params.enableClientToNodeEncrypt = userIntent.enableClientToNodeEncrypt;\n params.rootAndClientRootCASame = taskParams().rootAndClientRootCASame;\n\n params.allowInsecure = taskParams().allowInsecure;\n params.setTxnTableWaitCountFlag = taskParams().setTxnTableWaitCountFlag;\n params.rootCA = taskParams().rootCA;\n params.setClientRootCA(taskParams().getClientRootCA());\n params.enableYEDIS = userIntent.enableYEDIS;\n params.useSystemd = userIntent.useSystemd;\n // sshPortOverride, in case the passed imageBundle has a different port\n // configured for the region.\n params.sshPortOverride = node.sshPortOverride;\n paramsCustomizer.accept(params);\n\n // Development testing variable.\n params.itestS3PackagePath = taskParams().itestS3PackagePath;\n\n Universe universe = Universe.getOrBadRequest(taskParams().getUniverseUUID());\n UUID custUUID = Customer.get(universe.getCustomerId()).getUuid();\n\n params.callhomeLevel = CustomerConfig.getCallhomeLevel(custUUID);\n // Set if updating master addresses only.\n if (params.updateMasterAddrsOnly) {\n params.type = UpgradeTaskParams.UpgradeTaskType.GFlags;\n if (params.isMaster) {\n params.setProperty(\"processType\", ServerType.MASTER.toString());\n params.gflags =\n GFlagsUtil.getGFlagsForNode(\n node,\n ServerType.MASTER,\n universe.getUniverseDetails().getClusterByUuid(cluster.uuid),\n universe.getUniverseDetails().clusters);\n } else {\n params.setProperty(\"processType\", ServerType.TSERVER.toString());\n params.gflags =\n GFlagsUtil.getGFlagsForNode(\n node,\n ServerType.TSERVER,\n universe.getUniverseDetails().getClusterByUuid(cluster.uuid),\n universe.getUniverseDetails().clusters);\n }\n }\n // Create the Ansible task to get the server info.\n AnsibleConfigureServers task = createTask(AnsibleConfigureServers.class);\n task.initialize(params);\n task.setUserTaskUUID(userTaskUUID);\n // Add it to the task list.\n subTaskGroup.addSubTask(task);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "private CreateClusterRequest createClusterForAzureNative(ProvisionRequest provisionRequest, String processID) {\n\t\tCreateClusterRequest clusterRequest = new CreateClusterRequest();\n\t\t// Populate other fields\n\t\tclusterRequest.setClusterID(processID);\n\t\tclusterRequest.setKubeDashboard(provisionRequest.getKubeDashboard());\n\t\tclusterRequest.setCloudSrvc(provisionRequest.getCloudSrvc());\n\t\t// set cluster after replacing - with _\n\t\tclusterRequest.setClusterName(provisionRequest.getClusterName().replace('-', '_'));\n\t\tlogger.info(\"provisionRequest.getMonitoringEnabled()::\" + provisionRequest.getMonitoringEnabled());\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tclusterRequest.setKubeMonitoring(\"Grafana\");\n\t\t\tlogger.info(\"setKubeMonitoring::Grafana\");\n\t\t}\n\t\t// Populate other constant params\n\t\tpopulateCreateClusterRequest(clusterRequest);\n\n\t\tstartCreateClusterTaskAzure(clusterRequest);\n\n\t\treturn clusterRequest;\n\n\t}", "private void initialDeploy() {\n }", "Swarm createSwarm();", "@Before\n public void setup() throws Exception{\n \n System.setProperty(\"app.home\", BASE_DIR + \"/scribengin\");\n System.setProperty(\"vm.app.dir\", BASE_DIR + \"/scribengin\");\n \n localScribenginCluster = new LocalScribenginCluster(BASE_DIR) ;\n localScribenginCluster.clean(); \n localScribenginCluster.useLog4jConfig(\"classpath:scribengin/log4j/vm-log4j.properties\"); \n localScribenginCluster.start();\n registry = RegistryConfig.getDefault().newInstance().connect();\n shell = localScribenginCluster.getShell();\n \n }", "void start(String resourceGroupName, String virtualMachineName);", "public void provision(ProvisioningConfig provisioningConfig, Map<String, String> options) throws ProvisioningException {\n try(ProvisioningLayout<FeaturePackRuntimeBuilder> layout = newConfigLayout(provisioningConfig, options)) {\n doProvision(layout, getFsDiff(), false);\n }\n }", "void start(String resourceGroupName, String virtualMachineName, Context context);", "Cloud createCloud();", "public void setup(){\n this.cluster = Cluster.builder().addContactPoint(\"127.0.0.1\").build();\n this.session = this.cluster.connect(\"demo\");\n }", "public static void main(String[] args)\n {\n Client oneClient;\n\n try\n {\n oneClient = new Client();\n\n // We will try to create a new virtual machine. The first thing we\n // need is an OpenNebula virtual machine template.\n\n // This VM template is a valid one, but it will probably fail to run\n // if we try to deploy it; the path for the image is unlikely to\n // exist.\n String vmTemplate =\n \"NAME = vm_from_java CPU = 0.1 MEMORY = 64\\n\"\n + \"#DISK = [\\n\"\n + \"#\\tsource = \\\"/home/user/vmachines/ttylinux/ttylinux.img\\\",\\n\"\n + \"#\\ttarget = \\\"hda\\\",\\n\"\n + \"#\\treadonly = \\\"no\\\" ]\\n\"\n + \"# NIC = [ NETWORK = \\\"Non existing network\\\" ]\\n\"\n + \"FEATURES = [ acpi=\\\"no\\\" ]\";\n\n // You can try to uncomment the NIC line, in that case OpenNebula\n // won't be able to insert this machine in the database.\n\n System.out.println(\"Virtual Machine Template:\\n\" + vmTemplate);\n System.out.println();\n\n System.out.print(\"Trying to allocate the virtual machine... \");\n OneResponse rc = VirtualMachine.allocate(oneClient, vmTemplate);\n\n if( rc.isError() )\n {\n System.out.println( \"failed!\");\n throw new Exception( rc.getErrorMessage() );\n }\n\n // The response message is the new VM's ID\n int newVMID = Integer.parseInt(rc.getMessage());\n System.out.println(\"ok, ID \" + newVMID + \".\");\n\n // We can create a representation for the new VM, using the returned\n // VM-ID\n VirtualMachine vm = new VirtualMachine(newVMID, oneClient);\n\n // Let's hold the VM, so the scheduler won't try to deploy it\n System.out.print(\"Trying to hold the new VM... \");\n rc = vm.hold();\n\n if(rc.isError())\n {\n System.out.println(\"failed!\");\n throw new Exception( rc.getErrorMessage() );\n }\n else\n System.out.println(\"ok.\");\n\n // And now we can request its information.\n rc = vm.info();\n\n if(rc.isError())\n throw new Exception( rc.getErrorMessage() );\n\n System.out.println();\n System.out.println(\n \"This is the information OpenNebula stores for the new VM:\");\n System.out.println(rc.getMessage() + \"\\n\");\n\n // This VirtualMachine object has some helpers, so we can access its\n // attributes easily (remember to load the data first using the info\n // method).\n System.out.println(\"The new VM \" +\n vm.getName() + \" has status: \" + vm.status());\n\n // And we can also use xpath expressions\n System.out.println(\"The path of the disk is\");\n System.out.println( \"\\t\" + vm.xpath(\"template/disk/source\") );\n\n // Let's delete the VirtualMachine object.\n vm = null;\n\n // The reference is lost, but we can ask OpenNebula about the VM\n // again. This time however, we are going to use the VM pool\n VirtualMachinePool vmPool = new VirtualMachinePool(oneClient);\n // Remember that we have to ask the pool to retrieve the information\n // from OpenNebula\n rc = vmPool.info();\n\n if(rc.isError())\n throw new Exception( rc.getErrorMessage() );\n\n System.out.println(\n \"\\nThese are all the Virtual Machines in the pool:\");\n for ( VirtualMachine vmachine : vmPool )\n {\n System.out.println(\"\\tID : \" + vmachine.getId() +\n \", Name : \" + vmachine.getName() );\n\n // Check if we have found the VM we are looking for\n if ( vmachine.getId().equals( \"\"+newVMID ) )\n {\n vm = vmachine;\n }\n }\n\n // We have also some useful helpers for the actions you can perform\n // on a virtual machine, like suspend:\n rc = vm.suspend();\n System.out.println(\"\\nTrying to suspend the VM \" + vm.getId() +\n \" (should fail)...\");\n\n // This is all the information you can get from the OneResponse:\n System.out.println(\"\\tOpenNebula response\");\n System.out.println(\"\\t Error: \" + rc.isError());\n System.out.println(\"\\t Msg: \" + rc.getMessage());\n System.out.println(\"\\t ErrMsg: \" + rc.getErrorMessage());\n\n rc = vm.terminate();\n System.out.println(\"\\nTrying to terminate the VM \" +\n vm.getId() + \"...\");\n\n System.out.println(\"\\tOpenNebula response\");\n System.out.println(\"\\t Error: \" + rc.isError());\n System.out.println(\"\\t Msg: \" + rc.getMessage());\n System.out.println(\"\\t ErrMsg: \" + rc.getErrorMessage());\n\n\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n }\n\n\n }", "default void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getCreateAzureClusterMethod(), responseObserver);\n }", "@Override\n public TaskList createVolumes(VolumeCreate param, Project project, VirtualArray varray,\n VirtualPool vpool, List<Recommendation> recommendations, String task,\n VirtualPoolCapabilityValuesWrapper capabilities) throws InternalException {\n String volumeLabel = param.getName();\n TaskList taskList = new TaskList();\n Iterator<Recommendation> recommendationsIter;\n\n final BlockConsistencyGroup consistencyGroup = capabilities.getBlockConsistencyGroup() == null ? null : _dbClient\n .queryObject(BlockConsistencyGroup.class, capabilities.getBlockConsistencyGroup());\n\n // Store capabilities of the CG, so they make it down to the controller\n if (vpool.getRpCopyMode() != null) {\n capabilities.put(VirtualPoolCapabilityValuesWrapper.RP_COPY_MODE, vpool.getRpCopyMode());\n }\n if (vpool.getRpRpoType() != null &&\n NullColumnValueGetter.isNotNullValue(vpool.getRpRpoType())) {\n capabilities.put(VirtualPoolCapabilityValuesWrapper.RP_RPO_TYPE, vpool.getRpRpoType());\n }\n if (vpool.checkRpRpoValueSet()) {\n capabilities.put(VirtualPoolCapabilityValuesWrapper.RP_RPO_VALUE, vpool.getRpRpoValue());\n }\n\n // prepare the volumes\n List<URI> volumeURIs = prepareRecommendedVolumes(param, task, taskList, project,\n varray, vpool, capabilities.getResourceCount(), recommendations,\n consistencyGroup, volumeLabel);\n\n // Execute the volume creations requests for each recommendation.\n recommendationsIter = recommendations.iterator();\n while (recommendationsIter.hasNext()) {\n Recommendation recommendation = recommendationsIter.next();\n try {\n List<VolumeDescriptor> volumeDescriptors = createVolumeDescriptors((RPProtectionRecommendation) recommendation, volumeURIs,\n capabilities);\n BlockOrchestrationController controller = getController(BlockOrchestrationController.class,\n BlockOrchestrationController.BLOCK_ORCHESTRATION_DEVICE);\n\n // Check to see if this is a regular volume create or change virtual pool(add RP protection)\n URI changeVirtualPoolVolumeURI = VolumeDescriptor.getVirtualPoolChangeVolume(volumeDescriptors);\n boolean isChangeVpool = (changeVirtualPoolVolumeURI != null);\n\n // TODO might be able to use param.getSize() instead of the below code to find requestedVolumeCapactity\n Long requestedVolumeCapactity = 0L;\n for (URI volumeURI : volumeURIs) {\n Volume volume = _dbClient.queryObject(Volume.class, volumeURI);\n if (Volume.PersonalityTypes.SOURCE.name().equalsIgnoreCase(volume.getPersonality())) {\n requestedVolumeCapactity = volume.getCapacity();\n break;\n }\n }\n\n computeProtectionCapacity(volumeURIs, requestedVolumeCapactity, false, isChangeVpool, null);\n\n if (isChangeVpool) {\n _log.info(\"Add Recoverpoint Protection to existing volume\");\n controller.changeVirtualPool(volumeDescriptors, task);\n }\n else {\n _log.info(\"Create RP volumes\");\n controller.createVolumes(volumeDescriptors, task);\n }\n\n } catch (InternalException e) {\n if (_log.isErrorEnabled()) {\n _log.error(\"Controller error\", e);\n }\n\n if (volumeURIs != null) {\n for (URI volumeURI : volumeURIs) {\n Volume volume = _dbClient.queryObject(Volume.class, volumeURI);\n if (volume != null) {\n Operation op = new Operation();\n op.setResourceType(ResourceOperationTypeEnum.CREATE_BLOCK_VOLUME);\n _dbClient.createTaskOpStatus(Volume.class, volume.getId(), task, op);\n _dbClient.error(Volume.class, volume.getId(), task, e);\n if (volume.getPersonality() != null\n && volume.getPersonality().equals(Volume.PersonalityTypes.SOURCE.toString())) {\n taskList.getTaskList().add(toTask(volume, task, op));\n }\n }\n }\n throw e;\n }\n\n // If there was a controller error creating the volumes,\n // throw an internal server error and include the task\n // information in the response body, which will inform\n // the user what succeeded and what failed.\n throw new WebApplicationException(Response\n .status(Response.Status.INTERNAL_SERVER_ERROR).entity(taskList).build());\n }\n }\n\n return taskList;\n }", "public static void setupV1Crds(KubeClusterResource cluster) {\n cluster.replaceCustomResources(CRD_V1_KAFKA);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT_S2I);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER_2);\n cluster.replaceCustomResources(CRD_V1_KAFKA_BRIDGE);\n cluster.replaceCustomResources(CRD_V1_TOPIC);\n cluster.replaceCustomResources(CRD_V1_KAFKA_USER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECTOR);\n cluster.replaceCustomResources(CRD_V1_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "public boolean createCreateNodeTasks(\n Universe universe,\n Set<NodeDetails> nodesToBeCreated,\n boolean ignoreNodeStatus,\n boolean ignoreUseCustomImageConfig) {\n\n // Determine the starting state of the nodes and invoke the callback if\n // ignoreNodeStatus is not set.\n boolean isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n ignoreNodeStatus,\n NodeStatus.builder().nodeState(NodeState.ToBeAdded).build(),\n filteredNodes -> {\n createSetNodeStatusTasks(\n filteredNodes, NodeStatus.builder().nodeState(NodeState.Adding).build())\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n });\n\n // Create the node or wait for SSH connection on existing instance from cloud provider.\n isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n isNextFallThrough,\n NodeStatus.builder().nodeState(NodeState.Adding).build(),\n filteredNodes -> {\n createCreateServerTasks(filteredNodes)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n });\n\n // Get and update node instance details of node into our DB, mark node as 'provisioned'.\n // Includes public IP address and private IP address if applicable and others.\n isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n isNextFallThrough,\n NodeStatus.builder().nodeState(NodeState.InstanceCreated).build(),\n filteredNodes -> {\n createServerInfoTasks(filteredNodes)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n });\n\n // Install tools like Node-Exporter, Chrony and config changes like SSH ports, home dir.\n isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n isNextFallThrough,\n NodeStatus.builder().nodeState(NodeState.Provisioned).build(),\n filteredNodes -> {\n createInstallNodeAgentTasks(filteredNodes)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n createWaitForNodeAgentTasks(nodesToBeCreated)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n createHookProvisionTask(filteredNodes, TriggerType.PreNodeProvision);\n createSetupServerTasks(\n filteredNodes, p -> p.ignoreUseCustomImageConfig = ignoreUseCustomImageConfig)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n });\n\n isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n isNextFallThrough,\n NodeStatus.builder().nodeState(NodeState.ServerSetup).build(),\n filteredNodes -> {\n createHookProvisionTask(filteredNodes, TriggerType.PostNodeProvision);\n });\n\n return isNextFallThrough;\n }", "ProvisionProductResult provisionProduct(ProvisionProductRequest provisionProductRequest);", "@Override\n public AutoScalingData provision()\n {\n final String project = envConfig.getProjectId();\n final String zone = envConfig.getZoneName();\n final int numInstances = envConfig.getNumInstances();\n final String managedInstanceGroupName = envConfig.getManagedInstanceGroupName();\n\n try {\n List<String> before = getRunningInstances();\n log.debug(\"Existing instances [%s]\", String.join(\",\", before));\n\n int toSize = Math.min(before.size() + numInstances, getMaxNumWorkers());\n if (before.size() >= toSize) {\n // nothing to scale\n return new AutoScalingData(new ArrayList<>());\n }\n log.info(\"Asked to provision instances, will resize to %d\", toSize);\n\n Compute computeService = createComputeService();\n Compute.InstanceGroupManagers.Resize request =\n computeService.instanceGroupManagers().resize(project, zone,\n managedInstanceGroupName, toSize);\n\n Operation response = request.execute();\n Operation.Error err = waitForOperationEnd(computeService, response);\n if (err == null || err.isEmpty()) {\n List<String> after = null;\n // as the waitForOperationEnd only waits for the operation to be scheduled\n // this loop waits until the requested machines actually go up (or up to a\n // certain amount of retries in checking)\n for (int i = 0; i < RUNNING_INSTANCES_MAX_RETRIES; i++) {\n after = getRunningInstances();\n if (after.size() == toSize) {\n break;\n }\n log.info(\"Machines not up yet, waiting\");\n Thread.sleep(POLL_INTERVAL_MS);\n }\n after.removeAll(before); // these should be the new ones\n log.info(\"Added instances [%s]\", String.join(\",\", after));\n return new AutoScalingData(after);\n } else {\n log.error(\"Unable to provision instances: %s\", err.toPrettyString());\n }\n }\n catch (Exception e) {\n log.error(e, \"Unable to provision any gce instances.\");\n }\n\n return new AutoScalingData(new ArrayList<>());\n }", "public SubTaskGroup createStartYbcTasks(Collection<NodeDetails> nodes) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleClusterServerCtl\");\n for (NodeDetails node : nodes) {\n AnsibleClusterServerCtl.Params params = new AnsibleClusterServerCtl.Params();\n UserIntent userIntent = taskParams().getClusterByUuid(node.placementUuid).userIntent;\n // Add the node name.\n params.nodeName = node.nodeName;\n // Add the universe uuid.\n params.setUniverseUUID(taskParams().getUniverseUUID());\n // Add the az uuid.\n params.azUuid = node.azUuid;\n // The service and the command we want to run.\n params.process = \"controller\";\n params.command = \"start\";\n params.placementUuid = node.placementUuid;\n // Set the InstanceType\n params.instanceType = node.cloudInfo.instance_type;\n params.useSystemd = userIntent.useSystemd;\n // sshPortOverride, in case the passed imageBundle has a different port\n // configured for the region.\n params.sshPortOverride = node.sshPortOverride;\n // Create the Ansible task to get the server info.\n AnsibleClusterServerCtl task = createTask(AnsibleClusterServerCtl.class);\n task.initialize(params);\n // Add it to the task list.\n subTaskGroup.addSubTask(task);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "protected void createAndRunAServiceInGroup(String group) throws RunNodesException {\n ImmutableMap<String, String> userMetadata = ImmutableMap.of(\"test\", group);\n ImmutableSet<String> tags = ImmutableSet.of(group);\n Stopwatch watch = Stopwatch.createStarted();\n template = buildTemplate(client.templateBuilder());\n template.getOptions().inboundPorts(22, 8080).blockOnPort(22, 300).userMetadata(userMetadata).tags(tags);\n NodeMetadata node = getOnlyElement(client.createNodesInGroup(group, 1, template));\n long createSeconds = watch.elapsed(TimeUnit.SECONDS);\n final String nodeId = node.getId();\n //checkUserMetadataContains(node, userMetadata);\n //checkTagsInNodeEquals(node, tags);\n getAnonymousLogger().info(\n format(\"<< available node(%s) os(%s) in %ss\", node.getId(), node.getOperatingSystem(), createSeconds));\n watch.reset().start();\n client.runScriptOnNode(nodeId, JettyStatements.install(), nameTask(\"configure-jetty\"));\n long configureSeconds = watch.elapsed(TimeUnit.SECONDS);\n getAnonymousLogger().info(\n format(\n \"<< configured node(%s) with %s and jetty %s in %ss\",\n nodeId,\n exec(nodeId, \"java -fullversion\"),\n exec(nodeId, JettyStatements.version()), configureSeconds));\n trackProcessOnNode(JettyStatements.start(), \"start jetty\", node);\n client.runScriptOnNode(nodeId, JettyStatements.stop(), runAsRoot(false).wrapInInitScript(false));\n trackProcessOnNode(JettyStatements.start(), \"start jetty\", node);\n }", "void createComputeInstance(\n String accessKey, String secretKey, LaunchSpecifications launchSpecifications) throws CloudExceptions;", "WithReplicasAndCreate withBasicSku();", "public void provision(Path provisioningXml, Map<String, String> options) throws ProvisioningException {\n try(ProvisioningLayout<FeaturePackRuntimeBuilder> layout = newConfigLayout(ProvisioningXmlParser.parse(provisioningXml), options)) {\n doProvision(layout, getFsDiff(), false);\n }\n }", "@Test\n public void cluster() throws FlywayException {\n flyway.setLocations(\"migration/dbsupport/oracle/sql/cluster\");\n flyway.migrate();\n flyway.clean();\n flyway.migrate();\n }", "public void initAsg(){\n\t\tConfigure conf = Configure.getConf();\n\t\tint min = conf.getMaxNum();\n\t\t\n\t\t//launch min number of instances\n\t\tTimeManager.PrintCurrentTime(\"Init Cluster, launching %d DC\\n\", min);\n\t\tfor(int i=0; i < min; i++){\n\t\t\tConnToDC dc = nova.launchOne(conf.getInatanceName());\n\t\t\tif(dc != null){\n\t\t\t\tdcList.offer(dc);\n\t\t\t\tlb.addDC(dc.getIp());\n\t\t\t\tTimeManager.PrintCurrentTime(\"Successfully launch 1 DC [%s:%s]\\n\", \n\t\t\t\t\t\tdc.getIp(), dc.getId());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ;\n\t}", "public @Nonnull String provisionVM( @Nonnull VirtualMachineSupport support, @Nonnull String label, @Nonnull String namePrefix, @Nonnull String hostPrefix, @Nullable String preferredDataCenter ) throws CloudException, InternalException {\n String testImageId = getTestImageId(DaseinTestManager.STATELESS, false);\n if( testImageId == null ) {\n throw new CloudException(\"No test image exists for provisioning a virtual machine\");\n }\n long now = System.currentTimeMillis();\n String name = namePrefix + \"-\" + now;\n String host = hostPrefix + ( now % 10000 );\n Map<String, Object> metadata = new HashMap<String, Object>();\n metadata.put(\"dsnNullTag\", null);\n metadata.put(\"dsnEmptyTag\", \"\");\n metadata.put(\"dsnExtraTag\", \"extra\");\n return provisionVM(support, label, VMLaunchOptions.getInstance(testVMProductId, testImageId, name, host, \"Test VM for stateful integration tests for Dasein Cloud\").withExtendedAnalytics().withMetaData(metadata).withUserData(\"#!/bin/bash\\necho \\\"dasein\\\"\"), preferredDataCenter);\n }", "public void execute() throws MojoExecutionException {\n deploy(service, dockerImage,Optional.ofNullable(kalixProject),Optional.ofNullable(kalixContext));\n }", "public static void main(String args[]){\n ClientConfig remoteConfig = getCluster2();\n\n remoteClient = HazelcastClient.newHazelcastClient(remoteConfig);\n\n Map usCarMap = remoteClient.getMap(\"cars\");\n\n System.out.println(usCarMap.size());\n\n //ClientConfig localConfig = getEUClientConfig();\n Config localConfig = getHCCluster1();\n\n localClient = Hazelcast.newHazelcastInstance(localConfig);\n localClient.getMap(\"cars\");\n\n ClusterReconTask clusterReconTask = new ClusterReconTask(localClient, localClusterName, remoteClient, remoteClusterName);\n\n ClusterReconTask clusterReconTask1 = clusterReconTask;\n\n ClusterReconResults reconResults = null;\n\n try {\n reconResults = clusterReconTask1.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n System.out.println(reconResults.getMissingKeysByMap().size());\n\n System.out.println(reconResults.getMissingKeysByMap().toString());\n\n // Run Repair Task if needed\n if (reconResults.getMissingKeysByMap().size() > 0){\n ClusterRepairTask clusterRepairTask = new ClusterRepairTask(localClient, localClusterName, remoteClient, remoteClusterName, reconResults);\n try {\n clusterRepairTask.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n\n }", "public SubTaskGroup createStartTServersTasks(Collection<NodeDetails> nodes) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleClusterServerCtl\");\n for (NodeDetails node : nodes) {\n AnsibleClusterServerCtl.Params params = new AnsibleClusterServerCtl.Params();\n UserIntent userIntent = taskParams().getClusterByUuid(node.placementUuid).userIntent;\n // Add the node name.\n params.nodeName = node.nodeName;\n // Add the universe uuid.\n params.setUniverseUUID(taskParams().getUniverseUUID());\n // Add the az uuid.\n params.azUuid = node.azUuid;\n // The service and the command we want to run.\n params.process = \"tserver\";\n params.command = \"start\";\n params.placementUuid = node.placementUuid;\n // Set the InstanceType\n params.instanceType = node.cloudInfo.instance_type;\n params.useSystemd = userIntent.useSystemd;\n // Create the Ansible task to get the server info.\n AnsibleClusterServerCtl task = createTask(AnsibleClusterServerCtl.class);\n task.initialize(params);\n // Add it to the task list.\n subTaskGroup.addSubTask(task);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "public void init() throws Exception {\n if (\"local\".equalsIgnoreCase(cluster.provisioningMethod)) {\n zookeeper = new LocalZookeeper();\n int initValue = zookeeper.start();\n if (initValue != 0) {\n log.error(\"Failed to start Zookeeper!\");\n throw new RuntimeException(\"Failed to start Zookeeper!\");\n }\n\n ExecutorService executor = Executors.newFixedThreadPool(1, new ThreadFactoryBuilder().setNameFormat(\"nodestarter-threadpool\").build()); \n \t\t //Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()/2+1, new ThreadFactoryBuilder().setNameFormat(\"nodestarter-threadpool\").build()); \n\n int basePort = Util.getFreePort(cluster.numSolrNodes);\n\n for (int i = 1; i <= cluster.numSolrNodes; i++) {\n \t int nodeIndex = i;\n \t Callable c = () -> {\n \t\t SolrNode node = new LocalSolrNode(solrPackagePath, nodeIndex, String.valueOf(basePort + nodeIndex - 1), cluster.startupParams, cluster.startupParamsOverrides, zookeeper);\n \t\t \n \t\t try {\n\t \t\t node.init();\n\t \t\t node.start();\n\t \t\t nodes.add(node);\n\t \t\t \n\t \t\t log.info(\"Nodes started: \"+nodes.size());\n\t \t\t \n\t \t\t //try (HttpSolrClient client = new HttpSolrClient.Builder(node.getBaseUrl()).build();) {\n\t \t\t\t //log.info(\"Health check: \"+ new HealthCheckRequest().process(client) + \", Nodes started: \"+nodes.size());\n\t \t\t //} catch (Exception ex) {\n\t \t\t\t// log.error(\"Problem starting node: \"+node.getBaseUrl());\n\t \t\t\t //throw new RuntimeException(\"Problem starting node: \"+node.getBaseUrl());\n\t \t\t //}\n\t \t\t return node;\n \t\t } catch (Exception ex) {\n \t\t\t ex.printStackTrace();\n \t\t\t log.error(\"Problem starting node: \"+node.getBaseUrl());\n \t\t\t return null;\n \t\t }\n \t };\n \t executor.submit(c);\n }\n \n executor.shutdown();\n executor.awaitTermination(1, TimeUnit.HOURS);\n\n log.info(\"Looking for healthy nodes...\");\n List<SolrNode> healthyNodes = new ArrayList<>();\n for (SolrNode node: nodes) {\n \t\ttry (HttpSolrClient client = new HttpSolrClient.Builder(node.getBaseUrl().substring(0, node.getBaseUrl().length()-1)).build();) {\n \t\t\tHealthCheckRequest req = new HealthCheckRequest();\n \t\t\tHealthCheckResponse rsp;\n \t\t\ttry {\n \t\t\t\trsp = req.process(client);\n \t\t\t} catch (Exception ex) {\n \t\t\t\tThread.sleep(100);\n \t\t\t\trsp = req.process(client);\n \t\t\t}\n \t\t\tif (rsp.getNodeStatus().equalsIgnoreCase(\"ok\") == false) {\n \t\t\t\tlog.error(\"Couldn't start node: \"+node.getBaseUrl());\n \t\t\t\tthrow new RuntimeException(\"Couldn't start node: \"+node.getBaseUrl());\n \t\t\t} else {\n \t\t\t\thealthyNodes.add(node);\n \t\t\t}\n \t\t} catch (Exception ex) {\n \t\t\tex.printStackTrace();\n \t\t\tlog.error(\"Problem starting node: \"+node.getBaseUrl());\n \t\t}\n }\n \n this.nodes = healthyNodes;\n log.info(\"Healthy nodes: \"+healthyNodes.size());\n \n try (CloudSolrClient client = new CloudSolrClient.Builder().withZkHost(getZookeeperUrl()).build();) {\n\t log.info(\"Cluster state: \" + client.getClusterStateProvider().getClusterState());\n\t log.info(\"Overseer: \" + client.request(new OverseerStatus()));\n }\n\n \n } else if (\"terraform-gcp\".equalsIgnoreCase(cluster.provisioningMethod)) {\n \tSystem.out.println(\"Solr nodes: \"+getSolrNodesFromTFState());\n \tSystem.out.println(\"ZK node: \"+getZkNodeFromTFState());\n \tzookeeper = new GenericZookeeper(getZkNodeFromTFState());\n \tfor (String host: getSolrNodesFromTFState()) {\n \t\tnodes.add(new GenericSolrNode(host, cluster.terraformGCPConfig.get(\"user\").toString()));\n \t}\n } else if (\"vagrant\".equalsIgnoreCase(cluster.provisioningMethod)) {\n \tSystem.out.println(\"Solr nodes: \"+getSolrNodesFromVagrant());\n \tSystem.out.println(\"ZK node: \"+getZkNodeFromVagrant());\n \tzookeeper = new GenericZookeeper(getZkNodeFromVagrant());\n \tfor (String host: getSolrNodesFromVagrant()) {\n \t\tnodes.add(new GenericSolrNode(host, null)); // TODO fix username for vagrant\n \t}\n } else if (\"external\".equalsIgnoreCase(cluster.provisioningMethod)) {\n log.info(\"ZK node: \" + cluster.externalSolrConfig.zkHost);\n String[] tokens = cluster.externalSolrConfig.zkHost.split(\":\");\n zookeeper = new GenericZookeeper(tokens[0], tokens.length > 1 ? Integer.parseInt(tokens[1]) : null, cluster.externalSolrConfig.zkAdminPort, cluster.externalSolrConfig.zkChroot);\n\n try (CloudSolrClient client = new CloudSolrClient.Builder().withZkHost(cluster.externalSolrConfig.zkHost).withZkChroot(cluster.externalSolrConfig.zkChroot).build()) {\n for (String liveNode : client.getClusterStateProvider().getLiveNodes()) {\n nodes.add(new ExternalSolrNode(\n liveNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(liveNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript));\n }\n List<SolrNode> dataNodes = getExternalDataNodes(client).stream().map(dataNode -> new ExternalSolrNode(\n dataNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(dataNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!dataNodes.isEmpty()) {\n nodesByRole.put(NodeRole.DATA, dataNodes);\n }\n List<SolrNode> queryNodes = getExternalQueryNodes(client).stream().map(queryNode -> new ExternalSolrNode(\n queryNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(queryNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!queryNodes.isEmpty()) {\n nodesByRole.put(NodeRole.COORDINATOR, queryNodes);\n }\n List<SolrNode> overseerNodes = getExternalPreferredOverseerNodes(client).stream().map(overseerNode -> new ExternalSolrNode(\n overseerNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(overseerNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!queryNodes.isEmpty()) {\n nodesByRole.put(NodeRole.OVERSEER, overseerNodes);\n }\n }\n log.info(\"Cluster initialized with nodes: \" + nodes + \", zkHost: \" + zookeeper + \", nodes by role: \" + nodesByRole);\n }\n\n\n }", "@Override\n public void onComplete(AWSStartupResult awsStartupResult) {\n }", "@Override\n public void onComplete(AWSStartupResult awsStartupResult) {\n }", "@Override\n public void run() {\n ShellResponse response =\n getNodeManager().nodeCommand(NodeManager.NodeCommandType.Configure, taskParams());\n processShellResponse(response);\n\n if (taskParams().type == UpgradeUniverse.UpgradeTaskType.Everything\n && !taskParams().updateMasterAddrsOnly) {\n // Check cronjob status if installing software.\n response = getNodeManager().nodeCommand(NodeManager.NodeCommandType.CronCheck, taskParams());\n\n // Create an alert if the cronjobs failed to be created on this node.\n if (response.code != 0) {\n Universe universe = Universe.getOrBadRequest(taskParams().universeUUID);\n Customer cust = Customer.get(universe.customerId);\n String alertErrCode = \"CRON_CREATION_FAILURE\";\n String nodeName = taskParams().nodeName;\n String alertMsg =\n \"Universe %s was successfully created but failed to \"\n + \"create cronjobs on some nodes (%s)\";\n\n // Persist node cronjob status into the DB.\n UniverseUpdater updater =\n new UniverseUpdater() {\n @Override\n public void run(Universe universe) {\n UniverseDefinitionTaskParams universeDetails = universe.getUniverseDetails();\n NodeDetails node = universe.getNode(nodeName);\n node.cronsActive = false;\n LOG.info(\n \"Updated \"\n + nodeName\n + \" cronjob status to inactive from universe \"\n + taskParams().universeUUID);\n }\n };\n saveUniverseDetails(updater);\n\n // Create new alert or update existing alert with current node name if alert already exists.\n if (Alert.exists(alertErrCode, universe.universeUUID)) {\n Alert cronAlert = Alert.list(cust.uuid, alertErrCode, universe.universeUUID).get(0);\n List<String> failedNodesList =\n universe\n .getNodes()\n .stream()\n .map(nodeDetail -> nodeDetail.nodeName)\n .collect(Collectors.toList());\n String failedNodesString = String.join(\", \", failedNodesList);\n cronAlert.update(String.format(alertMsg, universe.name, failedNodesString));\n } else {\n Alert.create(\n cust.uuid,\n universe.universeUUID,\n Alert.TargetType.UniverseType,\n alertErrCode,\n \"Warning\",\n String.format(alertMsg, universe.name, nodeName));\n }\n }\n\n // We set the node state to SoftwareInstalled when configuration type is Everything.\n // TODO: Why is upgrade task type used to map to node state update?\n setNodeState(NodeDetails.NodeState.SoftwareInstalled);\n }\n }", "public static void main(String[] args) {\n\t\tint numUser = 1;\n\t\tCalendar cal = Calendar.getInstance();\n\t\tboolean traceFlag = false;\n\t\tCloudSim.init(numUser, cal, traceFlag);\n\t\t// TODO Create the data center and define the the policies for the allocating and scheduling\n\t\tDatacenter datacenter = CreateDataCenter();\n\t\t// TODO Create the data center broker\n\t\tDatacenterBroker datacenterBroker = CreateDataCenterBroker();\n\t\t// TODO Create Cloudlet\n\t\tList<Cloudlet> cloudletList = new ArrayList<Cloudlet>();\n\t\t//Try to set the random number for the cloudlet length\n\t\tlong cloudletLength = 40000;\n\t\tint pesNumber = 1;\n\t\tlong cloudletFileSize = 300;\n\t\tlong cloudletOutputSize = 400;\n\t\tUtilizationModel utilizationModelCpu = new UtilizationModelFull();\n\t\tUtilizationModel utilizationModelRam = new UtilizationModelFull();\n\t\tUtilizationModel utilizationModelBw = new UtilizationModelFull();\n\t\tfor (int cloudletId = 0; cloudletId < 40; cloudletId++) {\n\t\t\tCloudlet cloudlet = new Cloudlet(cloudletId, cloudletLength, pesNumber, cloudletFileSize, cloudletOutputSize,\n\t\t\t\t\tutilizationModelCpu, utilizationModelRam, utilizationModelBw);\n\t\t\tcloudlet.setUserId(datacenterBroker.getId());\n\t\t\tcloudletList.add(cloudlet);\n\t\t}\n\t\t// TODO Create Virtual Machines and define the Procedure for task scheduling algorithm\n\t\tList<Vm> vmList = new ArrayList<Vm>();\n\t\tint userId = 0;\n\t\tdouble mips = 1000;\n\t\tint numberOfPes = 1;\n\t\tint ram = 2000;\n\t\tlong bandwidth = 1000;\n\t\tlong diskSize = 20000;\n\t\tString vmm = \"XEN\";\n\t\tCloudletScheduler cloudletScheduler = new CloudletSchedulerTimeShared();\n\t\tfor (int id = 0; id < 10; id++) {\n\t\t\tVm virtualMachine = new Vm(id, datacenterBroker.getId(), mips, numberOfPes, ram, bandwidth, diskSize, vmm,\n\t\t\t\t\tcloudletScheduler);\n\t\t\tvmList.add(virtualMachine);\n\t\t}\n\t\tdatacenterBroker.submitCloudletList(cloudletList);\n\t\tdatacenterBroker.submitVmList(vmList);\n\t\t// TODO Implement the Power classes\n\t\tCloudSim.startSimulation();\n\t\tList<Cloudlet> finalCloudletExecutionResults = datacenterBroker.getCloudletReceivedList();\n\t\tCloudSim.stopSimulation();\n\t\t// TODO Test the demo and Print the result\n\t\tfor (Cloudlet cloudlet : finalCloudletExecutionResults) {\n\t\t\tLog.printLine(\"Cloudlet: \" + cloudlet.getCloudletId() + \" VM: \" + cloudlet.getVmId() + \n\t\t\t\t\t\" Status: \" + cloudlet.getStatus() + \" Execution Time: \" + cloudlet.getActualCPUTime() + \n\t\t\t\t\t\" Start Time \" + cloudlet.getExecStartTime() + \" Finished Time: \" + cloudlet.getFinishTime());\n\t\t\tLog.printLine(\"----------------------------------------------------------------------------------------------------\");\n\t\t}\n\t}", "private List<EC2AbstractSlave> provisionSpot(Image image, int number, EnumSet<ProvisionOptions> provisionOptions)\n throws IOException {\n if (!spotConfig.useBidPrice) {\n return provisionOndemand(image, 1, provisionOptions, true, spotConfig.getFallbackToOndemand());\n }\n\n AmazonEC2 ec2 = getParent().connect();\n String imageId = image.getImageId();\n\n try {\n LOGGER.info(\"Launching \" + imageId + \" for template \" + description);\n\n KeyPair keyPair = getKeyPair(ec2);\n\n RequestSpotInstancesRequest spotRequest = new RequestSpotInstancesRequest();\n\n // Validate spot bid before making the request\n if (getSpotMaxBidPrice() == null) {\n throw new AmazonClientException(\"Invalid Spot price specified: \" + getSpotMaxBidPrice());\n }\n\n spotRequest.setSpotPrice(getSpotMaxBidPrice());\n spotRequest.setInstanceCount(number);\n\n LaunchSpecification launchSpecification = new LaunchSpecification();\n\n launchSpecification.setImageId(imageId);\n launchSpecification.setInstanceType(type);\n launchSpecification.setEbsOptimized(ebsOptimized);\n launchSpecification.setMonitoringEnabled(monitoring);\n\n if (StringUtils.isNotBlank(getZone())) {\n SpotPlacement placement = new SpotPlacement(getZone());\n launchSpecification.setPlacement(placement);\n }\n\n InstanceNetworkInterfaceSpecification net = new InstanceNetworkInterfaceSpecification();\n String subnetId = chooseSubnetId();\n if (StringUtils.isNotBlank(subnetId)) {\n net.setSubnetId(subnetId);\n\n /*\n * If we have a subnet ID then we can only use VPC security groups\n */\n if (!securityGroupSet.isEmpty()) {\n List<String> groupIds = getEc2SecurityGroups(ec2);\n if (!groupIds.isEmpty()) {\n net.setGroups(groupIds);\n }\n }\n } else {\n if (!securityGroupSet.isEmpty()) {\n List<String> groupIds = getSecurityGroupsBy(\"group-name\", securityGroupSet, ec2)\n .getSecurityGroups()\n .stream().map(SecurityGroup::getGroupId)\n .collect(Collectors.toList());\n net.setGroups(groupIds);\n }\n }\n\n String userDataString = Base64.getEncoder().encodeToString(userData.getBytes(StandardCharsets.UTF_8));\n\n launchSpecification.setUserData(userDataString);\n launchSpecification.setKeyName(keyPair.getKeyName());\n launchSpecification.setInstanceType(type.toString());\n\n net.setAssociatePublicIpAddress(getAssociatePublicIp());\n net.setDeviceIndex(0);\n launchSpecification.withNetworkInterfaces(net);\n\n HashSet<Tag> instTags = buildTags(EC2Cloud.EC2_SLAVE_TYPE_SPOT);\n\n if (StringUtils.isNotBlank(getIamInstanceProfile())) {\n launchSpecification.setIamInstanceProfile(new IamInstanceProfileSpecification().withArn(getIamInstanceProfile()));\n }\n\n setupBlockDeviceMappings(image, launchSpecification.getBlockDeviceMappings());\n\n spotRequest.setLaunchSpecification(launchSpecification);\n\n if (getSpotBlockReservationDuration() != 0) {\n spotRequest.setBlockDurationMinutes(getSpotBlockReservationDuration() * 60);\n }\n\n RequestSpotInstancesResult reqResult;\n try {\n // Make the request for a new Spot instance\n reqResult = ec2.requestSpotInstances(spotRequest);\n } catch (AmazonEC2Exception e) {\n if (spotConfig.getFallbackToOndemand() && e.getErrorCode().equals(\"MaxSpotInstanceCountExceeded\")) {\n logProvisionInfo(\"There is no spot capacity available matching your request, falling back to on-demand instance.\");\n return provisionOndemand(image, number, provisionOptions);\n } else {\n throw e;\n }\n }\n\n List<SpotInstanceRequest> reqInstances = reqResult.getSpotInstanceRequests();\n if (reqInstances.isEmpty()) {\n throw new AmazonClientException(\"No spot instances found\");\n }\n\n List<EC2AbstractSlave> slaves = new ArrayList<>(reqInstances.size());\n for(SpotInstanceRequest spotInstReq : reqInstances) {\n if (spotInstReq == null) {\n throw new AmazonClientException(\"Spot instance request is null\");\n }\n String slaveName = spotInstReq.getSpotInstanceRequestId();\n\n if (spotConfig.getFallbackToOndemand()) {\n for (int i = 0; i < 2 && spotInstReq.getStatus().getCode().equals(\"pending-evaluation\"); i++) {\n LOGGER.info(\"Spot request \" + slaveName + \" is still pending evaluation\");\n Thread.sleep(5000);\n LOGGER.info(\"Fetching info about spot request \" + slaveName);\n DescribeSpotInstanceRequestsRequest describeRequest = new DescribeSpotInstanceRequestsRequest().withSpotInstanceRequestIds(slaveName);\n spotInstReq = ec2.describeSpotInstanceRequests(describeRequest).getSpotInstanceRequests().get(0);\n }\n\n List<String> spotRequestBadCodes = Arrays.asList(\"capacity-not-available\", \"capacity-oversubscribed\", \"price-too-low\");\n if (spotRequestBadCodes.contains(spotInstReq.getStatus().getCode())) {\n LOGGER.info(\"There is no spot capacity available matching your request, falling back to on-demand instance.\");\n List<String> requestsToCancel = reqInstances.stream().map(SpotInstanceRequest::getSpotInstanceRequestId).collect(Collectors.toList());\n CancelSpotInstanceRequestsRequest cancelRequest = new CancelSpotInstanceRequestsRequest(requestsToCancel);\n ec2.cancelSpotInstanceRequests(cancelRequest);\n return provisionOndemand(image, number, provisionOptions);\n }\n }\n\n // Now that we have our Spot request, we can set tags on it\n updateRemoteTags(ec2, instTags, \"InvalidSpotInstanceRequestID.NotFound\", spotInstReq.getSpotInstanceRequestId());\n\n // That was a remote request - we should also update our local instance data\n spotInstReq.setTags(instTags);\n\n LOGGER.info(\"Spot instance id in provision: \" + spotInstReq.getSpotInstanceRequestId());\n\n slaves.add(newSpotSlave(spotInstReq));\n }\n\n return slaves;\n\n } catch (FormException e) {\n throw new AssertionError(); // we should have discovered all\n // configuration issues upfront\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw new RuntimeException(e);\n }\n }", "public SubTaskGroup createCreateServerTasks(Collection<NodeDetails> nodes) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleCreateServer\");\n for (NodeDetails node : nodes) {\n UserIntent userIntent = taskParams().getClusterByUuid(node.placementUuid).userIntent;\n AnsibleCreateServer.Params params = new AnsibleCreateServer.Params();\n fillCreateParamsForNode(params, userIntent, node);\n params.creatingUser = taskParams().creatingUser;\n params.platformUrl = taskParams().platformUrl;\n // Create the Ansible task to setup the server.\n AnsibleCreateServer ansibleCreateServer = createTask(AnsibleCreateServer.class);\n ansibleCreateServer.initialize(params);\n // Add it to the task list.\n subTaskGroup.addSubTask(ansibleCreateServer);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "@Override\n public ITestbed create(ITasResolver tasResolver) {\n List<String> emChosenFeatures = Arrays.asList(\"Enterprise Manager\", \"WebView\");\n\n \n // Collector1 role\n EmRole collector1Role =\n new EmRole.LinuxBuilder(COLLECTOR1_ROLE_ID, tasResolver)\n .emClusterRole(DeployEMFlowContext.EmRoleEnum.COLLECTOR)\n .silentInstallChosenFeatures(emChosenFeatures)\n .dbhost(tasResolver.getHostnameById(MOM_ROLE_ID))\n .installDir(TasBuilder.LINUX_SOFTWARE_LOC+\"em_col\")\n .emPort(5005).emWebPort(8085).wvEmPort(8090)\n .nostartEM().nostartWV()\n .build();\n \n // MOM role\n EmRole momRole =\n new EmRole.LinuxBuilder(MOM_ROLE_ID, tasResolver)\n .emClusterRole(DeployEMFlowContext.EmRoleEnum.MANAGER)\n .emCollector(collector1Role)\n .nostartEM().nostartWV().build();\n \n //CDV role\n EmRole cdvRole = new EmRole.LinuxBuilder(CDV_ROLE_ID, tasResolver)\n .emClusterRole(DeployEMFlowContext.EmRoleEnum.CDV)\n .silentInstallChosenFeatures(emChosenFeatures)\n .emCollector(collector1Role)\n .nostartEM().nostartWV().build();\n\n // QAAppRole for Tomcat\n WebAppRole<TomcatRole> qaAppTomcatRole =\n new QaAppTomcatRole.Builder(QA_APP_TOMCAT_ROLE_ID, tasResolver)\n .cargoDeploy().contextName(\"qa-app\")\n .build(); \n\n // Tomcat Role\n TomcatRole tomcatRole =\n new TomcatRole.LinuxBuilder(TOMCAT_ROLE_ID, tasResolver).tomcatVersion(TomcatVersion.v70)\n .tomcatCatalinaPort(9091).webApp(qaAppTomcatRole).build();\n\n // Tomcat Agent Role\n IRole tomcatAgentRole =\n new AgentRole.LinuxBuilder(TOMCAT_AGENT_ROLE_ID, tasResolver).webAppServer(tomcatRole)\n .intrumentationLevel(AgentInstrumentationLevel.FULL).emRole(momRole)\n .build();\n \n \n // Configuration of Cdv machine\n TestbedMachine cdvMachine =\n TestBedUtils\n .createLinuxMachine(CDV_MACHINE_ID, EM_TEMPLATE_ID, cdvRole); \n \n // Configuration of Collector1 machine\n TestbedMachine emMachine =\n TestBedUtils\n .createLinuxMachine(EM_MACHINE_ID, EM_TEMPLATE_ID, momRole, collector1Role);\n\n\n // Configuration of Agent Machine\n TestbedMachine agentMachine =\n TestBedUtils.createLinuxMachine(AGENT_MACHINE_ID, AGENT_MACHINE_TEMPLATE_ID,\n tomcatRole, qaAppTomcatRole, tomcatAgentRole);\n \n return Testbed.create(this, cdvMachine, emMachine, agentMachine);\n\n }", "public static void main(String[] args) throws IOException{\n\t\tString accessToken = \"<YOUR_ACCESS_TOKEN>\";\n\t\t// The IBM Cloud organization & space to query - case sensitive.\n\t\tString org = \"<YOUR_ORG>\"; // Example: [email protected]\n\t\tString space = \"<YOUR_SPACE>\"; // Example: dev \n\n\t\t// Use TLSv1.2.\n\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t// Create the URL.\n\t\tURL orgsURL = new URL(apiEndpoint + \"/organizations/\" + org + \"/spaces/\" + space + \"/serviceinstances\");\n\t\tHttpURLConnection con = (HttpURLConnection) orgsURL.openConnection();\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"Authorization\", \"Bearer \" + accessToken);\n\t\tcon.setRequestProperty(\"Content-Type\",\"application/json\");\n\t\tcon.setDoOutput(true);\n\n\t\t/* CREATE OPTIONS\n\t\t * Type: The plan type to create.\n\t\t * \t\t\t\t\t\t\tEnum: [\"LibertyCollective\", \"LibertyCore\", \"LibertyNDServer\", \"WASBase\", \"WASCell\", \"WASNDServer\"]\n\t\t *\n\t\t * Name: Name your new service icon in IBM Cloud.\n\t\t *\n\t\t * ApplicationServerVMSize: The size of the virtual machine.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * ControlServerVMSize: The size of the Virtual Machine containing the Collective Controller for a LibertyCollective service instance,\n\t\t * \t\t\t\t\t\t\tor the size of the Virtual Machine containing the DMGR for a WASCell service instance. This is required for\n\t\t * \t\t\t\t\t\t \ttypes \"LibertyCollective\" and \"WASCell\", Illegal argument for the other Types.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * NumberOfApplicationVMs: The number (integer) of application server Virtual Machines to create This is required for types \"LibertyCollective\"\n\t\t * \t\t\t\t\t\t\tand \"WASCell\", Illegal argument for the other Types.\n\t\t *\n\t\t * Software_Level: This is optional for types \"WASBase\", \"WASNDServer\", and \"WASCell\". If one is not specified version \"9.0.0\" will be default.\n\t\t * \t\t\t\t\t\t\tEnum: [\"8.5.5\", \"9.0.0\"]\n\t\t */\n\t\tString createOptionsJSON = \"{\\\"Type\\\":\\\"LibertyCore\\\",\\\"Name\\\":\\\"MyFirstAPIServiceInstance\\\",\\\"ApplicationServerVMSize\\\":\\\"S\\\"}\";\n\n\t\t// Add JSON POST data.\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(createOptionsJSON);\n\t\twr.flush();\n\t\twr.close();\n\n\t\tBufferedReader br = null;\n\t\tif (HttpURLConnection.HTTP_OK == con.getResponseCode()) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t}\n\t\telse {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getErrorStream()));\n\t\t}\n\n\t\tStringBuffer response = new StringBuffer();\n\t\tString line;\n\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tresponse.append(line);\n\t\t}\n\t\tbr.close();\n\n\t\t// Response from the request.\n\t\tSystem.out.println(response.toString());\n\n\t\t/* Example Response for creating a service instance of type \"LibertyCore\"\n\t\t * {\n\t\t * \t\"Status\":\"Active\",\n\t\t * \t\"ApplicationVMInfo\":\n\t\t * \t{\n\t\t * \t\t\"disk\":12.0,\n\t\t * \t\t\"memory\":2048,\"vcpu\":1\n\t\t * \t},\n\t\t * \t\"ServiceInstance\":\n\t\t * \t{\n\t\t * \t\t\"ServiceInstanceID\":\"8b80bac5-4e78-4a87-bb3e-0e4a8fd6d13a\",\n\t\t * \t\t\"ServiceType\":\"LibertyCore\",\n\t\t * \t\t\"SpaceID\":\"esw7jc13-b12a-47jn-9627-06jdu78d98ed\",\n\t\t * \t\t\"OrganizationID\":\"a23w6701-5324-4af8-b593-e9fdffer36a2\",\n\t\t * \t\t\"Name\":\"MyFirstAPIServiceInstance\"\n\t\t * \t}\n\t\t * }\n\t\t */\n\t}", "pvcs createpvcs();", "public static void setupAllCrds(KubeClusterResource cluster) {\n cluster.createCustomResources(TestUtils.CRD_KAFKA);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECT);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECT_S2I);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_MIRROR_MAKER);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_MIRROR_MAKER_2);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_BRIDGE);\n cluster.createCustomResources(TestUtils.CRD_TOPIC);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_USER);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECTOR);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "void start(String resourceGroupName, String referer, String virtualMachineName);", "@Test(groups = {\"rest-commands\"})\n public void createStandaloneInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandCreateInstance(STANDALONE_INSTANCE, null,\n TestDomainV4Constants.NODE_NAME);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n //assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandCreateInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandCreateInstance command execution failed: \" + gfie.getMessage());\n }\n }", "void createComputeInstance(LaunchSpecifications launchSpecifications)\n throws CloudExceptions;", "@Override\n\tpublic void preStart() {\n\t\tcluster.subscribe(getSelf(), MemberUp.class);\n\t\tif (WorkerMain.role.equals(\"kvm\")) {\n\t\t\tSystem.out.println(\"generate KVMActor\");\n\t\t\tVMActor = getContext().actorOf(new RoundRobinPool(5).props(Props.create(KVMActor.class)), \"VMActor\");\n\t\t} else {\n\t\t\tSystem.out.println(\"generate LXDActor\");\n\t\t\tVMActor = getContext().actorOf(new RoundRobinPool(5).props(Props.create(LXDActor.class)), \"LXDActor\");\n\t\t}\n\n\t\tString actorURL = cluster.selfAddress().toString() + \"/user/worker\";\n\t\tUtil.write(\"actor.url\", actorURL);\n\t}", "@Override\n public BrokerCluster generateCluster(String clusterId, int numReplicas, Address address, AddressPlan addressPlan, StandardInfraConfig standardInfraConfig) throws Exception {\n\n KubernetesListBuilder resourcesBuilder = new KubernetesListBuilder();\n\n if (standardInfraConfig != null) {\n String templateName = getTemplateName(address, addressPlan, standardInfraConfig);\n KubernetesList newResources = processTemplate(clusterId, numReplicas, address, templateName, standardInfraConfig);\n resourcesBuilder.addAllToItems(newResources.getItems());\n }\n return new BrokerCluster(clusterId, resourcesBuilder.build());\n }", "@BeforeTest\n public void setupEnv() {\n CLUSTER.start();\n endpoints = CLUSTER.getClientEndpoints();\n Client client = Client.builder()\n .endpoints(endpoints)\n .build();\n\n this.authDisabledKVClient = client.getKVClient();\n this.authDisabledAuthClient = client.getAuthClient();\n }", "public static void main(String argv[]) {\n\n VertxOptions options = new VertxOptions().setBlockedThreadCheckInterval(200000000);\n options.setClustered(true);\n\n Vertx.clusteredVertx(options, res -> {\n if (res.succeeded()) {\n Vertx vertx = res.result();\n final JsonObject js = new JsonObject();\n vertx.fileSystem().readFile(\"app-conf.json\", result -> {\n if (result.succeeded()) {\n Buffer buff = result.result();\n js.mergeIn(new JsonObject(buff.toString()));\n initConfig(js);\n DeploymentOptions deploymentOptions = new DeploymentOptions().setConfig(js).setMaxWorkerExecuteTime(5000).setWorker(true).setWorkerPoolSize(5);\n vertx.deployVerticle(SparkVerticle.class.getName(), deploymentOptions);\n } else {\n System.err.println(\"Oh oh ...\" + result.cause());\n }\n });\n\n }\n });\n }", "@Test\n\tpublic void shouldRegisterClientInEurekaServer() throws InterruptedException {\n\t\tThread.sleep(3000);\n\n\t\tResponseEntity<String> response = this.testRestTemplate\n\t\t\t\t.getForEntity(\"http://localhost:\" + this.port + \"/service-instances/greeting\", String.class);\n\n\t\tthen(response.getStatusCode()).isEqualTo(HttpStatus.OK);\n\t\tthen(response.getBody()).contains(\"greeting\");\n\t}", "@Test\n public void constructStartAndStop() {\n kit.setBlockingStartup(false);\n kit.startAsync();\n kit.awaitRunning();\n kit.stopAsync();\n kit.awaitTerminated();\n }", "SqlElasticPoolOperations.DefinitionStages.WithCreate withNewDatabase(String databaseName);", "public void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateAzureClusterMethod(), getCallOptions()),\n request,\n responseObserver);\n }", "private void tryInitialize() throws IOException, ParseException, org.apache.commons.cli.ParseException {\n log.log(Level.FINE, MessageNames.STARTER_SERVICE_DEPLOYER_STARTING, myName);\n\n /*\n Establish the deployment directory.\n */\n deploymentDirectoryFile = fileUtility.getProfileDirectory().resolveFile(deployDirectory);\n if (deploymentDirectoryFile == null\n || deploymentDirectoryFile.getType() != FileType.FOLDER) {\n log.log(Level.WARNING, MessageNames.NO_DEPLOYMENT_DIRECTORY,\n new Object[]{deployDirectory, fileUtility.getProfileDirectory()});\n }\n /*\n * Find the name of the client we need to deploy. \n */\n /* First argument was the profile name. Second argument is the name of \n * the client app to run. All the rest are parameters to the client\n * app.\n */\n if (clientAppName == null && commandLineArguments.length < 2) {\n System.out.println(messages.getString(MessageNames.CLIENT_APP_USAGE));\n System.exit(1);\n }\n String[] clientAppArgs = new String[0];\n String additionalApps = Strings.EMPTY;\n if (clientAppName == null) {\n String[] argsWithoutProfile = new String[commandLineArguments.length - 1];\n System.arraycopy(commandLineArguments, 1, argsWithoutProfile, 0,\n argsWithoutProfile.length);\n CommandLine cl = CommandLineParsers.parseCommandLineAppRunnerLine(argsWithoutProfile);\n // At this point, any remaining args after -with are in getArgs()\n // The first of those is the app name.\n clientAppName = cl.getArgs()[0];\n clientAppArgs = new String[cl.getArgs().length - 1];\n System.arraycopy(cl.getArgs(), 1, clientAppArgs, 0, clientAppArgs.length);\n if (cl.hasOption(CommandLineParsers.WITH)) {\n additionalApps = cl.getOptionValue(CommandLineParsers.WITH);\n }\n } else {\n clientAppArgs = new String[commandLineArguments.length - 1];\n System.arraycopy(commandLineArguments, 1, clientAppArgs, 0,\n clientAppArgs.length);\n }\n if (!Strings.EMPTY.equals(additionalApps)) {\n startAdditionalApps(additionalApps);\n }\n\n /*\n See if the clientAppName happens to be a 'jar' name and refers to a \n jar file. If so, that's the service archive.\n */\n FileObject serviceArchive = null;\n if (isAppArchive(clientAppName)) {\n serviceArchive = fileUtility.resolveFile(clientAppName);\n } else {\n serviceArchive = findServiceArchiveForName(clientAppName);\n }\n\n if (serviceArchive == null) {\n System.err.println(MessageFormat.format(messages.getString(MessageNames.NO_SUCH_CLIENT_APP), clientAppName));\n System.exit(1);\n }\n // Deploy the service\n deployServiceArchive(serviceArchive, clientAppArgs);\n // Run the main method with the remaining command line parameters.\n }", "@SuppressWarnings(\"deprecation\")\n @Before\n public void setUp(final TestContext aContext) throws Exception {\n final Vertx vertx = myRunTestOnContextRule.vertx();\n final ConfigRetriever configRetriever = ConfigRetriever.create(vertx);\n final DeploymentOptions options = new DeploymentOptions();\n final Async asyncTask = aContext.async();\n\n configRetriever.getConfig(getConfig -> {\n if (getConfig.succeeded()) {\n final JsonObject config = getConfig.result();\n\n myUrl = config.getString(Config.FESTER_URL);\n\n // Create the IDs that will be needed for running the tests\n myManifestID = UUID.randomUUID().toString();\n myManifestS3Key = IDUtils.getWorkS3Key(myManifestID);\n myManifestUri = IDUtils.getResourceURI(myUrl, myManifestS3Key);\n\n myCollectionID = UUID.randomUUID().toString();\n myCollectionS3Key = IDUtils.getCollectionS3Key(myCollectionID);\n myCollectionUri = IDUtils.getResourceURI(myUrl, myCollectionS3Key);\n\n // We need to determine if we'll be able to run the S3 integration tests so we can skip if needed\n if (config.containsKey(Config.S3_ACCESS_KEY) && !config\n .getString(Config.S3_ACCESS_KEY, DEFAULT_ACCESS_KEY).equalsIgnoreCase(DEFAULT_ACCESS_KEY)) {\n isExecutable = true;\n }\n\n vertx.deployVerticle(S3BucketVerticle.class.getName(), options.setConfig(config), deployment -> {\n if (deployment.failed()) {\n final Throwable details = deployment.cause();\n final String message = details.getMessage();\n\n LOGGER.error(details, message);\n aContext.fail(message);\n }\n\n if (myAmazonS3 == null) {\n final String s3AccessKey = config.getString(Config.S3_ACCESS_KEY);\n final String s3SecretKey = config.getString(Config.S3_SECRET_KEY);\n\n // get myAWSCredentials ready\n myAWSCredentials = new BasicAWSCredentials(s3AccessKey, s3SecretKey);\n\n // instantiate the myAmazonS3 client\n myAmazonS3 = new AmazonS3Client(myAWSCredentials);\n }\n\n myS3Bucket = config.getString(Config.S3_BUCKET);\n\n LOGGER.debug(MessageCodes.MFS_067, getClass().getName());\n TestUtils.complete(asyncTask);\n });\n } else {\n aContext.fail(getConfig.cause());\n TestUtils.complete(asyncTask);\n }\n });\n }", "private static void spawnInstance(){\n\t\tString instanceType = null;\n\t\tString imageId = null; \n\t\tint numInstances = 0;\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Name of key to use?\");\n\t\tkeyname = in.next();\n\t\t\n\t\tSystem.out.println(\"Instance type? (use d for default: t2.micro)\");\n\t\tinstanceType = in.next();\n\t\t\n\t\tif(instanceType.equals(\"d\")){\n\t\t\tinstanceType = INSTANCE_TYPE;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Image id? (use d for default: ami-b5a7ea85, Amazon Linux AMI)\");\n\t\timageId = in.next();\n\t\t\n\t\tif(imageId.equals(\"d\")){\n\t\t\timageId = IMAGE_ID; \n\t\t}\n\t\t\n\t\tSystem.out.println(\"Number of instances?\");\n\t\tnumInstances = in.nextInt();\n\n\t\tin.close();\n\t\n\t\tRunInstancesRequest req = new RunInstancesRequest();\n\t\t\n\t String group = GROUP;\n\t \n\t req.withImageId(imageId)\n\t .withInstanceType(instanceType)\n\t .withMinCount(numInstances)\n\t .withMaxCount(numInstances)\n\t .withKeyName(keyname)\n\t .withSecurityGroups(group);\n\t \n\t RunInstancesResult reqRes = ec2.runInstances(req);\n\t Reservation res = reqRes.getReservation();\n\t System.out.println(\"Reservation number is \" + res.getReservationId());\n\t try {\n \t\tSystem.out.println(\"Just a moment while the instance is spun up...\");\n\t\t\tTimeUnit.SECONDS.sleep(10);\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.out.println(\"Instantiation failed!\");\n\t\t}\n \t\tString ip = listLiveInstances();\n \t\tSystem.out.println(\"\");\n \t\tSystem.out.println(\"Connect with 'ssh -i \" + keyname + \".pem ec2-user@\" + ip +\"'\");\n \t\tSystem.out.println(\"If connection fails, run with -l option and check status.\");\n \t\tSystem.exit(0);\n\t}", "void takeLeadership() throws Exception;", "@Override\n\tpublic void takeLeadership(CuratorFramework curator) throws Exception\n\t{\n\n\t\tLOG.info(\"a new leader has been elected: kaboom.id={}\", config.getKaboomId());\n\t\n\t\tThread.sleep(30 * 1000);\n\n\t\twhile (true)\n\t\t{\n\t\t\tMap<String, String> partitionToHost = new HashMap<String, String>();\n\t\t\tMap<String, List<String>> hostToPartition = new HashMap<String, List<String>>();\n\t\t\tfinal Map<String, KaBoomNodeInfo> clients = new HashMap<String, KaBoomNodeInfo>();\n\t\t\tMap<String, List<String>> clientToPartitions = new HashMap<String, List<String>>();\n\t\t\tMap<String, String> partitionToClient = new HashMap<String, String>();\n\t\t\tList<String> topics = new ArrayList<String>();\n\n\t\t\t// Get a full set of metadata from Kafka\n\t\t\tStateUtils.readTopicsFromZooKeeper(config.getKafkaZkConnectionString(), topics);\n\n\t\t\t// Map partition to host and host to partition\n\t\t\tStateUtils.getPartitionHosts(config.getKafkaSeedBrokers(), topics, partitionToHost, hostToPartition);\n\n\t\t\t// Get a list of active clients from zookeeper\n\t\t\tStateUtils.getActiveClients(curator, clients);\n\n\t\t\t// Get a list of current assignments\n\t\t\t// Get a list of current assignments\n\t\t\t\n\t\t\tfor (String partition : partitionToHost.keySet())\n\t\t\t{\n\t\t\t\tStat stat = curator.checkExists().forPath(\"/kaboom/assignments/\" + partition);\n\t\t\t\t\n\t\t\t\tif (stat != null)\n\t\t\t\t{\n\t\t\t\t\t// check if the client is still connected, and delete node if it is not.\n\t\t\t\t\t\n\t\t\t\t\tString client = new String(curator.getData().forPath(\"/kaboom/assignments/\" + partition), UTF8);\n\t\t\t\t\t\n\t\t\t\t\tif (clients.containsKey(client))\n\t\t\t\t\t{\n\t\t\t\t\t\tLOG.debug(\"Partition {} : client {} is connected\", partition, client);\n\t\t\t\t\t\t\n\t\t\t\t\t\tpartitionToClient.put(partition, client);\t\t\t\t\t\t\n\t\t\t\t\t\tList<String> parts = clientToPartitions.get(client);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (parts == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparts = new ArrayList<String>();\n\t\t\t\t\t\t\tclientToPartitions.put(client, parts);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparts.add(partition);\n\t\t\t\t\t} \n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tLOG.debug(\"Partition {} : client {} is not connected\", partition, client);\n\t\t\t\t\t\tcurator.delete().forPath(\"/kaboom/assignments/\" + partition);\n\t\t\t\t\t\tstat = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tStateUtils.calculateLoad(partitionToHost, clients, clientToPartitions);\n\n\t\t\t// If any node is over its target by at least one, then unassign partitions until it is at or below its target\n\t\t\t\n\t\t\tfor (Entry<String, KaBoomNodeInfo> e : clients.entrySet())\n\t\t\t{\n\t\t\t\tString client = e.getKey();\n\t\t\t\tKaBoomNodeInfo info = e.getValue();\n\n\t\t\t\tif (info.getLoad() >= info.getTargetLoad() + 1)\n\t\t\t\t{\n\t\t\t\t\tList<String> localPartitions = new ArrayList<String>();\n\t\t\t\t\tList<String> remotePartitions = new ArrayList<String>();\n\n\t\t\t\t\tfor (String partition : clientToPartitions.get(client))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (partitionToHost.get(partition).equals(info.getHostname()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalPartitions.add(partition);\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\tremotePartitions.add(partition);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (info.getLoad() > info.getTargetLoad())\n\t\t\t\t\t{\n\t\t\t\t\t\tString partitionToDelete;\n\t\t\t\t\t\tif (remotePartitions.size() > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpartitionToDelete = remotePartitions.remove(rand.nextInt(remotePartitions.size()));\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\tpartitionToDelete = localPartitions.remove(rand.nextInt(localPartitions.size()));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tLOG.info(\"Unassgning {} from overloaded client {}\", partitionToDelete, client);\n\t\t\t\t\t\tpartitionToClient.remove(partitionToDelete);\n\t\t\t\t\t\tclientToPartitions.get(client).remove(partitionToDelete);\n\t\t\t\t\t\tinfo.setLoad(info.getLoad() - 1);\n\n\t\t\t\t\t\tcurator.delete().forPath(\"/kaboom/assignments/\" + partitionToDelete);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Sort the clients by percent load, then add unassigned clients to the lowest loaded client\t\t\t\n\t\t\t{\n\t\t\t\tList<String> sortedClients = new ArrayList<String>();\n\t\t\t\tComparator<String> comparator = new Comparator<String>()\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic int compare(String a, String b)\n\t\t\t\t\t{\n\t\t\t\t\t\tKaBoomNodeInfo infoA = clients.get(a);\n\t\t\t\t\t\tdouble valA = infoA.getLoad() / infoA.getTargetLoad();\n\n\t\t\t\t\t\tKaBoomNodeInfo infoB = clients.get(b);\n\t\t\t\t\t\tdouble valB = infoB.getLoad() / infoB.getTargetLoad();\n\n\t\t\t\t\t\tif (valA == valB)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn 0;\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\tif (valA > valB)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tsortedClients.addAll(clients.keySet());\n\n\t\t\t\tfor (String partition : partitionToHost.keySet())\n\t\t\t\t{\n\t\t\t\t\t// If it's already assigned, skip it\n\t\t\t\t\t\n\t\t\t\t\tif (partitionToClient.containsKey(partition))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tCollections.sort(sortedClients, comparator);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * \n\t\t\t\t\t * Iterate through the list until we find either a local client below capacity, or we reach the ones that are \n\t\t\t\t\t * above capacity. If we reach clients above capacity, then just assign it to the first node.\n\t\t\t\t\t */\n\t\t\t\t\t\n\t\t\t\t\tLOG.info(\"Going to assign {}\", partition);\n\t\t\t\t\tString chosenClient = null;\n\t\t\t\t\t\n\t\t\t\t\tfor (String client : sortedClients)\n\t\t\t\t\t{\n\t\t\t\t\t\tLOG.info(\"- Checking {}\", client);\t\t\t\t\t\t\n\t\t\t\t\t\tKaBoomNodeInfo info = clients.get(client);\t\t\t\t\t\t\n\t\t\t\t\t\tLOG.info(\"- Current load = {}, Target load = {}\", info.getLoad(), info.getTargetLoad());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (info.getLoad() >= info.getTargetLoad())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchosenClient = sortedClients.get(0);\n\t\t\t\t\t\t\tbreak;\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\tif (clients.get(client).getHostname().equals(partitionToHost.get(partition)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchosenClient = client;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (chosenClient == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tchosenClient = sortedClients.get(0);\n\t\t\t\t\t}\n\n\t\t\t\t\tLOG.info(\"Assigning partition {} to client {}\", partition, chosenClient);\n\n\t\t\t\t\tcurator\n\t\t\t\t\t\t .create()\n\t\t\t\t\t\t .withMode(CreateMode.PERSISTENT)\n\t\t\t\t\t\t .forPath(\"/kaboom/assignments/\" + partition,\n\t\t\t\t\t\t\t chosenClient.getBytes(UTF8));\n\n\t\t\t\t\tList<String> parts = clientToPartitions.get(chosenClient);\n\t\t\t\t\t\n\t\t\t\t\tif (parts == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tparts = new ArrayList<String>();\n\t\t\t\t\t\tclientToPartitions.put(chosenClient, parts);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tparts.add(partition);\n\n\t\t\t\t\tpartitionToClient.put(partition, chosenClient);\n\n\t\t\t\t\tclients.get(chosenClient).setLoad(clients.get(chosenClient).getLoad() + 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Check to see if the kafka_ready flag writer thread exists and is alive:\n\t\t\t * \n\t\t\t * If it doesn't exist or isn't running, start it. This is designed to \n\t\t\t * work well when the load balancer sleeps for 10 minutes after assigning \n\t\t\t * work. If that behavior changes then additional logic will be required\n\t\t\t * to ensure this isn't executed too often \n\t\t\t */\n\t\t\t\n\t\t\tif (readyFlagThread == null || !readyFlagThread.isAlive())\n\t\t\t{\n\t\t\t\tLOG.info(\"[ready flag writer] thread doesn't exist or is not running\");\t\t\t\t\n\t\t\t\treadyFlagWriter = new ReadyFlagWriter(config, curator);\n\t\t\t\treadyFlagWriter.addListener(this);\n\t\t\t\treadyFlagThread = new Thread(readyFlagWriter);\n\t\t\t\treadyFlagThread.start();\n\t\t\t\tLOG.info(\"[ready flag writer] thread created and started\");\n\t\t\t}\n\n\t\t\tThread.sleep(10 * 60 * 1000);\n\t\t}\n\t}", "void restart(String resourceGroupName, String resourceName, String replicaName, Context context);", "public SubTaskGroup createSetupServerTasks(\n Collection<NodeDetails> nodes, Consumer<AnsibleSetupServer.Params> paramsCustomizer) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleSetupServer\");\n for (NodeDetails node : nodes) {\n UserIntent userIntent = taskParams().getClusterByUuid(node.placementUuid).userIntent;\n AnsibleSetupServer.Params params = new AnsibleSetupServer.Params();\n fillSetupParamsForNode(params, userIntent, node);\n params.useSystemd = userIntent.useSystemd;\n paramsCustomizer.accept(params);\n params.sshUserOverride = node.sshUserOverride;\n params.sshPortOverride = node.sshPortOverride;\n\n // Create the Ansible task to setup the server.\n AnsibleSetupServer ansibleSetupServer = createTask(AnsibleSetupServer.class);\n ansibleSetupServer.initialize(params);\n // Add it to the task list.\n subTaskGroup.addSubTask(ansibleSetupServer);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "private void executeContextStartEngine(MyEngineContext context, LinkedList<ITaskCluster> restartClusters) {\n context.startEngineTaskObjects.forEach(pair -> {\n Set<ITaskCluster> taskClusters = new HashSet<>();\n Set<ITaskObject> createClusters = new HashSet<>();\n pair.getLeft().stream().filter(taskObject -> taskObject != null).forEach(taskObject -> {\n // If cluster not existe, create\n ITaskCluster taskCluster = getTaskManagerConfiguration().getTaskManagerReader().findTaskClusterByTaskObject(taskObject);\n if (taskCluster == null) {\n createClusters.add(taskObject);\n } else {\n taskClusters.add(taskCluster);\n }\n });\n\n ITaskCluster res = null;\n if (!createClusters.isEmpty()) {\n res = createTaskCluster(createClusters.toArray(new ITaskObject[createClusters.size()]));\n taskClusters.add(res);\n } else if (taskClusters.size() == 1) {\n res = taskClusters.iterator().next();\n }\n\n restartClusters.addAll(taskClusters);\n\n if (pair.getRight() != null) {\n pair.getRight().setTaskCluster(res);\n }\n });\n\n // Start engine from cluster\n restartClusters.addAll(context.startEngineTaskClusters);\n }", "void start(String resourceGroupName, String referer, String virtualMachineName, Context context);", "public static void main(String... args) throws SQLException {\n new CreateCluster().runTool(args);\n }", "public interface InstanceDeployCenter {\r\n\r\n /**\r\n * 启动已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 启动已存在的实例,无需进行redis资源包校验\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstanceWithoutResourceCheck(long appId, int instanceId);\r\n\r\n /**\r\n * 下线已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean shutdownExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * cluster forget\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean forgetInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 清理(cluster forget)集群内所有fail节点\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean clearFailInstances(long appId);\r\n \r\n /**\r\n * 展示实例最近的日志\r\n * @param instanceId\r\n * @param maxLineNum\r\n * @return\r\n */\r\n String showInstanceRecentLog(int instanceId, int maxLineNum);\r\n\r\n /**\r\n * 修改实例配置\r\n * @param appId\r\n * @param appAuditId\r\n * @param host\r\n * @param port\r\n * @param instanceConfigKey\r\n * @param instanceConfigValue\r\n * @return\r\n */\r\n boolean modifyInstanceConfig(long appId, Long appAuditId, String host, int port, String instanceConfigKey,\r\n String instanceConfigValue);\r\n\r\n /**\r\n * 检测pod是否有被调度其他宿主机\r\n * @param ip\r\n */\r\n MachineSyncEnum podChangeStatus(String ip);\r\n\r\n /**\r\n * 检测pod是否有心跳停止实例&启动\r\n * @return\r\n */\r\n List<InstanceAlertValueResult> checkAndStartExceptionInstance(String ip, Boolean isAlert);\r\n\r\n\r\n}", "public boolean createProvisionNodeTasks(\n Universe universe,\n Set<NodeDetails> nodesToBeCreated,\n boolean isShellMode,\n boolean ignoreNodeStatus,\n boolean ignoreUseCustomImageConfig) {\n boolean isFallThrough =\n createCreateNodeTasks(\n universe, nodesToBeCreated, ignoreNodeStatus, ignoreUseCustomImageConfig);\n\n return createConfigureNodeTasks(\n universe,\n nodesToBeCreated,\n nodesToBeCreated,\n isShellMode,\n isFallThrough,\n ignoreUseCustomImageConfig);\n }", "@Test(groups = {\"rest-commands\"}, dependsOnMethods = {\"createStandaloneInstanceTest\"})\n public void startInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandStartInstance(STANDALONE_INSTANCE);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n //assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandStartInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandStartInstance command execution failed: \" + gfie.getMessage());\n }\n }", "@Before\n public void setup() {\n // Ensure all clusters have been removed.\n clusterTestTools.deleteAllClusters();\n }", "public static void main(String[] args)\n throws IOException, ExecutionException, InterruptedException, TimeoutException {\n\n String project = \"your-project-id\";\n String zone = \"zone-name\";\n String instanceName = \"instance-name\";\n\n suspendInstance(project, zone, instanceName);\n }", "@Test\n public void CloudScriptServer()\n {\n PlayFabServerModels.LoginWithServerCustomIdRequest customIdReq = new PlayFabServerModels.LoginWithServerCustomIdRequest();\n customIdReq.CreateAccount = true;\n customIdReq.ServerCustomId = PlayFabSettings.BuildIdentifier;\n PlayFabResult<PlayFabServerModels.ServerLoginResult> loginRes = PlayFabServerAPI.LoginWithServerCustomId(customIdReq);\n assertNotNull(loginRes.Result);\n PlayFabServerModels.ExecuteCloudScriptServerRequest hwRequest = new PlayFabServerModels.ExecuteCloudScriptServerRequest();\n hwRequest.FunctionName = \"helloWorld\";\n hwRequest.PlayFabId = loginRes.Result.PlayFabId;\n PlayFabResult<PlayFabServerModels.ExecuteCloudScriptResult> hwResult = PlayFabServerAPI.ExecuteCloudScript(hwRequest);\n assertNotNull(hwResult.Result.FunctionResult);\n Map<String, String> arbitraryResults = (Map<String, String>)hwResult.Result.FunctionResult;\n assertEquals(arbitraryResults.get(\"messageValue\"), \"Hello \" + loginRes.Result.PlayFabId + \"!\");\n }", "private void go(String[] args) {\n System.setProperty(\"jsse.enableSNIExtension\", \"false\");\n\n // process command line arguments\n options = new SampleCommandLineOptions();\n options.parseOptions(args);\n\n // Log in to vCHS API, getting a session in response if login is successful\n System.out.print(\"\\nConnecting to vCHS...\");\n\n authToken = IAM.login(options.hostname, options.username, options.password, options.version);\n\n System.out.println(\"Success\\n\");\n\n // Retrieve the collection of compute services which can be of type dedicated cloud or vpc\n // and has VDC in it.\n List<PlanType> plans = ServiceController.getPlans(options.hostname, options.version,\n authToken);\n if (null != plans && plans.size() > 0) {\n System.out.println(\"PLANS\");\n System.out.println(\"-----\");\n System.out.println();\n\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\", \"Name\", \"Id\", \"Region\",\n \"Service Name\", \"Plan Version\");\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\",\n \"----------------------------------------\",\n \"----------------------------------------\",\n \"--------------------------------------------------\",\n \"------------------------------\", \"-------------------\");\n\n for (PlanType plan : plans) {\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\", plan.getName(), plan.getId(),\n plan.getRegion(), plan.getServiceName(), plan.getPlanVersion());\n }\n }\n\n List<InstanceType> instances = ServiceController.getInstances(options.hostname,\n options.version, authToken);\n System.out.println(\"\\n\");\n\n if (null != instances && instances.size() > 0) {\n System.out.println(\"INSTANCES\");\n System.out.println(\"---------\");\n System.out.println();\n\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\", \"Name\", \"Id\", \"Region\", \"Plan Id\");\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\",\n \"----------------------------------------\",\n \"----------------------------------------\",\n \"--------------------------------------------------\",\n \"--------------------------------------------------\");\n\n for (InstanceType instance : instances) {\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\", instance.getName(),\n instance.getId(), instance.getRegion(), instance.getPlanId());\n }\n }\n\n System.out.println(\"\\n\\n\");\n }", "private void createPreflightNodeCheckTasks(\n SubTaskGroup subTaskGroup, Cluster cluster, Set<NodeDetails> nodesToBeProvisioned) {\n if (cluster.userIntent.providerType == CloudType.onprem) {\n for (NodeDetails node : nodesToBeProvisioned) {\n PreflightNodeCheck.Params params = new PreflightNodeCheck.Params();\n UserIntent userIntent = cluster.userIntent;\n params.nodeName = node.nodeName;\n params.nodeUuid = node.nodeUuid;\n params.deviceInfo = userIntent.getDeviceInfoForNode(node);\n params.azUuid = node.azUuid;\n params.setUniverseUUID(taskParams().getUniverseUUID());\n UniverseTaskParams.CommunicationPorts.exportToCommunicationPorts(\n params.communicationPorts, node);\n params.extraDependencies.installNodeExporter =\n taskParams().extraDependencies.installNodeExporter;\n PreflightNodeCheck task = createTask(PreflightNodeCheck.class);\n task.initialize(params);\n subTaskGroup.addSubTask(task);\n }\n }\n }", "@Override\n protected void before() {\n LOGGER.info(\"Creating cluster operator {} before test per @ClusterOperator annotation on {}\", cc, name(element));\n for (Map.Entry<File, String> entry : yamls.entrySet()) {\n LOGGER.info(\"creating possibly modified version of {}\", entry.getKey());\n deletable.push(entry.getValue());\n\n kubeClient().namespace(annotations(element, Namespace.class).get(0).value());\n kubeClient().clientWithAdmin().applyContent(entry.getValue());\n }\n applyMultipleNamespacesWatcher(element);\n kubeClient().waitForDeployment(CO_DEPLOYMENT_NAME, 1);\n }", "public abstract T provision();", "void restart(String resourceGroupName, String virtualMachineName, Context context);", "void restart(String resourceGroupName, String resourceName, String replicaName);", "void restart(String resourceGroupName, String virtualMachineName);", "SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(String databaseName);", "void deployGroup(String groupJson);", "@BeforeMethod\n void setup() throws Exception {\n bkEnsemble = new LocalBookkeeperEnsemble(3, 0, () -> 0);\n bkEnsemble.start();\n // Start broker\n ServiceConfiguration config = new ServiceConfiguration();\n config.setLoadManagerClassName(ModularLoadManagerImpl.class.getName());\n config.setClusterName(\"use\");\n config.setWebServicePort(Optional.of(0));\n config.setMetadataStoreUrl(\"zk:127.0.0.1:\" + bkEnsemble.getZookeeperPort());\n\n config.setAdvertisedAddress(\"localhost\");\n config.setBrokerShutdownTimeoutMs(0L);\n config.setLoadBalancerOverrideBrokerNicSpeedGbps(Optional.of(1.0d));\n config.setBrokerServicePort(Optional.of(0));\n config.setBrokerServicePortTls(Optional.of(0));\n config.setWebServicePortTls(Optional.of(0));\n pulsar = new PulsarService(config);\n pulsar.start();\n }", "public void updateClusterDetails(UpdateClusterRequest callbackRequest) throws JsonProcessingException, IOException {\n\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tString callbackRequestStr = mapper.writeValueAsString(callbackRequest);\n\t\tlogger.info(\"Update Request: \" + callbackRequestStr);\n\t\tArrayList<String> masterNodes = new ArrayList<String>();\n\t\tArrayList<String> workderNodes = new ArrayList<String>();\n\t\t// set cluster id and inventory path.\n\t\tClusterEnv clusterEnv = new ClusterEnv(callbackRequest.getClusterID());\n\t\tclusterEnv.setInventoryPath(getInventoryPath(callbackRequest.getClusterID()));\n\t\t// if provision details are present set it. If request is posted after\n\t\t// provisioning\n\t\tK8SCluster cluster = clusterRepository.findById(callbackRequest.getClusterID());\n\n\t\tif (cluster == null) {\n\t\t\tlogger.info(\"Cluster could not be found in Database... \");\n\t\t\tthrow new ClusterException(\"Cluster could not be found in database..\");\n\t\t}\n\n\t\tif (callbackRequest.getProvisionDetails() != null) {\n\t\t\tfor (ProvisionDetails provDetails : callbackRequest.getProvisionDetails()) {\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"MASTER\") && masterNodes.size() <= 1) {\n\t\t\t\t\tmasterNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"WORKER\")) {\n\t\t\t\t\tworkderNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] kubeMasterIps = new String[masterNodes.size()];\n\t\t\tString[] kubeNodeIps = new String[workderNodes.size()];\n\t\t\tmasterNodes.toArray(kubeMasterIps);\n\t\t\tworkderNodes.toArray(kubeNodeIps);\n\t\t\tclusterEnv.setKubeMasterIps(kubeMasterIps);\n\t\t\tclusterEnv.setKubeNodeIps(kubeNodeIps);\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t}\n\t\t// if request is posted after create cluster\n\t\tif (callbackRequest.getCreateClusterDetails() != null) {\n//\t\t\tclusterDetails = (ClusterEnv) redisRepo.findById(clusterRequest.getClusterID(),\n//\t\t\t\t\tCacheKeysEnum.CLUSTER_DETAILS);\t\n\n\t\t\tclusterEnv.setApiServerUrl(callbackRequest.getCreateClusterDetails().getKubeApiServerUrl());\n\t\t\t// clusterEnv.setK8sAdminToken(clusterRequest.getCreateClusterDetails().getK8sAdminToken());\n\t\t\tclusterEnv.setK8sDashboardUrl(callbackRequest.getCreateClusterDetails().getK8sDashboadUrl());\n\t\t\t// clusterEnv.setDashboardToken(clusterRequest.getCreateClusterDetails().getDashboardToken());\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\n\t\t\t// If provisioning completed, that means, Azure Native flow. Already record\n\t\t\t// present in clusterenv - hence update\n\t\t\tif (cluster.getCreateStatus().equalsIgnoreCase(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\tclusterRepository.updateClusterEnv(clusterEnv);\n\t\t\t} else {\n\t\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\t\t\t}\n\n\t\t\t// SAVE Tokens to Vault\n\t\t\tsaveTokensToVault(callbackRequest);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.READY.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t\tif (callbackRequest.getCreateClusterDetails().getKubeConfig() != null) {\n\n\t\t\t\tlogger.info(\"Kube Cofig from callback request::\"\n\t\t\t\t\t\t+ callbackRequest.getCreateClusterDetails().getKubeConfig().asText());\n\t\t\t} else {\n\t\t\t\tlogger.info(\"Kube Cofig from callback request is null::\");\n\t\t\t}\n\t\t}\n\n\t\tif (callbackRequest.getMonitoringDetails() != null) {\n\t\t\t// TODO - Save montiroting details in database\n\t\t\tlogger.info(\"Monitoring details - Grafana URL- from callback request::\"\n\t\t\t\t\t+ callbackRequest.getMonitoringDetails().getGrafanaUrl());\n\t\t}\n\t\t// redisRepo.save(clusterEnv, CacheKeysEnum.CLUSTER_DETAILS);\n\n\t}", "SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(SqlDatabase database);", "public void createStartMasterOnNodeTasks(\n Universe universe,\n NodeDetails currentNode,\n @Nullable NodeDetails stoppingNode,\n boolean isStoppable) {\n\n Set<NodeDetails> nodeSet = ImmutableSet.of(currentNode);\n\n // Check that installed MASTER software version is consistent.\n createSoftwareInstallTasks(\n nodeSet, ServerType.MASTER, null, SubTaskGroupType.InstallingSoftware);\n\n if (currentNode.masterState != MasterState.Configured) {\n // TODO Configuration subtasks may be skipped if it is already a master.\n // Update master configuration on the node.\n createConfigureServerTasks(\n nodeSet,\n params -> {\n params.isMasterInShellMode = true;\n params.updateMasterAddrsOnly = true;\n params.isMaster = true;\n params.resetMasterState = true;\n })\n .setSubTaskGroupType(SubTaskGroupType.ConfigureUniverse);\n\n // Set gflags for master.\n createGFlagsOverrideTasks(\n nodeSet,\n ServerType.MASTER,\n true /* isShell */,\n VmUpgradeTaskType.None,\n false /*ignoreUseCustomImageConfig*/);\n }\n\n // Copy the source root certificate to the node.\n createTransferXClusterCertsCopyTasks(nodeSet, universe, SubTaskGroupType.InstallingSoftware);\n\n // Start a master process.\n createStartMasterProcessTasks(nodeSet);\n\n // Add master to the quorum.\n createChangeConfigTask(currentNode, true /* isAdd */, SubTaskGroupType.ConfigureUniverse);\n\n if (stoppingNode != null && stoppingNode.isMaster) {\n // Perform master change only after the new master is added.\n createChangeConfigTask(stoppingNode, false /* isAdd */, SubTaskGroupType.ConfigureUniverse);\n if (isStoppable) {\n createStopMasterTasks(Collections.singleton(stoppingNode))\n .setSubTaskGroupType(SubTaskGroupType.ConfigureUniverse);\n // TODO this may not be needed as change master config is already done.\n createWaitForMasterLeaderTask().setSubTaskGroupType(SubTaskGroupType.ConfigureUniverse);\n }\n // Update this so that it is not added as a master in config update.\n createUpdateNodeProcessTask(stoppingNode.nodeName, ServerType.MASTER, false)\n .setSubTaskGroupType(SubTaskGroupType.ConfigureUniverse);\n }\n\n // Update all server conf files because there was a master change.\n createMasterInfoUpdateTask(universe, currentNode, stoppingNode);\n }", "protected void bootstrap() throws KikahaException {\n\t\ttry {\n\t\t\tval deploymentContext = createDeploymentContext();\n\t\t\trunDeploymentHooks(deploymentContext);\n\t\t\tdeployWebResourceFolder(deploymentContext);\n\t\t\tthis.deploymentContext = deploymentContext;\n\t\t} catch (final ServiceProviderException cause) {\n\t\t\tthrow new KikahaException(cause);\n\t\t}\n\t}", "@BeforeClass\n public void setup()\n throws Exception {\n startZk();\n startController();\n startBroker();\n startKafka();\n }", "@Test(timeout = TIMEOUT)\n public void createArchiveTaskLifecycle() throws Exception {\n final Result<TaskResponse> uploadImportTaskResponseResult = docSDKClient.importUsing().upload(new UploadImportRequest(), jpgTest1InputStream);\n assertThat(uploadImportTaskResponseResult.getStatus()).isEqualTo(HttpStatus.SC_OK);\n\n final TaskResponse uploadImportTaskResponse = uploadImportTaskResponseResult.getBody();\n assertThat(uploadImportTaskResponse.getOperation()).isEqualTo(Operation.IMPORT_UPLOAD);\n\n // Archive\n final CreateArchivesTaskRequest createArchivesTaskRequest = new CreateArchivesTaskRequest().setInput(uploadImportTaskResponse.getId()).setOutputFormat(ZIP);\n final Result<TaskResponse> archiveTaskResponseResult = docSDKClient.tasks().archive(createArchivesTaskRequest);\n assertThat(archiveTaskResponseResult.getStatus()).isEqualTo(HttpStatus.SC_CREATED);\n\n final TaskResponse archiveTaskResponse = archiveTaskResponseResult.getBody();\n assertThat(archiveTaskResponse.getOperation()).isEqualTo(Operation.ARCHIVE);\n\n // Wait\n final Result<TaskResponse> waitArchiveTaskResponseResult = docSDKClient.tasks().wait(archiveTaskResponse.getId());\n assertThat(waitArchiveTaskResponseResult.getStatus()).isEqualTo(HttpStatus.SC_OK);\n\n final TaskResponse waitArchiveTaskResponse = waitArchiveTaskResponseResult.getBody();\n assertThat(waitArchiveTaskResponse.getOperation()).isEqualTo(Operation.ARCHIVE);\n assertThat(waitArchiveTaskResponse.getStatus()).isEqualTo(Status.FINISHED);\n assertThat(waitArchiveTaskResponse.getId()).isEqualTo(archiveTaskResponse.getId());\n\n // Show\n final Result<TaskResponse> showArchiveTaskResponseResult = docSDKClient.tasks().show(archiveTaskResponse.getId());\n assertThat(showArchiveTaskResponseResult.getStatus()).isEqualTo(HttpStatus.SC_OK);\n\n final TaskResponse showArchiveTaskResponse = showArchiveTaskResponseResult.getBody();\n assertThat(showArchiveTaskResponse.getOperation()).isEqualTo(Operation.ARCHIVE);\n assertThat(showArchiveTaskResponse.getStatus()).isEqualTo(Status.FINISHED);\n assertThat(showArchiveTaskResponse.getId()).isEqualTo(archiveTaskResponse.getId());\n\n // Delete\n final Result<Void> deleteVoidResult = docSDKClient.tasks().delete(archiveTaskResponse.getId());\n assertThat(deleteVoidResult.getStatus()).isEqualTo(HttpStatus.SC_NO_CONTENT);\n }", "Replica.DefinitionStages.Blank define(String name);", "@Override\n public void run(String... args) throws Exception {\n initProgressReporter.submitProgress(String.format(LoaderProgress.ENTRY_POINT.message(), delayStartInSeconds));\n Thread.sleep(delayStartInSeconds * 1000);\n\n boolean allReady;\n do {\n initProgressReporter.submitProgress(LoaderProgress.WAITING_FOR_ALL.message());\n\n var applications = this.discoveryClient.getServices();\n initProgressReporter.submitProgress(\n String.format(LoaderProgress.N_SERVICES_REGISTERED.message(), applications.size()));\n for (var application : applications) {\n initProgressReporter.submitProgress(\n String.format(LoaderProgress.SERVICE_REGISTERED.message(), application));\n }\n\n allReady = applications.containsAll(\n Arrays.asList(\"config-server\", \"site-service\", \"role-service\", \"practitioner-service\"));\n if (!allReady) {\n Thread.sleep(5000);\n }\n } while (!allReady);\n\n initProgressReporter.submitProgress(LoaderProgress.ALL_REGISTERED.message());\n\n try {\n initProgressReporter.submitProgress(LoaderProgress.GET_ROLES_FROM_CONFIG.message());\n var roles = trialConfig.getRoles();\n\n initProgressReporter.submitProgress(LoaderProgress.CREATE_ROLES.message());\n roleServiceInvoker.createRoles(roles);\n\n initProgressReporter.submitProgress(LoaderProgress.GET_SITES_FROM_CONFIG.message());\n var sites = trialConfig.getSites();\n\n initProgressReporter.submitProgress(LoaderProgress.CREATE_SITES.message());\n List<String> siteIds = siteServiceInvoker.createSites(sites);\n\n initProgressReporter.submitProgress(LoaderProgress.GET_PERSONS_FROM_CONFIG.message());\n var persons = trialConfig.getPersons();\n\n initProgressReporter.submitProgress(String.format(\n LoaderProgress.SELECT_FIRST_SITE_FROM_COLLECTION_OF_SIZE.message(), siteIds.size()));\n // Assumption in story https://ndph-arts.atlassian.net/browse/ARTS-164\n String siteIdForUserRoles = siteIds.get(0);\n initProgressReporter.submitProgress(LoaderProgress.CREATE_PRACTITIONER.message());\n practitionerServiceInvoker.execute(persons, siteIdForUserRoles);\n initProgressReporter.submitProgress(LoaderProgress.FINISHED_SUCCESSFULY.message());\n } catch (Exception ex) {\n initProgressReporter.submitProgress(ex.toString());\n initProgressReporter.submitProgress(LoaderProgress.FAILURE.message());\n throw ex;\n }\n }", "@Override\r\n public void start(OpProjectSession session) {\n OpBroker broker = session.newBroker();\r\n try {\r\n if (session.administrator(broker) == null) {\r\n OpUserService.createAdministrator(broker);\r\n }\r\n if (session.everyone(broker) == null) {\r\n OpUserService.createEveryone(broker);\r\n }\r\n\r\n //register system objects with Backup manager\r\n OpBackupManager.addSystemObjectIDQuery(OpUser.ADMINISTRATOR_NAME, OpUser.ADMINISTRATOR_ID_QUERY);\r\n OpBackupManager.addSystemObjectIDQuery(OpGroup.EVERYONE_NAME, OpGroup.EVERYONE_ID_QUERY);\r\n }\r\n finally {\r\n broker.closeAndEvict();\r\n }\r\n }", "void createRecipe(Recipe recipe) throws ServiceFailureException;", "@Override\n @BeforeMethod(alwaysRun=true)\n public boolean testSetUp()\n throws Exception\n {\n ifolder = new Folder(connectAnchor);\n idvs = new DistributedVirtualSwitch(connectAnchor);\n ihs = new HostSystem(connectAnchor);\n\n // get a standalone hostmors\n // We need at at least 2 hostmors\n hostMors = ihs.getAllHosts(VersionConstants.ESX4x, HostSystemConnectionState.CONNECTED);\n authentication = new AuthorizationManager(connectAnchor);\n Assert.assertTrue(hostMors.size() >= 2, \"Unable to find two hosts\");\n\n Set<ManagedObjectReference> hostSet = hostMors.keySet();\n Iterator<ManagedObjectReference> hostIterator = hostSet.iterator();\n if (hostIterator.hasNext()) {\n hostMor1 = hostIterator.next();\n srcHostProfile1 = NetworkResourcePoolHelper.extractHostConfigSpec(\n connectAnchor, ProfileConstants.SRC_PROFILE + getTestId(),\n hostMor1);\n }\n if (hostIterator.hasNext()) {\n hostMor2 = hostIterator.next();\n srcHostProfile2 = NetworkResourcePoolHelper.extractHostConfigSpec(\n connectAnchor, ProfileConstants.SRC_PROFILE + getTestId()\n + \"-1\", hostMor2);\n }\n\n // create the dvs\n dvsMor = ifolder.createDistributedVirtualSwitch(\"dvs\",\n DVSTestConstants.VDS_VERSION_41);\n Assert.assertNotNull(dvsMor, \"DVS created\", \"DVS not created\");\n\n // enable netiorm\n Assert.assertTrue(idvs.enableNetworkResourceManagement(dvsMor, true),\n \"Netiorm not enabled\");\n\n Assert.assertTrue(NetworkResourcePoolHelper.isNrpEnabled(connectAnchor,\n dvsMor), \"NRP enabled on the dvs\",\n \"NRP is not enabled on the dvs\");\n\n // Extract the network resource pool related to the vm from the dvs\n nrp = idvs.extractNetworkResourcePool(dvsMor, DVSTestConstants.NRP_VM);\n\n // set the values in the config spec\n setNrpConfigSpec();\n authHelper = new AuthorizationHelper(connectAnchor, getTestId(), false,\n data.getString(TestConstants.TESTINPUT_USERNAME),\n data.getString(TestConstants.TESTINPUT_PASSWORD));\n authHelper.setPermissions(dvsMor, DVSWITCH_RESOURCEMANAGEMENT, testUser,\n false);\n return authHelper.performSecurityTestsSetup(testUser);\n\n }", "@Override\n protected void before() {\n LOGGER.info(\"Creating cluster operator with Helm Chart {} before test per @ClusterOperator annotation on {}\", cc, name(element));\n Path pathToChart = new File(HELM_CHART).toPath();\n String oldNamespace = kubeClient().namespace(\"kube-system\");\n InputStream helmAccountAsStream = getClass().getClassLoader().getResourceAsStream(\"helm/helm-service-account.yaml\");\n String helmServiceAccount = TestUtils.readResource(helmAccountAsStream);\n kubeClient().applyContent(helmServiceAccount);\n helmClient().init();\n kubeClient().namespace(oldNamespace);\n helmClient().install(pathToChart, HELM_RELEASE_NAME, allValues);\n }", "void launchAsMaster();" ]
[ "0.6303186", "0.6113944", "0.6049821", "0.59337205", "0.55924237", "0.54957086", "0.54912317", "0.5349267", "0.53109026", "0.5261015", "0.52208865", "0.52157414", "0.51910627", "0.5124748", "0.51134926", "0.5104672", "0.5093322", "0.5006876", "0.50059044", "0.5003984", "0.49901843", "0.49901825", "0.49533027", "0.49327388", "0.4926911", "0.48979753", "0.48481092", "0.4847975", "0.48467943", "0.4834123", "0.48336112", "0.48071593", "0.47990096", "0.4788285", "0.47858822", "0.47523043", "0.4751702", "0.47470608", "0.4730548", "0.47119048", "0.47115508", "0.47115508", "0.47050253", "0.47020102", "0.46950656", "0.46904206", "0.4682071", "0.4678007", "0.4663149", "0.46409723", "0.46348575", "0.46299163", "0.4618919", "0.4615705", "0.46156555", "0.46154076", "0.4609003", "0.4604182", "0.45938057", "0.45765257", "0.4554234", "0.45510232", "0.45456824", "0.4545056", "0.45233366", "0.45229903", "0.45131594", "0.45083508", "0.45079088", "0.45065278", "0.45000204", "0.4496146", "0.44903946", "0.44859424", "0.44854158", "0.44751513", "0.44740337", "0.44714198", "0.4459243", "0.4458814", "0.4458502", "0.44532478", "0.4452542", "0.44499704", "0.44433057", "0.4438026", "0.4431396", "0.44267195", "0.44205576", "0.44202793", "0.4413236", "0.44105962", "0.43954515", "0.4390935", "0.43886912", "0.4385701", "0.43849853", "0.43742126", "0.43696538", "0.43487123" ]
0.5758807
4
Invoke playbook and Create AKS cluster
private void createClusterForAks(ProvisionRequest provisionRequest, String processID) { if ("Y".equals(provisionRequest.getMonitoringEnabled())) { provisionRequest.setKubeMonitoring("Grafana"); } startCreateClusterTaskForAks(provisionRequest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "private Process startCreateClusterTaskForAks(ProvisionRequest provisionRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(provisionRequest);\n\t\t\tString provisionRequestStrWithQt = \"'\" + clusterRequestStr + \"'\";\n\t\t\tProcessBuilder builder = new ProcessBuilder(new String[0]);\n\n\t\t\tString command = \"ansible-playbook \"\n\t\t\t\t\t+ appConfig.getConfigValue(\n\t\t\t\t\t\t\t\"createClusterPlayBook\" + getPropertySuffix(provisionRequest.getCloudSrvc()))\n\t\t\t\t\t+ \" --e \" + provisionRequestStrWithQt;\n// Process p = Runtime.getRuntime().exec(ansible_run, null);\n\t\t\tlogger.info(\"Create Cluster Command:: \" + command);\n\t\t\tbuilder.command(new String[] { \"sh\", \"-c\", command });\n\t\t\tString directory = appConfig\n\t\t\t\t\t.getConfigValue(\"createClusterFolder\" + getPropertySuffix(provisionRequest.getCloudSrvc()));\n\t\t\tbuilder.directory(new File(directory));\n\n\t\t\tprocess = builder.start();\n\n\t\t\tlogger.info(\"Running create aks playbook ...\");\n\n\t\t\tStreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);\n\t\t\tExecutors.newSingleThreadExecutor().submit(streamGobbler);\n\t\t} catch (Exception ex) {\n\t\t\t// ex.printStackTrace();\n\t\t\tthrow new ClusterException(\"Exception occurred in startCreateClusterTaskForAks...\", ex);\n\t\t}\n\t\treturn process;\n\t}", "private Process startCreateClusterTaskAzure(CreateClusterRequest clusterRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(clusterRequest);\n\t\t\tString provisionRequestStrWithQt = \"'\" + clusterRequestStr + \"'\";\n\t\t\tProcessBuilder builder = new ProcessBuilder(new String[0]);\n\n\t\t\tString command = \"ansible-playbook -i \" + \"\\\"\" + getInventoryPath(clusterRequest.getClusterID()) + \"\\\" \"\n\t\t\t\t\t+ appConfig\n\t\t\t\t\t\t\t.getConfigValue(\"createClusterPlayBook\" + getPropertySuffix(clusterRequest.getCloudSrvc()))\n\t\t\t\t\t+ \" --e \" + provisionRequestStrWithQt;\n// Process p = Runtime.getRuntime().exec(ansible_run, null);\n\t\t\tlogger.info(\"Create Cluster Command:: \" + command);\n\t\t\tbuilder.command(new String[] { \"sh\", \"-c\", command });\n\t\t\tlogger.info(\"Config param for directory:\" + \"createClusterFolder\"\n\t\t\t\t\t+ getPropertySuffix(clusterRequest.getCloudSrvc()));\n\t\t\tString directory = appConfig\n\t\t\t\t\t.getConfigValue(\"createClusterFolder\" + getPropertySuffix(clusterRequest.getCloudSrvc()));\n\n\t\t\tlogger.info(\"Create cluster directory::\" + directory);\n\t\t\tbuilder.directory(new File(directory));\n\n\t\t\tprocess = builder.start();\n\n\t\t\tlogger.info(\"Running create azure cluster playbook ...\");\n\n\t\t\tStreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);\n\t\t\tExecutors.newSingleThreadExecutor().submit(streamGobbler);\n\t\t} catch (Exception ex) {\n\t\t\t// ex.printStackTrace();\n\t\t\tthrow new ClusterException(\"Exception occurred in startCreateClusterTaskAzure\", ex);\n\t\t}\n\t\treturn process;\n\t}", "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "@Test(groups = {\"rest-commands\"})\n public void createClusterInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandCreateInstance(INSTANCE_NAME, TestDomainV4Constants.CLUSTER,\n TestDomainV4Constants.NODE_NAME);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandCreateInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandCreateInstance command execution failed: \" + gfie.getMessage());\n }\n }", "private void createClusterAsyncAzureNative(ProvisionRequest provisionRequest, String processID)\n\t\t\tthrows ClusterException {\n\n\t\ttry {\n\n\t\t\t// K8SCluster cluster = new K8SCluster(processID, \"Started\");\n\t\t\t// redisRepo.save(cluster, CacheKeysEnum.CLUSTER_STATUS);\n\n\t\t\tProcess process = startProvisionTask(provisionRequest);\n\n\t\t\tK8SCluster cluster = saveAndGetProvisionStatus(processID, process,\n\t\t\t\t\tClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\n\t\t\tThread.sleep(10000);\n\n\t\t\tif (cluster.getCreateStatus().equals(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\t// to create cluster fields from provision request (kubeDashboard value) is also\n\t\t\t\t// required.\n\t\t\t\tcreateClusterForAzureNative(provisionRequest, processID);\n\n\t\t\t} else {\n\t\t\t\t// Retry once\n\t\t\t}\n\n\t\t\tlogger.info(\"Inside Async process\");\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"Exception Occurred...\", ex);\n\t\t\tthrow new ClusterException(\"Exception occurred in createClusterAsyncAzure..\", ex);\n\t\t}\n\t}", "default void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getCreateAzureClusterMethod(), responseObserver);\n }", "@Override\n\tpublic void execute(DelegateExecution execution) throws Exception {\n\t\tString ip = (String) execution.getVariable(\"ip\");\n\t\tString serviceHome = (String) execution.getVariable(\"serviceHome\");\n\t\tString coRoot = (String) execution.getVariable(\"coRoot\");\n\t\tString customizationId = (String) execution.getVariable(\"customizationId\");\n\t\tHashMap<String, String> data = toscaService.getCloudData(customizationId);\n\n\t\t// TODO al momento è vuoto perchè non lo leggiamo da nulla valutare se\n\t\t// leggerlo dinamicamente o da file di configurazione\n\t\tString privateKeyPath = (String) execution.getVariable(\"privateKeyPath\");\n\t\tString passphrase = (String) execution.getVariable(\"passphrase\");\n\n\t\t// prepare the certificates\n\t\tshellCert(serviceHome, caPath, data.get(\"vmname\"), ip, caPassword);\n\t\t// send the key\n\t\ttransferFile(serviceHome, \"key.pem\", privateKeyPath, passphrase, ip);\n\t\t// send the cert\n\t\ttransferFile(serviceHome, \"cert.pem\", privateKeyPath, passphrase, ip);\n\n\t\t// now that all the pieces are in the machine we can join it to swarm\n\t\tString remote_command = \"systemctl start docker && /usr/bin/docker run -itd --name=swarm-agent --expose=2376 -e SWARM_HOST=:2376 swarm join --advertise=\"\n\t\t\t\t+ ip + \":\" + dockerPort + \" consul://\" + hostip + \":8500\";\n\n\t\tProperties config = new Properties();\n\t\tconfig.put(\"StrictHostKeyChecking\", \"no\"); // without this it cannot\n\t\t\t\t\t\t\t\t\t\t\t\t\t// connect because the host\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key verification fails\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the right way would be to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// somehow get the server\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key and add it to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// trusted keys\n\t\t\t\t\t\t\t\t\t\t\t\t\t// jsch.setKnownHosts()\n\t\t\t\t\t\t\t\t\t\t\t\t\t// https://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/JSch.html#setKnownHosts-java.lang.String-\n\t\t\t\t\t\t\t\t\t\t\t\t\t// see also\n\t\t\t\t\t\t\t\t\t\t\t\t\t// http://stackoverflow.com/a/32858953/28582\n\t\tJSch jsch = new JSch();\n\t\tjsch.addIdentity(privateKeyPath, passphrase);\n\n\t\tSession session = jsch.getSession(ROOT_USER, ip, SSH_PORT);\n\t\tsession.setConfig(config);\n\t\tsession.connect();\n\n\t\tChannelExec channel = (ChannelExec) session.openChannel(\"exec\");\n\t\tint exitStatus = sendCommand(remote_command, channel);\n\t\tlog.debug(\"Command: [\" + remote_command + \"]\");\n\t\tif (exitStatus != 0) {\n\t\t\tlog.debug(\"FAILED - exit status: \" + exitStatus);\n\t\t} else {\n\t\t\tlog.debug(\"Executed successfully\");\n\t\t}\n\t\tchannel.disconnect();\n\t\tsession.disconnect();\n\n\t\tlog.debug(\"in DeployDockerSwarm\");\n\t\t// toscaService.getNodeType(\"\");\n\t\t// dockerService.addMachine(ip, 2376); //SSL\n\t\tString clusterToken = dockerService.addMachine(swarmIp, Integer.parseInt(swarmPort)); // no SSL\n\t\texecution.setVariable(\"clusterToken\", clusterToken);\n\t\tString clusterInfo = dockerService.clusterDetail(clusterToken);\n\t}", "Swarm createSwarm();", "public void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateAzureClusterMethod(), getCallOptions()),\n request,\n responseObserver);\n }", "public static void main(String[] args) throws IOException{\n\t\tString accessToken = \"<YOUR_ACCESS_TOKEN>\";\n\t\t// The IBM Cloud organization & space to query - case sensitive.\n\t\tString org = \"<YOUR_ORG>\"; // Example: [email protected]\n\t\tString space = \"<YOUR_SPACE>\"; // Example: dev \n\n\t\t// Use TLSv1.2.\n\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t// Create the URL.\n\t\tURL orgsURL = new URL(apiEndpoint + \"/organizations/\" + org + \"/spaces/\" + space + \"/serviceinstances\");\n\t\tHttpURLConnection con = (HttpURLConnection) orgsURL.openConnection();\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"Authorization\", \"Bearer \" + accessToken);\n\t\tcon.setRequestProperty(\"Content-Type\",\"application/json\");\n\t\tcon.setDoOutput(true);\n\n\t\t/* CREATE OPTIONS\n\t\t * Type: The plan type to create.\n\t\t * \t\t\t\t\t\t\tEnum: [\"LibertyCollective\", \"LibertyCore\", \"LibertyNDServer\", \"WASBase\", \"WASCell\", \"WASNDServer\"]\n\t\t *\n\t\t * Name: Name your new service icon in IBM Cloud.\n\t\t *\n\t\t * ApplicationServerVMSize: The size of the virtual machine.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * ControlServerVMSize: The size of the Virtual Machine containing the Collective Controller for a LibertyCollective service instance,\n\t\t * \t\t\t\t\t\t\tor the size of the Virtual Machine containing the DMGR for a WASCell service instance. This is required for\n\t\t * \t\t\t\t\t\t \ttypes \"LibertyCollective\" and \"WASCell\", Illegal argument for the other Types.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * NumberOfApplicationVMs: The number (integer) of application server Virtual Machines to create This is required for types \"LibertyCollective\"\n\t\t * \t\t\t\t\t\t\tand \"WASCell\", Illegal argument for the other Types.\n\t\t *\n\t\t * Software_Level: This is optional for types \"WASBase\", \"WASNDServer\", and \"WASCell\". If one is not specified version \"9.0.0\" will be default.\n\t\t * \t\t\t\t\t\t\tEnum: [\"8.5.5\", \"9.0.0\"]\n\t\t */\n\t\tString createOptionsJSON = \"{\\\"Type\\\":\\\"LibertyCore\\\",\\\"Name\\\":\\\"MyFirstAPIServiceInstance\\\",\\\"ApplicationServerVMSize\\\":\\\"S\\\"}\";\n\n\t\t// Add JSON POST data.\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(createOptionsJSON);\n\t\twr.flush();\n\t\twr.close();\n\n\t\tBufferedReader br = null;\n\t\tif (HttpURLConnection.HTTP_OK == con.getResponseCode()) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t}\n\t\telse {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getErrorStream()));\n\t\t}\n\n\t\tStringBuffer response = new StringBuffer();\n\t\tString line;\n\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tresponse.append(line);\n\t\t}\n\t\tbr.close();\n\n\t\t// Response from the request.\n\t\tSystem.out.println(response.toString());\n\n\t\t/* Example Response for creating a service instance of type \"LibertyCore\"\n\t\t * {\n\t\t * \t\"Status\":\"Active\",\n\t\t * \t\"ApplicationVMInfo\":\n\t\t * \t{\n\t\t * \t\t\"disk\":12.0,\n\t\t * \t\t\"memory\":2048,\"vcpu\":1\n\t\t * \t},\n\t\t * \t\"ServiceInstance\":\n\t\t * \t{\n\t\t * \t\t\"ServiceInstanceID\":\"8b80bac5-4e78-4a87-bb3e-0e4a8fd6d13a\",\n\t\t * \t\t\"ServiceType\":\"LibertyCore\",\n\t\t * \t\t\"SpaceID\":\"esw7jc13-b12a-47jn-9627-06jdu78d98ed\",\n\t\t * \t\t\"OrganizationID\":\"a23w6701-5324-4af8-b593-e9fdffer36a2\",\n\t\t * \t\t\"Name\":\"MyFirstAPIServiceInstance\"\n\t\t * \t}\n\t\t * }\n\t\t */\n\t}", "public com.google.longrunning.Operation createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getCreateAzureClusterMethod(), getCallOptions(), request);\n }", "static void runJobFlow() throws InterruptedException{\n JobFlowInstancesConfig instances = new JobFlowInstancesConfig();\n //********************************************************************//\n instances.setHadoopVersion(HADOOP_VERSION);\n instances.withEc2KeyName(\"ayuda-vp1\");\n instances.setInstanceCount(MASTER_INSTANCE_COUNT);\n //instances.setInstanceGroups(instanceGroups)\n instances.setMasterInstanceType(InstanceType.M24xlarge.toString());\n instances.setSlaveInstanceType(InstanceType.M24xlarge.toString());\n //********************************************************************//\n HadoopJarStepConfig hadoopJarStep1 = new HadoopJarStepConfig()\n .withJar(S3N_WORD_COUNT_JAR_) // This should be a full map reduce application.\n .withArgs(BUCKET_NAME+\"inWC\", BUCKET_NAME+\"outWC\");\n \n StepConfig stepConfig1 = new StepConfig()\n .withName(\"wordcount\")\n .withHadoopJarStep(hadoopJarStep1)\n .withActionOnFailure(\"TERMINATE_JOB_FLOW\");\n\n //********************************************************************//\n \n //********************************************************************//\n HadoopJarStepConfig hadoopJarStep2 = new HadoopJarStepConfig()\n .withJar(S3N_MAX_WORD_COUNT_JAR) // This should be a full map reduce application.\n .withArgs(BUCKET_NAME+\"outWC\", BUCKET_NAME+\"outXWC\",\"hate\",\"10\");\n \n \n StepConfig stepConfig2 = new StepConfig()\n .withName(\"maxwordcount\")\n .withHadoopJarStep(hadoopJarStep2)\n .withActionOnFailure(\"TERMINATE_JOB_FLOW\");\n //********************************************************************//\n \n Collection<StepConfig> csc = new ArrayList<StepConfig>();\n csc.add(stepConfig1);\n csc.add(stepConfig2);\n \n // BootstrapActions bootstrapActions = new BootstrapActions();\n RunJobFlowRequest runFlowRequest = new RunJobFlowRequest()\n .withName(FLOW_NAME)\n .withInstances(instances)\n .withSteps(csc)\n .withLogUri(BUCKET_NAME+\"debug\")\n /*.withBootstrapActions(\n bootstrapActions.newRunIf(\n \"instance.isMaster=true\",\n bootstrapActions.newConfigureDaemons()\n .withHeapSize(Daemon.JobTracker, 4096)\n .build()),\n bootstrapActions.newRunIf(\n \"instance.isRunningNameNode=true\",\n bootstrapActions.newConfigureDaemons()\n .withHeapSize(Daemon.NameNode, 4096).build()),\n bootstrapActions.newRunIf(\n \"instance.isRunningDataNode=true\",\n bootstrapActions.newConfigureDaemons()\n .withHeapSize(Daemon.DataNode, 4096).build()),\n bootstrapActions.newRunIf(\n \"instance.isRunningJobTracker=true\",\n bootstrapActions.newConfigureDaemons()\n .withHeapSize(Daemon.JobTracker, 4096).build()),\n bootstrapActions.newRunIf(\n \"instance.isRunningTaskTracker=true\",\n bootstrapActions.newConfigureDaemons()\n .withHeapSize(Daemon.TaskTracker, 4096).build()) \n \n /*,\n \n bootstrapActions.newRunIf(\n \"instance.isSlave=true\",\n bootstrapActions.newConfigureHadoop()\n .withKeyValue(ConfigFile.Site,\"mapred.tasktracker.map.tasks.maximum\", \"4\")) \n )*/;\n \n \n RunJobFlowResult runJobFlowResult = emr.runJobFlow(runFlowRequest);\n\t \n\t String jobFlowId = runJobFlowResult.getJobFlowId();\n\t System.out.println(\"Ran job flow with id: \" + jobFlowId);\n\t \n\t //wasFinished(runJobFlowResult);\n\t \n }", "public static void main(String args[]){\n ClientConfig remoteConfig = getCluster2();\n\n remoteClient = HazelcastClient.newHazelcastClient(remoteConfig);\n\n Map usCarMap = remoteClient.getMap(\"cars\");\n\n System.out.println(usCarMap.size());\n\n //ClientConfig localConfig = getEUClientConfig();\n Config localConfig = getHCCluster1();\n\n localClient = Hazelcast.newHazelcastInstance(localConfig);\n localClient.getMap(\"cars\");\n\n ClusterReconTask clusterReconTask = new ClusterReconTask(localClient, localClusterName, remoteClient, remoteClusterName);\n\n ClusterReconTask clusterReconTask1 = clusterReconTask;\n\n ClusterReconResults reconResults = null;\n\n try {\n reconResults = clusterReconTask1.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n System.out.println(reconResults.getMissingKeysByMap().size());\n\n System.out.println(reconResults.getMissingKeysByMap().toString());\n\n // Run Repair Task if needed\n if (reconResults.getMissingKeysByMap().size() > 0){\n ClusterRepairTask clusterRepairTask = new ClusterRepairTask(localClient, localClusterName, remoteClient, remoteClusterName, reconResults);\n try {\n clusterRepairTask.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n\n }", "@Test(timeOut = DEFAULT_TEST_TIMEOUT * 2, groups = \"1\", enabled = false)\r\n \tpublic void bootstrapEc2CloudTest() throws Exception {\r\n \t \r\n \t\tfor (int i = 0; i < NUM_OF_MANAGEMENT_MACHINES; i++) {\r\n \t\t\t// The rest home page is a JSP page, which will fail to compile if there is no JDK installed. So use testrest instead\r\n \t\t\tassertWebServiceAvailable(new URL( restAdminUrl[i].toString() + \"/service/testrest\"));\r\n \t\t\tassertWebServiceAvailable(webUIUrl[i]);\r\n \t\t}\r\n \t \r\n \t\tString connectCommand = \"connect \" + restAdminUrl[0].toString() + \";\";\r\n \t \r\n \t URL machinesURL = getMachinesUrl(restAdminUrl[0].toString());\r\n \t assertEquals(\"Expecting \" + NUM_OF_MANAGEMENT_MACHINES + \" machines\", \r\n \t \t\tNUM_OF_MANAGEMENT_MACHINES, getNumberOfMachines(machinesURL));\r\n \t \r\n \t //running install application on simple\r\n \t String installCommand = new StringBuilder()\r\n \t .append(\"install-application \")\r\n \t .append(\"--verbose \")\r\n \t .append(\"-timeout \")\r\n \t .append(TimeUnit.MILLISECONDS.toMinutes(DEFAULT_TEST_TIMEOUT * 2)).append(\" \")\r\n\t .append((new File(ScriptUtils.getBuildPath(), \"examples/travel\").toString()).replace('\\\\', '/'))\r\n \t .toString();\r\n \t \r\n \t String output = CommandTestUtils.runCommandAndWait(connectCommand + installCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(INSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \r\n \t // Travel is started with 2 instances (1 tomcat, 1 cassandra) so we are expecting two more machine\r\n assertEquals(\"Expecting \" + (NUM_OF_MANAGEMENT_MACHINES+2) + \" machines\", \r\n NUM_OF_MANAGEMENT_MACHINES+2, getNumberOfMachines(machinesURL));\r\n \t \r\n \t \r\n \t //uninstall simple application\r\n \t String uninstallCommand = \"uninstall-application --verbose travel\";\r\n \t output = CommandTestUtils.runCommandAndWait(connectCommand + uninstallCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(UNINSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \t \r\n \t}", "public void setup(){\n this.cluster = Cluster.builder().addContactPoint(\"127.0.0.1\").build();\n this.session = this.cluster.connect(\"demo\");\n }", "public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>\n createAzureCluster(com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getCreateAzureClusterMethod(), getCallOptions()), request);\n }", "@Override\n protected void before() {\n LOGGER.info(\"Creating cluster operator with Helm Chart {} before test per @ClusterOperator annotation on {}\", cc, name(element));\n Path pathToChart = new File(HELM_CHART).toPath();\n String oldNamespace = kubeClient().namespace(\"kube-system\");\n InputStream helmAccountAsStream = getClass().getClassLoader().getResourceAsStream(\"helm/helm-service-account.yaml\");\n String helmServiceAccount = TestUtils.readResource(helmAccountAsStream);\n kubeClient().applyContent(helmServiceAccount);\n helmClient().init();\n kubeClient().namespace(oldNamespace);\n helmClient().install(pathToChart, HELM_RELEASE_NAME, allValues);\n }", "private CreateClusterRequest createClusterForAzureNative(ProvisionRequest provisionRequest, String processID) {\n\t\tCreateClusterRequest clusterRequest = new CreateClusterRequest();\n\t\t// Populate other fields\n\t\tclusterRequest.setClusterID(processID);\n\t\tclusterRequest.setKubeDashboard(provisionRequest.getKubeDashboard());\n\t\tclusterRequest.setCloudSrvc(provisionRequest.getCloudSrvc());\n\t\t// set cluster after replacing - with _\n\t\tclusterRequest.setClusterName(provisionRequest.getClusterName().replace('-', '_'));\n\t\tlogger.info(\"provisionRequest.getMonitoringEnabled()::\" + provisionRequest.getMonitoringEnabled());\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tclusterRequest.setKubeMonitoring(\"Grafana\");\n\t\t\tlogger.info(\"setKubeMonitoring::Grafana\");\n\t\t}\n\t\t// Populate other constant params\n\t\tpopulateCreateClusterRequest(clusterRequest);\n\n\t\tstartCreateClusterTaskAzure(clusterRequest);\n\n\t\treturn clusterRequest;\n\n\t}", "private static void performChefComputeServiceBootstrapping(Properties properties) throws \n IOException, InstantiationException, IllegalAccessException, \n NoSuchMethodException, IllegalArgumentException, InvocationTargetException {\n String rsContinent = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), \n RS_CONTINENT, \"rackspace-cloudservers-us\");\n String rsUser = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_USERNAME, \"asf-gora\");\n String rsApiKey = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_APIKEY, null);\n String rsRegion = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_REGION, \"DFW\");\n String client = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), CHEF_CLIENT, System.getProperty(\"user.name\"));\n String organization = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), CHEF_ORGANIZATION, null);\n String pemFile = System.getProperty(\"user.home\") + \"/.chef/\" + client + \".pem\";\n String credential = Files.toString(new File(pemFile), Charsets.UTF_8);\n\n // Provide the validator information to let the nodes to auto-register themselves\n // in the Chef server during bootstrap\n String validator = organization + \"-validator\";\n String validatorPemFile = System.getProperty(\"user.home\") + \"/.chef/\" + validator + \".pem\";\n String validatorCredential = Files.toString(new File(validatorPemFile), Charsets.UTF_8);\n\n Properties chefConfig = new Properties();\n chefConfig.put(ChefProperties.CHEF_VALIDATOR_NAME, validator);\n chefConfig.put(ChefProperties.CHEF_VALIDATOR_CREDENTIAL, validatorCredential);\n\n // Create the connection to the Chef server\n ChefApi chefApi = ContextBuilder.newBuilder(new ChefApiMetadata())\n .endpoint(\"https://api.opscode.com/organizations/\" + organization)\n .credentials(client, credential)\n .overrides(chefConfig)\n .buildApi(ChefApi.class);\n\n // Create the connection to the compute provider. Note that ssh will be used to bootstrap chef\n ComputeServiceContext computeContext = ContextBuilder.newBuilder(rsContinent)\n .endpoint(rsRegion)\n .credentials(rsUser, rsApiKey)\n .modules(ImmutableSet.<Module> of(new SshjSshClientModule()))\n .buildView(ComputeServiceContext.class);\n\n // Group all nodes in both Chef and the compute provider by this group\n String group = \"jclouds-chef-goraci\";\n\n // Set the recipe to install and the configuration values to override\n String recipe = \"apache2\";\n JsonBall attributes = new JsonBall(\"{\\\"apache\\\": {\\\"listen_ports\\\": \\\"8080\\\"}}\");\n\n // Check to see if the recipe you want exists\n List<String> runlist = null;\n Iterable< ? extends CookbookVersion> cookbookVersions =\n chefApi.chefService().listCookbookVersions();\n if (any(cookbookVersions, CookbookVersionPredicates.containsRecipe(recipe))) {\n runlist = new RunListBuilder().addRecipe(recipe).build();\n }\n for (Iterator<String> iterator = runlist.iterator(); iterator.hasNext();) {\n String string = (String) iterator.next();\n LOG.info(string);\n }\n\n // Update the chef service with the run list you wish to apply to all nodes in the group\n // and also provide the json configuration used to customize the desired values\n BootstrapConfig config = BootstrapConfig.builder().runList(runlist).attributes(attributes).build();\n chefApi.chefService().updateBootstrapConfigForGroup(group, config);\n\n // Build the script that will bootstrap the node\n Statement bootstrap = chefApi.chefService().createBootstrapScriptForGroup(group);\n\n TemplateBuilder templateBuilder = computeContext.getComputeService().templateBuilder();\n templateBuilder.options(runScript(bootstrap));\n // Run a node on the compute provider that bootstraps chef\n try {\n Set< ? extends NodeMetadata> nodes =\n computeContext.getComputeService().createNodesInGroup(group, 1, templateBuilder.build());\n for (NodeMetadata nodeMetadata : nodes) {\n LOG.info(\"<< node %s: %s%n\", nodeMetadata.getId(),\n concat(nodeMetadata.getPrivateAddresses(), nodeMetadata.getPublicAddresses()));\n }\n } catch (RunNodesException e) {\n throw new RuntimeException(e.getMessage());\n }\n\n // Release resources\n chefApi.close();\n computeContext.close();\n\n }", "void createComputeInstance(\n String accessKey, String secretKey, LaunchSpecifications launchSpecifications) throws CloudExceptions;", "public static void main(String[] args) throws Exception {\n InputStream clientCert = new FileInputStream(System.getenv(\"TEMPORAL_CLIENT_CERT\"));\n // PKCS8 client key, which should look like:\n // -----BEGIN PRIVATE KEY-----\n // ...\n // -----END PRIVATE KEY-----\n InputStream clientKey = new FileInputStream(System.getenv(\"TEMPORAL_CLIENT_KEY\"));\n // For temporal cloud this would likely be ${namespace}.tmprl.cloud:7233\n String targetEndpoint = System.getenv(\"TEMPORAL_ENDPOINT\");\n // Your registered namespace.\n String namespace = System.getenv(\"TEMPORAL_NAMESPACE\");\n // Create SSL enabled client by passing SslContext, created by SimpleSslContextBuilder.\n WorkflowServiceStubs service =\n WorkflowServiceStubs.newServiceStubs(\n WorkflowServiceStubsOptions.newBuilder()\n .setSslContext(SimpleSslContextBuilder.forPKCS8(clientCert, clientKey).build())\n .setTarget(targetEndpoint)\n .build());\n\n // Now setup and start workflow worker, which uses SSL enabled gRPC service to communicate with\n // backend.\n // client that can be used to start and signal workflows.\n WorkflowClient client =\n WorkflowClient.newInstance(\n service, WorkflowClientOptions.newBuilder().setNamespace(namespace).build());\n // worker factory that can be used to create workers for specific task queues\n WorkerFactory factory = WorkerFactory.newInstance(client);\n // Worker that listens on a task queue and hosts both workflow and activity implementations.\n factory.newWorker(TASK_QUEUE);\n // TODO now register your workflow types and activity implementations.\n // worker.registerWorkflowImplementationTypes(...);\n // worker.registerActivitiesImplementations(...);\n factory.start();\n }", "static ActorSystemInfo createActorSystem(Map<String, String> conf) throws IOException {\n int akkaThreads = toInt(conf.get(\"spark.akka.threads\"), 4);\n int akkaBatchSize = toInt(conf.get(\"spark.akka.batchSize\"), 15);\n int akkaTimeout = toInt(conf.get(\"spark.akka.timeout\"), 100);\n int akkaFrameSize = toInt(conf.get(\"spark.akka.frameSize\"), 10) * 1024 * 1024;\n String lifecycleEvents = toBoolean(conf.get(\"spark.akka.logLifecycleEvents\")) ? \"on\" : \"off\";\n String logAkkaConfig = toBoolean(conf.get(\"spark.akka.logAkkaConfig\")) ? \"on\" : \"off\";\n\n int akkaHeartBeatPauses = toInt(conf.get(\"spark.akka.heartbeat.pauses\"), 600);\n double akkaFailureDetector =\n toDouble(conf.get(\"spark.akka.failure-detector.threshold\"), 300.0);\n int akkaHeartBeatInterval = toInt(conf.get(\"spark.akka.heartbeat.interval\"), 1000);\n String akkaSerializer = Optional.fromNullable(conf.get(CONF_KEY_SERIALIZER)).or(\"java\");\n\n String host = findLocalIpAddress();\n String secret = conf.get(CONF_KEY_SECRET);\n Preconditions.checkArgument(secret != null, \"%s not set.\", CONF_KEY_SECRET);\n\n Map<String, String> sparkConf = Maps.newHashMap();\n for (Map.Entry<String, String> e : sparkConf.entrySet()) {\n if (e.getKey().startsWith(\"akka.\")) {\n sparkConf.put(e.getKey(), e.getValue());\n }\n }\n\n Config fallback = ConfigFactory.parseString(\"\"\n + \"akka.daemonic = on\\n\"\n + \"akka.loggers = [ \\\"akka.event.slf4j.Slf4jLogger\\\" ]\\n\"\n + \"akka.stdout-loglevel = \\\"ERROR\\\"\\n\"\n + \"akka.jvm-exit-on-fatal-error = off\\n\"\n + \"akka.actor.default-dispatcher.throughput = \" + akkaBatchSize + \"\\n\"\n + \"akka.actor.serializers.java = \\\"akka.serialization.JavaSerializer\\\"\\n\"\n + \"akka.actor.serializers.kryo = \\\"com.twitter.chill.akka.AkkaSerializer\\\"\\n\"\n + String.format(\n \"akka.actor.serialization-bindings = { \\\"java.io.Serializable\\\" = \\\"%s\\\" }\\n\",\n akkaSerializer)\n + \"akka.log-config-on-start = \" + logAkkaConfig + \"\\n\"\n + \"akka.log-dead-letters = \" + lifecycleEvents + \"\\n\"\n + \"akka.log-dead-letters-during-shutdown = \" + lifecycleEvents + \"\\n\"\n + \"akka.actor.provider = \\\"akka.remote.RemoteActorRefProvider\\\"\\n\"\n + \"akka.remote.log-remote-lifecycle-events = \" + lifecycleEvents + \"\\n\"\n + String.format(\"akka.remote.netty.tcp.connection-timeout = %d s\\n\", akkaTimeout)\n + \"akka.remote.netty.tcp.execution-pool-size = \" + akkaThreads + \"\\n\"\n + \"akka.remote.netty.tcp.hostname = \\\"\" + host + \"\\\"\\n\"\n + String.format(\"akka.remote.netty.tcp.maximum-frame-size = %d B\\n\", akkaFrameSize)\n + \"akka.remote.netty.tcp.port = 0\\n\"\n + \"akka.remote.netty.tcp.tcp-nodelay = on\\n\"\n + \"akka.remote.netty.tcp.transport-class = \\\"akka.remote.transport.netty.NettyTransport\\\"\\n\"\n + \"akka.remote.require-cookie = on\\n\"\n + \"akka.remote.secure-cookie = \\\"\" + secret + \"\\\"\\n\"\n + String.format(\n \"akka.remote.transport-failure-detector.acceptable-heartbeat-pause = %d s\\n\",\n akkaHeartBeatPauses)\n + String.format(\n \"akka.remote.transport-failure-detector.heartbeat-interval = %d s\\n\",\n akkaHeartBeatInterval)\n + \"akka.remote.transport-failure-detector.threshold = \" +\n String.valueOf(akkaFailureDetector) + \"\\n\");\n\n String name = randomName();\n Config akkaConf = ConfigFactory.parseMap(sparkConf).withFallback(fallback);\n ActorSystem actorSystem = ActorSystem.create(name, akkaConf);\n ExtendedActorSystem extActorSystem = (ExtendedActorSystem) actorSystem;\n int boundPort =\n ((Integer)extActorSystem.provider().getDefaultAddress().port().get()).intValue();\n return new ActorSystemInfo(actorSystem,\n String.format(\"akka.tcp://%s@%s:%d/user\", name, host, boundPort));\n }", "Cloud createCloud();", "public Cluster startCluster() throws Exception\n {\n createCluster();\n cluster.start();\n cluster.awaitLeader();\n return cluster;\n }", "Cluster getRuntimeCluster() throws TimeoutException, InterruptedException;", "public void init() throws Exception {\n if (\"local\".equalsIgnoreCase(cluster.provisioningMethod)) {\n zookeeper = new LocalZookeeper();\n int initValue = zookeeper.start();\n if (initValue != 0) {\n log.error(\"Failed to start Zookeeper!\");\n throw new RuntimeException(\"Failed to start Zookeeper!\");\n }\n\n ExecutorService executor = Executors.newFixedThreadPool(1, new ThreadFactoryBuilder().setNameFormat(\"nodestarter-threadpool\").build()); \n \t\t //Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()/2+1, new ThreadFactoryBuilder().setNameFormat(\"nodestarter-threadpool\").build()); \n\n int basePort = Util.getFreePort(cluster.numSolrNodes);\n\n for (int i = 1; i <= cluster.numSolrNodes; i++) {\n \t int nodeIndex = i;\n \t Callable c = () -> {\n \t\t SolrNode node = new LocalSolrNode(solrPackagePath, nodeIndex, String.valueOf(basePort + nodeIndex - 1), cluster.startupParams, cluster.startupParamsOverrides, zookeeper);\n \t\t \n \t\t try {\n\t \t\t node.init();\n\t \t\t node.start();\n\t \t\t nodes.add(node);\n\t \t\t \n\t \t\t log.info(\"Nodes started: \"+nodes.size());\n\t \t\t \n\t \t\t //try (HttpSolrClient client = new HttpSolrClient.Builder(node.getBaseUrl()).build();) {\n\t \t\t\t //log.info(\"Health check: \"+ new HealthCheckRequest().process(client) + \", Nodes started: \"+nodes.size());\n\t \t\t //} catch (Exception ex) {\n\t \t\t\t// log.error(\"Problem starting node: \"+node.getBaseUrl());\n\t \t\t\t //throw new RuntimeException(\"Problem starting node: \"+node.getBaseUrl());\n\t \t\t //}\n\t \t\t return node;\n \t\t } catch (Exception ex) {\n \t\t\t ex.printStackTrace();\n \t\t\t log.error(\"Problem starting node: \"+node.getBaseUrl());\n \t\t\t return null;\n \t\t }\n \t };\n \t executor.submit(c);\n }\n \n executor.shutdown();\n executor.awaitTermination(1, TimeUnit.HOURS);\n\n log.info(\"Looking for healthy nodes...\");\n List<SolrNode> healthyNodes = new ArrayList<>();\n for (SolrNode node: nodes) {\n \t\ttry (HttpSolrClient client = new HttpSolrClient.Builder(node.getBaseUrl().substring(0, node.getBaseUrl().length()-1)).build();) {\n \t\t\tHealthCheckRequest req = new HealthCheckRequest();\n \t\t\tHealthCheckResponse rsp;\n \t\t\ttry {\n \t\t\t\trsp = req.process(client);\n \t\t\t} catch (Exception ex) {\n \t\t\t\tThread.sleep(100);\n \t\t\t\trsp = req.process(client);\n \t\t\t}\n \t\t\tif (rsp.getNodeStatus().equalsIgnoreCase(\"ok\") == false) {\n \t\t\t\tlog.error(\"Couldn't start node: \"+node.getBaseUrl());\n \t\t\t\tthrow new RuntimeException(\"Couldn't start node: \"+node.getBaseUrl());\n \t\t\t} else {\n \t\t\t\thealthyNodes.add(node);\n \t\t\t}\n \t\t} catch (Exception ex) {\n \t\t\tex.printStackTrace();\n \t\t\tlog.error(\"Problem starting node: \"+node.getBaseUrl());\n \t\t}\n }\n \n this.nodes = healthyNodes;\n log.info(\"Healthy nodes: \"+healthyNodes.size());\n \n try (CloudSolrClient client = new CloudSolrClient.Builder().withZkHost(getZookeeperUrl()).build();) {\n\t log.info(\"Cluster state: \" + client.getClusterStateProvider().getClusterState());\n\t log.info(\"Overseer: \" + client.request(new OverseerStatus()));\n }\n\n \n } else if (\"terraform-gcp\".equalsIgnoreCase(cluster.provisioningMethod)) {\n \tSystem.out.println(\"Solr nodes: \"+getSolrNodesFromTFState());\n \tSystem.out.println(\"ZK node: \"+getZkNodeFromTFState());\n \tzookeeper = new GenericZookeeper(getZkNodeFromTFState());\n \tfor (String host: getSolrNodesFromTFState()) {\n \t\tnodes.add(new GenericSolrNode(host, cluster.terraformGCPConfig.get(\"user\").toString()));\n \t}\n } else if (\"vagrant\".equalsIgnoreCase(cluster.provisioningMethod)) {\n \tSystem.out.println(\"Solr nodes: \"+getSolrNodesFromVagrant());\n \tSystem.out.println(\"ZK node: \"+getZkNodeFromVagrant());\n \tzookeeper = new GenericZookeeper(getZkNodeFromVagrant());\n \tfor (String host: getSolrNodesFromVagrant()) {\n \t\tnodes.add(new GenericSolrNode(host, null)); // TODO fix username for vagrant\n \t}\n } else if (\"external\".equalsIgnoreCase(cluster.provisioningMethod)) {\n log.info(\"ZK node: \" + cluster.externalSolrConfig.zkHost);\n String[] tokens = cluster.externalSolrConfig.zkHost.split(\":\");\n zookeeper = new GenericZookeeper(tokens[0], tokens.length > 1 ? Integer.parseInt(tokens[1]) : null, cluster.externalSolrConfig.zkAdminPort, cluster.externalSolrConfig.zkChroot);\n\n try (CloudSolrClient client = new CloudSolrClient.Builder().withZkHost(cluster.externalSolrConfig.zkHost).withZkChroot(cluster.externalSolrConfig.zkChroot).build()) {\n for (String liveNode : client.getClusterStateProvider().getLiveNodes()) {\n nodes.add(new ExternalSolrNode(\n liveNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(liveNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript));\n }\n List<SolrNode> dataNodes = getExternalDataNodes(client).stream().map(dataNode -> new ExternalSolrNode(\n dataNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(dataNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!dataNodes.isEmpty()) {\n nodesByRole.put(NodeRole.DATA, dataNodes);\n }\n List<SolrNode> queryNodes = getExternalQueryNodes(client).stream().map(queryNode -> new ExternalSolrNode(\n queryNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(queryNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!queryNodes.isEmpty()) {\n nodesByRole.put(NodeRole.COORDINATOR, queryNodes);\n }\n List<SolrNode> overseerNodes = getExternalPreferredOverseerNodes(client).stream().map(overseerNode -> new ExternalSolrNode(\n overseerNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(overseerNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!queryNodes.isEmpty()) {\n nodesByRole.put(NodeRole.OVERSEER, overseerNodes);\n }\n }\n log.info(\"Cluster initialized with nodes: \" + nodes + \", zkHost: \" + zookeeper + \", nodes by role: \" + nodesByRole);\n }\n\n\n }", "public static void setupV1Crds(KubeClusterResource cluster) {\n cluster.replaceCustomResources(CRD_V1_KAFKA);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT_S2I);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER_2);\n cluster.replaceCustomResources(CRD_V1_KAFKA_BRIDGE);\n cluster.replaceCustomResources(CRD_V1_TOPIC);\n cluster.replaceCustomResources(CRD_V1_KAFKA_USER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECTOR);\n cluster.replaceCustomResources(CRD_V1_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "@Bean\n\tRiakCluster riakCluster() throws UnknownHostException {\n RiakNode node = new RiakNode.Builder()\n .withRemoteAddress(\"127.0.0.1\")\n .withRemotePort(8087)\n .build();\n // you could also have multiple nodes, see riakCluster\n RiakCluster cluster = new RiakCluster.Builder(node)\n .build();\n\n cluster.start();\n\n return cluster;\n }", "private static void spawnInstance(){\n\t\tString instanceType = null;\n\t\tString imageId = null; \n\t\tint numInstances = 0;\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Name of key to use?\");\n\t\tkeyname = in.next();\n\t\t\n\t\tSystem.out.println(\"Instance type? (use d for default: t2.micro)\");\n\t\tinstanceType = in.next();\n\t\t\n\t\tif(instanceType.equals(\"d\")){\n\t\t\tinstanceType = INSTANCE_TYPE;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Image id? (use d for default: ami-b5a7ea85, Amazon Linux AMI)\");\n\t\timageId = in.next();\n\t\t\n\t\tif(imageId.equals(\"d\")){\n\t\t\timageId = IMAGE_ID; \n\t\t}\n\t\t\n\t\tSystem.out.println(\"Number of instances?\");\n\t\tnumInstances = in.nextInt();\n\n\t\tin.close();\n\t\n\t\tRunInstancesRequest req = new RunInstancesRequest();\n\t\t\n\t String group = GROUP;\n\t \n\t req.withImageId(imageId)\n\t .withInstanceType(instanceType)\n\t .withMinCount(numInstances)\n\t .withMaxCount(numInstances)\n\t .withKeyName(keyname)\n\t .withSecurityGroups(group);\n\t \n\t RunInstancesResult reqRes = ec2.runInstances(req);\n\t Reservation res = reqRes.getReservation();\n\t System.out.println(\"Reservation number is \" + res.getReservationId());\n\t try {\n \t\tSystem.out.println(\"Just a moment while the instance is spun up...\");\n\t\t\tTimeUnit.SECONDS.sleep(10);\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.out.println(\"Instantiation failed!\");\n\t\t}\n \t\tString ip = listLiveInstances();\n \t\tSystem.out.println(\"\");\n \t\tSystem.out.println(\"Connect with 'ssh -i \" + keyname + \".pem ec2-user@\" + ip +\"'\");\n \t\tSystem.out.println(\"If connection fails, run with -l option and check status.\");\n \t\tSystem.exit(0);\n\t}", "private JsonObject callSpark(JsonObject o, String coords) {\n\t\t\r\n\t\tlong startTime = System.currentTimeMillis();\r\n\t\t\r\n\t\tString sparkMasterIp = context.getInitParameter(\"sparkMasterIp\");\r\n\t\tString cassandraIp = context.getInitParameter(\"cassandraIp\");\r\n\t\t\r\n\t\tString url = \"http://\"+sparkMasterIp+\":6066/v1/submissions/create\";\r\n\r\n\t\tString payload = \"{\"+\"\\\"action\\\" : \\\"CreateSubmissionRequest\\\",\"+\r\n \"\\\"appArgs\\\" : [ \\\"\"+coords+\"\\\", \\\"1\\\" ],\"+\r\n \"\\\"appResource\\\" : \\\"file:/job-dependencies/CVSTSparkJobEngine-0.0.1-SNAPSHOT.jar\\\",\"+\r\n \"\\\"clientSparkVersion\\\" : \\\"1.3.0\\\",\"+\r\n \"\\\"environmentVariables\\\" : {\"+\r\n \"\\\"SPARK_ENV_LOADED\\\" : \\\"1\\\"\"+\r\n \"},\"+\r\n \"\\\"mainClass\\\" : \\\"ca.yorku.ceras.cvstsparkjobengine.job.LegisJob\\\",\"+\r\n \"\\\"sparkProperties\\\" : {\"+\r\n\t\"\\\"spark.jars\\\" : \\\"file:/job-dependencies/CVSTSparkJobEngine-0.0.1-SNAPSHOT.jar\\\",\"+\r\n \"\\\"spark.driver.extraClassPath\\\" : \\\"file:/job-dependencies/RoaringBitmap-0.4.5.jar:file:/job-dependencies/activation-1.1.jar:file:/job-dependencies/akka-actor_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/akka-remote_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/akka-slf4j_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/apacheds-i18n-2.0.0-M15.jar:file:/job-dependencies/apacheds-kerberos-codec-2.0.0-M15.jar:file:/job-dependencies/api-asn1-api-1.0.0-M20.jar:file:/job-dependencies/api-util-1.0.0-M20.jar:file:/job-dependencies/asm-3.1.jar:file:/job-dependencies/asm-5.0.3.jar:file:/job-dependencies/asm-analysis-5.0.3.jar:file:/job-dependencies/asm-commons-5.0.3.jar:file:/job-dependencies/asm-tree-5.0.3.jar:file:/job-dependencies/asm-util-5.0.3.jar:file:/job-dependencies/avro-1.7.6-cdh5.3.0.jar:file:/job-dependencies/aws-java-sdk-1.7.14.jar:file:/job-dependencies/cassandra-clientutil-2.1.5.jar:file:/job-dependencies/cassandra-driver-core-2.1.10.jar:file:/job-dependencies/chill-java-0.5.0.jar:file:/job-dependencies/chill_2.10-0.5.0.jar:file:/job-dependencies/commons-beanutils-1.7.0.jar:file:/job-dependencies/commons-beanutils-core-1.8.0.jar:file:/job-dependencies/commons-cli-1.2.jar:file:/job-dependencies/commons-codec-1.7.jar:file:/job-dependencies/commons-collections-3.2.1.jar:file:/job-dependencies/commons-compress-1.4.1.jar:file:/job-dependencies/commons-configuration-1.6.jar:file:/job-dependencies/commons-daemon-1.0.13.jar:file:/job-dependencies/commons-digester-1.8.jar:file:/job-dependencies/commons-el-1.0.jar:file:/job-dependencies/commons-httpclient-3.1.jar:file:/job-dependencies/commons-io-2.4.jar:file:/job-dependencies/commons-lang-2.6.jar:file:/job-dependencies/commons-lang3-3.3.2.jar:file:/job-dependencies/commons-logging-1.1.1.jar:file:/job-dependencies/commons-math-2.1.jar:file:/job-dependencies/commons-math3-3.2.jar:file:/job-dependencies/commons-net-2.2.jar:file:/job-dependencies/compress-lzf-1.0.0.jar:file:/job-dependencies/config-1.0.2.jar:file:/job-dependencies/core-3.1.1.jar:file:/job-dependencies/curator-client-2.6.0.jar:file:/job-dependencies/curator-framework-2.4.0.jar:file:/job-dependencies/curator-recipes-2.4.0.jar:file:/job-dependencies/findbugs-annotations-1.3.9-1.jar:file:/job-dependencies/gson-2.4.jar:file:/job-dependencies/guava-16.0.1.jar:file:/job-dependencies/hadoop-annotations-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-auth-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-aws-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-client-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-common-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-core-2.5.0-mr1-cdh5.3.0.jar:file:/job-dependencies/hadoop-hdfs-2.5.0-cdh5.3.0-tests.jar:file:/job-dependencies/hadoop-hdfs-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-mapreduce-client-app-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-core-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-jobclient-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-shuffle-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-api-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-client-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-server-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hamcrest-core-1.3.jar:file:/job-dependencies/hbase-client-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-common-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-common-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-hadoop-compat-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-hadoop-compat-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-hadoop2-compat-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-hadoop2-compat-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-prefix-tree-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-protocol-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-server-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-server-0.98.6-cdh5.3.0.jar:file:/job-dependencies/high-scale-lib-1.1.1.jar:file:/job-dependencies/hsqldb-1.8.0.10.jar:file:/job-dependencies/htrace-core-2.04.jar:file:/job-dependencies/httpclient-4.1.2.jar:file:/job-dependencies/httpcore-4.1.2.jar:file:/job-dependencies/ivy-2.4.0.jar:file:/job-dependencies/jackson-annotations-2.2.3.jar:file:/job-dependencies/jackson-core-2.2.3.jar:file:/job-dependencies/jackson-core-asl-1.8.8.jar:file:/job-dependencies/jackson-databind-2.2.3.jar:file:/job-dependencies/jackson-jaxrs-1.8.8.jar:file:/job-dependencies/jackson-mapper-asl-1.8.8.jar:file:/job-dependencies/jackson-module-scala_2.10-2.2.3.jar:file:/job-dependencies/jackson-xc-1.7.1.jar:file:/job-dependencies/jamon-runtime-2.3.1.jar:file:/job-dependencies/jasper-compiler-5.5.23.jar:file:/job-dependencies/jasper-runtime-5.5.23.jar:file:/job-dependencies/java-xmlbuilder-0.4.jar:file:/job-dependencies/javax.servlet-3.0.0.v201112011016.jar:file:/job-dependencies/jaxb-api-2.1.jar:file:/job-dependencies/jaxb-impl-2.2.3-1.jar:file:/job-dependencies/jcl-over-slf4j-1.7.5.jar:file:/job-dependencies/jersey-client-1.9.jar:file:/job-dependencies/jersey-core-1.8.jar:file:/job-dependencies/jersey-json-1.8.jar:file:/job-dependencies/jersey-server-1.8.jar:file:/job-dependencies/jets3t-0.9.0.jar:file:/job-dependencies/jettison-1.1.jar:file:/job-dependencies/jetty-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-continuation-8.1.14.v20131031.jar:file:/job-dependencies/jetty-http-8.1.14.v20131031.jar:file:/job-dependencies/jetty-io-8.1.14.v20131031.jar:file:/job-dependencies/jetty-server-8.1.14.v20131031.jar:file:/job-dependencies/jetty-sslengine-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-util-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-util-8.1.14.v20131031.jar:file:/job-dependencies/jffi-1.2.10-native.jar:file:/job-dependencies/jffi-1.2.10.jar:file:/job-dependencies/jnr-constants-0.9.0.jar:file:/job-dependencies/jnr-ffi-2.0.7.jar:file:/job-dependencies/jnr-posix-3.0.27.jar:file:/job-dependencies/jnr-x86asm-1.0.2.jar:file:/job-dependencies/joda-convert-1.2.jar:file:/job-dependencies/joda-time-2.3.jar:file:/job-dependencies/jodd-core-3.6.3.jar:file:/job-dependencies/jsch-0.1.42.jar:file:/job-dependencies/json4s-ast_2.10-3.2.10.jar:file:/job-dependencies/json4s-core_2.10-3.2.10.jar:file:/job-dependencies/json4s-jackson_2.10-3.2.10.jar:file:/job-dependencies/jsp-2.1-6.1.14.jar:file:/job-dependencies/jsp-api-2.1-6.1.14.jar:file:/job-dependencies/jsp-api-2.1.jar:file:/job-dependencies/jsr166e-1.1.0.jar:file:/job-dependencies/jsr305-1.3.9.jar:file:/job-dependencies/jul-to-slf4j-1.7.5.jar:file:/job-dependencies/junit-4.11.jar:file:/job-dependencies/kryo-2.21.jar:file:/job-dependencies/leveldbjni-all-1.8.jar:file:/job-dependencies/log4j-1.2.17.jar:file:/job-dependencies/lz4-1.2.0.jar:file:/job-dependencies/mesos-0.21.0-shaded-protobuf.jar:file:/job-dependencies/metrics-core-2.2.0.jar:file:/job-dependencies/metrics-core-3.0.2.jar:file:/job-dependencies/metrics-core-3.1.0.jar:file:/job-dependencies/metrics-graphite-3.1.0.jar:file:/job-dependencies/metrics-json-3.1.0.jar:file:/job-dependencies/metrics-jvm-3.1.0.jar:file:/job-dependencies/minlog-1.2.jar:file:/job-dependencies/netty-3.9.0.Final.jar:file:/job-dependencies/netty-all-4.0.23.Final.jar:file:/job-dependencies/netty-buffer-4.0.33.Final.jar:file:/job-dependencies/netty-codec-4.0.33.Final.jar:file:/job-dependencies/netty-common-4.0.33.Final.jar:file:/job-dependencies/netty-handler-4.0.33.Final.jar:file:/job-dependencies/netty-transport-4.0.33.Final.jar:file:/job-dependencies/objenesis-1.2.jar:file:/job-dependencies/oro-2.0.8.jar:file:/job-dependencies/paranamer-2.3.jar:file:/job-dependencies/parquet-column-1.6.0rc3.jar:file:/job-dependencies/parquet-common-1.6.0rc3.jar:file:/job-dependencies/parquet-encoding-1.6.0rc3.jar:file:/job-dependencies/parquet-format-2.2.0-rc1.jar:file:/job-dependencies/parquet-generator-1.6.0rc3.jar:file:/job-dependencies/parquet-hadoop-1.6.0rc3.jar:file:/job-dependencies/parquet-jackson-1.6.0rc3.jar:file:/job-dependencies/protobuf-java-2.4.1-shaded.jar:file:/job-dependencies/protobuf-java-2.5.0.jar:file:/job-dependencies/py4j-0.8.2.1.jar:file:/job-dependencies/pyrolite-2.0.1.jar:file:/job-dependencies/quasiquotes_2.10-2.0.1.jar:file:/job-dependencies/reflectasm-1.07-shaded.jar:file:/job-dependencies/scala-compiler-2.10.4.jar:file:/job-dependencies/scala-library-2.10.4.jar:file:/job-dependencies/scala-reflect-2.10.5.jar:file:/job-dependencies/scalap-2.10.0.jar:file:/job-dependencies/scalatest_2.10-2.1.5.jar:file:/job-dependencies/servlet-api-2.5-6.1.14.jar:file:/job-dependencies/servlet-api-2.5.jar:file:/job-dependencies/slf4j-api-1.7.5.jar:file:/job-dependencies/slf4j-log4j12-1.7.5.jar:file:/job-dependencies/snappy-java-1.0.4.1.jar:file:/job-dependencies/spark-cassandra-connector-java_2.10-1.3.1.jar:file:/job-dependencies/spark-cassandra-connector_2.10-1.3.1.jar:file:/job-dependencies/spark-catalyst_2.10-1.3.0.jar:file:/job-dependencies/spark-core_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-hbase-0.0.2-clabs.jar:file:/job-dependencies/spark-network-common_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-network-shuffle_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-sql_2.10-1.3.0.jar:file:/job-dependencies/spark-streaming_2.10-1.2.0-cdh5.3.0-tests.jar:file:/job-dependencies/spark-streaming_2.10-1.2.0-cdh5.3.0.jar:file:/job-dependencies/stream-2.7.0.jar:file:/job-dependencies/tachyon-0.5.0.jar:file:/job-dependencies/tachyon-client-0.5.0.jar:file:/job-dependencies/uncommons-maths-1.2.2a.jar:file:/job-dependencies/unused-1.0.0.jar:file:/job-dependencies/xmlenc-0.52.jar:file:/job-dependencies/xz-1.0.jar:file:/job-dependencies/zookeeper-3.4.5-cdh5.3.0.jar\\\",\"+\r\n\t\"\\\"spark.executor.extraClassPath\\\" : \\\"file:/job-dependencies/RoaringBitmap-0.4.5.jar:file:/job-dependencies/activation-1.1.jar:file:/job-dependencies/akka-actor_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/akka-remote_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/akka-slf4j_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/apacheds-i18n-2.0.0-M15.jar:file:/job-dependencies/apacheds-kerberos-codec-2.0.0-M15.jar:file:/job-dependencies/api-asn1-api-1.0.0-M20.jar:file:/job-dependencies/api-util-1.0.0-M20.jar:file:/job-dependencies/asm-3.1.jar:file:/job-dependencies/asm-5.0.3.jar:file:/job-dependencies/asm-analysis-5.0.3.jar:file:/job-dependencies/asm-commons-5.0.3.jar:file:/job-dependencies/asm-tree-5.0.3.jar:file:/job-dependencies/asm-util-5.0.3.jar:file:/job-dependencies/avro-1.7.6-cdh5.3.0.jar:file:/job-dependencies/aws-java-sdk-1.7.14.jar:file:/job-dependencies/cassandra-clientutil-2.1.5.jar:file:/job-dependencies/cassandra-driver-core-2.1.10.jar:file:/job-dependencies/chill-java-0.5.0.jar:file:/job-dependencies/chill_2.10-0.5.0.jar:file:/job-dependencies/commons-beanutils-1.7.0.jar:file:/job-dependencies/commons-beanutils-core-1.8.0.jar:file:/job-dependencies/commons-cli-1.2.jar:file:/job-dependencies/commons-codec-1.7.jar:file:/job-dependencies/commons-collections-3.2.1.jar:file:/job-dependencies/commons-compress-1.4.1.jar:file:/job-dependencies/commons-configuration-1.6.jar:file:/job-dependencies/commons-daemon-1.0.13.jar:file:/job-dependencies/commons-digester-1.8.jar:file:/job-dependencies/commons-el-1.0.jar:file:/job-dependencies/commons-httpclient-3.1.jar:file:/job-dependencies/commons-io-2.4.jar:file:/job-dependencies/commons-lang-2.6.jar:file:/job-dependencies/commons-lang3-3.3.2.jar:file:/job-dependencies/commons-logging-1.1.1.jar:file:/job-dependencies/commons-math-2.1.jar:file:/job-dependencies/commons-math3-3.2.jar:file:/job-dependencies/commons-net-2.2.jar:file:/job-dependencies/compress-lzf-1.0.0.jar:file:/job-dependencies/config-1.0.2.jar:file:/job-dependencies/core-3.1.1.jar:file:/job-dependencies/curator-client-2.6.0.jar:file:/job-dependencies/curator-framework-2.4.0.jar:file:/job-dependencies/curator-recipes-2.4.0.jar:file:/job-dependencies/findbugs-annotations-1.3.9-1.jar:file:/job-dependencies/gson-2.4.jar:file:/job-dependencies/guava-16.0.1.jar:file:/job-dependencies/hadoop-annotations-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-auth-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-aws-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-client-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-common-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-core-2.5.0-mr1-cdh5.3.0.jar:file:/job-dependencies/hadoop-hdfs-2.5.0-cdh5.3.0-tests.jar:file:/job-dependencies/hadoop-hdfs-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-mapreduce-client-app-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-core-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-jobclient-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-shuffle-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-api-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-client-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-server-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hamcrest-core-1.3.jar:file:/job-dependencies/hbase-client-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-common-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-common-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-hadoop-compat-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-hadoop-compat-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-hadoop2-compat-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-hadoop2-compat-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-prefix-tree-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-protocol-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-server-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-server-0.98.6-cdh5.3.0.jar:file:/job-dependencies/high-scale-lib-1.1.1.jar:file:/job-dependencies/hsqldb-1.8.0.10.jar:file:/job-dependencies/htrace-core-2.04.jar:file:/job-dependencies/httpclient-4.1.2.jar:file:/job-dependencies/httpcore-4.1.2.jar:file:/job-dependencies/ivy-2.4.0.jar:file:/job-dependencies/jackson-annotations-2.2.3.jar:file:/job-dependencies/jackson-core-2.2.3.jar:file:/job-dependencies/jackson-core-asl-1.8.8.jar:file:/job-dependencies/jackson-databind-2.2.3.jar:file:/job-dependencies/jackson-jaxrs-1.8.8.jar:file:/job-dependencies/jackson-mapper-asl-1.8.8.jar:file:/job-dependencies/jackson-module-scala_2.10-2.2.3.jar:file:/job-dependencies/jackson-xc-1.7.1.jar:file:/job-dependencies/jamon-runtime-2.3.1.jar:file:/job-dependencies/jasper-compiler-5.5.23.jar:file:/job-dependencies/jasper-runtime-5.5.23.jar:file:/job-dependencies/java-xmlbuilder-0.4.jar:file:/job-dependencies/javax.servlet-3.0.0.v201112011016.jar:file:/job-dependencies/jaxb-api-2.1.jar:file:/job-dependencies/jaxb-impl-2.2.3-1.jar:file:/job-dependencies/jcl-over-slf4j-1.7.5.jar:file:/job-dependencies/jersey-client-1.9.jar:file:/job-dependencies/jersey-core-1.8.jar:file:/job-dependencies/jersey-json-1.8.jar:file:/job-dependencies/jersey-server-1.8.jar:file:/job-dependencies/jets3t-0.9.0.jar:file:/job-dependencies/jettison-1.1.jar:file:/job-dependencies/jetty-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-continuation-8.1.14.v20131031.jar:file:/job-dependencies/jetty-http-8.1.14.v20131031.jar:file:/job-dependencies/jetty-io-8.1.14.v20131031.jar:file:/job-dependencies/jetty-server-8.1.14.v20131031.jar:file:/job-dependencies/jetty-sslengine-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-util-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-util-8.1.14.v20131031.jar:file:/job-dependencies/jffi-1.2.10-native.jar:file:/job-dependencies/jffi-1.2.10.jar:file:/job-dependencies/jnr-constants-0.9.0.jar:file:/job-dependencies/jnr-ffi-2.0.7.jar:file:/job-dependencies/jnr-posix-3.0.27.jar:file:/job-dependencies/jnr-x86asm-1.0.2.jar:file:/job-dependencies/joda-convert-1.2.jar:file:/job-dependencies/joda-time-2.3.jar:file:/job-dependencies/jodd-core-3.6.3.jar:file:/job-dependencies/jsch-0.1.42.jar:file:/job-dependencies/json4s-ast_2.10-3.2.10.jar:file:/job-dependencies/json4s-core_2.10-3.2.10.jar:file:/job-dependencies/json4s-jackson_2.10-3.2.10.jar:file:/job-dependencies/jsp-2.1-6.1.14.jar:file:/job-dependencies/jsp-api-2.1-6.1.14.jar:file:/job-dependencies/jsp-api-2.1.jar:file:/job-dependencies/jsr166e-1.1.0.jar:file:/job-dependencies/jsr305-1.3.9.jar:file:/job-dependencies/jul-to-slf4j-1.7.5.jar:file:/job-dependencies/junit-4.11.jar:file:/job-dependencies/kryo-2.21.jar:file:/job-dependencies/leveldbjni-all-1.8.jar:file:/job-dependencies/log4j-1.2.17.jar:file:/job-dependencies/lz4-1.2.0.jar:file:/job-dependencies/mesos-0.21.0-shaded-protobuf.jar:file:/job-dependencies/metrics-core-2.2.0.jar:file:/job-dependencies/metrics-core-3.0.2.jar:file:/job-dependencies/metrics-core-3.1.0.jar:file:/job-dependencies/metrics-graphite-3.1.0.jar:file:/job-dependencies/metrics-json-3.1.0.jar:file:/job-dependencies/metrics-jvm-3.1.0.jar:file:/job-dependencies/minlog-1.2.jar:file:/job-dependencies/netty-3.9.0.Final.jar:file:/job-dependencies/netty-all-4.0.23.Final.jar:file:/job-dependencies/netty-buffer-4.0.33.Final.jar:file:/job-dependencies/netty-codec-4.0.33.Final.jar:file:/job-dependencies/netty-common-4.0.33.Final.jar:file:/job-dependencies/netty-handler-4.0.33.Final.jar:file:/job-dependencies/netty-transport-4.0.33.Final.jar:file:/job-dependencies/objenesis-1.2.jar:file:/job-dependencies/oro-2.0.8.jar:file:/job-dependencies/paranamer-2.3.jar:file:/job-dependencies/parquet-column-1.6.0rc3.jar:file:/job-dependencies/parquet-common-1.6.0rc3.jar:file:/job-dependencies/parquet-encoding-1.6.0rc3.jar:file:/job-dependencies/parquet-format-2.2.0-rc1.jar:file:/job-dependencies/parquet-generator-1.6.0rc3.jar:file:/job-dependencies/parquet-hadoop-1.6.0rc3.jar:file:/job-dependencies/parquet-jackson-1.6.0rc3.jar:file:/job-dependencies/protobuf-java-2.4.1-shaded.jar:file:/job-dependencies/protobuf-java-2.5.0.jar:file:/job-dependencies/py4j-0.8.2.1.jar:file:/job-dependencies/pyrolite-2.0.1.jar:file:/job-dependencies/quasiquotes_2.10-2.0.1.jar:file:/job-dependencies/reflectasm-1.07-shaded.jar:file:/job-dependencies/scala-compiler-2.10.4.jar:file:/job-dependencies/scala-library-2.10.4.jar:file:/job-dependencies/scala-reflect-2.10.5.jar:file:/job-dependencies/scalap-2.10.0.jar:file:/job-dependencies/scalatest_2.10-2.1.5.jar:file:/job-dependencies/servlet-api-2.5-6.1.14.jar:file:/job-dependencies/servlet-api-2.5.jar:file:/job-dependencies/slf4j-api-1.7.5.jar:file:/job-dependencies/slf4j-log4j12-1.7.5.jar:file:/job-dependencies/snappy-java-1.0.4.1.jar:file:/job-dependencies/spark-cassandra-connector-java_2.10-1.3.1.jar:file:/job-dependencies/spark-cassandra-connector_2.10-1.3.1.jar:file:/job-dependencies/spark-catalyst_2.10-1.3.0.jar:file:/job-dependencies/spark-core_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-hbase-0.0.2-clabs.jar:file:/job-dependencies/spark-network-common_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-network-shuffle_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-sql_2.10-1.3.0.jar:file:/job-dependencies/spark-streaming_2.10-1.2.0-cdh5.3.0-tests.jar:file:/job-dependencies/spark-streaming_2.10-1.2.0-cdh5.3.0.jar:file:/job-dependencies/stream-2.7.0.jar:file:/job-dependencies/tachyon-0.5.0.jar:file:/job-dependencies/tachyon-client-0.5.0.jar:file:/job-dependencies/uncommons-maths-1.2.2a.jar:file:/job-dependencies/unused-1.0.0.jar:file:/job-dependencies/xmlenc-0.52.jar:file:/job-dependencies/xz-1.0.jar:file:/job-dependencies/zookeeper-3.4.5-cdh5.3.0.jar\\\",\"+\r\n \"\\\"spark.driver.supervise\\\" : \\\"false\\\",\"+\r\n \"\\\"spark.app.name\\\" : \\\"ca.yorku.ceras.cvstsparkjobengine.job.LegisJob\\\",\"+\r\n \"\\\"spark.eventLog.enabled\\\": \\\"false\\\",\"+\r\n \"\\\"spark.submit.deployMode\\\" : \\\"cluster\\\",\"+\r\n \"\\\"spark.master\\\" : \\\"spark://\"+sparkMasterIp+\":6066\\\",\"+\r\n\t\"\\\"spark.cassandra.connection.host\\\" : \\\"\"+cassandraIp+\"\\\",\"+\r\n \"\\\"spark.executor.cores\\\" : \\\"1\\\",\"+\r\n \"\\\"spark.cores.max\\\" : \\\"1\\\"\"+\r\n \"}\"+\r\n\"}'\";\r\n\t\t\r\n\t\tClient client = ClientBuilder.newClient();\r\n\t\tResponse response = client.target(url).request(MediaType.APPLICATION_JSON_TYPE).post(Entity.json(payload));\r\n\t\t\r\n\t\t// check response status code\r\n if (response.getStatus() != 200) {\r\n throw new RuntimeException(\"Failed : HTTP error code : \" + response.getStatus());\r\n }\r\n \r\n\t\tJsonReader reader = new JsonReader(new StringReader(response.readEntity(String.class)));\r\n\t\treader.setLenient(true);\r\n\t\tJsonObject jsonResponse = new JsonParser().parse(reader).getAsJsonObject();\r\n\t\t\r\n\t\tString submissionId = jsonResponse.get(\"submissionId\").getAsString();\r\n\t\t\r\n\t\turl = \"http://\"+sparkMasterIp+\":6066/v1/submissions/status/\" + submissionId;\r\n\t\t\r\n\t\tString status = \"\";\r\n\t\t\r\n\t\tint attempts = 0;\r\n\t\t\r\n\t\twhile (attempts < 600) {\t\t\t\r\n\t\t\tresponse = client.target(url).request(MediaType.APPLICATION_JSON_TYPE).get();\r\n\t\t\t\r\n\t\t\t// check response status code\r\n\t if (response.getStatus() != 200) {\r\n\t throw new RuntimeException(\"Failed : HTTP error code : \" + response.getStatus());\r\n\t }\r\n\t \r\n\t String result = response.readEntity(String.class);\r\n\t \r\n\t //System.out.println(\"RESULT: \" + result);\r\n\t \r\n\t if (result.contains(\"FINISHED\")) {\r\n\t \tstatus = \"FINISHED\";\r\n\t \tbreak;\r\n\t } else if (result.contains(\"FAILED\")) {\r\n\t \tstatus = \"FAILED\";\r\n\t \tbreak;\r\n\t }\r\n\t \r\n\t try {\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t \r\n\t attempts++;\r\n\t\t}\r\n\t\t\r\n\t\tif (status.equals(\"\"))\r\n\t\t\tthrow new RuntimeException(\"Failed to retrieve Spark job status\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\treader.close();\r\n\t\t\tclient.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tint cont = 0;\r\n\t\t\r\n\t\tfor (JsonElement route : o.get(\"routes\").getAsJsonArray()) {\r\n\t\t\tfor (JsonElement leg : route.getAsJsonObject().get(\"legs\").getAsJsonArray()) {\r\n\t\t\t\tfor (JsonElement step : leg.getAsJsonObject().get(\"steps\").getAsJsonArray()) {\r\n\t\t\t\t\tJsonObject stepObject = step.getAsJsonObject();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (status.equals(\"FINISHED\")) {\r\n\t\t\t\t\t\tstepObject.addProperty(\"score\", \"\"+SCORES[cont]);\r\n\t\t\t\t\t\tcont++;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstepObject.addProperty(\"score\", \"FAILED\");\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\tlong endTime = System.currentTimeMillis();\r\n\t\t\r\n\t\tServletContextInitializer.logger.info(\"TIME SPENT WITH SPARK: \" + (endTime-startTime) + \" milliseconds\");\r\n\t\t\r\n\t\treturn o;\r\n\t}", "public static void main(String... args) {\n String endpoint = \"cb.<your endpoint address>.dp.cloud.couchbase.com\";\n String bucketName = \"couchbasecloudbucket\";\n String username = \"user\";\n String password = \"password\";\n // User Input ends here.\n\n ClusterEnvironment env = ClusterEnvironment.builder()\n .securityConfig(SecurityConfig.enableTls(true)\n .trustManagerFactory(InsecureTrustManagerFactory.INSTANCE))\n .ioConfig(IoConfig.enableDnsSrv(true))\n .build();\n\n // Initialize the Connection\n Cluster cluster = Cluster.connect(endpoint,\n ClusterOptions.clusterOptions(username, password).environment(env));\n Bucket bucket = cluster.bucket(bucketName);\n bucket.waitUntilReady(Duration.parse(\"PT10S\"));\n Collection collection = bucket.defaultCollection();\n\n cluster.queryIndexes().createPrimaryIndex(bucketName, CreatePrimaryQueryIndexOptions.createPrimaryQueryIndexOptions().ignoreIfExists(true));\n\n // Create a JSON Document\n JsonObject arthur = JsonObject.create()\n .put(\"name\", \"Arthur\")\n .put(\"email\", \"[email protected]\")\n .put(\"interests\", JsonArray.from(\"Holy Grail\", \"African Swallows\"));\n\n // Store the Document\n collection.upsert(\n \"u:king_arthur\",\n arthur\n );\n\n // Load the Document and print it\n // Prints Content and Metadata of the stored Document\n System.out.println(collection.get(\"u:king_arthur\"));\n\n // Perform a N1QL Query\n QueryResult result = cluster.query(\n String.format(\"SELECT name FROM `%s` WHERE $1 IN interests\", bucketName),\n queryOptions().parameters(JsonArray.from(\"African Swallows\"))\n );\n\n // Print each found Row\n for (JsonObject row : result.rowsAsObject()) {\n System.out.println(row);\n }\n }", "@Test(groups = {AllTestSuit.test_group_runner, AllTestSuit.test_group_cluster})\r\n\tpublic void testRunOnClusterAsync() {\r\n\t\tassertFalse(SysPrefs.isWindows,\r\n\t\t\t\t\"Cluster execution can only be in unix environment\");\r\n\t\ttry {\r\n\t\t\tConfiguredExecutable<AACon> confAAcon = Configurator\r\n\t\t\t\t\t.configureExecutable(aacon, Executable.ExecProvider.Cluster);\r\n\t\t\tAsyncExecutor aengine = Configurator.getAsyncEngine(confAAcon);\r\n\t\t\tString jobId = aengine.submitJob(confAAcon);\r\n\t\t\tassertNotNull(jobId, \"Runner is NULL\");\r\n\t\t\t// let drmaa to start\r\n\t\t\tThread.sleep(500);\r\n\t\t\tJobStatus status = aengine.getJobStatus(jobId);\r\n\t\t\twhile (status != JobStatus.FINISHED) {\r\n\t\t\t\tSystem.out.println(\"Job Status: \" + status);\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t\tstatus = aengine.getJobStatus(jobId);\r\n\t\t\t\tConfiguredExecutable<AACon> result = (ConfiguredExecutable<AACon>) aengine\r\n\t\t\t\t\t\t.getResults(jobId);\r\n\t\t\t\tassertNotNull(result);\r\n\t\t\t\tSystem.out.println(\"RES:\" + result);\r\n\t\t\t\t// Some times the job could be removed from the cluster\r\n\t\t\t\t// accounting\r\n\t\t\t\t// before it has been reported to finish. Make sure\r\n\t\t\t\t// to stop waiting in such case\r\n\t\t\t\tif (status == JobStatus.UNDEFINED) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (JobSubmissionException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tfail(\"DrmaaException caught:\" + e.getMessage());\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tfail(e.getMessage());\r\n\t\t} catch (ResultNotAvailableException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tfail(e.getMessage());\r\n\t\t}\r\n\t}", "void start(String resourceGroupName, String virtualMachineName);", "public void testRuntimeConfigurationClusterName()\n {\n RuntimeConfiguration runtimeConfiguration = new Jonas4xRuntimeConfiguration();\n runtimeConfiguration.setProperty(JonasPropertySet.JONAS_SERVER_NAME, \"foo\");\n runtimeConfiguration.setProperty(JonasPropertySet.JONAS_DOMAIN_NAME, \"bar\");\n runtimeConfiguration.setProperty(JonasPropertySet.JONAS_CLUSTER_NAME, \"jar\");\n\n AbstractRemoteContainer remoteContainer = new Jonas4xRemoteContainer(runtimeConfiguration);\n AbstractJonasRemoteDeployer remoteDeployer = new TestDeployer(remoteContainer);\n RemoteDeployerConfig deployerConfig = remoteDeployer.getConfig();\n\n assertEquals(\"foo\", deployerConfig.getServerName());\n assertEquals(\"bar\", deployerConfig.getDomainName());\n assertEquals(\"jar\", deployerConfig.getClusterName());\n }", "void deploy(String template, Map<String, String> parameters, String group, String regionStr) throws IOException {\n String deploymentName = \"SunstoneDeployment-\" + UUID.randomUUID().toString().substring(0, 5);\n Region region = Region.fromName(regionStr);\n if (region == null) {\n throw new IllegalArgumentException(\"Unknown region \" + regionStr);\n }\n\n if (!armManager.resourceGroups().contain(group)) {\n armManager.resourceGroups().define(group)\n .withRegion(region)\n .create();\n } else {\n LOGGER.warn(\"Azure resource group '{}' already exists! It will be reused and deleted when tests are finished.\", group);\n }\n\n armManager.deployments().define(deploymentName)\n .withExistingResourceGroup(group)\n .withTemplate(template)\n .withParameters(parametersFromMap(template, parameters))\n .withMode(DeploymentMode.INCREMENTAL)\n .create();\n LOGGER.debug(\"Azure deployment from template {} in \\\"{}\\\" group is ready\", deploymentName, group);\n }", "@Override\n protected void before() {\n LOGGER.info(\"Creating cluster operator {} before test per @ClusterOperator annotation on {}\", cc, name(element));\n for (Map.Entry<File, String> entry : yamls.entrySet()) {\n LOGGER.info(\"creating possibly modified version of {}\", entry.getKey());\n deletable.push(entry.getValue());\n\n kubeClient().namespace(annotations(element, Namespace.class).get(0).value());\n kubeClient().clientWithAdmin().applyContent(entry.getValue());\n }\n applyMultipleNamespacesWatcher(element);\n kubeClient().waitForDeployment(CO_DEPLOYMENT_NAME, 1);\n }", "protected void createAndRunAServiceInGroup(String group) throws RunNodesException {\n ImmutableMap<String, String> userMetadata = ImmutableMap.of(\"test\", group);\n ImmutableSet<String> tags = ImmutableSet.of(group);\n Stopwatch watch = Stopwatch.createStarted();\n template = buildTemplate(client.templateBuilder());\n template.getOptions().inboundPorts(22, 8080).blockOnPort(22, 300).userMetadata(userMetadata).tags(tags);\n NodeMetadata node = getOnlyElement(client.createNodesInGroup(group, 1, template));\n long createSeconds = watch.elapsed(TimeUnit.SECONDS);\n final String nodeId = node.getId();\n //checkUserMetadataContains(node, userMetadata);\n //checkTagsInNodeEquals(node, tags);\n getAnonymousLogger().info(\n format(\"<< available node(%s) os(%s) in %ss\", node.getId(), node.getOperatingSystem(), createSeconds));\n watch.reset().start();\n client.runScriptOnNode(nodeId, JettyStatements.install(), nameTask(\"configure-jetty\"));\n long configureSeconds = watch.elapsed(TimeUnit.SECONDS);\n getAnonymousLogger().info(\n format(\n \"<< configured node(%s) with %s and jetty %s in %ss\",\n nodeId,\n exec(nodeId, \"java -fullversion\"),\n exec(nodeId, JettyStatements.version()), configureSeconds));\n trackProcessOnNode(JettyStatements.start(), \"start jetty\", node);\n client.runScriptOnNode(nodeId, JettyStatements.stop(), runAsRoot(false).wrapInInitScript(false));\n trackProcessOnNode(JettyStatements.start(), \"start jetty\", node);\n }", "public static void setupAllCrds(KubeClusterResource cluster) {\n cluster.createCustomResources(TestUtils.CRD_KAFKA);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECT);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECT_S2I);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_MIRROR_MAKER);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_MIRROR_MAKER_2);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_BRIDGE);\n cluster.createCustomResources(TestUtils.CRD_TOPIC);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_USER);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECTOR);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "@SuppressWarnings(\"deprecation\")\n @Before\n public void setUp(final TestContext aContext) throws Exception {\n final Vertx vertx = myRunTestOnContextRule.vertx();\n final ConfigRetriever configRetriever = ConfigRetriever.create(vertx);\n final DeploymentOptions options = new DeploymentOptions();\n final Async asyncTask = aContext.async();\n\n configRetriever.getConfig(getConfig -> {\n if (getConfig.succeeded()) {\n final JsonObject config = getConfig.result();\n\n myUrl = config.getString(Config.FESTER_URL);\n\n // Create the IDs that will be needed for running the tests\n myManifestID = UUID.randomUUID().toString();\n myManifestS3Key = IDUtils.getWorkS3Key(myManifestID);\n myManifestUri = IDUtils.getResourceURI(myUrl, myManifestS3Key);\n\n myCollectionID = UUID.randomUUID().toString();\n myCollectionS3Key = IDUtils.getCollectionS3Key(myCollectionID);\n myCollectionUri = IDUtils.getResourceURI(myUrl, myCollectionS3Key);\n\n // We need to determine if we'll be able to run the S3 integration tests so we can skip if needed\n if (config.containsKey(Config.S3_ACCESS_KEY) && !config\n .getString(Config.S3_ACCESS_KEY, DEFAULT_ACCESS_KEY).equalsIgnoreCase(DEFAULT_ACCESS_KEY)) {\n isExecutable = true;\n }\n\n vertx.deployVerticle(S3BucketVerticle.class.getName(), options.setConfig(config), deployment -> {\n if (deployment.failed()) {\n final Throwable details = deployment.cause();\n final String message = details.getMessage();\n\n LOGGER.error(details, message);\n aContext.fail(message);\n }\n\n if (myAmazonS3 == null) {\n final String s3AccessKey = config.getString(Config.S3_ACCESS_KEY);\n final String s3SecretKey = config.getString(Config.S3_SECRET_KEY);\n\n // get myAWSCredentials ready\n myAWSCredentials = new BasicAWSCredentials(s3AccessKey, s3SecretKey);\n\n // instantiate the myAmazonS3 client\n myAmazonS3 = new AmazonS3Client(myAWSCredentials);\n }\n\n myS3Bucket = config.getString(Config.S3_BUCKET);\n\n LOGGER.debug(MessageCodes.MFS_067, getClass().getName());\n TestUtils.complete(asyncTask);\n });\n } else {\n aContext.fail(getConfig.cause());\n TestUtils.complete(asyncTask);\n }\n });\n }", "@Override\n\tpublic void preStart() {\n\t\tcluster.subscribe(getSelf(), MemberUp.class);\n\t\tif (WorkerMain.role.equals(\"kvm\")) {\n\t\t\tSystem.out.println(\"generate KVMActor\");\n\t\t\tVMActor = getContext().actorOf(new RoundRobinPool(5).props(Props.create(KVMActor.class)), \"VMActor\");\n\t\t} else {\n\t\t\tSystem.out.println(\"generate LXDActor\");\n\t\t\tVMActor = getContext().actorOf(new RoundRobinPool(5).props(Props.create(LXDActor.class)), \"LXDActor\");\n\t\t}\n\n\t\tString actorURL = cluster.selfAddress().toString() + \"/user/worker\";\n\t\tUtil.write(\"actor.url\", actorURL);\n\t}", "@Override\n public BrokerCluster generateCluster(String clusterId, int numReplicas, Address address, AddressPlan addressPlan, StandardInfraConfig standardInfraConfig) throws Exception {\n\n KubernetesListBuilder resourcesBuilder = new KubernetesListBuilder();\n\n if (standardInfraConfig != null) {\n String templateName = getTemplateName(address, addressPlan, standardInfraConfig);\n KubernetesList newResources = processTemplate(clusterId, numReplicas, address, templateName, standardInfraConfig);\n resourcesBuilder.addAllToItems(newResources.getItems());\n }\n return new BrokerCluster(clusterId, resourcesBuilder.build());\n }", "public void testAsyncMapPutGet() throws Throwable {\n TestCluster<AsyncMap<String, String>> cluster = TestCluster.<AsyncMap<String, String>>builder()\n .withActiveMembers(3)\n .withPassiveMembers(2)\n .withUriFactory(id -> String.format(\"local://test%d\", id))\n .withClusterFactory(members -> new ClusterConfig().withProtocol(new LocalProtocol()).withMembers(members))\n .withResourceFactory(config -> AsyncMap.create(\"test\", config, new AsyncMapConfig().withLog(new BufferedLog())))\n .build();\n expectResume();\n cluster.open().thenRun(this::resume);\n await(5000);\n \n AsyncMap<String, String> map = cluster.activeResources().iterator().next();\n expectResume();\n map.put(\"foo\", \"Hello world!\").thenRun(() -> {\n map.get(\"foo\").thenAccept(result -> {\n threadAssertEquals(result, \"Hello world!\");\n resume();\n });\n });\n await(5000);\n }", "public static void main(String[] args) throws Exception {\n\n\t\tString dockerIp = InetAddress.getLocalHost().getHostAddress();//getByName(\"localhost\")\n\t\tVertxOptions options = new VertxOptions();\n\t\toptions.setClusterHost(dockerIp);\n\t\tVertx.clusteredVertx(options,\n\t\t\t\tvertxAsyncResult -> vertxAsyncResult.result().deployVerticle(new Receiver()));//new Receiver()));\n\t \n\t}", "@Override\r\n protected void execute() throws Exception {\r\n log.debug(\"Downloading SAML certificate and adding it to the keystore\");\r\n TlsPolicy tlsPolicy = TlsPolicyBuilder.factory().strictWithKeystore(trustagentConfiguration.getTrustagentKeystoreFile(), trustagentConfiguration.getTrustagentKeystorePassword()).build();\r\n TlsConnection tlsConnection = new TlsConnection(new URL(url), tlsPolicy);\r\n \r\n Properties clientConfiguration = new Properties();\r\n clientConfiguration.setProperty(TrustagentConfiguration.MTWILSON_API_USERNAME, username);\r\n clientConfiguration.setProperty(TrustagentConfiguration.MTWILSON_API_PASSWORD, password);\r\n \r\n CaCertificates client = new CaCertificates(clientConfiguration, tlsConnection);\r\n X509Certificate certificate = client.retrieveCaCertificate(\"saml\");\r\n keystore.addTrustedCaCertificate(certificate, \"saml\");\r\n// X509Certificate endorsementCertificate = client.retrieveCaCertificate(\"endorsement\");\r\n// keystore.addTrustedCaCertificate(endorsementCertificate, \"endorsement\");\r\n keystore.save();\r\n }", "public static void main(String[] args) throws NacosException, InterruptedException, IOException {\n String dataId = \"StreamingServiceOrderMainV2.yml\";\n// downLoadFromConfigCenter(dataId);\n// String group = \"DEFAULT_GROUP\";\n// String namespace = \"847b80b1-0e6f-4409-ac09-442efd3b969b\";\n// Properties properties = new Properties();\n// properties.put(PropertyKeyConst.NAMESPACE, namespace);\n// properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);\n// ConfigService configService = NacosFactory.createConfigService(properties);\n// String content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n// configService.addListener(dataId, group, new Listener() {\n// @Override\n// public void receiveConfigInfo(String configInfo) {\n// System.out.println(\"recieve:\" + configInfo);\n// }\n//\n// @Override\n// public Executor getExecutor() {\n// return null;\n// }\n// });\n//\n// boolean isPublishOk = configService.publishConfig(dataId, group, \"content\");\n// System.out.println(isPublishOk);\n//\n// Thread.sleep(3000);\n// content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n//\n// boolean isRemoveOk = configService.removeConfig(dataId, group);\n// System.out.println(isRemoveOk);\n// Thread.sleep(3000);\n//\n// content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n// Thread.sleep(300000);\n }", "public SubTaskGroup createStartYbcTasks(Collection<NodeDetails> nodes) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleClusterServerCtl\");\n for (NodeDetails node : nodes) {\n AnsibleClusterServerCtl.Params params = new AnsibleClusterServerCtl.Params();\n UserIntent userIntent = taskParams().getClusterByUuid(node.placementUuid).userIntent;\n // Add the node name.\n params.nodeName = node.nodeName;\n // Add the universe uuid.\n params.setUniverseUUID(taskParams().getUniverseUUID());\n // Add the az uuid.\n params.azUuid = node.azUuid;\n // The service and the command we want to run.\n params.process = \"controller\";\n params.command = \"start\";\n params.placementUuid = node.placementUuid;\n // Set the InstanceType\n params.instanceType = node.cloudInfo.instance_type;\n params.useSystemd = userIntent.useSystemd;\n // sshPortOverride, in case the passed imageBundle has a different port\n // configured for the region.\n params.sshPortOverride = node.sshPortOverride;\n // Create the Ansible task to get the server info.\n AnsibleClusterServerCtl task = createTask(AnsibleClusterServerCtl.class);\n task.initialize(params);\n // Add it to the task list.\n subTaskGroup.addSubTask(task);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "@Test\n public void constructStartAndStop() {\n kit.setBlockingStartup(false);\n kit.startAsync();\n kit.awaitRunning();\n kit.stopAsync();\n kit.awaitTerminated();\n }", "@Test\n public void cluster() throws FlywayException {\n flyway.setLocations(\"migration/dbsupport/oracle/sql/cluster\");\n flyway.migrate();\n flyway.clean();\n flyway.migrate();\n }", "@Test\n public void CloudScriptServer()\n {\n PlayFabServerModels.LoginWithServerCustomIdRequest customIdReq = new PlayFabServerModels.LoginWithServerCustomIdRequest();\n customIdReq.CreateAccount = true;\n customIdReq.ServerCustomId = PlayFabSettings.BuildIdentifier;\n PlayFabResult<PlayFabServerModels.ServerLoginResult> loginRes = PlayFabServerAPI.LoginWithServerCustomId(customIdReq);\n assertNotNull(loginRes.Result);\n PlayFabServerModels.ExecuteCloudScriptServerRequest hwRequest = new PlayFabServerModels.ExecuteCloudScriptServerRequest();\n hwRequest.FunctionName = \"helloWorld\";\n hwRequest.PlayFabId = loginRes.Result.PlayFabId;\n PlayFabResult<PlayFabServerModels.ExecuteCloudScriptResult> hwResult = PlayFabServerAPI.ExecuteCloudScript(hwRequest);\n assertNotNull(hwResult.Result.FunctionResult);\n Map<String, String> arbitraryResults = (Map<String, String>)hwResult.Result.FunctionResult;\n assertEquals(arbitraryResults.get(\"messageValue\"), \"Hello \" + loginRes.Result.PlayFabId + \"!\");\n }", "protected void bootstrap() throws KikahaException {\n\t\ttry {\n\t\t\tval deploymentContext = createDeploymentContext();\n\t\t\trunDeploymentHooks(deploymentContext);\n\t\t\tdeployWebResourceFolder(deploymentContext);\n\t\t\tthis.deploymentContext = deploymentContext;\n\t\t} catch (final ServiceProviderException cause) {\n\t\t\tthrow new KikahaException(cause);\n\t\t}\n\t}", "@Test\n public final void testStaticTopology() {\n URL resourceUrl = this.getClass().getResource(configPath + \"/loadbalancer2.conf\");\n File configFile = new File(resourceUrl.getFile());\n\n System.setProperty(\"loadbalancer.conf.file\", configFile.getAbsolutePath());\n LoadBalancerConfiguration.getInstance();\n\n try {\n String validationError = \"Static topology validation failed\";\n\n TopologyProvider topologyProvider = LoadBalancerConfiguration.getInstance().getTopologyProvider();\n\n String clusterId = \"app-server-cluster1\";\n Cluster cluster1 = topologyProvider.getClusterByClusterId(clusterId);\n Assert.assertNotNull(String.format(\"%s, cluster not found: [cluster] %s\", validationError, clusterId), cluster1);\n Assert.assertEquals(String.format(\"%s, tenant range is not valid: [cluster] %s\", validationError, clusterId), cluster1.getTenantRange(), \"1-100\");\n\n String hostName = \"cluster1.appserver.foo.org\";\n Assert.assertTrue(String.format(\"%s, hostname not found: [hostname] %s\", validationError, hostName), hostNameExist(cluster1, hostName));\n\n hostName = \"cluster1.org\";\n Assert.assertTrue(String.format(\"%s, hostname not found: [hostname] %s\", validationError, hostName), hostNameExist(cluster1, hostName));\n Assert.assertEquals(String.format(\"%s, algorithm not valid\", validationError), \"round-robin\", cluster1.getLoadBalanceAlgorithmName());\n\n String memberId = \"m1\";\n Member m1 = cluster1.getMember(memberId);\n Assert.assertNotNull(String.format(\"%s, member not found: [member] %s\", validationError, memberId), m1);\n Assert.assertEquals(String.format(\"%s, member ip not valid\", validationError), \"10.0.0.10\", m1.getHostName());\n\n int proxyPort = 80;\n Port m1Http = m1.getPort(proxyPort);\n Assert.assertNotNull(String.format(\"%s, port not found: [member] %s [proxy-port] %d\", validationError, memberId, proxyPort), m1Http);\n Assert.assertEquals(String.format(\"%s, port value not valid: [member] %s [proxy-port] %d\", validationError, memberId, proxyPort), 8080, m1Http.getValue());\n Assert.assertEquals(String.format(\"%s, port proxy not valid: [member] %s [proxy-port] %d\", validationError, memberId, proxyPort), 80, m1Http.getProxy());\n\n Assert.assertFalse(String.format(\"%s, rewrite-location-header is not false\", validationError), LoadBalancerConfiguration.getInstance().isReWriteLocationHeader());\n Assert.assertTrue(String.format(\"%s, map-domain-names is not true\", validationError), LoadBalancerConfiguration.getInstance().isDomainMappingEnabled());\n\n } finally {\n LoadBalancerConfiguration.clear();\n }\n }", "public interface InstanceDeployCenter {\r\n\r\n /**\r\n * 启动已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 启动已存在的实例,无需进行redis资源包校验\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstanceWithoutResourceCheck(long appId, int instanceId);\r\n\r\n /**\r\n * 下线已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean shutdownExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * cluster forget\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean forgetInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 清理(cluster forget)集群内所有fail节点\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean clearFailInstances(long appId);\r\n \r\n /**\r\n * 展示实例最近的日志\r\n * @param instanceId\r\n * @param maxLineNum\r\n * @return\r\n */\r\n String showInstanceRecentLog(int instanceId, int maxLineNum);\r\n\r\n /**\r\n * 修改实例配置\r\n * @param appId\r\n * @param appAuditId\r\n * @param host\r\n * @param port\r\n * @param instanceConfigKey\r\n * @param instanceConfigValue\r\n * @return\r\n */\r\n boolean modifyInstanceConfig(long appId, Long appAuditId, String host, int port, String instanceConfigKey,\r\n String instanceConfigValue);\r\n\r\n /**\r\n * 检测pod是否有被调度其他宿主机\r\n * @param ip\r\n */\r\n MachineSyncEnum podChangeStatus(String ip);\r\n\r\n /**\r\n * 检测pod是否有心跳停止实例&启动\r\n * @return\r\n */\r\n List<InstanceAlertValueResult> checkAndStartExceptionInstance(String ip, Boolean isAlert);\r\n\r\n\r\n}", "public static void main(String argv[]) {\n\n VertxOptions options = new VertxOptions().setBlockedThreadCheckInterval(200000000);\n options.setClustered(true);\n\n Vertx.clusteredVertx(options, res -> {\n if (res.succeeded()) {\n Vertx vertx = res.result();\n final JsonObject js = new JsonObject();\n vertx.fileSystem().readFile(\"app-conf.json\", result -> {\n if (result.succeeded()) {\n Buffer buff = result.result();\n js.mergeIn(new JsonObject(buff.toString()));\n initConfig(js);\n DeploymentOptions deploymentOptions = new DeploymentOptions().setConfig(js).setMaxWorkerExecuteTime(5000).setWorker(true).setWorkerPoolSize(5);\n vertx.deployVerticle(SparkVerticle.class.getName(), deploymentOptions);\n } else {\n System.err.println(\"Oh oh ...\" + result.cause());\n }\n });\n\n }\n });\n }", "public static void main(String args[]) throws IOException {\n Settings settings = Settings.builder().put(\"cluster.name\", \"elasticsearch\").build();\r\n //.put(\"xpack.security.user\", \"elastic:changeme\").build();\r\n TransportClient client = new PreBuiltTransportClient(settings)\r\n // client.addTransportAddress(new TransportAddress(InetAddress.getByName(\"localhost\"), 9300));\r\n \r\n //TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)\r\n .addTransportAddress(new TransportAddress(InetAddress.getByName(\"localhost\"), 9300));\r\n //.addTransportAddress(new TransportAddress(InetAddress.getByName(\"host2\"), 9300));\r\n \r\n // client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(\"localhost1\"), 9300));\r\n\r\n // TransportClient client = TransportClient.builder().settings(settings).build()\r\n // .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(\"localhost\"), 9300));\r\n // .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(\"host2\"), 9300));\r\n\r\n client.prepareIndex(\"java-example\", \"_doc\", \"1\")\r\n .setSource(putJsonDocument(\"ElasticSearch: Java\",\r\n \"ElasticSeach provides Java API, thus it executes all operations \"\r\n + \"asynchronously by using client object..\",\r\n new Date(), new String[] { \"elasticsearch\" }, \"Hüseyin Akdoğan\"))\r\n .execute().actionGet();\r\n //\r\n // client.prepareIndex(\"kodcucom\", \"article\", \"2\")\r\n // .setSource(putJsonDocument(\"Java Web Application and ElasticSearch (Video)\",\r\n // \"Today, here I am for exemplifying the usage of ElasticSearch which is an open source, distributed \" +\r\n // \"and scalable full text search engine and a data analysis tool in a Java web application.\",\r\n // new Date(),\r\n // new String[]{\"elasticsearch\"},\r\n // \"Hüseyin Akdoğan\")).execute().actionGet();\r\n\r\n getDocument(client, \"java-example\", \"_doc\", \"1\");\r\n\r\n // updateDocument(client, \"java-example\", \"article\", \"1\", \"title\", \"ElasticSearch: Java API\");\r\n //getDocument(client, \"java-example\", \"_doc\", \"1\");\r\n // updateDocument(client, \"kodcucom\", \"article\", \"1\", \"tags\", new String[]{\"bigdata\"});\r\n\r\n // getDocument(client, \"kodcucom\", \"article\", \"1\");\r\n\r\n //searchDocument(client, \"cars\", \"_doc\", \"title\", \"honda is a korean company\");\r\n\r\n // deleteDocument(client, \"kodcucom\", \"article\", \"1\");\r\n\r\n client.close();\r\n }", "@Override\n\tpublic void takeLeadership(CuratorFramework curator) throws Exception\n\t{\n\n\t\tLOG.info(\"a new leader has been elected: kaboom.id={}\", config.getKaboomId());\n\t\n\t\tThread.sleep(30 * 1000);\n\n\t\twhile (true)\n\t\t{\n\t\t\tMap<String, String> partitionToHost = new HashMap<String, String>();\n\t\t\tMap<String, List<String>> hostToPartition = new HashMap<String, List<String>>();\n\t\t\tfinal Map<String, KaBoomNodeInfo> clients = new HashMap<String, KaBoomNodeInfo>();\n\t\t\tMap<String, List<String>> clientToPartitions = new HashMap<String, List<String>>();\n\t\t\tMap<String, String> partitionToClient = new HashMap<String, String>();\n\t\t\tList<String> topics = new ArrayList<String>();\n\n\t\t\t// Get a full set of metadata from Kafka\n\t\t\tStateUtils.readTopicsFromZooKeeper(config.getKafkaZkConnectionString(), topics);\n\n\t\t\t// Map partition to host and host to partition\n\t\t\tStateUtils.getPartitionHosts(config.getKafkaSeedBrokers(), topics, partitionToHost, hostToPartition);\n\n\t\t\t// Get a list of active clients from zookeeper\n\t\t\tStateUtils.getActiveClients(curator, clients);\n\n\t\t\t// Get a list of current assignments\n\t\t\t// Get a list of current assignments\n\t\t\t\n\t\t\tfor (String partition : partitionToHost.keySet())\n\t\t\t{\n\t\t\t\tStat stat = curator.checkExists().forPath(\"/kaboom/assignments/\" + partition);\n\t\t\t\t\n\t\t\t\tif (stat != null)\n\t\t\t\t{\n\t\t\t\t\t// check if the client is still connected, and delete node if it is not.\n\t\t\t\t\t\n\t\t\t\t\tString client = new String(curator.getData().forPath(\"/kaboom/assignments/\" + partition), UTF8);\n\t\t\t\t\t\n\t\t\t\t\tif (clients.containsKey(client))\n\t\t\t\t\t{\n\t\t\t\t\t\tLOG.debug(\"Partition {} : client {} is connected\", partition, client);\n\t\t\t\t\t\t\n\t\t\t\t\t\tpartitionToClient.put(partition, client);\t\t\t\t\t\t\n\t\t\t\t\t\tList<String> parts = clientToPartitions.get(client);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (parts == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparts = new ArrayList<String>();\n\t\t\t\t\t\t\tclientToPartitions.put(client, parts);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparts.add(partition);\n\t\t\t\t\t} \n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tLOG.debug(\"Partition {} : client {} is not connected\", partition, client);\n\t\t\t\t\t\tcurator.delete().forPath(\"/kaboom/assignments/\" + partition);\n\t\t\t\t\t\tstat = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tStateUtils.calculateLoad(partitionToHost, clients, clientToPartitions);\n\n\t\t\t// If any node is over its target by at least one, then unassign partitions until it is at or below its target\n\t\t\t\n\t\t\tfor (Entry<String, KaBoomNodeInfo> e : clients.entrySet())\n\t\t\t{\n\t\t\t\tString client = e.getKey();\n\t\t\t\tKaBoomNodeInfo info = e.getValue();\n\n\t\t\t\tif (info.getLoad() >= info.getTargetLoad() + 1)\n\t\t\t\t{\n\t\t\t\t\tList<String> localPartitions = new ArrayList<String>();\n\t\t\t\t\tList<String> remotePartitions = new ArrayList<String>();\n\n\t\t\t\t\tfor (String partition : clientToPartitions.get(client))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (partitionToHost.get(partition).equals(info.getHostname()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalPartitions.add(partition);\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\tremotePartitions.add(partition);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (info.getLoad() > info.getTargetLoad())\n\t\t\t\t\t{\n\t\t\t\t\t\tString partitionToDelete;\n\t\t\t\t\t\tif (remotePartitions.size() > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpartitionToDelete = remotePartitions.remove(rand.nextInt(remotePartitions.size()));\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\tpartitionToDelete = localPartitions.remove(rand.nextInt(localPartitions.size()));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tLOG.info(\"Unassgning {} from overloaded client {}\", partitionToDelete, client);\n\t\t\t\t\t\tpartitionToClient.remove(partitionToDelete);\n\t\t\t\t\t\tclientToPartitions.get(client).remove(partitionToDelete);\n\t\t\t\t\t\tinfo.setLoad(info.getLoad() - 1);\n\n\t\t\t\t\t\tcurator.delete().forPath(\"/kaboom/assignments/\" + partitionToDelete);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Sort the clients by percent load, then add unassigned clients to the lowest loaded client\t\t\t\n\t\t\t{\n\t\t\t\tList<String> sortedClients = new ArrayList<String>();\n\t\t\t\tComparator<String> comparator = new Comparator<String>()\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic int compare(String a, String b)\n\t\t\t\t\t{\n\t\t\t\t\t\tKaBoomNodeInfo infoA = clients.get(a);\n\t\t\t\t\t\tdouble valA = infoA.getLoad() / infoA.getTargetLoad();\n\n\t\t\t\t\t\tKaBoomNodeInfo infoB = clients.get(b);\n\t\t\t\t\t\tdouble valB = infoB.getLoad() / infoB.getTargetLoad();\n\n\t\t\t\t\t\tif (valA == valB)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn 0;\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\tif (valA > valB)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tsortedClients.addAll(clients.keySet());\n\n\t\t\t\tfor (String partition : partitionToHost.keySet())\n\t\t\t\t{\n\t\t\t\t\t// If it's already assigned, skip it\n\t\t\t\t\t\n\t\t\t\t\tif (partitionToClient.containsKey(partition))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tCollections.sort(sortedClients, comparator);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * \n\t\t\t\t\t * Iterate through the list until we find either a local client below capacity, or we reach the ones that are \n\t\t\t\t\t * above capacity. If we reach clients above capacity, then just assign it to the first node.\n\t\t\t\t\t */\n\t\t\t\t\t\n\t\t\t\t\tLOG.info(\"Going to assign {}\", partition);\n\t\t\t\t\tString chosenClient = null;\n\t\t\t\t\t\n\t\t\t\t\tfor (String client : sortedClients)\n\t\t\t\t\t{\n\t\t\t\t\t\tLOG.info(\"- Checking {}\", client);\t\t\t\t\t\t\n\t\t\t\t\t\tKaBoomNodeInfo info = clients.get(client);\t\t\t\t\t\t\n\t\t\t\t\t\tLOG.info(\"- Current load = {}, Target load = {}\", info.getLoad(), info.getTargetLoad());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (info.getLoad() >= info.getTargetLoad())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchosenClient = sortedClients.get(0);\n\t\t\t\t\t\t\tbreak;\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\tif (clients.get(client).getHostname().equals(partitionToHost.get(partition)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchosenClient = client;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (chosenClient == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tchosenClient = sortedClients.get(0);\n\t\t\t\t\t}\n\n\t\t\t\t\tLOG.info(\"Assigning partition {} to client {}\", partition, chosenClient);\n\n\t\t\t\t\tcurator\n\t\t\t\t\t\t .create()\n\t\t\t\t\t\t .withMode(CreateMode.PERSISTENT)\n\t\t\t\t\t\t .forPath(\"/kaboom/assignments/\" + partition,\n\t\t\t\t\t\t\t chosenClient.getBytes(UTF8));\n\n\t\t\t\t\tList<String> parts = clientToPartitions.get(chosenClient);\n\t\t\t\t\t\n\t\t\t\t\tif (parts == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tparts = new ArrayList<String>();\n\t\t\t\t\t\tclientToPartitions.put(chosenClient, parts);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tparts.add(partition);\n\n\t\t\t\t\tpartitionToClient.put(partition, chosenClient);\n\n\t\t\t\t\tclients.get(chosenClient).setLoad(clients.get(chosenClient).getLoad() + 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Check to see if the kafka_ready flag writer thread exists and is alive:\n\t\t\t * \n\t\t\t * If it doesn't exist or isn't running, start it. This is designed to \n\t\t\t * work well when the load balancer sleeps for 10 minutes after assigning \n\t\t\t * work. If that behavior changes then additional logic will be required\n\t\t\t * to ensure this isn't executed too often \n\t\t\t */\n\t\t\t\n\t\t\tif (readyFlagThread == null || !readyFlagThread.isAlive())\n\t\t\t{\n\t\t\t\tLOG.info(\"[ready flag writer] thread doesn't exist or is not running\");\t\t\t\t\n\t\t\t\treadyFlagWriter = new ReadyFlagWriter(config, curator);\n\t\t\t\treadyFlagWriter.addListener(this);\n\t\t\t\treadyFlagThread = new Thread(readyFlagWriter);\n\t\t\t\treadyFlagThread.start();\n\t\t\t\tLOG.info(\"[ready flag writer] thread created and started\");\n\t\t\t}\n\n\t\t\tThread.sleep(10 * 60 * 1000);\n\t\t}\n\t}", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "@Before\n public void setup() throws Exception{\n \n System.setProperty(\"app.home\", BASE_DIR + \"/scribengin\");\n System.setProperty(\"vm.app.dir\", BASE_DIR + \"/scribengin\");\n \n localScribenginCluster = new LocalScribenginCluster(BASE_DIR) ;\n localScribenginCluster.clean(); \n localScribenginCluster.useLog4jConfig(\"classpath:scribengin/log4j/vm-log4j.properties\"); \n localScribenginCluster.start();\n registry = RegistryConfig.getDefault().newInstance().connect();\n shell = localScribenginCluster.getShell();\n \n }", "@Test\n\tpublic void shouldRegisterClientInEurekaServer() throws InterruptedException {\n\t\tThread.sleep(3000);\n\n\t\tResponseEntity<String> response = this.testRestTemplate\n\t\t\t\t.getForEntity(\"http://localhost:\" + this.port + \"/service-instances/greeting\", String.class);\n\n\t\tthen(response.getStatusCode()).isEqualTo(HttpStatus.OK);\n\t\tthen(response.getBody()).contains(\"greeting\");\n\t}", "@Bean\n public ActorSystem createActorSystemWithAgent(ClientConfig clientConfig, Environment env) {\n\n if (!clientConfig.isRemoteArtifact()) {\n String usPwd = env.getProperty(\"gatling.user\") + \":\" + env.getProperty(\"gatling.password\");\n String basicToken = \"Basic \" + Base64Utils.encodeToString(usPwd.getBytes());\n // upload files here\n String jarFileFullPath;\n boolean uploadSucceeded = true;\n try {\n jarFileFullPath = UploadUtils.uploadFile(serverUrl, clientConfig.getJarPath(), basicToken);\n clientConfig.setJarPath(jarFileFullPath);\n if (!clientConfig.getResourcesFeedPath().isEmpty()) {\n String resourcesFileFullPath =\n UploadUtils.uploadFile(serverUrl, clientConfig.getResourcesFeedPath(), basicToken);\n clientConfig.setResourcesFeedPath(resourcesFileFullPath);\n }\n } catch (IOException| RuntimeException e) {\n uploadSucceeded = false;\n logger.error(\"Upload failed.\",e);\n }\n if (uploadSucceeded) {\n return ClientFactory.startCommandClient(clientConfig);\n }\n return null;\n } else {\n return ClientFactory.startCommandClient(clientConfig);\n }\n }", "@Test\n\tpublic void testRedisTemplateClusterScript() {\n\t\tString key = \"TEST\" + simpleDateFormatThreadLocal.get().format(new Date());\n\t\tDefaultRedisScript<String> redisScript = new DefaultRedisScript<String>();\n\t\tredisScript.setLocation(new ClassPathResource(\"lua/genID.lua\"));\n\t\tredisScript.setResultType(String.class);\n\t\tList<String> keys = new ArrayList<String>();\n\n\t\tkeys.add(key);\n\n\t\t// 注意redis.clients.jedis.JedisCluster与org.springframework.data.redis.connection.jedis.JedisClusterConnection区别\n\t\t// JedisClusterConnection不支持lua脚本的执行,JedisCluster支持\n\t\t// 除了JedisCluster支持lua脚本的执行,lettuce也可以\n\t\t// 如果是集群模式,则JedisConnectionFactory则调用getClusterConnection,由于clusterConnection不支持evalsha,所以会报错\n\t\t// String nextId = redisTemplate.execute(redisScript, keys, new String());\n\t\tString nextId = redisTemplate.execute(redisScript, keys);\n\n\t\tSystem.out.println(\"生成的主键id:\" + nextId);\n\t}", "Cluster getUpcomingCluster() throws TimeoutException, InterruptedException;", "SqlElasticPoolOperations.DefinitionStages.WithCreate withNewDatabase(String databaseName);", "public static void main(String[] args) throws Exception {\n CloudFrontService cloudFrontService = new CloudFrontService(\n SamplesUtils.loadAWSCredentials());\n \n // List your distributions\n Distribution[] distributions = cloudFrontService.listDistributions();\n for (int i = 0; i < distributions.length; i++) {\n System.out.println(\"Distribution \" + (i + 1) + \": \" + distributions[i]);\n }\n \n /*\n // List the distributions applied to a given S3 bucket\n Distribution[] bucketDistributions = cloudFrontService.listDistributions(\"jets3t\");\n for (int i = 0; i < bucketDistributions.length; i++) {\n System.out.println(\"Bucket distribution \" + (i + 1) + \": \" + bucketDistributions[i]);\n }\n \n // Create a new distribution \n String originBucket = \"jets3t.s3.amazonaws.com\";\n Distribution newDistribution = cloudFrontService.createDistribution(\n originBucket, \n \"\" + System.currentTimeMillis(), // Caller reference - a unique string value\n new String[] {\"test1.jamesmurty.com\"}, // CNAME aliases for distribution\n \"Testing\", // Comment\n true // Enabled?\n );\n System.out.println(\"New Distribution: \" + newDistribution);\n \n // The ID of the new distribution we will use for testing\n String testDistributionId = newDistribution.getId(); \n \n // List information about a distribution\n Distribution distribution = cloudFrontService.getDistributionInfo(testDistributionId);\n System.out.println(\"Distribution: \" + distribution);\n\n // List configuration information about a distribution\n DistributionConfig distributionConfig = cloudFrontService.getDistributionConfig(testDistributionId);\n System.out.println(\"Distribution Config: \" + distributionConfig);\n\n // Update a distribution's configuration, in this case to add an extra CNAME alias.\n DistributionConfig updatedDistributionConfig = cloudFrontService.updateDistributionConfig(\n testDistributionId, \n new String[] {\"test1.jamesmurty.com\", \"test2.jamesmurty.com\"}, // CNAME aliases for distribution\n \"Another comment for testing\", // Comment \n true // Enabled?\n );\n System.out.println(\"Updated Distribution Config: \" + updatedDistributionConfig);\n\n // Disable a distribution, e.g. so that it may be deleted. This operation may take some time to complete...\n DistributionConfig disabledDistributionConfig = cloudFrontService.updateDistributionConfig(\n testDistributionId, new String[] {}, \"Deleting distribution\", false);\n System.out.println(\"Disabled Distribution Config: \" + disabledDistributionConfig);\n\n // Check whether a distribution is deployed\n Distribution distribution = cloudFrontService.getDistributionInfo(testDistributionId);\n System.out.println(\"Distribution is deployed? \" + distribution.isDeployed());\n\n // Delete a distribution (the distribution must be disabled and deployed first)\n cloudFrontService.deleteDistribution(testDistributionId);\n */\n \n }", "void start(String resourceGroupName, String virtualMachineName, Context context);", "interface WithContainerSettings {\n /**\n * Specifies containerSettings.\n * @param containerSettings If the container was downloaded as part of cluster setup then the same container image will be used. If not provided, the job will run on the VM\n * @return the next definition stage\n */\n WithCreate withContainerSettings(ContainerSettings containerSettings);\n }", "public static void main(String[] args) throws Exception {\n\t\tZkHosts zkHosts = new ZkHosts(\"192.168.0.111:2181\");\n\t\t//Create the KafkaSpout configuration\n\t\t//Second argument -> topic name\n\t\t//Third argument -> zk root for Kafka\n\t\t//Forth argument -> consumer group id\n\t\t\n\t\tSpoutConfig kafkaConfig = new SpoutConfig(zkHosts, \"words_topic\", \"\", \"id111\");\n\t\t//Specify kafka message type\n\t\tkafkaConfig.scheme = new SchemeAsMultiScheme(new StringScheme());\n\t\t//We want to consume all the first message in the topic every time\n\t\t//方便debug,在生产环境应该设置为false not sure used to be `forceFromStart`\n\t\tkafkaConfig.useStartOffsetTimeIfOffsetOutOfRange = true;\n\t\t//create the topology\n\t\tTopologyBuilder builder = new TopologyBuilder();\n\t\t//set kafka spout class\n\t\tbuilder.setSpout(\"KafkaSpout\", new KafkaSpout(kafkaConfig), 1);\n\t\t//configure bolts ##after update not work\n//\t\tbuilder.setBolt(\"SentenceBolt\", new SentenceBolt(), 1).globalGrouping(\"KafkaSpout\");\n//\t\tbuilder.setBolt(\"PrintBolt\", new PrintBolt(), 1).globalGrouping(\"SentenceBolt\");\n\t\t\n\t\tLocalCluster cluster = new LocalCluster();\n\t\tConfig conf = new Config();\n\t\t\n\t\tcluster.submitTopology(\"KafkaTopology\", conf, builder.createTopology());\n\t\t\n\t\ttry {\n\t\t\tSystem.out.println(\"Waiting to consume from kafka\");\n\t\t\tTimeUnit.SECONDS.sleep(100);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tcluster.killTopology(\"KafkaTopology\");\n\t\tcluster.shutdown();\n\t}", "java.util.concurrent.Future<CreateSolNetworkInstanceResult> createSolNetworkInstanceAsync(CreateSolNetworkInstanceRequest createSolNetworkInstanceRequest);", "public static void init() throws Exception {\n AWSCredentials credentials = new PropertiesCredentials(\n AwsConsoleApp.class.getResourceAsStream(\"AwsCredentials.properties\"));\n ec2 = new AmazonEC2Client(credentials);\n s3 = new AmazonS3Client(credentials);\n sdb = new AmazonSimpleDBClient(credentials);\n emr = new AmazonElasticMapReduceClient(credentials);\n }", "protected void setupHttps(){\n try {\n if (!testKeystoreFile.exists()) {\n // Prepare a temporary directory for the tests\n BioUtils.delete(this.testDir, true);\n this.testDir.mkdir();\n // Copy the keystore into the test directory\n Response response = new Client(Protocol.CLAP)\n .handle(new Request(Method.GET,\n \"clap://class/org/restlet/test/engine/dummy.jks\"));\n\n if (response.getEntity() != null) {\n OutputStream outputStream = new FileOutputStream(\n testKeystoreFile);\n response.getEntity().write(outputStream);\n outputStream.flush();\n outputStream.close();\n } else {\n throw new Exception(\n \"Unable to find the dummy.jks file in the classpath.\");\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n }", "DeployShard() {\n }", "private static Map<String, Object> createClusterTemplateArtifact(Object configuration1, Object configuration2, Object configuration3) {\n return\n map(\n \"mpack_instances\",\n list(\n map(\n \"name\", \"HDPCORE\",\n \"version\", \"1.0.0.0\",\n \"configurations\", configuration1,\n \"service_instances\", list(\n map(\n \"name\", \"ZK1\",\n \"type\", \"ZOOKEEPER\",\n \"configurations\", configuration2\n )\n )\n )\n ),\n \"host_groups\",\n list(\n map(\n \"name\", \"hostgroup1\",\n \"host_count\", \"1\"\n )\n ),\n \"configurations\", configuration3\n );\n }", "public CreateClusterRequest(CreateClusterRequest source) {\n if (source.ClusterName != null) {\n this.ClusterName = new String(source.ClusterName);\n }\n if (source.ClusterType != null) {\n this.ClusterType = new String(source.ClusterType);\n }\n if (source.VpcId != null) {\n this.VpcId = new String(source.VpcId);\n }\n if (source.ClusterCIDR != null) {\n this.ClusterCIDR = new String(source.ClusterCIDR);\n }\n if (source.ClusterDesc != null) {\n this.ClusterDesc = new String(source.ClusterDesc);\n }\n if (source.TsfRegionId != null) {\n this.TsfRegionId = new String(source.TsfRegionId);\n }\n if (source.TsfZoneId != null) {\n this.TsfZoneId = new String(source.TsfZoneId);\n }\n if (source.SubnetId != null) {\n this.SubnetId = new String(source.SubnetId);\n }\n if (source.ClusterVersion != null) {\n this.ClusterVersion = new String(source.ClusterVersion);\n }\n if (source.MaxNodePodNum != null) {\n this.MaxNodePodNum = new Long(source.MaxNodePodNum);\n }\n if (source.MaxClusterServiceNum != null) {\n this.MaxClusterServiceNum = new Long(source.MaxClusterServiceNum);\n }\n if (source.ProgramId != null) {\n this.ProgramId = new String(source.ProgramId);\n }\n if (source.KuberneteApiServer != null) {\n this.KuberneteApiServer = new String(source.KuberneteApiServer);\n }\n if (source.KuberneteNativeType != null) {\n this.KuberneteNativeType = new String(source.KuberneteNativeType);\n }\n if (source.KuberneteNativeSecret != null) {\n this.KuberneteNativeSecret = new String(source.KuberneteNativeSecret);\n }\n if (source.ProgramIdList != null) {\n this.ProgramIdList = new String[source.ProgramIdList.length];\n for (int i = 0; i < source.ProgramIdList.length; i++) {\n this.ProgramIdList[i] = new String(source.ProgramIdList[i]);\n }\n }\n }", "public static void main(String[] args) {\n\t\tEnvironmentInformation.logEnvironmentInfo(LOG, KubernetesJobClusterEntrypoint.class.getSimpleName(), args);\n\t\tSignalHandler.register(LOG);\n\t\tJvmShutdownSafeguard.installAsShutdownHook(LOG);\n\n\t\tConfiguration configuration = GlobalConfiguration.loadConfiguration();\n\n\t\tKubernetesJobClusterEntrypoint kubernetesJobClusterEntrypoint =\n\t\t\tnew KubernetesJobClusterEntrypoint(configuration);\n\n\t\tkubernetesJobClusterEntrypoint.startCluster();\n\t}", "public static void main(String[] args) throws Exception {\n V1Pod pod =\n new V1Pod()\n .metadata(new V1ObjectMeta().name(\"foo\").namespace(\"default\"))\n .spec(\n new V1PodSpec()\n .containers(Arrays.asList(new V1Container().name(\"c\").image(\"test\"))));\n\n ApiClient apiClient = ClientBuilder.standard().build();\n GenericKubernetesApi<V1Pod, V1PodList> podClient =\n new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, \"\", \"v1\", \"pods\", apiClient);\n\n V1Pod latestPod = podClient.create(pod).throwsApiException().getObject();\n System.out.println(\"Created!\");\n\n V1Pod patchedPod =\n podClient\n .patch(\n \"default\",\n \"foo\",\n V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH,\n new V1Patch(\"{\\\"metadata\\\":{\\\"finalizers\\\":[\\\"example.io/foo\\\"]}}\"))\n .throwsApiException()\n .getObject();\n System.out.println(\"Patched!\");\n\n V1Pod deletedPod = podClient.delete(\"default\", \"foo\").throwsApiException().getObject();\n if (deletedPod != null) {\n System.out.println(\n \"Received after-deletion status of the requested object, will be deleting in background!\");\n }\n System.out.println(\"Deleted!\");\n }", "@Override\n public ITestbed create(ITasResolver tasResolver) {\n List<String> emChosenFeatures = Arrays.asList(\"Enterprise Manager\", \"WebView\");\n\n \n // Collector1 role\n EmRole collector1Role =\n new EmRole.LinuxBuilder(COLLECTOR1_ROLE_ID, tasResolver)\n .emClusterRole(DeployEMFlowContext.EmRoleEnum.COLLECTOR)\n .silentInstallChosenFeatures(emChosenFeatures)\n .dbhost(tasResolver.getHostnameById(MOM_ROLE_ID))\n .installDir(TasBuilder.LINUX_SOFTWARE_LOC+\"em_col\")\n .emPort(5005).emWebPort(8085).wvEmPort(8090)\n .nostartEM().nostartWV()\n .build();\n \n // MOM role\n EmRole momRole =\n new EmRole.LinuxBuilder(MOM_ROLE_ID, tasResolver)\n .emClusterRole(DeployEMFlowContext.EmRoleEnum.MANAGER)\n .emCollector(collector1Role)\n .nostartEM().nostartWV().build();\n \n //CDV role\n EmRole cdvRole = new EmRole.LinuxBuilder(CDV_ROLE_ID, tasResolver)\n .emClusterRole(DeployEMFlowContext.EmRoleEnum.CDV)\n .silentInstallChosenFeatures(emChosenFeatures)\n .emCollector(collector1Role)\n .nostartEM().nostartWV().build();\n\n // QAAppRole for Tomcat\n WebAppRole<TomcatRole> qaAppTomcatRole =\n new QaAppTomcatRole.Builder(QA_APP_TOMCAT_ROLE_ID, tasResolver)\n .cargoDeploy().contextName(\"qa-app\")\n .build(); \n\n // Tomcat Role\n TomcatRole tomcatRole =\n new TomcatRole.LinuxBuilder(TOMCAT_ROLE_ID, tasResolver).tomcatVersion(TomcatVersion.v70)\n .tomcatCatalinaPort(9091).webApp(qaAppTomcatRole).build();\n\n // Tomcat Agent Role\n IRole tomcatAgentRole =\n new AgentRole.LinuxBuilder(TOMCAT_AGENT_ROLE_ID, tasResolver).webAppServer(tomcatRole)\n .intrumentationLevel(AgentInstrumentationLevel.FULL).emRole(momRole)\n .build();\n \n \n // Configuration of Cdv machine\n TestbedMachine cdvMachine =\n TestBedUtils\n .createLinuxMachine(CDV_MACHINE_ID, EM_TEMPLATE_ID, cdvRole); \n \n // Configuration of Collector1 machine\n TestbedMachine emMachine =\n TestBedUtils\n .createLinuxMachine(EM_MACHINE_ID, EM_TEMPLATE_ID, momRole, collector1Role);\n\n\n // Configuration of Agent Machine\n TestbedMachine agentMachine =\n TestBedUtils.createLinuxMachine(AGENT_MACHINE_ID, AGENT_MACHINE_TEMPLATE_ID,\n tomcatRole, qaAppTomcatRole, tomcatAgentRole);\n \n return Testbed.create(this, cdvMachine, emMachine, agentMachine);\n\n }", "public void updateClusterDetails(UpdateClusterRequest callbackRequest) throws JsonProcessingException, IOException {\n\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tString callbackRequestStr = mapper.writeValueAsString(callbackRequest);\n\t\tlogger.info(\"Update Request: \" + callbackRequestStr);\n\t\tArrayList<String> masterNodes = new ArrayList<String>();\n\t\tArrayList<String> workderNodes = new ArrayList<String>();\n\t\t// set cluster id and inventory path.\n\t\tClusterEnv clusterEnv = new ClusterEnv(callbackRequest.getClusterID());\n\t\tclusterEnv.setInventoryPath(getInventoryPath(callbackRequest.getClusterID()));\n\t\t// if provision details are present set it. If request is posted after\n\t\t// provisioning\n\t\tK8SCluster cluster = clusterRepository.findById(callbackRequest.getClusterID());\n\n\t\tif (cluster == null) {\n\t\t\tlogger.info(\"Cluster could not be found in Database... \");\n\t\t\tthrow new ClusterException(\"Cluster could not be found in database..\");\n\t\t}\n\n\t\tif (callbackRequest.getProvisionDetails() != null) {\n\t\t\tfor (ProvisionDetails provDetails : callbackRequest.getProvisionDetails()) {\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"MASTER\") && masterNodes.size() <= 1) {\n\t\t\t\t\tmasterNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"WORKER\")) {\n\t\t\t\t\tworkderNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] kubeMasterIps = new String[masterNodes.size()];\n\t\t\tString[] kubeNodeIps = new String[workderNodes.size()];\n\t\t\tmasterNodes.toArray(kubeMasterIps);\n\t\t\tworkderNodes.toArray(kubeNodeIps);\n\t\t\tclusterEnv.setKubeMasterIps(kubeMasterIps);\n\t\t\tclusterEnv.setKubeNodeIps(kubeNodeIps);\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t}\n\t\t// if request is posted after create cluster\n\t\tif (callbackRequest.getCreateClusterDetails() != null) {\n//\t\t\tclusterDetails = (ClusterEnv) redisRepo.findById(clusterRequest.getClusterID(),\n//\t\t\t\t\tCacheKeysEnum.CLUSTER_DETAILS);\t\n\n\t\t\tclusterEnv.setApiServerUrl(callbackRequest.getCreateClusterDetails().getKubeApiServerUrl());\n\t\t\t// clusterEnv.setK8sAdminToken(clusterRequest.getCreateClusterDetails().getK8sAdminToken());\n\t\t\tclusterEnv.setK8sDashboardUrl(callbackRequest.getCreateClusterDetails().getK8sDashboadUrl());\n\t\t\t// clusterEnv.setDashboardToken(clusterRequest.getCreateClusterDetails().getDashboardToken());\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\n\t\t\t// If provisioning completed, that means, Azure Native flow. Already record\n\t\t\t// present in clusterenv - hence update\n\t\t\tif (cluster.getCreateStatus().equalsIgnoreCase(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\tclusterRepository.updateClusterEnv(clusterEnv);\n\t\t\t} else {\n\t\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\t\t\t}\n\n\t\t\t// SAVE Tokens to Vault\n\t\t\tsaveTokensToVault(callbackRequest);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.READY.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t\tif (callbackRequest.getCreateClusterDetails().getKubeConfig() != null) {\n\n\t\t\t\tlogger.info(\"Kube Cofig from callback request::\"\n\t\t\t\t\t\t+ callbackRequest.getCreateClusterDetails().getKubeConfig().asText());\n\t\t\t} else {\n\t\t\t\tlogger.info(\"Kube Cofig from callback request is null::\");\n\t\t\t}\n\t\t}\n\n\t\tif (callbackRequest.getMonitoringDetails() != null) {\n\t\t\t// TODO - Save montiroting details in database\n\t\t\tlogger.info(\"Monitoring details - Grafana URL- from callback request::\"\n\t\t\t\t\t+ callbackRequest.getMonitoringDetails().getGrafanaUrl());\n\t\t}\n\t\t// redisRepo.save(clusterEnv, CacheKeysEnum.CLUSTER_DETAILS);\n\n\t}", "private ITaskCluster createTaskCluster(ITaskObject... taskObjects) {\n ITaskCluster taskCluster = getTaskManagerConfiguration().getTaskFactory().newTaskCluster();\n taskCluster = getTaskManagerConfiguration().getTaskManagerWriter().saveNewTaskCluster(taskCluster);\n\n return createTaskGraphForTaskCluster(taskCluster, taskObjects);\n }", "private void createInstance(RemoteService remote, Path tmp, String groupName, ProductManifest product, String instanceName,\n String... nodeNames) {\n InstanceConfiguration instanceConfig = TestFactory.createInstanceConfig(instanceName, product);\n try (BHive hive = new BHive(tmp.resolve(\"hive\").toUri(), null, new ActivityReporter.Null())) {\n PushOperation pushOperation = new PushOperation();\n Builder instanceManifest = new InstanceManifest.Builder().setInstanceConfiguration(instanceConfig);\n\n for (String nodeName : nodeNames) {\n InstanceNodeConfiguration nodeConfig = new InstanceNodeConfiguration();\n nodeConfig.id = UuidHelper.randomId();\n nodeConfig.applications.add(TestFactory.createAppConfig(product));\n\n Key instanceNodeKey = new InstanceNodeManifest.Builder().setInstanceNodeConfiguration(nodeConfig)\n .setMinionName(nodeName).insert(hive);\n instanceManifest.addInstanceNodeManifest(nodeName, instanceNodeKey);\n pushOperation.addManifest(instanceNodeKey);\n }\n\n Key instanceKey = instanceManifest.insert(hive);\n pushOperation.addManifest(instanceKey);\n hive.execute(pushOperation.setHiveName(groupName).setRemote(remote));\n }\n }", "void start(String resourceGroupName, String referer, String virtualMachineName);", "public static boolean runSample(Azure azure) {\n final String resourceGroupName = Utils.createRandomName(\"rg\");\n final String cdnProfileName = Utils.createRandomName(\"cdnStandardProfile\");\n String[] appNames = new String[8];\n\n try {\n // ============================================================\n // Create a resource group for holding all the created resources\n azure.resourceGroups().define(resourceGroupName)\n .withRegion(Region.US_CENTRAL)\n .create();\n\n // ============================================================\n // Create 8 websites\n for (int i = 0; i < 8; i++) {\n appNames[i] = SdkContext.randomResourceName(\"webapp\" + (i + 1) + \"-\", 20);\n }\n\n // 2 in US\n createWebApp(appNames[0], Region.US_WEST, azure, resourceGroupName);\n createWebApp(appNames[1], Region.US_EAST, azure, resourceGroupName);\n\n // 2 in EU\n createWebApp(appNames[2], Region.EUROPE_WEST, azure, resourceGroupName);\n createWebApp(appNames[3], Region.EUROPE_NORTH, azure, resourceGroupName);\n\n // 2 in Southeast\n createWebApp(appNames[4], Region.ASIA_SOUTHEAST, azure, resourceGroupName);\n createWebApp(appNames[5], Region.AUSTRALIA_SOUTHEAST, azure, resourceGroupName);\n\n // 1 in Brazil\n createWebApp(appNames[6], Region.BRAZIL_SOUTH, azure, resourceGroupName);\n\n // 1 in Japan\n createWebApp(appNames[7], Region.JAPAN_WEST, azure, resourceGroupName);\n\n // =======================================================================================\n // Create CDN profile using Standard Verizon SKU with endpoints in each region of Web apps.\n System.out.println(\"Creating a CDN Profile\");\n\n // Create CDN Profile definition object that will let us do a for loop\n // to define all 8 endpoints and then parallelize their creation\n CdnProfile.DefinitionStages.WithStandardCreate profileDefinition = azure.cdnProfiles().define(cdnProfileName)\n .withRegion(Region.US_CENTRAL)\n .withExistingResourceGroup(resourceGroupName)\n .withStandardVerizonSku();\n\n // Define all the endpoints. We need to keep track of the last creatable stage\n // to be able to call create on the entire Cdn profile deployment definition.\n Creatable<CdnProfile> cdnCreatable = null;\n for (String webSite : appNames) {\n cdnCreatable = profileDefinition.defineNewEndpoint()\n .withOrigin(webSite + SUFFIX)\n .withHostHeader(webSite + SUFFIX)\n .withCompressionEnabled(true)\n .withContentTypeToCompress(\"application/javascript\")\n .withQueryStringCachingBehavior(QueryStringCachingBehavior.IGNORE_QUERY_STRING)\n .attach();\n }\n\n // Create profile and then all the defined endpoints in parallel\n CdnProfile profile = cdnCreatable.create();\n\n // =======================================================================================\n // Load some content (referenced by Web Apps) to the CDN endpoints.\n Set<String> contentToLoad = new HashSet<>();\n contentToLoad.add(\"/server.js\");\n contentToLoad.add(\"/pictures/microsoft_logo.png\");\n\n for (CdnEndpoint endpoint : profile.endpoints().values()) {\n endpoint.loadContent(contentToLoad);\n }\n return true;\n } catch (Exception f) {\n System.out.println(f.getMessage());\n f.printStackTrace();\n } finally {\n if (azure.resourceGroups().getByName(resourceGroupName) != null) {\n System.out.println(\"Deleting Resource Group: \" + resourceGroupName);\n azure.resourceGroups().deleteByName(resourceGroupName);\n System.out.println(\"Deleted Resource Group: \" + resourceGroupName);\n } else {\n System.out.println(\"Did not create any resources in Azure. No clean up is necessary\");\n }\n }\n return false;\n }", "public static void main(String[] args) {\n String master = \"spark://10.211.55.101:7077\";\n SparkConf conf = new SparkConf()\n .setMaster(master)\n// .set(\"spark.driver.memory\", \"512m\")\n// .set(\"spark.worker.memory\", \"512m\")\n .set(\"spark.executor.memory\", \"1g\")\n// .set(\"spark.task.cpus\", \"2\")\n .set(\"spark.cores.max\", \"3\")\n .setAppName(\"Simple Application\");\n\n JavaSparkContext sc = new JavaSparkContext(conf);\n sc.addJar(\"target/SparkTraining-1.0-SNAPSHOT.jar\");\n\n// JavaRDD<String> rdd = sc.textFile(\"file:///home/pi/raspberry/Notes.txt\");\n// JavaPairRDD<String, Integer> reducedRDD = rdd.flatMap(s -> Arrays.asList(s.split(\"\\\\s+\")))\n// .mapToPair(s -> new Tuple2<>(s, 1))\n// .reduceByKey((a, b) -> a + b);\n// System.out.println(reducedRDD.take(10));\n\n JavaRDD<String> rdd = sc.parallelize(Arrays.asList(\n \"//vagrant/raspberry/Notes.txt\",\n \"/vagrant/raspberry/run-hadoop.sh\",\n \"/vagrant/raspberry/run-hadoop.sh\"));\n// rdd = rdd.repartition(2);\n List<String> collect = rdd.map(new ClusterExecutor()).collect();\n System.out.println(collect);\n }", "@PostMapping\n public KubeClusterDto create(@RequestBody ClusterCreationRequest clusterCreationRequest) {\n return kubeClusterMapper.map(kubeClusterService.create(clusterCreationRequest));\n }", "@When(\"^I match for resources for my application on the cloud$\")\n public void I_match_for_resources_for_my_application_on_the_cloud() throws Throwable {\n Application application = Context.getInstance().getApplication();\n Context.getInstance().registerRestResponse(\n Context.getRestClientInstance().get(\n \"/rest/applications/\" + application.getId() + \"/environments/\"\n + Context.getInstance().getDefaultApplicationEnvironmentId(application.getName()) + \"/deployment-setup\"));\n }", "public CreateServiceRequest withCluster(String cluster) {\n setCluster(cluster);\n return this;\n }", "void start() throws Exception {\n vaultManager.start();\n\n cfgManager.start();\n\n // metastorage configuration\n var config = String.format(\"{\\\"node\\\": {\\\"metastorageNodes\\\": [ \\\"%s\\\" ]}}\", addr);\n\n cfgManager.bootstrap(config, ConfigurationType.LOCAL);\n\n Stream.of(clusterService, raftManager, metaStorageManager).forEach(IgniteComponent::start);\n\n // this is needed to avoid assertion errors\n cfgStorage.registerConfigurationListener(changedEntries -> {});\n\n // deploy watches to propagate data from the metastore into the vault\n metaStorageManager.deployWatches();\n }", "void createComputeInstance(LaunchSpecifications launchSpecifications)\n throws CloudExceptions;", "public void initAsg(){\n\t\tConfigure conf = Configure.getConf();\n\t\tint min = conf.getMaxNum();\n\t\t\n\t\t//launch min number of instances\n\t\tTimeManager.PrintCurrentTime(\"Init Cluster, launching %d DC\\n\", min);\n\t\tfor(int i=0; i < min; i++){\n\t\t\tConnToDC dc = nova.launchOne(conf.getInatanceName());\n\t\t\tif(dc != null){\n\t\t\t\tdcList.offer(dc);\n\t\t\t\tlb.addDC(dc.getIp());\n\t\t\t\tTimeManager.PrintCurrentTime(\"Successfully launch 1 DC [%s:%s]\\n\", \n\t\t\t\t\t\tdc.getIp(), dc.getId());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ;\n\t}", "public void addCluster()\r\n\t{\r\n\t\tcluster[nextAvailableCluster()] = true;\r\n\t}", "public static void main(String[] args) {\n KSCKETClient ksc = new KSCKETClient(\"73404025\",\"http://taskmanager.xiaomitest.ksyun.com:8095/offline/\");\n //KSCKETClient ksc = new KSCKETClient(\"73404025\",\"http://120.92.213.72/offline/\");\n\n /**\n * 模板管理\n */\n //创建模板\n PresetRequest presetRequest = new PresetRequest();\n String data = setPresetSet(\"hls_265\", \"h265\");\n presetRequest.setData(data);\n KvsErrResult presetResult = ksc.Preset(presetRequest);\n System.out.println(presetResult);\n\n //查询模板列表\n GetPresetListRequest getPresetListRequest = new GetPresetListRequest();\n getPresetListRequest.setPresetType(\"avtrans\");\n getPresetListRequest.setWithDetail(1);\n GetPresetListResult getPresetListResult = ksc.GetPresetList(getPresetListRequest);\n System.out.println(getPresetListResult);\n\n //更新模板\n UpdatePresetRequest updatePresetRequest = new UpdatePresetRequest();\n String data1 = setPresetSet4Update(\"hls_265_720p\", \"scale to width of 360px and transcode to flv format\");\n updatePresetRequest.setData(data1);\n KvsErrResult updatePresetresetResult = ksc.UpdatePreset(updatePresetRequest);\n System.out.println(updatePresetresetResult);\n\n //删除模板\n DeletePresetRequest deletePresetRequest = new DeletePresetRequest();\n deletePresetRequest.setPreset(\"hls_265\");\n KvsErrResult deletePresetResult = ksc.DelPreset(deletePresetRequest);\n System.out.println(deletePresetResult);\n\n\n //查询模板详情\n GetPresetDetailRequest getPresetDetailRequest = new GetPresetDetailRequest();\n getPresetDetailRequest.setPreset(\"myd_test1\");//hls_265_720p\n GetPresetDetailResult getPresetDetailResult = ksc.GetPresetDetail(getPresetDetailRequest);\n System.out.println(getPresetDetailResult);\n\n\n /**\n * 任务管理\n */\n // 创建任务\n CreateTaskRequest createTaskRequest = new CreateTaskRequest();\n //String data2 = setTask4kss(\"myd_test1\", \"3c6c1cf8a26080944ab95a42a05b1ca6\");//\"liuhengxin/video/logo.mp4\"); //test_hls_265_720\n String data2 = setTask4ks3(\"myd_test1\", \"chenjin_test_ref_id\");\n\n createTaskRequest.setData(data2);\n CreateTasklResult createTasklResult = ksc.CreateTask(createTaskRequest);\n System.out.println(createTasklResult);\n\n //删除任务\n DelTaskByTaskIDRequest delTaskByTaskIDRequest = new DelTaskByTaskIDRequest();\n delTaskByTaskIDRequest.setTaskID(\"88124659ee1daaa50b75c043dd9533z020200218\");\n KvsErrResult delTaskByTaskIDResult = ksc.DelTaskByTaskID(delTaskByTaskIDRequest);\n System.out.println(delTaskByTaskIDResult);\n\n\n//\n// //查询任务列表\n GetTaskListRequest getTaskListRequest = new GetTaskListRequest();\n getTaskListRequest.setStartDate(20200402);\n getTaskListRequest.setEndDate(20200427);\n getTaskListRequest.setTaskStatus(\"succ\"); //可选值:init,exec,succ,fail\n //getTaskListRequest.setErrorCode(\"3255\");\n GetTaskListResult getTaskListResult = ksc.GetTaskList(getTaskListRequest);\n System.out.println(getTaskListResult);\n//\n //查询任务详情\n GetTaskByTaskIDRequest getTaskByTaskIDRequest = new GetTaskByTaskIDRequest();\n getTaskByTaskIDRequest.setTaskID(\"44428d77907c99a65a41b1d24dd156z020200427\");\n GetTaskByTaskIDResult getTaskByTaskIDResult = ksc.GetTaskByTaskID(getTaskByTaskIDRequest);\n System.out.println(getTaskByTaskIDResult);\n\n //查询任务META列表\n GetTaskMetaRequest getTaskMetaInfoRequest = new GetTaskMetaRequest();\n getTaskMetaInfoRequest.setTaskID(\"020256be6ab02c9351b037d9c7b7e3z020200219\"); //需要是avinfo类型模板的任务\n getTaskMetaInfoRequest.setStartDate(20200202);\n GetTaskMetaResult getTaskMetaResult = ksc.GetTaskMetaInfo(getTaskMetaInfoRequest);\n System.out.println(getTaskMetaResult);\n\n\n\n }", "@BeforeTest\n public void setupEnv() {\n CLUSTER.start();\n endpoints = CLUSTER.getClientEndpoints();\n Client client = Client.builder()\n .endpoints(endpoints)\n .build();\n\n this.authDisabledKVClient = client.getKVClient();\n this.authDisabledAuthClient = client.getAuthClient();\n }", "public static void main(String[] args) {\n port(getHerokuAssignedPort());\n\n // This will store the cats retrieved from the API\n ArrayList<PetModel> cats = new ArrayList<>();\n\n // Set up Configuration for Freemark. This should only be done once.\n Configuration cfg = new Configuration(Configuration.VERSION_2_3_26);\n cfg.setClassForTemplateLoading(CatFinder.class, \"/layouts/\");\n cfg.setDefaultEncoding(\"UTF-8\");\n\n staticFiles.location(\"/static\");\n\n\n // zipcode that will be used to populate results page\n //int zipCode;\n\n // Home page\n get(\"/\", (Request req, Response res) -> {\n\n StringWriter writer = new StringWriter();\n Map attributes = new HashMap();\n attributes.put(\"home_banner\", \"Lets find a cat.\");\n\n String path = \"static/home_bg.jpg\";\n Path p = Paths.get(path);\n String pString = p.toString();\n\n attributes.put(\"image_path\", pString);\n\n try {\n Template homeTemplate = cfg.getTemplate(\"home.ftl\");\n homeTemplate.process(attributes, writer);\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"home.ftl not found!\");\n Spark.halt(500);\n }\n return writer;\n });\n\n\n // a sample to demo API\n ArrayList<PetModel> pets = new ArrayList<>();\n get(\"/sample\", (req, res) -> {\n\n // Store your key in a .env file and be sure to ignore that from git.\n String key = System.getenv(\"PETFINDER_KEY\");\n String urlString = \"http://api.petfinder.com/pet.find?key=\" + key + \"&animal=cat&location=93117&format=json\";\n\n System.out.println(urlString);\n\n // Create a URL with the url formed.\n URL url = new URL(urlString);\n // Open a connection.\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n\n // because we are retrieving...\n connection.setRequestMethod(\"GET\");\n connection.connect();\n\n // There will be an issue with the response code is not 200..\n int responsecode = connection.getResponseCode();\n if (responsecode != 200) { System.out.println(\"oh no\");}\n\n // Use a scanner to read from the API.\n Scanner sc = new Scanner(url.openStream());\n String inline = \"\";\n while (sc.hasNext()) {\n inline += sc.nextLine();\n }\n sc.close();\n\n // Using the string formed from the scanner, create a JSON object\n JSONObject json = new JSONObject(inline);\n\n // We want to store every pet into a PetModel. Note the layout of the JSON file retrieved from the API.\n json = (JSONObject) json.get(\"petfinder\");\n json = (JSONObject) json.get(\"pets\");\n\n // Now get the array of pets from the JSON. We can iterate through it to store them into the model.\n JSONArray json_pets = (JSONArray) json.get(\"pet\");\n for (int i = 0; i < json_pets.length(); i++) {\n PetModel pet = new PetModel();\n JSONObject json_pet = (JSONObject) json_pets.get(i);\n JSONObject json_pet_name = (JSONObject) json_pet.get(\"name\");\n JSONObject json_pet_gender = (JSONObject) json_pet.get(\"sex\");\n JSONObject json_pet_description = (JSONObject) json_pet.get(\"description\");\n JSONObject json_pet_img = (JSONObject) json_pet.get(\"media\");\n\n // Watch out for situations where some fields may be empty. We can check the length of it before trying\n // to grab from it.\n if (json_pet_img.length() != 0) {\n json_pet_img = (JSONObject) json_pet_img.get(\"photos\");\n JSONArray json_pet_img_arr = (JSONArray) json_pet_img.get(\"photo\");\n\n if (json_pet_img_arr.length() != 0) {\n for (int k = 0; k < json_pet_img_arr.length(); k++) {\n json_pet_img = (JSONObject) json_pet_img_arr.get(0);\n }\n }\n\n pet.img = json_pet_img.get(\"$t\").toString();\n }\n\n if (json_pet_name.length() != 0) {\n pet.name = json_pet_name.get(\"$t\").toString();\n }\n if (json_pet_description.length() != 0) {\n pet.description = json_pet_description.get(\"$t\").toString();\n }\n if (json_pet_gender.length() != 0) {\n pet.gender = json_pet_gender.get(\"$t\").toString();\n }\n\n pets.add(pet);\n }\n\n for ( PetModel cat:pets) {\n System.out.println(\"name: \" + cat.name + \" gender: \" + cat.gender);\n }\n\n return \"\";\n });\n\n post(\"/\", (req, res) -> {\n //System.out.println(req.body());\n int zipCode = Integer.parseInt(req.queryParams(\"zipcode\"));\n cats.clear();\n buildCatsList(zipCode, cats);\n System.out.println(\"zipcode entered is: \" + zipCode);\n\n StringWriter writer = new StringWriter();\n try {\n Map<String, Object> attributes = new HashMap<>();\n attributes.put(\"cats\", cats);\n Template resultsTemplate = cfg.getTemplate(\"results.ftl\");\n resultsTemplate.process(attributes, writer);\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"results.ftl not found!\");\n Spark.halt(500);\n }\n return writer;\n\n\n });\n\n\n System.out.println(\"\");\n System.out.println(\"(Don't worry about the warnings below about SLF4J... we'll deal with those later)\");\n System.out.println(\"\");\n System.out.println(\"In browser, visit: http://localhost:\" + getHerokuAssignedPort() + \"\");\n System.out.println(\"\");\n\n }", "java.util.concurrent.Future<StartApplicationResult> startApplicationAsync(StartApplicationRequest startApplicationRequest);", "public static void main(String[] args) {\n KeyStore myStore = null;\n try {\n\n /* Note: could also use a keystore file, which contains the token label or slot no. to use. Load that via\n * \"new FileInputStream(ksFileName)\" instead of ByteArrayInputStream. Save objects to the keystore via a\n * FileOutputStream. */\n\n ByteArrayInputStream is1 = new ByteArrayInputStream((\"slot:\" + slot).getBytes());\n myStore = KeyStore.getInstance(keystoreProvider);\n myStore.load(is1, passwd.toCharArray());\n } catch (KeyStoreException kse) {\n System.out.println(\"Unable to create keystore object\");\n System.exit(-1);\n } catch (NoSuchAlgorithmException nsae) {\n System.out.println(\"Unexpected NoSuchAlgorithmException while loading keystore\");\n System.exit(-1);\n } catch (CertificateException e) {\n System.out.println(\"Unexpected CertificateException while loading keystore\");\n System.exit(-1);\n } catch (IOException e) {\n // this should never happen\n System.out.println(\"Unexpected IOException while loading keystore.\");\n System.exit(-1);\n }\n\n KeyPairGenerator keyGen = null;\n KeyPair keyPair = null;\n try {\n // Generate an ECDSA KeyPair\n /* The KeyPairGenerator class is used to determine the type of KeyPair being generated. For more information\n * concerning the algorithms available in the Luna provider please see the Luna Development Guide. For more\n * information concerning other providers, please read the documentation available for the provider in question. */\n System.out.println(\"Generating ECDSA Keypair\");\n /* The KeyPairGenerator.getInstance method also supports specifying providers as a parameter to the method. Many\n * other methods will allow you to specify the provider as a parameter. Please see the Sun JDK class reference at\n * http://java.sun.org for more information. */\n keyGen = KeyPairGenerator.getInstance(\"ECDSA\", provider);\n /* ECDSA keys need to know what curve to use. If you know the curve ID to use you can specify it directly. In the\n * Luna Provider all supported curves are defined in LunaECCurve */\n ECGenParameterSpec ecSpec = new ECGenParameterSpec(\"c2pnb304w1\");\n keyGen.initialize(ecSpec);\n keyPair = keyGen.generateKeyPair();\n } catch (Exception e) {\n System.out.println(\"Exception during Key Generation - \" + e.getMessage());\n System.exit(1);\n }\n\n // generate a self-signed ECDSA certificate.\n Date notBefore = new Date();\n Date notAfter = new Date(notBefore.getTime() + 1000000000);\n BigInteger serialNum = new BigInteger(\"123456\");\n LunaCertificateX509 cert = null;\n try {\n cert = LunaCertificateX509.SelfSign(keyPair, \"CN=ECDSA Sample Cert\", serialNum, notBefore, notAfter);\n } catch (InvalidKeyException ike) {\n System.out.println(\"Unexpected InvalidKeyException while generating cert.\");\n System.exit(-1);\n } catch (CertificateEncodingException cee) {\n System.out.println(\"Unexpected CertificateEncodingException while generating cert.\");\n System.exit(-1);\n }\n\n byte[] bytes = \"Some Text to Sign as an Example\".getBytes();\n System.out.println(\"PlainText = \" + com.safenetinc.luna.LunaUtils.getHexString(bytes, true));\n\n Signature ecdsaSig = null;\n byte[] signatureBytes = null;\n try {\n // Create a Signature Object and signUsingI2p the encrypted text\n /* Sign/Verify operations like Encrypt/Decrypt operations can be performed in either singlepart or multipart\n * steps. Single part Signing and Verify examples are given in this code. Multipart signatures use the\n * Signature.update() method to load all the bytes and then invoke the Signature.signUsingI2p() method to get the result.\n * For more information please see the class documentation for the java.security.Signature class with respect to\n * the version of the JDK you are using. */\n System.out.println(\"Signing encrypted text\");\n ecdsaSig = Signature.getInstance(\"ECDSA\", provider);\n ecdsaSig = Signature.getInstance(\"SHA256withECDSA\", provider);\n ecdsaSig.initSign(keyPair.getPrivate());\n ecdsaSig.update(bytes);\n signatureBytes = ecdsaSig.sign();\n\n // Verify the signature\n System.out.println(\"Verifying signature(via Signature.verify)\");\n ecdsaSig.initVerify(keyPair.getPublic());\n ecdsaSig.update(bytes);\n boolean verifies = ecdsaSig.verify(signatureBytes);\n if (verifies == true) {\n System.out.println(\"Signature passed verification\");\n } else {\n System.out.println(\"Signature failed verification\");\n }\n\n } catch (Exception e) {\n System.out.println(\"Exception during Signing - \" + e.getMessage());\n System.exit(1);\n }\n\n try {\n // Verify the signature\n System.out.println(\"Verifying signature(via cert)\");\n ecdsaSig.initVerify(cert);\n ecdsaSig.update(bytes);\n boolean verifies = ecdsaSig.verify(signatureBytes);\n if (verifies == true) {\n System.out.println(\"Signature passed verification\");\n } else {\n System.out.println(\"Signature failed verification\");\n }\n } catch (Exception e) {\n System.out.println(\"Exception during Verification - \" + e.getMessage());\n System.exit(1);\n }\n\n// // Logout of the token\n// HSM_Manager.hsmLogout();\n }", "SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(String databaseName);", "@Override\n public void onComplete(AWSStartupResult awsStartupResult) {\n }", "@Override\n public void onComplete(AWSStartupResult awsStartupResult) {\n }", "public static void main(String[] args)\n {\n Client oneClient;\n\n try\n {\n oneClient = new Client();\n\n // We will try to create a new virtual machine. The first thing we\n // need is an OpenNebula virtual machine template.\n\n // This VM template is a valid one, but it will probably fail to run\n // if we try to deploy it; the path for the image is unlikely to\n // exist.\n String vmTemplate =\n \"NAME = vm_from_java CPU = 0.1 MEMORY = 64\\n\"\n + \"#DISK = [\\n\"\n + \"#\\tsource = \\\"/home/user/vmachines/ttylinux/ttylinux.img\\\",\\n\"\n + \"#\\ttarget = \\\"hda\\\",\\n\"\n + \"#\\treadonly = \\\"no\\\" ]\\n\"\n + \"# NIC = [ NETWORK = \\\"Non existing network\\\" ]\\n\"\n + \"FEATURES = [ acpi=\\\"no\\\" ]\";\n\n // You can try to uncomment the NIC line, in that case OpenNebula\n // won't be able to insert this machine in the database.\n\n System.out.println(\"Virtual Machine Template:\\n\" + vmTemplate);\n System.out.println();\n\n System.out.print(\"Trying to allocate the virtual machine... \");\n OneResponse rc = VirtualMachine.allocate(oneClient, vmTemplate);\n\n if( rc.isError() )\n {\n System.out.println( \"failed!\");\n throw new Exception( rc.getErrorMessage() );\n }\n\n // The response message is the new VM's ID\n int newVMID = Integer.parseInt(rc.getMessage());\n System.out.println(\"ok, ID \" + newVMID + \".\");\n\n // We can create a representation for the new VM, using the returned\n // VM-ID\n VirtualMachine vm = new VirtualMachine(newVMID, oneClient);\n\n // Let's hold the VM, so the scheduler won't try to deploy it\n System.out.print(\"Trying to hold the new VM... \");\n rc = vm.hold();\n\n if(rc.isError())\n {\n System.out.println(\"failed!\");\n throw new Exception( rc.getErrorMessage() );\n }\n else\n System.out.println(\"ok.\");\n\n // And now we can request its information.\n rc = vm.info();\n\n if(rc.isError())\n throw new Exception( rc.getErrorMessage() );\n\n System.out.println();\n System.out.println(\n \"This is the information OpenNebula stores for the new VM:\");\n System.out.println(rc.getMessage() + \"\\n\");\n\n // This VirtualMachine object has some helpers, so we can access its\n // attributes easily (remember to load the data first using the info\n // method).\n System.out.println(\"The new VM \" +\n vm.getName() + \" has status: \" + vm.status());\n\n // And we can also use xpath expressions\n System.out.println(\"The path of the disk is\");\n System.out.println( \"\\t\" + vm.xpath(\"template/disk/source\") );\n\n // Let's delete the VirtualMachine object.\n vm = null;\n\n // The reference is lost, but we can ask OpenNebula about the VM\n // again. This time however, we are going to use the VM pool\n VirtualMachinePool vmPool = new VirtualMachinePool(oneClient);\n // Remember that we have to ask the pool to retrieve the information\n // from OpenNebula\n rc = vmPool.info();\n\n if(rc.isError())\n throw new Exception( rc.getErrorMessage() );\n\n System.out.println(\n \"\\nThese are all the Virtual Machines in the pool:\");\n for ( VirtualMachine vmachine : vmPool )\n {\n System.out.println(\"\\tID : \" + vmachine.getId() +\n \", Name : \" + vmachine.getName() );\n\n // Check if we have found the VM we are looking for\n if ( vmachine.getId().equals( \"\"+newVMID ) )\n {\n vm = vmachine;\n }\n }\n\n // We have also some useful helpers for the actions you can perform\n // on a virtual machine, like suspend:\n rc = vm.suspend();\n System.out.println(\"\\nTrying to suspend the VM \" + vm.getId() +\n \" (should fail)...\");\n\n // This is all the information you can get from the OneResponse:\n System.out.println(\"\\tOpenNebula response\");\n System.out.println(\"\\t Error: \" + rc.isError());\n System.out.println(\"\\t Msg: \" + rc.getMessage());\n System.out.println(\"\\t ErrMsg: \" + rc.getErrorMessage());\n\n rc = vm.terminate();\n System.out.println(\"\\nTrying to terminate the VM \" +\n vm.getId() + \"...\");\n\n System.out.println(\"\\tOpenNebula response\");\n System.out.println(\"\\t Error: \" + rc.isError());\n System.out.println(\"\\t Msg: \" + rc.getMessage());\n System.out.println(\"\\t ErrMsg: \" + rc.getErrorMessage());\n\n\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n }\n\n\n }", "java.util.concurrent.Future<StartApplicationResult> startApplicationAsync(StartApplicationRequest startApplicationRequest,\n com.amazonaws.handlers.AsyncHandler<StartApplicationRequest, StartApplicationResult> asyncHandler);", "@Test\n public void testAddedSeldonMLDeploymentsForSingleNamespaceCluster_FailureCase() throws Exception {\n createMocks(\"src/test/resources/deployment_model_deployed.json\", \"ADDED\",true);\n SeldonDeploymentWatcher watcher = new SeldonDeploymentWatcher(mockK8sApiProvider, mockK8sClientProvider, mockCRDCreator, props, mockSeldonDeploymentController, mockMLCache, mockCRDHandler);\n watcher.watchSeldonMLDeployments(0,0);\n verify(mockCRDHandler,times(1)).updateRaw(anyString(),anyString(),anyString());\n }" ]
[ "0.646643", "0.61076933", "0.6090284", "0.59042436", "0.5330118", "0.52665925", "0.51417863", "0.51051706", "0.5074303", "0.50631285", "0.50487846", "0.50238055", "0.49120572", "0.48937413", "0.48868686", "0.48745173", "0.48737848", "0.48369938", "0.4835597", "0.48304325", "0.48009408", "0.47541282", "0.47063658", "0.4657384", "0.46496394", "0.46434373", "0.46254137", "0.46106043", "0.46015716", "0.45951003", "0.45899093", "0.4572765", "0.4572491", "0.45622584", "0.45497718", "0.4542158", "0.45338982", "0.4507861", "0.45032328", "0.44927722", "0.44348043", "0.4426405", "0.44225612", "0.44150198", "0.4405557", "0.43986264", "0.43951038", "0.43828887", "0.43826297", "0.43794826", "0.43738377", "0.4373254", "0.43663937", "0.43595302", "0.43322033", "0.43319133", "0.432959", "0.43243614", "0.43183425", "0.43046358", "0.4300758", "0.43000656", "0.4291214", "0.42905444", "0.4286347", "0.4286098", "0.4275927", "0.42755115", "0.42698178", "0.42633855", "0.42586175", "0.4248109", "0.42478338", "0.42443845", "0.4243371", "0.42346558", "0.42276803", "0.42275006", "0.42234233", "0.42221436", "0.422091", "0.42200488", "0.42157143", "0.42147514", "0.42074433", "0.41888148", "0.41850516", "0.4182952", "0.41826516", "0.41815957", "0.4173338", "0.417292", "0.41632655", "0.4161769", "0.4161285", "0.41600373", "0.41600373", "0.41554525", "0.4140996", "0.41370502" ]
0.57636285
4
Read IP from file CreateClusterRequest clusterRequest = readFileAndGetIPs(); Read IP from Cache disabling as IPs need not be passed for azure. (replaced by inventory) CreateClusterRequest clusterRequest = buildClusterRequestWithIPs(processID);
private CreateClusterRequest createClusterForAzureNative(ProvisionRequest provisionRequest, String processID) { CreateClusterRequest clusterRequest = new CreateClusterRequest(); // Populate other fields clusterRequest.setClusterID(processID); clusterRequest.setKubeDashboard(provisionRequest.getKubeDashboard()); clusterRequest.setCloudSrvc(provisionRequest.getCloudSrvc()); // set cluster after replacing - with _ clusterRequest.setClusterName(provisionRequest.getClusterName().replace('-', '_')); logger.info("provisionRequest.getMonitoringEnabled()::" + provisionRequest.getMonitoringEnabled()); if ("Y".equals(provisionRequest.getMonitoringEnabled())) { clusterRequest.setKubeMonitoring("Grafana"); logger.info("setKubeMonitoring::Grafana"); } // Populate other constant params populateCreateClusterRequest(clusterRequest); startCreateClusterTaskAzure(clusterRequest); return clusterRequest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readFile(File filename) throws IOException {\n\t\tFileInputStream fis = new FileInputStream(filename);\n\t\tInputStreamReader isr = new InputStreamReader(fis, \"UTF-8\");\n\t\tBufferedReader br = new BufferedReader(isr);\n\t\tSimpleFieldSet fs = new SimpleFieldSet(br, false, true);\n\t\tbr.close();\n\t\t// Read contents\n\t\tString[] udp = fs.getAll(\"physical.udp\");\n\t\tif((udp != null) && (udp.length > 0)) {\n\t\t\tfor(int i=0;i<udp.length;i++) {\n\t\t\t\t// Just keep the first one with the correct port number.\n\t\t\t\tPeer p;\n\t\t\t\ttry {\n\t\t\t\t\tp = new Peer(udp[i], false, true);\n\t\t\t\t} catch (HostnameSyntaxException e) {\n\t\t\t\t\tLogger.error(this, \"Invalid hostname or IP Address syntax error while loading opennet peer node reference: \"+udp[i]);\n\t\t\t\t\tSystem.err.println(\"Invalid hostname or IP Address syntax error while loading opennet peer node reference: \"+udp[i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t} catch (PeerParseException e) {\n\t\t\t\t\tthrow (IOException)new IOException().initCause(e);\n\t\t\t\t}\n\t\t\t\tif(p.getPort() == crypto.portNumber) {\n\t\t\t\t\t// DNSRequester doesn't deal with our own node\n\t\t\t\t\tnode.ipDetector.setOldIPAddress(p.getFreenetAddress());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcrypto.readCrypto(fs);\n\t}", "public File cluster() throws IOException, InterruptedException {\n Runtime r = Runtime.getRuntime();\n Process p = r.exec(mclExecutablePath + \" \" + fileName + \" -o \" + fileName + \".I20\");\n p.waitFor();\n clusterResultFile = new File(fileName + \".I20\");\n return clusterResultFile;\n }", "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "private static void fileRead(String file) {\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(file));\n\t\t\tString line = \"\";\n\t\t\twhile((line=br.readLine())!=null) {\n\t\t\t\tString data[] = line.split(\"\\\\t\");\n\t\t\t\tint id = Integer.parseInt(data[0]);\n\t\t\t\tint groundTruth = Integer.parseInt(data[1]);\n\t\t\t\tactualClusters.put(id, groundTruth);\n\t\t\t\tArrayList<Double> temp = new ArrayList<>();\n\t\t\t\tfor(int i=2;i<data.length;i++) {\n\t\t\t\t\ttemp.add(Double.parseDouble(data[i]));\n\t\t\t\t}\n\t\t\t\tcols = data.length-2;\n\t\t\t\tgeneAttributes.put(id, temp);\n\t\t\t\tallClusters.add(id+\"\");\n\t\t\t\ttotalGenes++;\n\t\t\t}\n\t\t\ttotalCluster = totalGenes;\n\t\t\tbr.close();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public VCFManager(String inputVcf_file,NaivePedcaPlotter n) throws FileNotFoundException, InterruptedException {\n\t\tSystem.out.println(\"cluster 1 size:\"+n.LENGTH_OF_CLUSTER_ONE_CONTIGS+\" cluster 2 size:\"+n.LENGTH_OF_CLUSTER_TWO_CONTIGS);\n\t\tploestPlotter=n;\n\t\tFile pilonOutFolder = new File(outputFileRoot);\n\t\tpilonOutFolder.mkdirs();\n\t\tvcfExtractor(inputVcf_file);\n\t}", "public synchronized void start() throws IOException, ClassNotFoundException, RemoteReadException, InstantiationException, IllegalAccessException, InterruptedException\n\t{\n\t\t// Start up the peer. 06/14/2017, Bing Li\n\t\tif (!this.peer.isStarted())\n\t\t{\n\t\t\tthis.peer.start();\n\t\t}\n\n\t\t// Retrieve all of the registered IP addresses of the distributed nodes in the cluster from the registry server. 07/05/2017, Bing Li\n\t\tClusterIPResponse ipResponse = (ClusterIPResponse)this.peer.read(RegistryConfig.PEER_REGISTRY_ADDRESS, RegistryConfig.PEER_REGISTRY_PORT, new ClusterIPRequest());\n\t\tif (ipResponse.getIPs() != null)\n\t\t{\n\t\t\t// Add the IP addresses to the client pool. 07/05/2017, Bing Li\n\t\t\tfor (IPAddress ip : ipResponse.getIPs().values())\n\t\t\t{\n\t\t\t\tthis.peer.getClientPool().addIP(ip.getIP(), ip.getPort());\n\t\t\t}\n\n\t\t\t// Initialize the cluster root IP address broadcast notifier. 07/05/2017, Bing Li\n\t\t\tthis.rootIPBroadcastNotifier = new ClusterRootBroadcastNotifier<IPAddress, OldRootIPAddressBroadcastNotification, RootIPAddressBroadcastNotificationCreator>(this.peer.getClientPool(), MulticastConfig.MULTICASTOR_POOL_SIZE, MulticastConfig.RESOURCE_WAIT_TIME, new RootIPAddressBroadcastNotificationCreator());\n\t\t\t// Broadcast the root IP address to each child in the cluster. 07/05/2017, Bing Li\n\t\t\tthis.rootIPBroadcastNotifier.notifiy(new IPAddress(this.peer.getPeerID(), this.peer.getPeerIP(), this.peer.getPort()), MulticastConfig.ROOT_BRANCH_COUNT, MulticastConfig.SUB_BRANCH_COUNT);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Initialize the cluster root IP address broadcast notifier. 07/05/2017, Bing Li\n\t\t\tthis.rootIPBroadcastNotifier = new ClusterRootBroadcastNotifier<IPAddress, OldRootIPAddressBroadcastNotification, RootIPAddressBroadcastNotificationCreator>(this.peer.getClientPool(), MulticastConfig.MULTICASTOR_POOL_SIZE, MulticastConfig.RESOURCE_WAIT_TIME, new RootIPAddressBroadcastNotificationCreator());\n\t\t}\n\t}", "@Override\n\tpublic initNode readInfo() throws IOException {\n\t\tif(!isInit()) \n\t\t{\n\t\t\tthrow new IOException();\n\t\t}\n\n\t\tinitNode info = new initNode();\n\t\t\n\t\tBufferedReader br = new BufferedReader(new FileReader(initService.defaultAddr+initFile));\n\t\tString line;\n\t\twhile((line = br.readLine())!=null) \n\t\t{\n\t\t\tif(line.startsWith(beforeBlockChainIp)) \n\t\t\t{\n\t\t\t\tinfo.setBlockChainIp(line.substring(beforeBlockChainIp.length(),line.length()));\n\t\t\t}\n\t\t\telse if(line.startsWith(beforeFilepath)) \n\t\t\t{\n\t\t\t\tinfo.setBlockChainFilepath(line.substring(beforeFilepath.length(),line.length()));\n\t\t\t}\n\t\t\telse if(line.startsWith(beforePassword)) \n\t\t\t{\n\t\t\t\tinfo.setBlockChainPassword(line.substring(beforePassword.length(),line.length()));\n\t\t\t}\n\t\t\telse if(line.startsWith(beforeIpfsIp)) \n\t\t\t{\n\t\t\t\tinfo.setIpfsIp(line.substring(beforeIpfsIp.length(),line.length()));\n\t\t\t}\n\t\t}\n\t\tbr.close();\n\t\treturn info;\n\t}", "public void setup(Context context) throws IOException{\n\t\t\t//读取存储的centers\n\t\t\tConfiguration conf = context.getConfiguration();\n\t\t\tPath[] caches = DistributedCache.getLocalCacheFiles(conf);\n\t\t\t\n\t\t\tif (caches == null || caches.length <= 0) {\n\t\t\t\tSystem.err.println(\"Centers Index File does not exist\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\t\n\t\t\t//此处不能直接使用java的FileReader,因为MapReduce框架会自动给文件路径加前缀file:\n\t\t\t//这样会导致FileReader不能识别路径,建议使用MapReduce自带的文件读取API\n\t\t\t//BufferedReader in = new BufferedReader(new FileReader(caches[0].toString()));\n\t\t\tPath centerIndexFile = caches[0];\n\t\t\tFileSystem fs = centerIndexFile.getFileSystem(conf);\n\t\t\tString line;\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(fs.open(centerIndexFile)));\n\t\t\ttry{\n\t\t\t\twhile((line = in.readLine()) != null)\n\t\t\t\t\tcentersList.add(new Text(line));\n\t\t\t}\n\t\t\tfinally{\n\t\t\t\tin.close();\n\t\t\t}\n\t\t}", "private void createClusterForAks(ProvisionRequest provisionRequest, String processID) {\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tprovisionRequest.setKubeMonitoring(\"Grafana\");\n\t\t}\n\t\tstartCreateClusterTaskForAks(provisionRequest);\n\t}", "public static void main(String[] args) throws RemoteException, UnknownHostException, IOException\n {\n BufferedReader in = null;\n in = new BufferedReader(new FileReader(NN_ConfigFile));\n String line = null;\n ArrayList<String> config = new ArrayList<String>();\n while((line = in.readLine()) != null){\n config.add(line);\n }\n in.close();\n String name = config.get(0).split(\":\")[1];\n String ip = config.get(1).split(\":\")[1];\n int port = Integer.parseInt(config.get(2).split(\":\")[1]);\n //Intitalize the Client\n Client Me = new Client();\n Me.heartbeat = Integer.parseInt(config.get(5).split(\":\")[1]);\n Me.block_size = Integer.parseInt(config.get(6).split(\":\")[1]);\n Me.NNStub = Me.GetNNStub(name,ip,port);\n System.out.println(\"Welcome to HDFS!!\");\n Scanner Scan = new Scanner(System.in);\n while(true)\n {\n //Scanner, prompt and then call the functions according to the command\n System.out.print(\"$> \"); //Prompt\n String Command = Scan.nextLine();\n String[] Split_Commands = Command.split(\" \");\n\n if(Split_Commands[0].equals(\"help\"))\n {\n System.out.println(\"The following are the Supported Commands\");\n System.out.println(\"1. put filename ## To put a file in HDFS\");\n System.out.println(\"2. get filename ## To get a file in HDFS\"); System.out.println(\"2. list ## To get the list of files in HDFS\");\n }\n else if(Split_Commands[0].equals(\"put\")) // put Filename\n {\n //Put file into HDFS\n String Filename;\n try{\n Filename = Split_Commands[1];\n Me.PutFile(Filename);\n }catch(ArrayIndexOutOfBoundsException e){\n System.out.println(\"Please type 'help' for instructions\");\n continue;\n }\n }\n else if(Split_Commands[0].equals(\"get\"))\n {\n //Get file from HDFS\n String Filename;\n try{\n Filename = Split_Commands[1];\n Me.GetFile(Filename);\n }catch(ArrayIndexOutOfBoundsException e){\n System.out.println(\"Please type 'help' for instructions\");\n continue;\n }\n }\n else if(Split_Commands[0].equals(\"list\"))\n {\n System.out.println(\"List request\");\n //Get list of files in HDFS\n Me.List();\n }\n else\n {\n System.out.println(\"Please type 'help' for instructions\");\n }\n }\n }", "public static void main(String[] args) {\n IPFS ipfs = new IPFS(\"/ip4/127.0.0.1/tcp/5001\");\n\n /* Add a file */\n //can be done via NamedStreamable.FileWrapper(File file) -> files\n //NamedStreamable.ByteWrapper(byte[]) -> bytes\n //added files are always pinned\n //using file chooser (for now)\n JFileChooser chooser = new JFileChooser();\n\n chooser.setCurrentDirectory(new File(\".\"));\n chooser.setDialogTitle(\"Select file to host\");\n chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\n\n //filter different types of files to add\n //FileNameExtensionFilter filter = new FileNameExtensionFilter(\"txt & HTML \", \"txt\", \"html\");\n int returnVal = chooser.showOpenDialog(null);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = chooser.getSelectedFile();\n\n //add file to ipfs and store version/s\n /*@EDIT better to use JSON format!! */\n try {\n List<MerkleNode> nodes;\n if (file.isDirectory()) {\n System.out.println(\"directory\");\n System.out.println(file.getAbsolutePath());\n System.out.println(file.getName());\n nodes = ipfs.add(new NamedStreamable.FileWrapper(file));\n for (MerkleNode node : nodes) {\n System.out.println(node.toJSONString());\n }\n MerkleNode addResult = nodes.get(nodes.size()-1);\n } else {\n //get merkle node/s of the file (multiple nodes for a large file)\n nodes = ipfs.add(new NamedStreamable.FileWrapper(file));\n\n// //output the hashes to a file\n// File versionedFile = new File(file.getParent() + \"/\" + file.getName() + \".ipfs\"); //add extension to file (hope it works)\n// if(!versionedFile.exists()){\n// versionedFile.createNewFile();\n// System.out.println(\"Created new file in: \" + versionedFile.getAbsolutePath());\n// }\n //new line for storing new version merkel nodes\n// BufferedWriter writer = new BufferedWriter(new FileWriter(versionedFile, true)); //ensure to append to file\n for (MerkleNode node : nodes) {\n// writer.append(node.hash.toString() + \" \"); //hashes seperated by spaces..\n System.out.println(node.toJSONString()); //testing what output is!\n }\n// writer.append(\"\\n\"); //new line for end of version\n// writer.close();\n }\n } catch (IOException ex) {\n System.err.println(\"Issue when adding file\");\n }\n }\n\n }", "private Map<String, Cluster> readFile(String labelPath, String dataPath, String phase) {\n\t\tSystem.out.println(\"read the \" + phase + \" file ..... \");\n\n\t\t// read the label file\n\t\tSystem.out.println(\"Reading label from file \" + phase + \".label \");\n\t\tList<String> classRecords = IOUtils.readFile(labelPath);\n\t\tdocumentClass = new HashMap<String, String>();\n\t\tdocumentListClass = new HashMap<String,ArrayList<String>>();\n\n\t\tfor (int i = 0; i < classRecords.size(); i++) {\n\t\t\tString record = classRecords.get(i);\n\t\t\tdocumentClass.put((i + 1) + \"\", record);\n\n\t\t\tboolean contain = documentListClass.containsKey(record);\n\t\t\tif(!contain){\n\t\t\t\tdocumentListClass.put(record, new ArrayList<String>()) ;\n\t\t\t}\n\t\t\tdocumentListClass.get(record).add((i+1)+\"\");\n\t\t}\n\n\t\t// read the document\n\t\tSystem.out.println(\"Reading document from file \" + phase + \".data \");\n\t\tList<String> dataRecords = IOUtils.readFile(dataPath);\n\t\tdocumentsCount = new HashMap<String, Document>();\t\t\n\n\t\tfor (String record : dataRecords) {\n\t\t\tString[] elements = record.split(\" \");\n\t\t\tString documentID = elements[0];\n\t\t\tString wordID = elements[1];\n\t\t\tint wordCount = Integer.parseInt(elements[2]);\n\n\t\t\tboolean contain = documentsCount.containsKey(documentID);\n\t\t\tif (!contain) {\n\t\t\t\tdocumentsCount.put(documentID, new Document(documentID));\n\t\t\t}\n\n\t\t\tdocumentsCount.get(documentID).add(wordID, wordCount);\n\t\t}\t\t\n\n\t\t// put the documents with the same cluster ID into the cluster\n\t\tSystem.out.println(\"put the documents with the same cluster ID into the cluster\");\n\t\tMap<String, Cluster> clusters = new HashMap<String, Cluster>();\n\t\tfor (String documentID : documentClass.keySet()) {\n\t\t\tString clusterID = documentClass.get(documentID);\n\n\t\t\tboolean contain = clusters.containsKey(clusterID);\n\t\t\tif (!contain) {\n\t\t\t\tclusters.put(clusterID, new Cluster(clusterID));\n\t\t\t}\n\n\t\t\t// put the document into cluster\n\t\t\tDocument document = documentsCount.get(documentID);\n\t\t\tclusters.get(clusterID).addDocument(document);\n\t\t}\n\n\t\t// when in training phase, calculate the probability and frequence\n\t\tif (phase.equals(\"training\")) {\n\t\t\tSystem.out.println(\"calculate the training probability\");\n\n\t\t\t// generate the word count of cluster\n\t\t\tfor (int index = 1; index <= 20; index++) {\n\t\t\t\tSystem.out.println(\"calculate the cluster \"+ index);\n\t\t\t\t// fill the word count\n\t\t\t\t// clusters.get(clusterID).fillWordCounts();\n\n\t\t\t\t// calculate the bernoulli probability\n\t\t\t\tclusters.get(Integer.toString(index)).calculateBernoulliProbability();\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn clusters;\n\t}", "private Set<NodeCandidate> getPaidNodeCandidate(Infrastructure infra, String region, String imageReq,\n File pricingFile, Set<Image> resultImages, Set<Hardware> resultHardware) throws IOException {\n final String HARDWARE_ID = \"hardwareId\";\n final String IMAGE_ID = \"imageId\";\n final String COST = \"cost\";\n // We constitute a list of hardwareId of the cloud region, to be seek into later on\n List<String> listOfhardwareId = resultHardware.parallelStream()\n .map(Hardware::getType)\n .collect(Collectors.toList());\n // We constitute multiple list of Image ID beacause image specification diverges on the Cloud infra provide.\n List<String> listOfAvailableImageId = resultImages.parallelStream()\n .map(Image::getId)\n .distinct()\n .collect(Collectors.toList());\n List<String> listOfAvailableImageName = resultImages.parallelStream()\n .map(Image::getName)\n .distinct()\n .filter(Objects::nonNull)\n .filter(s -> !s.isEmpty())\n .collect(Collectors.toList());\n // we read and proces the pricingfile.\n String fileContent = Files.readAllLines(pricingFile.toPath()).stream().collect(Collectors.joining());\n JSONArray princingArrayOfaRegion = new JSONArray(fileContent);\n // JSONArray cannot be stream. We will use this constrain to enforce the JSONObject typing in the JSONArray\n List<JSONObject> checkedPricingArray = new ArrayList<>();\n for (Object entree : princingArrayOfaRegion) {\n checkedPricingArray.add((JSONObject) entree);\n }\n // We determine the pricing to be analyzed in the region, based on which Hardware and image are available from user account.\n List<JSONObject> releavantPricing = checkedPricingArray.parallelStream()\n .filter(Objects::nonNull)\n .filter(jo -> jo.has(HARDWARE_ID))\n .filter(jo -> jo.has(IMAGE_ID))\n .filter(jo -> listOfhardwareId.contains(jo.get(HARDWARE_ID)))\n .filter(jo -> listOfAvailableImageId.contains(jo.getString(IMAGE_ID)) ||\n listOfAvailableImageName.stream()\n .filter(s -> s.contains(jo.getString(IMAGE_ID)))\n .count() > 0)\n .collect(Collectors.toList());\n // We select pricing that are match the search criteria\n List<JSONObject> selectedPricing = releavantPricing.parallelStream()\n .filter(jo -> jo.getString(IMAGE_ID).contains(imageReq))\n .collect(Collectors.toList());\n // We build the nodeCandidate based on these\n Set<NodeCandidate> result = selectedPricing.parallelStream().map(jo -> {\n return NodeCandidate.builder()\n .cloud(infra.getType())\n .region(region)\n .hw(resultHardware.stream()\n .filter(hw -> hw.getType().contains(jo.getString(HARDWARE_ID)))\n .findFirst()\n .get())\n .img(resultImages.stream().filter(img -> {\n String imageId = jo.getString(IMAGE_ID);\n return img.getName().contains(imageId) || img.getId().contains(imageId);\n }).findFirst().get())\n .price(jo.optDouble(COST))\n .build();\n }).collect(Collectors.toSet());\n return result;\n }", "public void init() throws IOException{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\tline=in.readLine();\n\t\tif(line.trim().length()!=0)\n\t\t\tnum=Integer.parseInt(line.trim());\n\t\tfor(int i=0; i<num; i++){\n\t\t\tHashSet<Integer> datasets = new HashSet<Integer>();\n\t\t\tline=in.readLine();\n\t\t\tif(line.trim().length()!=0){\n\t\t\t\tString[] strs=line.trim().split(\"\\\\s+\");\n\t\t\t\tfor(String s: strs){\n\t\t\t\t\tif(s.trim().length()!=0){\n\t\t\t\t\t\tdatasets.add(new Integer(s.trim()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcenters.add(datasets);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public CreateClusterRequest(CreateClusterRequest source) {\n if (source.ClusterName != null) {\n this.ClusterName = new String(source.ClusterName);\n }\n if (source.ClusterType != null) {\n this.ClusterType = new String(source.ClusterType);\n }\n if (source.VpcId != null) {\n this.VpcId = new String(source.VpcId);\n }\n if (source.ClusterCIDR != null) {\n this.ClusterCIDR = new String(source.ClusterCIDR);\n }\n if (source.ClusterDesc != null) {\n this.ClusterDesc = new String(source.ClusterDesc);\n }\n if (source.TsfRegionId != null) {\n this.TsfRegionId = new String(source.TsfRegionId);\n }\n if (source.TsfZoneId != null) {\n this.TsfZoneId = new String(source.TsfZoneId);\n }\n if (source.SubnetId != null) {\n this.SubnetId = new String(source.SubnetId);\n }\n if (source.ClusterVersion != null) {\n this.ClusterVersion = new String(source.ClusterVersion);\n }\n if (source.MaxNodePodNum != null) {\n this.MaxNodePodNum = new Long(source.MaxNodePodNum);\n }\n if (source.MaxClusterServiceNum != null) {\n this.MaxClusterServiceNum = new Long(source.MaxClusterServiceNum);\n }\n if (source.ProgramId != null) {\n this.ProgramId = new String(source.ProgramId);\n }\n if (source.KuberneteApiServer != null) {\n this.KuberneteApiServer = new String(source.KuberneteApiServer);\n }\n if (source.KuberneteNativeType != null) {\n this.KuberneteNativeType = new String(source.KuberneteNativeType);\n }\n if (source.KuberneteNativeSecret != null) {\n this.KuberneteNativeSecret = new String(source.KuberneteNativeSecret);\n }\n if (source.ProgramIdList != null) {\n this.ProgramIdList = new String[source.ProgramIdList.length];\n for (int i = 0; i < source.ProgramIdList.length; i++) {\n this.ProgramIdList[i] = new String(source.ProgramIdList[i]);\n }\n }\n }", "@Bean\n\tRiakCluster riakCluster() throws UnknownHostException {\n RiakNode node = new RiakNode.Builder()\n .withRemoteAddress(\"127.0.0.1\")\n .withRemotePort(8087)\n .build();\n // you could also have multiple nodes, see riakCluster\n RiakCluster cluster = new RiakCluster.Builder(node)\n .build();\n\n cluster.start();\n\n return cluster;\n }", "void formCluster(Set<ControllerNode> nodes, String ipPrefix);", "Cluster getRuntimeCluster() throws TimeoutException, InterruptedException;", "@Override\n public List<String> idToIpLookup(List<String> nodeIds)\n {\n log.info(\"Asked IDs -> IPs for: [%s]\", String.join(\",\", nodeIds));\n\n if (nodeIds.isEmpty()) {\n return new ArrayList<>();\n }\n\n final String project = envConfig.getProjectId();\n final String zone = envConfig.getZoneName();\n\n try {\n Compute computeService = createComputeService();\n Compute.Instances.List request = computeService.instances().list(project, zone);\n request.setFilter(GceUtils.buildFilter(nodeIds, \"name\"));\n\n List<String> instanceIps = new ArrayList<>();\n InstanceList response;\n do {\n response = request.execute();\n if (response.getItems() == null) {\n continue;\n }\n for (Instance instance : response.getItems()) {\n // Assuming that every server has at least one network interface...\n String ip = instance.getNetworkInterfaces().get(0).getNetworkIP();\n // ...even though some IPs are reported as null on the spot but later they are ok,\n // so we skip the ones that are null. fear not, they are picked up later this just\n // prevents to have a machine called 'null' around which makes the caller wait for\n // it for maxScalingDuration time before doing anything else\n if (ip != null && !\"null\".equals(ip)) {\n instanceIps.add(ip);\n } else {\n // log and skip it\n log.warn(\"Call returned null IP for %s, skipping\", instance.getName());\n }\n }\n request.setPageToken(response.getNextPageToken());\n } while (response.getNextPageToken() != null);\n\n return instanceIps;\n }\n catch (Exception e) {\n log.error(e, \"Unable to convert IDs to IPs.\");\n }\n\n return new ArrayList<>();\n }", "private static Map<String,NetNode> parseAddresses(String ipAddrsFile) throws IOException {\n\t\tfinal Map<String,NetNode> nodes = new LinkedHashMap<String,NetNode>();\n\t\tfinal BufferedReader reader = new BufferedReader(new FileReader(new File(ipAddrsFile)));\n\t\tfor (String line = reader.readLine(); line != null; line = reader.readLine()) {\n\t\t\tfinal NetNode node = new NetNode(line);\n\t\t\tif (nodes.put(node.port, node) != null)\n\t\t\t\tthrow new IllegalArgumentException(\"Duplicate ip address specification: \" + line);\n\t\t}\n\t\treturn nodes;\n\t}", "public interface ClusterDefinitionService {\n\n /**\n * Returns the local controller node.\n * @return local controller node\n */\n ControllerNode localNode();\n\n /**\n * Returns the set of seed nodes that should be used for discovering other members\n * of the cluster.\n * @return set of seed controller nodes\n */\n Set<ControllerNode> seedNodes();\n\n /**\n * Forms cluster configuration based on the specified set of node\n * information. Assumes subsequent restart for the new configuration to\n * take hold.\n *\n * @param nodes set of nodes that form the cluster\n * @param ipPrefix IP address prefix, e.g. 10.0.1.*\n */\n void formCluster(Set<ControllerNode> nodes, String ipPrefix);\n}", "public Ms2Cluster() { super(); }", "private IpAddress() {\n\t\tInputStream iis = IpAddress.class.getResourceAsStream(\"/QQWry.dat\");\n\t\tif (iis == null) {\n\t\t\tlog.warn(\"IP地址信息文件没有找到,IP显示功能将无法使用\");\n\t\t\treturn;\n\t\t}\n\n\t\tfinal File dataFile;\n\t\ttry (InputStream is = iis) {\n\t\t\tPath tmp = Files.createTempFile(\"QQWry.dat\", null);\n\t\t\ttmp.toFile().deleteOnExit();\n\n\t\t\ttry (OutputStream out = Files.newOutputStream(tmp, StandardOpenOption.WRITE)) {\n\t\t\t\tbyte[] buf = new byte[8192];\n\t\t\t\tint n;\n\t\t\t\twhile ((n = is.read(buf)) > 0) {\n\t\t\t\t\tout.write(buf, 0, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdataFile = tmp.toFile();\n\t\t} catch (IOException e1) {\n\t\t\tlog.warn(\"读取IP地址信息文件失败,IP显示功能将无法使用\");\n\t\t\tthrow new RuntimeException(e1);\n\t\t}\n\n\t\ttry (RandomAccessFile ipFile = new RandomAccessFile(dataFile, \"r\")) {\n\t\t\tthis.ipBegin = byteArrayToLong(readBytes(ipFile, 0L, 4));\n\t\t\tthis.ipEnd = byteArrayToLong(readBytes(ipFile, 4L, 4));\n\t\t\tif (this.ipBegin != -1L && this.ipEnd != -1L) {\n\t\t\t\tcachedIpFile = new RandomAccessFile(dataFile, \"r\");\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\tlog.warn(\"IP地址信息文件没有找到,IP显示功能将无法使用\", e);\n\t\t} catch (IOException e) {\n\t\t\tlog.warn(\"IP地址信息文件格式有错误,IP显示功能将无法使用\", e);\n\t\t}\n\n\t\tthis.ipSum = (this.ipEnd - this.ipBegin) / 7L + 1L;\n\t}", "public LocalServerDiscoveryFile(String fileNamePath) throws IOException {\n\t\tsetFileNamePath(fileNamePath);\n\t\ttry (FileChannel fileStream = FileChannel.open(Paths.get(fileNamePath), StandardOpenOption.READ)) {\n\t\t\tByteBuffer buffer = fileStream.map(MapMode.READ_ONLY, 0, (Integer.BYTES * 3));\n\t\t\tsetProcessId(buffer.getInt());\n\t\t\tsetPublisherPort(buffer.getInt());\n\t\t\tsetSubscriberPort(buffer.getInt());\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow e;\n\t\t}\n\t}", "public void readFile(String configFileName){\n\t\tBufferedReader readLine_br = null;\r\n\t\tFileReader readLine_fr = null;\r\n\t\tString line;\r\n\t\tString searchLink = \"LINK:\";\r\n\t\tString searchNetwork = \"NETWORK:\";\r\n\t\tString selfHop = \"0.0.0.0:0\";\r\n\t\tint selfCost = 0;\r\n\t\troutingTableClass routingTableObject = new routingTableClass();\r\n\t\t\t\t\r\n\t\ttry{\r\n\t\t\treadLine_fr = new FileReader(configFileName);\r\n\t\t\treadLine_br = new BufferedReader(readLine_fr);\r\n\t\t\t\r\n\t\t\t// reading line by line\r\n\t\t\twhile((line = readLine_br.readLine()) != null){\r\n\t\t\t\t\r\n\t\t\t\t// making an array of the input\r\n\t\t\t\tString[] ipArray_1 = line.split(\" \");\r\n\t\t\t\t\r\n\t\t\t\t// for LINKS\r\n\t\t\t\tif(ipArray_1[0].equals(searchLink))\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] ipArray = {ipArray_1[0],ipArray_1[1],ipArray_1[2]};\r\n\t\t\t\t\t//segregating the IP's and the Port Numbers\r\n\t\t\t\t\tString ip_1 = ipArray[1].split(\":\")[0];\r\n\t\t\t\t\tint port_1 = Integer.parseInt(ipArray[1].split(\":\")[1]);\r\n\t\t\t\t\tString ip_2 = ipArray[2].split(\":\")[0];\r\n\t\t\t\t\tint port_2 = Integer.parseInt(ipArray[2].split(\":\")[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//making objects for receiving and sending\r\n\t\t\t\t\tRunnable senderObject = new Sender(ip_2,port_2, port_1, routingTableObject);\r\n\t\t\t\t\tRunnable receiverObject = new Receiver(ip_1, port_1,ip_2,port_2,routingTableObject);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// making Receiver and Sender Thread\r\n\t\t\t\t\tThread receiverThread = new Thread(receiverObject);\r\n\t\t\t\t\tThread senderThread = new Thread(senderObject);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//starting the sending and receiving Threads\r\n\t\t\t\t\tsenderThread.start();\r\n\t\t\t\t\treceiverThread.start();\r\n\t\t\t\t}\r\n\t\t\t\t// for NETWORKS\r\n\t\t\t\telse if(ipArray_1[0].equals(searchNetwork))\r\n\t\t\t\t{\r\n\t\t\t\t\tString[] ipArray = {ipArray_1[0],ipArray_1[1]};\r\n\t\t\t\t\tArrayList addEntry = new ArrayList();\r\n\t\t\t\t\taddEntry.add(ipArray[1]);\r\n\t\t\t\t\taddEntry.add(selfHop);\r\n\t\t\t\t\taddEntry.add(selfCost);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t// making entry in the routing table\r\n\t\t\t\t\tsynchronized (routingTableObject) {\r\n\t\t\t\t\t\troutingTableObject.routingTable.add(addEntry);\r\n\t\t\t\t\t\troutingTableObject.printTable();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IOException exc){\r\n\t\t\texc.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t\t\n\t\tOpenFileRequest.Builder openFileReqObj = OpenFileRequest.newBuilder();\n\t\topenFileReqObj.setFileName(fileName);\t\t\n\t\topenFileReqObj.setForRead(true);\n\t\t\n\t\t\n\t\tFileWriterClass fileWriteObj = new FileWriterClass(localOutFile);\n\t\tfileWriteObj.createFile();\n\t\t\n\t\tbyte[] responseArray;\n\t\t\n\t\ttry {\n\t\t\tRegistry registry=LocateRegistry.getRegistry(Constants.NAME_NODE_IP,Registry.REGISTRY_PORT);\n\t\t\tINameNode nameStub;\n\t\t\tnameStub=(INameNode) registry.lookup(Constants.NAME_NODE);\n\t\t\tresponseArray = nameStub.openFile(openFileReqObj.build().toByteArray());\n\t\t\t\n\t\t\ttry {\n\t\t\t\tOpenFileResponse responseObj = OpenFileResponse.parseFrom(responseArray);\n\t\t\t\tif(responseObj.getStatus()==Constants.STATUS_NOT_FOUND)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"File not found fatal error\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<Integer> blockNums = responseObj.getBlockNumsList();\n\t\t\t\tBlockLocationRequest.Builder blockLocReqObj = BlockLocationRequest.newBuilder();\n\t\t\t\t\n//\t\t\t\tSystem.out.println(blockNums);\n\t\t\t\t/**Now perform Read Block Request from all the blockNums**/\n\t\t\t\tblockLocReqObj.addAllBlockNums(blockNums);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tresponseArray = nameStub.getBlockLocations(blockLocReqObj.build().toByteArray());\n\t\t\t\t} catch (RemoteException 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\t\n\t\t\t\t\n\t\t\t\tBlockLocationResponse blockLocResObj = BlockLocationResponse.parseFrom(responseArray);\n//\t\t\t\tSystem.out.println(blockLocResObj.toString());\n\t\t\t\t\n\t\t\t\tif(blockLocResObj.getStatus()==Constants.STATUS_FAILED)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Fatal error!\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<BlockLocations> blockLocations = blockLocResObj.getBlockLocationsList();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<blockLocations.size();i++)\n\t\t\t\t{\n\t\t\t\t\tBlockLocations thisBlock = blockLocations.get(i);\n\t\t\t\t\t\n\t\t\t\t\tint blockNumber = thisBlock.getBlockNumber();\t\t\t\t\t\n\t\t\t\t\tList<DataNodeLocation> dataNodes = thisBlock.getLocationsList();\n\t\t\t\t\t\n\t\t\t\t\tif(dataNodes==null || dataNodes.size()==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"All nodes are down :( \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint dataNodeCounter=0;\n\t\t\t\t\t\n\t\t\t\t\tDataNodeLocation thisDataNode = null;//dataNodes.get(dataNodeCounter);\t\t\t\t\t\n\t\t\t\t\tString ip;// = thisDataNode.getIp();\n\t\t\t\t\tint port ; //= thisDataNode.getPort();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tIDataNode dataStub=null;\n\t\t\t\t\t\n\t\t\t\t\tboolean gotDataNodeFlag=false;\n\t\t\t\t\t\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthisDataNode = dataNodes.get(dataNodeCounter);\n\t\t\t\t\t\t\tip = thisDataNode.getIp();\n\t\t\t\t\t\t\tport = thisDataNode.getPort();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRegistry registry2=LocateRegistry.getRegistry(ip,port);\t\t\t\t\t\n\t\t\t\t\t\t\tdataStub = (IDataNode) registry2.lookup(Constants.DATA_NODE_ID);\n\t\t\t\t\t\t\tgotDataNodeFlag=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (RemoteException e) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgotDataNodeFlag=false;\n//\t\t\t\t\t\t\tSystem.out.println(\"Remote Exception\");\n\t\t\t\t\t\t\tdataNodeCounter++;\n\t\t\t\t\t\t} \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\twhile(gotDataNodeFlag==false && dataNodeCounter<dataNodes.size());\n\t\t\t\t\t\n\t\t\t\t\tif(dataNodeCounter == dataNodes.size())\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"All data nodes are down :( \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\t/**Construct Read block request **/\n\t\t\t\t\tReadBlockRequest.Builder readBlockReqObj = ReadBlockRequest.newBuilder();\n\t\t\t\t\treadBlockReqObj.setBlockNumber(blockNumber);\n\t\t\t\t\t\n\t\t\t\t\t/**Read block request call **/\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tresponseArray = dataStub.readBlock(readBlockReqObj.build().toByteArray());\n\t\t\t\t\t\tReadBlockResponse readBlockResObj = ReadBlockResponse.parseFrom(responseArray);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(readBlockResObj.getStatus()==Constants.STATUS_FAILED)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"In method openFileGet(), readError\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tresponseArray = readBlockResObj.getData(0).toByteArray();\t\t\t\t\t\t\n\t\t\t\t\t\tString str = new String(responseArray, StandardCharsets.UTF_8);\t\t\t\t\t\t\n\t\t\t\t\t\tfileWriteObj.writeonly(str);\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (NotBoundException e) {\n\t\t\tSystem.out.println(\"Exception caught: NotBoundException \");\t\t\t\n\t\t} catch (RemoteException e2) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te2.printStackTrace();\n\t\t}\n\t\tfileWriteObj.closeFile();\n\t\t\n\t\t\n\t}", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "public static void main(String args[]){\n ClientConfig remoteConfig = getCluster2();\n\n remoteClient = HazelcastClient.newHazelcastClient(remoteConfig);\n\n Map usCarMap = remoteClient.getMap(\"cars\");\n\n System.out.println(usCarMap.size());\n\n //ClientConfig localConfig = getEUClientConfig();\n Config localConfig = getHCCluster1();\n\n localClient = Hazelcast.newHazelcastInstance(localConfig);\n localClient.getMap(\"cars\");\n\n ClusterReconTask clusterReconTask = new ClusterReconTask(localClient, localClusterName, remoteClient, remoteClusterName);\n\n ClusterReconTask clusterReconTask1 = clusterReconTask;\n\n ClusterReconResults reconResults = null;\n\n try {\n reconResults = clusterReconTask1.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n System.out.println(reconResults.getMissingKeysByMap().size());\n\n System.out.println(reconResults.getMissingKeysByMap().toString());\n\n // Run Repair Task if needed\n if (reconResults.getMissingKeysByMap().size() > 0){\n ClusterRepairTask clusterRepairTask = new ClusterRepairTask(localClient, localClusterName, remoteClient, remoteClusterName, reconResults);\n try {\n clusterRepairTask.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n\n }", "public static void main(String[] args) {\n\n\t\tBufferedReader br = null;\n\t\tFile fFile = new File(\"\");\n\t\tString cwd = fFile.getAbsolutePath();\n\n\t\tFile nodes = new File(cwd + \"\\\\cmhadd_nodes.config\");\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(nodes));\n\t\t\tint number_of_nodes = 0;\n\t\t\tString node_addr = br.readLine();\n\t\t\tArrayList<String> node_table = new ArrayList<String>();\n\n\t\t\twhile (node_addr != null) {\n\t\t\t\tnode_table.add(node_addr);\n\t\t\t\tnumber_of_nodes++;\n\t\t\t\tnode_addr = br.readLine();\n\n\t\t\t}\n\t\t\tbr.close();\n\t\t\t// System.out.println(number_of_nodes);\n\n\t\t\tint[] siteNumber = new int[number_of_nodes];\n\t\t\tString[] ip_addr = new String[number_of_nodes];\n\t\t\tint[] port = new int[number_of_nodes];\n\n\t\t\tString[] tmpAddress = null;\n\n\t\t\tfor (int counter = 0; counter < number_of_nodes; counter++) {\n\n\t\t\t\ttmpAddress = node_table.get(counter).split(\" \");\n\t\t\t\tsiteNumber[counter] = Integer.parseInt(tmpAddress[0]);\n\t\t\t\tip_addr[counter] = tmpAddress[1];\n\t\t\t\tport[counter] = Integer.parseInt(tmpAddress[2]);\n\n\t\t\t}\n\n\t\t\t// preparing this site\n\n\t\t\tScanner scan = new Scanner(System.in);\n\n\t\t\tint thissiteNumber = 0;\n\n\t\t\tint inFlag = 0;\n\n\t\t\tdo {\n\n\t\t\t\tSystem.out.print(\"Enter site number (1-\" + number_of_nodes + \"): \");\n\t\t\t\tthissiteNumber = Integer.parseInt(scan.nextLine());\n\n\t\t\t\tif (thissiteNumber >= 1 && thissiteNumber <= number_of_nodes) {\n\t\t\t\t\tinFlag = 1;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Please enter the correct site number i.e. from 1 to \" + number_of_nodes);\n\t\t\t\t}\n\n\t\t\t} while (inFlag == 0);\n\n\t\t\t// Preparing processes\n\t\t\tFile process_site = new File(cwd + \"\\\\process.config\");\n\n\t\t\tBufferedReader br1 = new BufferedReader(new FileReader(process_site));\n\t\t\tint process_count = 0;\n\t\t\tString process = br1.readLine();\n\t\t\tArrayList<String> process_site_table = new ArrayList<String>();\n\n\t\t\twhile (process != null) {\n\t\t\t\tprocess_site_table.add(process);\n\t\t\t\tprocess_count++;\n\t\t\t\tprocess = br1.readLine();\n\n\t\t\t}\n\t\t\t// System.out.println(process_count);\n\n\t\t\t// Initializing process per site\n\n\t\t\tString[] process_site_map = null;\n\n\t\t\tString process_numbers = \"\";\n\t\t\tint site_process_count = 0;\n\n\t\t\tInteger[][] process_map = new Integer[process_count][2];\n\n\t\t\tfor (int i = 0; i < process_count; i++) {\n\n\t\t\t\tprocess_site_map = process_site_table.get(i).split(\",\");\n\n\t\t\t\tprocess_map[i][0] = Integer.parseInt(process_site_map[0]);\n\t\t\t\tprocess_map[i][1] = Integer.parseInt(process_site_map[1]);\n\n\t\t\t\tif (thissiteNumber == Integer.parseInt(process_site_map[1])) {\n\t\t\t\t\tsite_process_count++;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tprocess[] processes = new process[site_process_count];\n\n\t\t\tint j = 0;\n\n\t\t\tfor (int i = 0; i < process_count; i++) {\n\n\t\t\t\tprocess_site_map = process_site_table.get(i).split(\",\");\n\n\t\t\t\tif (thissiteNumber == Integer.parseInt(process_site_map[1])) {\n\n\t\t\t\t\tprocess_numbers += process_site_map[0] + \" \";\n\n\t\t\t\t\tprocesses[j] = new process(Integer.parseInt(process_site_map[0]),\n\t\t\t\t\t\t\tInteger.parseInt(process_site_map[1]), process_count, site_process_count);\n\t\t\t\t\tj++;\n\n\t\t\t\t}\n\n\t\t\t\t// System.out.println(process_map[i][0]+\" \"+process_map[i][1]);\n\n\t\t\t}\n\n\t\t\t// System.out.println(\"....................................\");\n\n\t\t\t// Constructing WFG\n\n\t\t\tString[] siteProcesses = process_numbers.split(\" \");\n\n\t\t\tFile dep_wfg = new File(cwd + \"\\\\dependency.config\");\n\n\t\t\tBufferedReader br2 = new BufferedReader(new FileReader(dep_wfg));\n\n\t\t\tArrayList<String> dep_edge = new ArrayList<String>();\n\n\t\t\tString dependecy = br2.readLine();\n\n\t\t\tString[] depVertex = null;\n\n\t\t\twhile (dependecy != null) {\n\n\t\t\t\tdepVertex = dependecy.split(\",\");\n\n\t\t\t\tfor (int i = 0; i < site_process_count; i++) {\n\n\t\t\t\t\tif (depVertex[0].equalsIgnoreCase(siteProcesses[i])) {\n\t\t\t\t\t\t// System.out.println(dependecy);\n\t\t\t\t\t\tprocesses[i].addDependOn(depVertex[1], 1);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tdependecy = br2.readLine();\n\n\t\t\t}\n\n\t\t\t// for(int i=0;i<site_process_count;i++) {\n\t\t\t// System.out.println(\"Process: \"+processes[i].getProcessNo());\n\t\t\t// processes[i].printDepGraph();\n\t\t\t// }\n\n\t\t\t// Open a socket\n\n\t\t\tlistenToBroadcast listenBcst = new listenToBroadcast(processes, port[thissiteNumber - 1], process_map,\n\t\t\t\t\tip_addr, port, siteNumber);\n\n\t\t\tlistenBcst.start();\n\n\t\t\tString input_query = \"\";\n\n\t\t\tSystem.out.println(\"This site has \" + site_process_count + \" process in total. Process numbers are: \"\n\t\t\t\t\t+ process_numbers);\n\n\t\t\twhile (!input_query.equalsIgnoreCase(\"quit\")) {\n\t\t\t\tSystem.out.print(\"\\n\\nEnter process number for intitating deadlock check (\" + process_numbers + \"): \");\n\n\t\t\t\tScanner scan_query = new Scanner(System.in);\n\t\t\t\tinput_query = scan_query.nextLine();\n\t\t\t\tint process_flag = 0;\n\t\t\t\tint process_ref = 0;\n\n\t\t\t\tfor (int i = 0; i < site_process_count; i++) {\n\n\t\t\t\t\tif (processes[i].getProcessNo() == Integer.parseInt(input_query)) {\n\t\t\t\t\t\tprocess_flag = 1;\n\t\t\t\t\t\tprocess_ref = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process_flag == 1) {\n\n\t\t\t\t\tchar result = processes[process_ref].checkDeadlock(processes, process_map);\n\n\t\t\t\t\tif (result == 'D') {\n\t\t\t\t\t\tSystem.out.println(\"Local deadlock detected.\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result == 'L') {\n\t\t\t\t\t\tSystem.out.println(\"The process is not dependent on any othe process, hence no deadloack .\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result == 'N') {\n\t\t\t\t\t\tSystem.out.println(\"No Local deadlock detected.\");\n\t\t\t\t\t\tprocesses[process_ref].checkRemoteDeadlock(processes, process_map, ip_addr, port, siteNumber,\n\t\t\t\t\t\t\t\tInteger.parseInt(input_query));\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"It seems this process does not belong this site. The process numbers belonging to this site (site number: \"\n\t\t\t\t\t\t\t\t\t+ thissiteNumber + \") are: \" + process_numbers);\n\t\t\t\t}\n\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}\n\n\t}", "@Override\n public BrokerCluster generateCluster(String clusterId, int numReplicas, Address address, AddressPlan addressPlan, StandardInfraConfig standardInfraConfig) throws Exception {\n\n KubernetesListBuilder resourcesBuilder = new KubernetesListBuilder();\n\n if (standardInfraConfig != null) {\n String templateName = getTemplateName(address, addressPlan, standardInfraConfig);\n KubernetesList newResources = processTemplate(clusterId, numReplicas, address, templateName, standardInfraConfig);\n resourcesBuilder.addAllToItems(newResources.getItems());\n }\n return new BrokerCluster(clusterId, resourcesBuilder.build());\n }", "private void recoverINodes()\n {\n Map<String, DFSNode.SerializedDFSNode> serInodeMap = new HashMap<>();\n try (BufferedReader reader = new BufferedReader(new FileReader(dfsNodeFile)))\n {\n String line;\n while((line=reader.readLine())!=null)\n {\n DFSNode.SerializedDFSNode serializedINode = (DFSNode.SerializedDFSNode) JSONUtil.fromJSON(line, DFSNode.SerializedDFSNode.class);\n DFSNode inode = new DFSNode();\n inode.fqpn = serializedINode.fqpn;\n inode.dataBlockMetas = serializedINode.dataBlockMeta;\n inode.dirOrFile= serializedINode.dirOrFile;\n inodeMap.put(inode.fqpn,inode);\n\n\n serInodeMap.put(serializedINode.fqpn,serializedINode);\n if (NumberUtils.isCreatable(inode.fqpn))\n fileNodeCounter = Math.max(fileNodeCounter,Integer.valueOf(inode.fqpn));\n\n /* if (inode.dataBlockMetas!=null) {\n\n DFSDataBlockMeta meta = inode.dataBlockMetas.get(inode.dataBlockMetas.size()-1);\n\n meta.fileSystem = resolve(meta.fileSystemName);\n\n }*/\n\n\n }\n } catch (Exception ex) {\n ex.printStackTrace();}\n\n\n inodeMap.values().stream().forEach(inode->{\n\n DFSNode.SerializedDFSNode serializedINode = serInodeMap.get(inode.fqpn);\n\n // inode.next = inodeMap.get(serializedINode.nextNodeName);\n\n if (serializedINode.getNodeNames()!=null) {\n List<DFSNode> nodes = serializedINode.getNodeNames().stream().map(name -> {\n return inodeMap.get(name) ;\n }).collect(Collectors.toList());\n\n inode.setNodes(nodes);\n }\n });\n\n }", "void getPeerInfo() {\n\n String strcount;// string used to count peers\n\n String str;\n\n int peercount = 0;// to calculate total peers number\n\n int count = 0; //to calculate myrank\n\n myPeerInfo = new Vector<RemotePeerInfo>();//peers' info vector\n\n try {\n\n BufferedReader incount = new BufferedReader(new FileReader(\"PeerInfo.cfg\"));//used to count lines\n\n BufferedReader in = new BufferedReader(new FileReader(\"PeerInfo.cfg\"));\n\n //Calculate lines, i.e peer numbers in the system\n while ((strcount = incount.readLine()) != null) {\n\n peercount++;\n\n }\n\n incount.close();\n\n peercount--;\n\n peer_ip = new String[peercount];\n\n peer_port = new int[peercount];\n\n peer_id = new int[peercount];\n\n num_peers = peercount;\n \n int cnt2 = 1;\n\n while ((str = in.readLine()) != null) {\n\n String[] tokens = str.split(\"\\\\s+\");\n\n myPeerInfo.addElement(new RemotePeerInfo(tokens[0], tokens[1], tokens[2]));\n\n if (this.id != Integer.parseInt(tokens[0])) {// if host id is not equal to id read, collect other peers\n\n peer_id[count] = Integer.parseInt(tokens[0]);\n\n peer_ip[count] = tokens[1];\n\n peer_port[count] = Integer.parseInt(tokens[2]);\n \n peer_ip[count] = host_ip;\n\n count++;\n\n } else {// if host id is equal to the id read, read info\n\n own_file = Integer.parseInt(tokens[3])==1;\n\n port = Integer.parseInt(tokens[2]);\n\n myRank = count;\n\n }\n \n cnt2++;\n\n }\n\n in.close();\n\n } catch (Exception ex) {\n\n }\n\n }", "public ClusterManager() throws UnknownHostException {\n\t\t// We give each server a unique name because there can be several servers\n\t\t// started on the same machine. For example several Tomcats each with a war. In\n\t\t// this case the ip addresses will overlap. Ikube can also be started as stand alone\n\t\t// just in a Jvm(which is the same as a Tomcat essentially) also they will have the\n\t\t// same ip address\n\t\tthis.ip = InetAddress.getLocalHost().getHostAddress();\n\t\tthis.address = ip + \".\" + System.nanoTime();\n\t\tthis.servers = new HashMap<String, Server>();\n\t}", "private static void getAllReplicaAddress(String fileName) throws IOException {\n\n\t\tSystem.out.println(\"Working Directory = \" +\n\t System.getProperty(\"user.dir\"));\n\t\tBufferedReader br = new BufferedReader(new FileReader(fileName));\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\t\n\t\t while(line!=null && !line.trim().equals(\"\")) {\n\t\t \tallReplicaAddrs.add(line);\n\t\t \tline = br.readLine();\n\t\t }\n\t\t \n\t\t} finally {\n\t\t br.close();\n\t\t}\n\t}", "public static SnakeProblem buildProblemFromFile(File file) throws IOException {\n int NUM_ONE_AI_OBLIGATORY_PARAMS = 4;\n int NUM_TWO_AI_OBLIGATORY_PARAMS = 7;\n\n java.util.Scanner f;\n try {\n f = new java.util.Scanner(file);\n } catch (FileNotFoundException e) {\n return null;\n }\n\n List<String> lines = new LinkedList<>();\n\n while (f.hasNextLine()) {\n String s = f.nextLine();\n if (!s.equals(\"\") && !s.startsWith(\"//\")) {\n lines.add(s);\n }\n }\n\n List<String> parametersValues = new LinkedList<>();\n for (String line : lines) {\n String[] tokens = line.split(\":|,\");\n for (int i = 1; i < tokens.length; i++) {\n parametersValues.add(tokens[i].trim());\n }\n }\n\n int environmentSize, maxIterations, numEnvironmentRuns;\n\n\n try {\n environmentSize = Integer.parseInt(parametersValues.get(0));\n maxIterations = Integer.parseInt(parametersValues.get(1));\n numEnvironmentRuns = Integer.parseInt(parametersValues.get(2));\n } catch (NumberFormatException e) {\n return null;\n }\n\n if (parametersValues.size() > NUM_ONE_AI_OBLIGATORY_PARAMS) {\n List<Integer> numInputs = new ArrayList<>();\n List<Integer> numHiddenUnits = new ArrayList<>();\n List<Integer> numOutputs = new ArrayList<>();\n List<ActivationFunction> activationFunctions = new ArrayList<>();\n\n try {\n numInputs.add(Integer.parseInt(parametersValues.get(3)));\n\n if (parametersValues.size() > NUM_TWO_AI_OBLIGATORY_PARAMS) {\n numInputs.add(Integer.parseInt(parametersValues.get(4)));\n numHiddenUnits.add(Integer.parseInt(parametersValues.get(5)));\n numHiddenUnits.add(Integer.parseInt(parametersValues.get(6)));\n numOutputs.add(Integer.parseInt(parametersValues.get(7)));\n numOutputs.add(Integer.parseInt(parametersValues.get(8)));\n activationFunctions.add(ActivationFunction.valueOf(parametersValues.get(9).toUpperCase()));\n activationFunctions.add(ActivationFunction.valueOf(parametersValues.get(10).toUpperCase()));\n } else {\n numHiddenUnits.add(Integer.parseInt(parametersValues.get(4)));\n numOutputs.add(Integer.parseInt(parametersValues.get(5)));\n activationFunctions.add(ActivationFunction.valueOf(parametersValues.get(6).toUpperCase()));\n }\n } catch (IllegalArgumentException e) {\n return null;\n }\n\n return new SnakeProblem(\n environmentSize,\n maxIterations,\n numEnvironmentRuns,\n numInputs,\n numHiddenUnits,\n numOutputs,\n activationFunctions);\n }\n\n return new SnakeProblem(\n environmentSize,\n maxIterations,\n numEnvironmentRuns);\n }", "public void load(String inFN) throws FileNotFoundException\n {\n String check = \" \";\n \tfile = new Scanner(new FileReader(inFN));\n \n \t// Rip apart the string and find the number of cities\n \t// Save it to a misc string named fileInfo\n \twhile (!check.equals(\"NODE_COORD_SECTION\"))\n {\n \tcheck = file.next();\n \t// Get the number of cities from the file\n \tif (check.equals(\"DIMENSION\"))\n \t{\n \t\t// Removes the character ':'\n \t\tcheck = file.next();\n \t\tfileInfo = fileInfo + check + \" \";\n \t\t\n \t\t// Extracts the number of cities\n \t\tcityNumber = file.nextInt();\n \t\tfileInfo = fileInfo + cityNumber + \" \";\n \t}\n \t\n \t// Dumps the fileinfo into one string\n \tfileInfo = fileInfo + check + \" \";\n }\n\n \t// Now that we have the number of cities, use it to\n \t// initialize an array\n \tcity = new City[cityNumber];\n \t\n \t// Loads the city data from the file into the city array\n \tfor (int i = 0; i < cityNumber; i++)\n {\n \t\tfile.nextInt();\n \tcity[i] = new City(i, file.nextDouble(), file.nextDouble());\n \t}\n }", "@ServiceActivator\r\n public Map<String, String> manageProcessDataFile(@Payload File file) {\r\n log.debug(\"~int.manageProcessDataFile() : Invoked.\");\r\n log.trace(\"~int.manageProcessDataFile() : Thread '\" + Thread.currentThread().getName() + \"'.\");\r\n\r\n String fileCanonicalPath = null;\r\n try {\r\n fileCanonicalPath = file.getCanonicalPath();\r\n log.debug(\"~int.manageProcessDataFile() : File canonical path '\" + fileCanonicalPath + \"'\");\r\n } catch (IOException e) {\r\n final String errorMessage = \"IO Exception retrieving file canonical path : '\" + e.getMessage() + \"'\";\r\n log.warn(\"~int.manageProcessDataFile() : \" + errorMessage);\r\n e.printStackTrace();\r\n throw new UnsupportedOperationException(errorMessage);\r\n }\r\n\r\n /*\r\n * Read in the process data file contents\r\n */\r\n Scanner scanner = null;\r\n try {\r\n scanner = new Scanner(file);\r\n } catch (FileNotFoundException fileNotFoundException) {\r\n final String errorMessage = \"Failed to read file '\" + file.toString() + \"' - error '\" + fileNotFoundException.getMessage() + \"'\";\r\n log.fatal(\"~int.manageProcessDataFile() : \" + errorMessage);\r\n fileNotFoundException.printStackTrace();\r\n throw new UnsupportedOperationException(errorMessage);\r\n }\r\n\r\n final StringBuilder fileContents = new StringBuilder((int) file.length());\r\n String procFileContents = null;\r\n try {\r\n while(scanner.hasNextLine()) {\r\n fileContents.append(scanner.nextLine());\r\n }\r\n procFileContents = fileContents.toString();\r\n log.debug(\"~int.manageProcessDataFile() : Contents '\" + procFileContents + \"'\");\r\n } finally {\r\n scanner.close();\r\n }\r\n\r\n /*\r\n * Process the contents of the process data file then delete the file.\r\n */\r\n final Map<String, String> processInfo = new HashMap<String, String>(2);\r\n if (procFileContents != null) {\r\n String appManagerId = null;\r\n String processId = null;\r\n\r\n if (procFileContents.contains(DELIMETER)) {\r\n if (procFileContents.startsWith(DELIMETER)) {\r\n log.error(\"~int.manageProcessDataFile() : Cannot determine AppManagerId from process data file content.\");\r\n processId = procFileContents.split(SPLITTER)[1];\r\n } else if (procFileContents.endsWith(DELIMETER)) {\r\n log.error(\"~int.manageProcessDataFile() : Cannot determine ProcessId from process data file content.\");\r\n appManagerId = procFileContents.split(SPLITTER)[0];\r\n } else {\r\n final String[] procData = procFileContents.split(SPLITTER);\r\n appManagerId = procData[0];\r\n processId = procData[1];\r\n }\r\n } else {\r\n log.error(\"~int.manageProcessDataFile() : Cannot determine AppManagerId or ProcessId from process data file content.\");\r\n }\r\n\r\n if (appManagerId != null)\r\n processInfo.put(PROCESS_INFO_APP_MANAGER_ID, appManagerId);\r\n if (processId != null)\r\n processInfo.put(PROCESS_INFO_PROCESS_ID, processId);\r\n\r\n log.debug(\"~int.manageProcessDataFile() : Deleting process data file\");\r\n // delete the file as it's no longer required\r\n try {\r\n final FileSystemManager fileSystemManager = VFS.getManager();\r\n final FileObject fileObject = fileSystemManager.resolveFile(fileCanonicalPath);\r\n fileObject.delete(Selectors.SELECT_SELF);\r\n } catch (FileSystemException e) {\r\n log.warn(\"~int.manageProcessDataFile() : FS Exception during process data file deletion : '\" + e.getMessage() + \"'\");\r\n e.printStackTrace();\r\n }\r\n }\r\n\r\n /*\r\n * Determine if overall success and persist the status (if there's enough information to do so). \r\n */\r\n boolean processingFailure = false;\r\n if (processInfo.containsKey(PROCESS_INFO_APP_MANAGER_ID)) {\r\n final long appManagerId = new Long(processInfo.get(PROCESS_INFO_APP_MANAGER_ID));\r\n\r\n String statusMessage = null;\r\n String level = null;\r\n\r\n final String processId = processInfo.get(PROCESS_INFO_PROCESS_ID); \r\n if (processId == null) {\r\n statusMessage = \"No process id was found in process data file - simulation failure!\";\r\n processingFailure = true;\r\n //level = RunStatus.ERROR_PREFIX;\r\n } else {\r\n //appManagerDAO.saveSimulationProcessId(appManagerId, processId);\r\n\r\n statusMessage = \"Process data file read and processed successfully\";\r\n //level = RunStatus.DEBUG_PREFIX;\r\n }\r\n //final RunStatus runStatus = new RunStatus(appManagerId, null, level, statusMessage);\r\n //appManagerDAO.addStatus(runStatus);\r\n } else {\r\n // can't even persist a status update\r\n processingFailure = true;\r\n }\r\n\r\n if (processingFailure) {\r\n /*\r\n * TODO : Improve failure recovery procedure, e.g...\r\n * 1) Return VRE_INFO or VRE_OUTPUT?!\r\n * 2) Remove ~/vre_run/<port>/<app manager id>\r\n */\r\n final String errorMessage = \"Simulation processing failure problem\";\r\n log.error(\"~int.manageProcessDataFile() : \" + errorMessage);\r\n }\r\n\r\n return processInfo;\r\n }", "public byte[] readall(String filePath) throws IOException {\n\t\tint ret;\n\t\t\n\t\tTFSClientFile file = getFileFromCache(filePath);\n\t\tif (file == null) {\t\t// cannot find the file, try to get file info from the master\n\t\t\tret = getFileInfo(filePath);\n\t\t\t\n\t\t\tif (ret != OK)\n\t\t\t\treturn null;\n\t\t\telse {\n\t\t\t\tfile = getFileFromCache(filePath);\t\t\t\t\n\t\t\t\tassert(file != null);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// now the file info is ready\n\t\t// pick-up a chunkserver to read from\n\t\tList<String> servers = new LinkedList<String>();\n\t\tfor (String server : file.getChunkServers())\n\t\t\tservers.add(server);\n\t\t\n\t\tRandom rand = new Random();\n\t\tint index = 0;\n\t\twhile (!servers.isEmpty()) {\n\t\t\tindex = rand.nextInt(servers.size());\n\t\t\t\n\t\t\tString[] strs = servers.get(index).split(\" \");\n\t\t\tservers.remove(index);\n\t\t\t\n\t\t\tSocketIO sockIO = new SocketIO(strs[0], Integer.parseInt(strs[1]));\n\t\t\tsockIO.write((READALL + \" \" + filePath + \"\\r\\n\").getBytes());\n\t\t\tsockIO.flush();\n\t\t\t\n\t\t\tString line = sockIO.readLine();\n\t\t\tif (line.startsWith(STR_OK)) {\n\t\t\t\tstrs = line.split(\" \");\n\t\t\t\tint length = Integer.parseInt(strs[1]);\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[length];\n\t\t\t\tsockIO.read(data);\n\t\t\t\tsockIO.close();\n\t\t\t\treturn data;\n\t\t\t} else {\n\t\t\t\tsockIO.close();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "private static void clustering(String inputFile, String outputDir, double opticsXi, int opticsMinPoints) {\n \tLOG.info(\"Begin clustering of stay points.\");\n \t\n \tELKIClusterer.cluster(inputFile, outputDir,\topticsXi, opticsMinPoints);\n \t\n \tLOG.info(\"Finished clustering of stay points.\");\n }", "private ClusterConfig(ClusterId id, Map<ResourceId, ResourceConfig> resourceMap,\n Map<ParticipantId, ParticipantConfig> participantMap,\n Map<ConstraintType, ClusterConstraints> constraintMap,\n Map<StateModelDefId, StateModelDefinition> stateModelMap, PersistentStats stats,\n Alerts alerts, UserConfig userConfig, boolean isPaused, boolean allowAutoJoin) {\n _id = id;\n _resourceMap = ImmutableMap.copyOf(resourceMap);\n _participantMap = ImmutableMap.copyOf(participantMap);\n _constraintMap = ImmutableMap.copyOf(constraintMap);\n _stateModelMap = ImmutableMap.copyOf(stateModelMap);\n _stats = stats;\n _alerts = alerts;\n _userConfig = userConfig;\n _isPaused = isPaused;\n _autoJoin = allowAutoJoin;\n }", "public void updateClusterDetails(UpdateClusterRequest callbackRequest) throws JsonProcessingException, IOException {\n\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tString callbackRequestStr = mapper.writeValueAsString(callbackRequest);\n\t\tlogger.info(\"Update Request: \" + callbackRequestStr);\n\t\tArrayList<String> masterNodes = new ArrayList<String>();\n\t\tArrayList<String> workderNodes = new ArrayList<String>();\n\t\t// set cluster id and inventory path.\n\t\tClusterEnv clusterEnv = new ClusterEnv(callbackRequest.getClusterID());\n\t\tclusterEnv.setInventoryPath(getInventoryPath(callbackRequest.getClusterID()));\n\t\t// if provision details are present set it. If request is posted after\n\t\t// provisioning\n\t\tK8SCluster cluster = clusterRepository.findById(callbackRequest.getClusterID());\n\n\t\tif (cluster == null) {\n\t\t\tlogger.info(\"Cluster could not be found in Database... \");\n\t\t\tthrow new ClusterException(\"Cluster could not be found in database..\");\n\t\t}\n\n\t\tif (callbackRequest.getProvisionDetails() != null) {\n\t\t\tfor (ProvisionDetails provDetails : callbackRequest.getProvisionDetails()) {\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"MASTER\") && masterNodes.size() <= 1) {\n\t\t\t\t\tmasterNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"WORKER\")) {\n\t\t\t\t\tworkderNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] kubeMasterIps = new String[masterNodes.size()];\n\t\t\tString[] kubeNodeIps = new String[workderNodes.size()];\n\t\t\tmasterNodes.toArray(kubeMasterIps);\n\t\t\tworkderNodes.toArray(kubeNodeIps);\n\t\t\tclusterEnv.setKubeMasterIps(kubeMasterIps);\n\t\t\tclusterEnv.setKubeNodeIps(kubeNodeIps);\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t}\n\t\t// if request is posted after create cluster\n\t\tif (callbackRequest.getCreateClusterDetails() != null) {\n//\t\t\tclusterDetails = (ClusterEnv) redisRepo.findById(clusterRequest.getClusterID(),\n//\t\t\t\t\tCacheKeysEnum.CLUSTER_DETAILS);\t\n\n\t\t\tclusterEnv.setApiServerUrl(callbackRequest.getCreateClusterDetails().getKubeApiServerUrl());\n\t\t\t// clusterEnv.setK8sAdminToken(clusterRequest.getCreateClusterDetails().getK8sAdminToken());\n\t\t\tclusterEnv.setK8sDashboardUrl(callbackRequest.getCreateClusterDetails().getK8sDashboadUrl());\n\t\t\t// clusterEnv.setDashboardToken(clusterRequest.getCreateClusterDetails().getDashboardToken());\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\n\t\t\t// If provisioning completed, that means, Azure Native flow. Already record\n\t\t\t// present in clusterenv - hence update\n\t\t\tif (cluster.getCreateStatus().equalsIgnoreCase(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\tclusterRepository.updateClusterEnv(clusterEnv);\n\t\t\t} else {\n\t\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\t\t\t}\n\n\t\t\t// SAVE Tokens to Vault\n\t\t\tsaveTokensToVault(callbackRequest);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.READY.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t\tif (callbackRequest.getCreateClusterDetails().getKubeConfig() != null) {\n\n\t\t\t\tlogger.info(\"Kube Cofig from callback request::\"\n\t\t\t\t\t\t+ callbackRequest.getCreateClusterDetails().getKubeConfig().asText());\n\t\t\t} else {\n\t\t\t\tlogger.info(\"Kube Cofig from callback request is null::\");\n\t\t\t}\n\t\t}\n\n\t\tif (callbackRequest.getMonitoringDetails() != null) {\n\t\t\t// TODO - Save montiroting details in database\n\t\t\tlogger.info(\"Monitoring details - Grafana URL- from callback request::\"\n\t\t\t\t\t+ callbackRequest.getMonitoringDetails().getGrafanaUrl());\n\t\t}\n\t\t// redisRepo.save(clusterEnv, CacheKeysEnum.CLUSTER_DETAILS);\n\n\t}", "static Cluster clusterProvider(String neptune, int BATCH_SIZE) {\n java.security.Security.setProperty(\"networkaddress.cache.ttl\", \"0\");\n java.security.Security.setProperty(\"networkaddress.cache.negative.ttl\", \"0\");\n\n Cluster.Builder clusterBuilder = Cluster.build()\n .addContactPoint(neptune) // add more ro contact points for load balancing\n .port(8182)\n .enableSsl(true)\n// .keyStore(keyStore) // optional as amazon cert will be used and should be in truststore of server\n// .keyStorePassword(keyStorePassword)\n .channelizer(SigV4WebSocketChannelizer.class)\n .serializer(Serializers.GRAPHBINARY_V1D0)\n .maxInProcessPerConnection(1) // ensure no contention for connections per batch\n .minInProcessPerConnection(1)\n .maxSimultaneousUsagePerConnection(1)\n .minSimultaneousUsagePerConnection(1)\n .maxWaitForConnection(15000)\n .minConnectionPoolSize(BATCH_SIZE)\n .maxConnectionPoolSize(BATCH_SIZE);\n\n return clusterBuilder.create();\n }", "public void readNetworkFromFile() {\r\n\t\tFileReader fr = null;\r\n\t\t// open file with name given by filename\r\n\t\ttry {\r\n\t\t\ttry {\r\n\t\t\t\tfr = new FileReader (filename);\r\n\t\t\t\tScanner in = new Scanner (fr);\r\n\r\n\t\t\t\t// get number of vertices\r\n\t\t\t\tString line = in.nextLine();\r\n\t\t\t\tint numVertices = Integer.parseInt(line);\r\n\r\n\t\t\t\t// create new network with desired number of vertices\r\n\t\t\t\tnet = new Network (numVertices);\r\n\r\n\t\t\t\t// now add the edges\r\n\t\t\t\twhile (in.hasNextLine()) {\r\n\t\t\t\t\tline = in.nextLine();\r\n\t\t\t\t\tString [] tokens = line.split(\"[( )]+\");\r\n\t\t\t\t\t// this line corresponds to add vertices adjacent to vertex u\r\n\t\t\t\t\tint u = Integer.parseInt(tokens[0]);\r\n\t\t\t\t\t// get corresponding Vertex object\r\n\t\t\t\t\tVertex uu = net.getVertexByIndex(u);\r\n\t\t\t\t\tint i=1;\r\n\t\t\t\t\twhile (i<tokens.length) {\r\n\t\t\t\t\t\t// get label of vertex v adjacent to u\r\n\t\t\t\t\t\tint v = Integer.parseInt(tokens[i++]);\r\n\t\t\t\t\t\t// get corresponding Vertex object\r\n\t\t\t\t\t\tVertex vv = net.getVertexByIndex(v);\r\n\t\t\t\t\t\t// get capacity c of (uu,vv)\r\n\t\t\t\t\t\tint c = Integer.parseInt(tokens[i++]);\r\n\t\t\t\t\t\t// add edge (uu,vv) with capacity c to network \r\n\t\t\t\t\t\tnet.addEdge(uu, vv, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinally { \r\n\t\t\t\tif (fr!=null) fr.close();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.err.println(\"IO error:\");\r\n\t\t\tSystem.err.println(e);\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {Main receives two arguments: path to input file and path to output file.\n\t\t// You can assume that they will always be provided, so no need to check them.\n\t\t// Scanner and PrintStream are already defined for you.\n\t\t// Use them to read input and write output.\n\t\t// \n\t\t// Good Luck!\n\t\t// \n\t\t\n\t\tScanner in = new Scanner(new File(args[0]));\n\t\t\n\t\tint N = in.nextInt();\n\t\tin.nextLine();\n\t\tString[] myFileData = new String[N];\n\t\tint keepPortID = 0;\n\t\tint keepShipID = 0;\n\t\tint keepContainerID = 0;\n\t\tArrayList<Port> myPorts = new ArrayList<Port>();\n\t\tArrayList<Ship> myShips = new ArrayList<Ship>();\n\t\tArrayList<Container> myContainers = new ArrayList<Container>();\n\t\t\n\t\t\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tmyFileData[i] = in.nextLine();\n\t\t}\n\t\t\n\t\tfor(int j = 0; j < N; j++) {\n\t\t\tString[] myLines = myFileData[j].split(\" \");\n\t\t\t\n\t\t\tif(myLines[0].equals(\"1\")) { //create a container\n\t\t\t\tPort containerPort = myPorts.get(Integer.parseInt(myLines[1]));\n\t\t\t\tif(myLines[myLines.length - 1].contains(\"L\") || myLines[myLines.length - 1].contains(\"R\")) {\n\t\t\t\t\tswitch(myLines[myLines.length-1]) {\n\t\t\t\t\tcase \"L\":\n\t\t\t\t\t\tLiquidContainer myNewLiquidContainer = new LiquidContainer(keepContainerID, Integer.parseInt(myLines[2]));\n\t\t\t\t\t\tmyNewLiquidContainer.setPortID(Integer.parseInt(myLines[1]));\n\t\t\t\t\t\tcontainerPort.containers.add(myNewLiquidContainer);\n\t\t\t\t\t\tcontainerPort.portLiquidContainers += 1;\n\t\t\t\t\t\tmyContainers.add(myNewLiquidContainer);\n\t\t\t\t\t\tkeepContainerID += 1;\n\t\t\t\t\tcase \"R\":\n\t\t\t\t\t\tRefrigeratedContainer myNewRefrigeratedContainer = new RefrigeratedContainer(keepContainerID, Integer.parseInt(myLines[2]));\n\t\t\t\t\t\tmyNewRefrigeratedContainer.setPortID(Integer.parseInt(myLines[1]));\n\t\t\t\t\t\tcontainerPort.containers.add(myNewRefrigeratedContainer);\n\t\t\t\t\t\tcontainerPort.portRefrigeratedContainers += 1;\n\t\t\t\t\t\tmyContainers.add(myNewRefrigeratedContainer);\n\t\t\t\t\t\tkeepContainerID += 1;\n\t\t\t\t\t} \n\t\t\t\t} else if(Integer.parseInt(myLines[2]) > 3000) {\n\t\t\t\t\tHeavyContainer myNewHeavyContainer = new HeavyContainer(keepContainerID, Integer.parseInt(myLines[2]));\n\t\t\t\t\tmyNewHeavyContainer.setPortID(Integer.parseInt(myLines[1]));\n\t\t\t\t\tcontainerPort.containers.add(myNewHeavyContainer);\n\t\t\t\t\tcontainerPort.portHeavyContainers += 1;\n\t\t\t\t\tmyContainers.add(myNewHeavyContainer);\n\t\t\t\t\tkeepContainerID += 1;\n\t\t\t\t} else {\n\t\t\t\t\tBasicContainer myNewBasicContainer = new BasicContainer(keepContainerID, Integer.parseInt(myLines[2]));\n\t\t\t\t\tmyNewBasicContainer.setPortID(Integer.parseInt(myLines[1]));\n\t\t\t\t\tcontainerPort.containers.add(myNewBasicContainer);\n\t\t\t\t\tcontainerPort.portBasicContainers += 1;\n\t\t\t\t\tmyContainers.add(myNewBasicContainer);\n\t\t\t\t\tkeepContainerID += 1;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t} else if(myLines[0].equals(\"2\")) { //create a ship\n\t\t\t\tint myPortID = Integer.parseInt(myLines[1]);\n\t\t\t\tint myWeightLimit = Integer.parseInt(myLines[2]);\n\t\t\t\tint maxAllCont = Integer.parseInt(myLines[3]);\n\t\t\t\tint maxHeavyCont = Integer.parseInt(myLines[4]);\n\t\t\t\tint maxRefCont = Integer.parseInt(myLines[5]);\n\t\t\t\tint maxLiqCont = Integer.parseInt(myLines[6]);\n\t\t\t\tdouble fuelConsumption = Double.parseDouble(myLines[7]);\n\t\t\t\tShip myNewShip = new Ship(keepShipID, myPorts.get(myPortID), myWeightLimit, maxAllCont, maxHeavyCont, maxRefCont, maxLiqCont, fuelConsumption);\n\t\t\t\tmyNewShip.currentPort.current.add(myNewShip);\n\t\t\t\tkeepShipID += 1;\n\t\t\t\tmyShips.add(myNewShip);\n\t\t\t\t\n\t\t\t\t\n\t\t\t} else if(myLines[0].equals(\"3\")) { //create a port\n\t\t\t\tdouble x = Double.parseDouble(myLines[1]);\n\t\t\t\tdouble y = Double.parseDouble(myLines[2]);\n\t\t\t\tPort myNewPort = new Port(keepPortID, x, y);\n\t\t\t\tkeepPortID += 1;\n\t\t\t\tmyPorts.add(myNewPort);\n\t\t\t\t\n\t\t\t} else if(myLines[0].equals(\"4\")) { //loading a container\n\t\t\t\tint shipLoadID = Integer.parseInt(myLines[1]);\n\t\t\t\tint contLoadID = Integer.parseInt(myLines[2]);\n\t\t\t\tmyShips.get(shipLoadID).load(myContainers.get(contLoadID));\n\t\t\t\t\n\t\t\t} else if(myLines[0].equals(\"5\")) { //unloading a container\n\t\t\t\tint shipLoadID = Integer.parseInt(myLines[1]);\n\t\t\t\tint contLoadID = Integer.parseInt(myLines[2]);\n\t\t\t\tmyShips.get(shipLoadID).unLoad(myContainers.get(contLoadID));\n\t\t\t\t\n\t\t\t} else if(myLines[0].equals(\"6\")) { //sailing to another port\n\t\t\t\tint shipID = Integer.parseInt(myLines[1]);\n\t\t\t\tint portID = Integer.parseInt(myLines[2]);\n\t\t\t\tShip myShip = myShips.get(shipID);\n\t\t\t\tPort destinationPort = myPorts.get(portID);\n\t\t\t\tdouble contConsumption = 0.00;\n\t\t\t\tfor(Container cont : myShip.containersInShip) {\n\t\t\t\t\tcontConsumption += cont.consumption();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble consumptionPerKM = contConsumption + myShip.getFuelConsumptionPerKM();\n\t\t\t\tdouble distance = myShip.currentPort.getDistance(myPorts.get(portID));\n\t\t\t\tdouble totalFuelRequired = distance*consumptionPerKM;\n\t\t\t\tif(myShip.getFuel() >= totalFuelRequired) {\n\t\t\t\t\tmyShip.setFuel(myShip.getFuel() - totalFuelRequired);\n\t\t\t\t\tmyShip.currentPort.current.remove(myShip);\n\t\t\t\t\tmyShip.currentPort.outgoingShip(myShip);\n\t\t\t\t\tdestinationPort.incomingShip(myShip);\n\t\t\t\t\tmyShip.currentPort = destinationPort;\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} else if(myLines[0].equals(\"7\")) {\n\t\t\t\tint shipID = Integer.parseInt(myLines[1]);\n\t\t\t\tdouble fuel = Double.parseDouble(myLines[2]);\n\t\t\t\tmyShips.get(shipID).reFuel(fuel);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\t\tPrintStream out = new PrintStream(new File(args[1]));\n\t\t\n\t\tint portNumbers = myPorts.size();\n\t\tint shipNumbers;\n\t\tfor(int n = 0; n < portNumbers; n++ ) {\n\t\t\tPort printingPort = myPorts.get(n);\n\t\t\tout.print(\"Port \" + n + \":(\" + printingPort.getX() + \", \" + printingPort.getY() + \")\");\n\t\t\tArrayList<Integer> basicPortList = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> heavyPortList = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> liquidPortList = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> refrigeratedPortList = new ArrayList<Integer>();\n\t\t\tfor(Container c : printingPort.containers) {\n\t\t\t\tif(c instanceof BasicContainer) {\n\t\t\t\t\tbasicPortList.add(c.ID);\n\t\t\t\t} else if(c instanceof LiquidContainer) {\n\t\t\t\t\tliquidPortList.add(c.ID);\n\t\t\t\t} else if(c instanceof RefrigeratedContainer) {\n\t\t\t\t\trefrigeratedPortList.add(c.ID);\n\t\t\t\t} else {\n\t\t\t\t\theavyPortList.add(c.ID);\n\t\t\t\t}\n\t\t\t}\n\t\t\tCollections.sort(basicPortList); Collections.sort(heavyPortList); Collections.sort(liquidPortList); Collections.sort(refrigeratedPortList);\n\t\t\tif(!(basicPortList.size() == 0)) {\n\t\t\t\tout.println();\n\t\t\t\tout.print(\" BasicContainer: \");\t\n\t\t\t\tfor(int b = 0; b < basicPortList.size(); b ++) {\t\n\t\t\t\t\tout.print(basicPortList.get(b) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!(heavyPortList.size() == 0)) {\n\t\t\t\tout.println();\n\t\t\t\tout.print(\" HeavyContainer: \");\n\t\t\t\tfor(int h = 0; h < heavyPortList.size(); h++) {\n\t\t\t\t\tout.print(heavyPortList.get(h) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!(refrigeratedPortList.size() == 0)) {\n\t\t\t\tout.println();\n\t\t\t\tout.print(\" RefrigeratedContainer: \");\n\t\t\t\tfor(int r = 0; r < refrigeratedPortList.size(); r++) {\n\t\t\t\t\tout.print(refrigeratedPortList.get(r) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!(liquidPortList.size() == 0)) {\n\t\t\t\tout.println();\n\t\t\t\tout.print(\" LiquidContainer: \");\n\t\t\t\tfor(int l = 0; l < liquidPortList.size(); l++) {\n\t\t\t\t\tout.print(liquidPortList.get(l) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tArrayList<Integer> portShipList = new ArrayList<Integer>();\n\t\t\tfor(Ship s : printingPort.current) {\n\t\t\t\tportShipList.add(s.getID());\n\t\t\t}\n\t\t\tCollections.sort(portShipList);\n\t\t\tfor(int p : portShipList) {\n\t\t\t\tout.println();\n\t\t\t\tout.print(\" Ship\" + p + \": \" + myShips.get(p).getFuel());\n\t\t\t\tArrayList<Integer> basicShipList = new ArrayList<Integer>();\n\t\t\t\tArrayList<Integer> heavyShipList = new ArrayList<Integer>();\n\t\t\t\tArrayList<Integer> liquidShipList = new ArrayList<Integer>();\n\t\t\t\tArrayList<Integer> refrigeratedShipList = new ArrayList<Integer>();\n\t\t\t\tfor(Container co : myShips.get(p).containersInShip) {\n\t\t\t\t\tif(co instanceof BasicContainer) {\n\t\t\t\t\t\tbasicShipList.add(co.ID);\n\t\t\t\t\t} else if(co instanceof LiquidContainer) {\n\t\t\t\t\t\tliquidShipList.add(co.ID);\n\t\t\t\t\t} else if(co instanceof RefrigeratedContainer) {\n\t\t\t\t\t\trefrigeratedShipList.add(co.ID);\n\t\t\t\t\t} else {\n\t\t\t\t\t\theavyShipList.add(co.ID);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t\tif(!(basicShipList.size() == 0)) {\n\t\t\t\t\tout.println();\n\t\t\t\t\tout.print(\" BasicContainer:\");\n\t\t\t\t\tfor(int b : basicShipList) {\n\t\t\t\t\t\tout.print(\" \" + b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!(heavyShipList.size() == 0)) {\n\t\t\t\t\tout.println();\n\t\t\t\t\tout.print(\" HeavyContainer:\");\n\t\t\t\t\tfor(int h : heavyShipList) {\n\t\t\t\t\tout.print(\" \" + h);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!(refrigeratedShipList.size() == 0)) {\n\t\t\t\t\tout.println();\n\t\t\t\t\tout.print(\" RefrigeratedContainer:\");\n\t\t\t\t\tfor(int r : refrigeratedShipList) {\n\t\t\t\t\t\tout.print(\" \" + r);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!(liquidShipList.size() == 0)) {\n\t\t\t\t\tout.println();\n\t\t\t\t\tout.print(\" LiquidContainer:\");\n\t\t\t\t\tfor(int l : liquidShipList) {\n\t\t\t\t\t\tout.print(\" \" + l);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\tCollections.sort(basicShipList); Collections.sort(heavyShipList); Collections.sort(liquidShipList); Collections.sort(refrigeratedShipList);\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\t\n\t\t\t\n\t\t\tout.println();\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tin.close();\n\t\tout.close();\n\t}", "public void init() throws Exception {\n if (\"local\".equalsIgnoreCase(cluster.provisioningMethod)) {\n zookeeper = new LocalZookeeper();\n int initValue = zookeeper.start();\n if (initValue != 0) {\n log.error(\"Failed to start Zookeeper!\");\n throw new RuntimeException(\"Failed to start Zookeeper!\");\n }\n\n ExecutorService executor = Executors.newFixedThreadPool(1, new ThreadFactoryBuilder().setNameFormat(\"nodestarter-threadpool\").build()); \n \t\t //Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()/2+1, new ThreadFactoryBuilder().setNameFormat(\"nodestarter-threadpool\").build()); \n\n int basePort = Util.getFreePort(cluster.numSolrNodes);\n\n for (int i = 1; i <= cluster.numSolrNodes; i++) {\n \t int nodeIndex = i;\n \t Callable c = () -> {\n \t\t SolrNode node = new LocalSolrNode(solrPackagePath, nodeIndex, String.valueOf(basePort + nodeIndex - 1), cluster.startupParams, cluster.startupParamsOverrides, zookeeper);\n \t\t \n \t\t try {\n\t \t\t node.init();\n\t \t\t node.start();\n\t \t\t nodes.add(node);\n\t \t\t \n\t \t\t log.info(\"Nodes started: \"+nodes.size());\n\t \t\t \n\t \t\t //try (HttpSolrClient client = new HttpSolrClient.Builder(node.getBaseUrl()).build();) {\n\t \t\t\t //log.info(\"Health check: \"+ new HealthCheckRequest().process(client) + \", Nodes started: \"+nodes.size());\n\t \t\t //} catch (Exception ex) {\n\t \t\t\t// log.error(\"Problem starting node: \"+node.getBaseUrl());\n\t \t\t\t //throw new RuntimeException(\"Problem starting node: \"+node.getBaseUrl());\n\t \t\t //}\n\t \t\t return node;\n \t\t } catch (Exception ex) {\n \t\t\t ex.printStackTrace();\n \t\t\t log.error(\"Problem starting node: \"+node.getBaseUrl());\n \t\t\t return null;\n \t\t }\n \t };\n \t executor.submit(c);\n }\n \n executor.shutdown();\n executor.awaitTermination(1, TimeUnit.HOURS);\n\n log.info(\"Looking for healthy nodes...\");\n List<SolrNode> healthyNodes = new ArrayList<>();\n for (SolrNode node: nodes) {\n \t\ttry (HttpSolrClient client = new HttpSolrClient.Builder(node.getBaseUrl().substring(0, node.getBaseUrl().length()-1)).build();) {\n \t\t\tHealthCheckRequest req = new HealthCheckRequest();\n \t\t\tHealthCheckResponse rsp;\n \t\t\ttry {\n \t\t\t\trsp = req.process(client);\n \t\t\t} catch (Exception ex) {\n \t\t\t\tThread.sleep(100);\n \t\t\t\trsp = req.process(client);\n \t\t\t}\n \t\t\tif (rsp.getNodeStatus().equalsIgnoreCase(\"ok\") == false) {\n \t\t\t\tlog.error(\"Couldn't start node: \"+node.getBaseUrl());\n \t\t\t\tthrow new RuntimeException(\"Couldn't start node: \"+node.getBaseUrl());\n \t\t\t} else {\n \t\t\t\thealthyNodes.add(node);\n \t\t\t}\n \t\t} catch (Exception ex) {\n \t\t\tex.printStackTrace();\n \t\t\tlog.error(\"Problem starting node: \"+node.getBaseUrl());\n \t\t}\n }\n \n this.nodes = healthyNodes;\n log.info(\"Healthy nodes: \"+healthyNodes.size());\n \n try (CloudSolrClient client = new CloudSolrClient.Builder().withZkHost(getZookeeperUrl()).build();) {\n\t log.info(\"Cluster state: \" + client.getClusterStateProvider().getClusterState());\n\t log.info(\"Overseer: \" + client.request(new OverseerStatus()));\n }\n\n \n } else if (\"terraform-gcp\".equalsIgnoreCase(cluster.provisioningMethod)) {\n \tSystem.out.println(\"Solr nodes: \"+getSolrNodesFromTFState());\n \tSystem.out.println(\"ZK node: \"+getZkNodeFromTFState());\n \tzookeeper = new GenericZookeeper(getZkNodeFromTFState());\n \tfor (String host: getSolrNodesFromTFState()) {\n \t\tnodes.add(new GenericSolrNode(host, cluster.terraformGCPConfig.get(\"user\").toString()));\n \t}\n } else if (\"vagrant\".equalsIgnoreCase(cluster.provisioningMethod)) {\n \tSystem.out.println(\"Solr nodes: \"+getSolrNodesFromVagrant());\n \tSystem.out.println(\"ZK node: \"+getZkNodeFromVagrant());\n \tzookeeper = new GenericZookeeper(getZkNodeFromVagrant());\n \tfor (String host: getSolrNodesFromVagrant()) {\n \t\tnodes.add(new GenericSolrNode(host, null)); // TODO fix username for vagrant\n \t}\n } else if (\"external\".equalsIgnoreCase(cluster.provisioningMethod)) {\n log.info(\"ZK node: \" + cluster.externalSolrConfig.zkHost);\n String[] tokens = cluster.externalSolrConfig.zkHost.split(\":\");\n zookeeper = new GenericZookeeper(tokens[0], tokens.length > 1 ? Integer.parseInt(tokens[1]) : null, cluster.externalSolrConfig.zkAdminPort, cluster.externalSolrConfig.zkChroot);\n\n try (CloudSolrClient client = new CloudSolrClient.Builder().withZkHost(cluster.externalSolrConfig.zkHost).withZkChroot(cluster.externalSolrConfig.zkChroot).build()) {\n for (String liveNode : client.getClusterStateProvider().getLiveNodes()) {\n nodes.add(new ExternalSolrNode(\n liveNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(liveNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript));\n }\n List<SolrNode> dataNodes = getExternalDataNodes(client).stream().map(dataNode -> new ExternalSolrNode(\n dataNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(dataNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!dataNodes.isEmpty()) {\n nodesByRole.put(NodeRole.DATA, dataNodes);\n }\n List<SolrNode> queryNodes = getExternalQueryNodes(client).stream().map(queryNode -> new ExternalSolrNode(\n queryNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(queryNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!queryNodes.isEmpty()) {\n nodesByRole.put(NodeRole.COORDINATOR, queryNodes);\n }\n List<SolrNode> overseerNodes = getExternalPreferredOverseerNodes(client).stream().map(overseerNode -> new ExternalSolrNode(\n overseerNode.split(\"_solr\")[0].split(\":\")[0],\n Integer.valueOf(overseerNode.split(\"_solr\")[0].split(\":\")[1]),\n cluster.externalSolrConfig.sshUserName,\n cluster.externalSolrConfig.restartScript)).collect(Collectors.toList());\n if (!queryNodes.isEmpty()) {\n nodesByRole.put(NodeRole.OVERSEER, overseerNodes);\n }\n }\n log.info(\"Cluster initialized with nodes: \" + nodes + \", zkHost: \" + zookeeper + \", nodes by role: \" + nodesByRole);\n }\n\n\n }", "public static void readNWriteCsvFile(String ipFilePath, String opFilePath, List diagnosticHeader, String currWellName) {\n logger.info(\"Start executing readNWriteCsvFile method !!!\");\n\n FileReader fileReader = null;\n CSVParser csvFileParser = null;\n List csvRecords = null;\n try {\n //initialize FileReader object\n fileReader = new FileReader(ipFilePath);\n //initialize CSVParser object\n csvFileParser = new CSVParser(fileReader, CSVFormat.EXCEL);\n //Get a list of CSV file records\n csvRecords = csvFileParser.getRecords();\n } catch (Exception e) {\n logger.error(\"Error in CsvFileReader !!!\");\n e.printStackTrace();\n logger.error(\"Exception : \", e);\n } finally {\n try {\n fileReader.close();\n csvFileParser.close();\n } catch (IOException e) {\n logger.error(\"Error while closing fileReader/csvFileParser !!!\");\n e.printStackTrace();\n logger.error(\"IOException : \", e);\n }\n }\n// Calling Parser\n createProcessedFile(opFilePath, csvRecords, diagnosticHeader, currWellName);\n }", "@Test\n\tpublic void testExecuteRequestClientActionGetFileParallelNoThreadsIndicated() throws Exception {\n\n\t\tif (!testingPropertiesHelper.isTestParallelTransfer(testingProperties)) {\n\t\t\treturn;\n\t\t}\n\n\t\tString testFileName = \"testExecuteRequestClientActionGetFileParallelNoThreadsIndicated.txt\";\n\t\tString testFileGetName = \"testExecuteRequestClientActionGetFileParallelNoThreadsIndicatedReturned.txt\";\n\n\t\tString absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);\n\t\tFile scratchDir = new File(absPath);\n\t\tscratchDir.delete();\n\t\tString scratchFileAbsolutePath = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName,\n\t\t\t\t32 * 1024 * 1024);\n\n\t\tString targetIrodsCollection = testingPropertiesHelper\n\t\t\t\t.buildIRODSCollectionAbsolutePathFromTestProperties(testingProperties, IRODS_TEST_SUBDIR_PATH);\n\n\t\tIRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);\n\n\t\tIRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory();\n\n\t\t// put the file\n\n\t\tFile sourceFile = new File(scratchFileAbsolutePath);\n\t\tIRODSFile targetFile = accessObjectFactory.getIRODSFileFactory(irodsAccount)\n\t\t\t\t.instanceIRODSFile(targetIrodsCollection);\n\n\t\tDataTransferOperations dto = accessObjectFactory.getDataTransferOperations(irodsAccount);\n\t\tdto.putOperation(sourceFile, targetFile, null, null);\n\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"testClientAction||msiDataObjGet(\");\n\t\tbuilder.append(testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(testingProperties,\n\t\t\t\tIRODS_TEST_SUBDIR_PATH));\n\t\tbuilder.append('/');\n\t\tbuilder.append(testFileName);\n\t\tbuilder.append(\",\\\"numThreads=-1++++localPath=\");\n\t\tbuilder.append(absPath);\n\t\tbuilder.append(testFileGetName);\n\t\tbuilder.append(\"++++rescName=\");\n\t\tbuilder.append(irodsAccount.getDefaultStorageResource());\n\t\tbuilder.append(\"++++forceFlag=\\\"\");\n\t\tbuilder.append(\",*status)|nop\\n\");\n\t\tbuilder.append(\"*A=null\\n\");\n\t\tbuilder.append(\"*ruleExecOut\");\n\n\t\tRuleProcessingAO ruleProcessingAO = accessObjectFactory.getRuleProcessingAO(irodsAccount);\n\t\tRuleInvocationConfiguration context = new RuleInvocationConfiguration();\n\t\tcontext.setIrodsRuleInvocationTypeEnum(IrodsRuleInvocationTypeEnum.IRODS);\n\t\tcontext.setEncodeRuleEngineInstance(true);\n\n\t\truleProcessingAO.executeRule(builder.toString(), null, context);\n\n\t\tassertionHelper.assertLocalFileExistsInScratch(IRODS_TEST_SUBDIR_PATH + '/' + testFileGetName);\n\n\t}", "static public InputLayer readFromFile(NetworkFileReader nfr) throws IOException {\n\t\t// read in the size and make a new InputLayer of that size\n\t\tint size = nfr.readInt();\n\t\treturn new InputLayer(size);\n\t}", "public static ClusterId getClusterId(FileSystem fs, Path rootdir) throws IOException {\n Path idPath = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);\n ClusterId clusterId = null;\n FileStatus status = fs.exists(idPath) ? fs.getFileStatus(idPath) : null;\n if (status != null) {\n int len = Ints.checkedCast(status.getLen());\n byte[] content = new byte[len];\n FSDataInputStream in = fs.open(idPath);\n try {\n in.readFully(content);\n } catch (EOFException eof) {\n LOG.warn(\"Cluster ID file {} is empty\", idPath);\n } finally {\n in.close();\n }\n try {\n clusterId = ClusterId.parseFrom(content);\n } catch (DeserializationException e) {\n throw new IOException(\"content=\" + Bytes.toString(content), e);\n }\n // If not pb'd, make it so.\n if (!ProtobufUtil.isPBMagicPrefix(content)) {\n String cid = null;\n in = fs.open(idPath);\n try {\n cid = in.readUTF();\n clusterId = new ClusterId(cid);\n } catch (EOFException eof) {\n LOG.warn(\"Cluster ID file {} is empty\", idPath);\n } finally {\n in.close();\n }\n rewriteAsPb(fs, rootdir, idPath, clusterId);\n }\n return clusterId;\n } else {\n LOG.warn(\"Cluster ID file does not exist at {}\", idPath);\n }\n return clusterId;\n }", "private static void getTcpPrivateAddress() {\n\n\t\tString address = readFileString(FileConstant.FILE_NAME_TCP_ADDRESS_PRIVATE);\n\n\t\tif (Utils.isNotEmpty(address)) {\n\n\t\t\tint start = 0;\n\t\t\tint end = address.indexOf(FileConstant.FILE_STRING_SPLIP_SYMBOL, start);\n\n\t\t\tif (end < address.length()) {\n\n\t\t\t\tConfigureVariable.Tcp_Address_Ip_Private = address.substring(start, end);\n\n\t\t\t\tstart = end + 1;\n\t\t\t\tend = address.length();\n\n\t\t\t\tConfigureVariable.Tcp_Address_Port_Private = address.substring(start, end);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) throws InterruptedException {\r\n\r\n\t\tString clustercfg = \"\";\r\n\t\tString ddlfile = \"\";\r\n\t\tString line = null;\r\n\t\tString wordLeft = \"\"; // left side of catalog eqs\r\n\t\tString wordRight = \"\"; // right side of catalog eqs\r\n\r\n\t\t// ArrayList to store the node information\r\n\t\t// ArrayList<DBNode> nodeAL = new ArrayList<DBNode>();\r\n\t\tint nodeCount = 1; // for use in getting values for nodes\r\n\t\tint temp = 0;\r\n\r\n\t\tString nodeDriver = \"\";\r\n\t\tString nodeHostName = \"\";\r\n\t\tString nodeUserName = \"\";\r\n\t\tString nodePassword = \"\";\r\n\r\n\t\t/*\r\n\t\t * switch for scanning catalogs. -1 = nothing 0 = driver, 1=hostname,\r\n\t\t * 2=username, 3=passwd\r\n\t\t *\r\n\t\t */\r\n\r\n\t\tFileReader fr;\r\n\t\tBufferedReader br;\r\n\r\n\t\t// int numnodes = 0;\r\n\r\n\t\tif (args.length > 1) {\r\n\t\t\tclustercfg = args[0];\r\n\t\t\tddlfile = args[1];\r\n\r\n\t\t\ttry {\r\n\t\t\t\tfr = new FileReader(clustercfg);\r\n\t\t\t\tbr = new BufferedReader(fr);\r\n\r\n\t\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\t\t// System.out.println(line);\r\n\r\n\t\t\t\t\tif (numnodes == -1) {\r\n\t\t\t\t\t\tprocessCatalogLine(line);\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t// System.out.println(line);\r\n\r\n\t\t\t\t\t\tfor (int x = 0; x < line.length(); x++) {\r\n\t\t\t\t\t\t\t// System.out.println(wordLeft);\r\n\t\t\t\t\t\t\t// System.out.println(temp);\r\n\t\t\t\t\t\t\t// System.out.println(\"node\" + nodeCount +\r\n\t\t\t\t\t\t\t// \"driver=\");\r\n\r\n\t\t\t\t\t\t\tif (wordLeft.equals(\"node\" + nodeCount + \".driver=\")) {\r\n\t\t\t\t\t\t\t\tnodeDriver = nodeDriver + line.charAt(x);\r\n\r\n\t\t\t\t\t\t\t\tif (x == (line.length() - 1)) {\r\n\t\t\t\t\t\t\t\t\ttemp++;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else if (wordLeft.equals(\"node\" + nodeCount + \".hostname=\")) {\r\n\t\t\t\t\t\t\t\tnodeHostName = nodeHostName + line.charAt(x);\r\n\r\n\t\t\t\t\t\t\t\tif (x == (line.length() - 1)) {\r\n\t\t\t\t\t\t\t\t\ttemp++;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else if (wordLeft.equals(\"node\" + nodeCount + \".username=\")) {\r\n\t\t\t\t\t\t\t\tnodeUserName = nodeUserName + line.charAt(x);\r\n\r\n\t\t\t\t\t\t\t\tif (x == (line.length() - 1)) {\r\n\t\t\t\t\t\t\t\t\ttemp++;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else if (wordLeft.equals(\"node\" + nodeCount + \".passwd=\")) {\r\n\t\t\t\t\t\t\t\tnodePassword = nodePassword + line.charAt(x);\r\n\r\n\t\t\t\t\t\t\t\tif (x == (line.length() - 1)) {\r\n\t\t\t\t\t\t\t\t\ttemp++;\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\twordLeft = wordLeft + line.charAt(x);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (temp == 4) {\r\n\r\n\t\t\t\t\t\tDBNode newNode = new DBNode(nodeDriver, nodeHostName, nodeUserName, nodePassword);\r\n\r\n\t\t\t\t\t\tnodeAL.add(newNode);\r\n\r\n\t\t\t\t\t\tnodeDriver = \"\";\r\n\t\t\t\t\t\tnodeHostName = \"\";\r\n\t\t\t\t\t\tnodeUserName = \"\";\r\n\t\t\t\t\t\tnodePassword = \"\";\r\n\t\t\t\t\t\tnodeCount++;\r\n\t\t\t\t\t\ttemp = 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// System.out.println(wordLeft);\r\n\t\t\t\t\twordLeft = \"\";\r\n\t\t\t\t\t// catalog = -1;\r\n\t\t\t\t} // end of while\r\n\r\n\t\t\t\t// String tname = \"\";\r\n\r\n\t\t\t\treadDDL(ddlfile);\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * String derp =\r\n\t\t\t\t * \"CREATE TABLE BOOKS(isbn char(14), title char(80), price decimal)\"\r\n\t\t\t\t * ;\r\n\t\t\t\t * \r\n\t\t\t\t * System.out.println(derp); System.out.print(\"herr drr: \");\r\n\t\t\t\t * System.out.println(parseTname(derp));\r\n\t\t\t\t */\r\n\r\n\t\t\t\tdoThread();\r\n\r\n\t\t\t\tif (successful) {\r\n\t\t\t\t\trunCatalog();\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"File not found\");\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Argument insufficient\");\r\n\t\t}\r\n\r\n\t}", "public static Network loadNetwork(String filename)\n throws IOException,\n InvalidNetworkException {\n Network network = new Network();\n BufferedReader bufferedReader = new BufferedReader(\n new FileReader(filename)\n );\n String currentLine = bufferedReader.readLine();\n List<String> intersectionsWithTrafficLights = new ArrayList<>();\n int currentLineNumber = 1;\n int numIntersections = 0;\n int numRoutes = 0;\n\n while (currentLine != null) {\n if (currentLine.startsWith(\";\")) {\n currentLine = bufferedReader.readLine();\n continue;\n }\n\n switch(currentLineNumber) {\n case 1:\n numIntersections = Integer.parseInt(currentLine);\n break;\n case 2:\n numRoutes = Integer.parseInt(currentLine);\n break;\n case 3:\n network.setYellowTime(Integer.parseInt(currentLine));\n break;\n case 4:\n parseIntersections(\n numIntersections,\n intersectionsWithTrafficLights,\n currentLine,\n network,\n bufferedReader\n );\n break;\n case 5:\n parseRoutesAndSensors(\n numRoutes,\n currentLine,\n network,\n bufferedReader\n );\n\n // Create traffic lights\n for (int i = 0; i < intersectionsWithTrafficLights.size(); i++) {\n String[] intersectionValues =\n intersectionsWithTrafficLights\n .get(i)\n .split(\":\");\n List<String> intersectionOrder = new ArrayList<>();\n for (String originIntersection: intersectionValues[2]\n .split(\",\")) {\n intersectionOrder.add(originIntersection);\n }\n try {\n network.addLights(intersectionValues[0],\n Integer.parseInt(intersectionValues[1]),\n intersectionOrder);\n } catch (IntersectionNotFoundException\n | InvalidOrderException e) {\n e.printStackTrace();\n }\n }\n\n break;\n }\n\n currentLineNumber++;\n currentLine = bufferedReader.readLine();\n }\n\n bufferedReader.close();\n return network;\n }", "private boolean readFile(String fileName) {\n Message msg = new Message();\n FileInputStream fis;\n InputStreamReader isr;\n BufferedReader br;\n int depCount = 0;\n int depIndex = 0;\n float xIndex = 0;\n float yIndex = 0;\n int dist = 0;\n int capacity = 0;\n File file = new File(fileName);\n\n try {\n //open the requested file\n fis = new FileInputStream(file);\n isr = new InputStreamReader(fis);\n br = new BufferedReader(isr);\n } catch (Exception e) {\n System.err.println(\"File is not present \" + file);\n\n return false;\n }\n\n String line;\n StringTokenizer st = null;\n\n try {\n br.readLine(); // skip text labels\n line = br.readLine(); // depot constraints\n st = new StringTokenizer(line);\n\n // skip text labels\n br.readLine();\n } catch (IOException ex) {\n System.err.println(\"Error reading depot file: \" + fileName + \": \" +\n ex);\n }\n\n try {\n depCount = Integer.parseInt(st.nextToken().trim());\n dist = Integer.parseInt(st.nextToken().trim());\n capacity = Integer.parseInt(st.nextToken().trim());\n } catch (NumberFormatException ex) {\n System.err.println(\"Error processing depot constraint info: \" + ex);\n }\n\n //process depots\n for (int i = 0; i < depCount; i++) {\n try {\n line = br.readLine();\n st = new StringTokenizer(line);\n } catch (IOException ex) {\n System.err.println(\"Error reading depot file: \" + fileName +\n \": \" + ex);\n }\n\n //read the depot information\n try {\n depIndex = Integer.parseInt(st.nextToken().trim());\n xIndex = Float.parseFloat(st.nextToken().trim());\n yIndex = Float.parseFloat(st.nextToken().trim());\n } catch (NumberFormatException ex) {\n System.err.println(\"Error processing depot coordinate info: \" +\n ex);\n }\n\n // build the message\n msg.addArgument(IndexTag, \"\" + depIndex);\n msg.addArgument(XCoordTag, \"\" + xIndex);\n msg.addArgument(YCoordTag, \"\" + yIndex);\n }\n\n //save max distance and capacity\n if (dist == 0) { //if no max distance, set to a large number...\n dist = 999999999;\n }\n\n if (capacity == 0) { //if there is no maximum capacity, set it to a very large number\n capacity = 999999999;\n }\n\n // build the message\n msg.addArgument(NumberOfDepotsTag, \"\" + depCount);\n msg.addArgument(MaxCapacityTag, \"\" + capacity);\n msg.addArgument(MaxDistanceTag, \"\" + dist);\n msg.addArgument(FileNameTag, fileName);\n\n zAdapt.setProblemConstraints(msg);\n\n return true;\n }", "public static List<Server> readFile() {\n String fileName = \"servers.txt\";\n\n List<Server> result = new LinkedList<>();\n try (Scanner sc = new Scanner(createFile(fileName))) {\n\n while (sc.hasNextLine()) {\n String line = sc.nextLine();\n result.add(lineProcessing(line));\n\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File is not found\");\n } catch (MyException e) {\n System.out.println(\"File is corrupted\");\n }\n return result;\n }", "@Override\n public List<String> ipToIdLookup(List<String> ips)\n {\n log.info(\"Asked IPs -> IDs for: [%s]\", String.join(\",\", ips));\n\n if (ips.isEmpty()) {\n return new ArrayList<>();\n }\n\n // If the first one is not an IP, just assume all the other ones are not as well and just\n // return them as they are. This check is here because Druid does not check if IPs are\n // actually IPs and can send IDs to this function instead\n if (!InetAddresses.isInetAddress(ips.get(0))) {\n log.debug(\"Not IPs, doing nothing\");\n return ips;\n }\n\n final String project = envConfig.getProjectId();\n final String zone = envConfig.getZoneName();\n try {\n Compute computeService = createComputeService();\n Compute.Instances.List request = computeService.instances().list(project, zone);\n // Cannot filter by IP atm, see below\n // request.setFilter(GceUtils.buildFilter(ips, \"networkInterfaces[0].networkIP\"));\n\n List<String> instanceIds = new ArrayList<>();\n InstanceList response;\n do {\n response = request.execute();\n if (response.getItems() == null) {\n continue;\n }\n for (Instance instance : response.getItems()) {\n // This stupid look up is needed because atm it is not possible to filter\n // by IP, see https://issuetracker.google.com/issues/73455339\n for (NetworkInterface ni : instance.getNetworkInterfaces()) {\n if (ips.contains(ni.getNetworkIP())) {\n instanceIds.add(instance.getName());\n }\n }\n }\n request.setPageToken(response.getNextPageToken());\n } while (response.getNextPageToken() != null);\n\n log.debug(\"Converted to [%s]\", String.join(\",\", instanceIds));\n return instanceIds;\n }\n catch (Exception e) {\n log.error(e, \"Unable to convert IPs to IDs.\");\n }\n\n return new ArrayList<>();\n }", "public static void main(String[] args) throws IOException{\n\t\tintersections = new HashMap<Integer,LatLong>();\n\t\t/*nodeIDs = new ArrayList<Integer>();\n\t\tnodeCoordinates = new ArrayList<LatLong>();*/\n\t\t\n\t\tString intersectionsFileName = \"data/CENTRELINE_INTERSECTION_WGS84.csv\";\n\t\tScanner input = new Scanner(new File(intersectionsFileName));\n\t\t//System.out.println(\"intersection\");\n\t\t//System.out.println(input.hasNextLine());\n\t\tString[] throwout = input.nextLine().split(\",\");\n\t\twhile (input.hasNextLine()){\n\t\t\tString[] line = input.nextLine().split(\",\");\n\t\t\tLatLong l = new LatLong(Double.parseDouble(line[16]), Double.parseDouble(line[15]));\n\t\t\t\n\t\t\tInteger data = Integer.parseInt(line[0]);\n\t\t\t\n\t\t\tintersections.put(data,l);\n\t\t\t\n\t\t\t/*nodeIDs.add(data);\n\t\t\tnodeCoordinates.add(l);*/\n\t\t\t\n\t\t}\n\t\tinput.close();\n\t\t\n\t\t\n\t\t//Create graph based on centreline data, which tells us which nodes/intersections are connected\n\t\tG = new Graph();\n\t\tString centrelineFileName = \"data/CENTRELINE_WGS84.csv\";\n\t\tinput = new Scanner(new File(centrelineFileName));\n\n\t\tthrowout = input.nextLine().split(\",\");\n\t\twhile (input.hasNextLine()){\n\t\t\tString[] line = input.nextLine().split(\",\");\n\t\t\tInteger fnode = Integer.parseInt(line[11]);\n\t\t\tInteger tnode = Integer.parseInt(line[12]);\n\t\t\t\n\t\t\t//Look up corresponding lat/long points\n\t\t\tdouble fnodeLat = intersections.get(fnode).getLatitude();\n\t\t\tdouble fnodeLon = intersections.get(fnode).getLongitude();\n\t\t\tdouble tnodeLat = intersections.get(tnode).getLatitude();\n\t\t\tdouble tnodeLon = intersections.get(tnode).getLongitude();\n\t\t\t\n\t\t\tG.addEdge(fnode, fnodeLat, fnodeLon, tnode, tnodeLat, tnodeLon);\n\t\t}\n\t\tinput.close();\n\t\t\n\t\t\n\t\t//Import bike parking on street\n\t\tbikeParkingCoordinates = new ArrayList<LatLong>();\n\t\tbikeParkingNodeIDs = new ArrayList<Integer>();\n\t\tbikeNodes = new HashMap<Integer, LatLong>();\n\t\tString bikeParkingOnStreetFileName = \"data/BICYCLE_PARKING_ON_STREET_WGS84.csv\";\n\t\tinput = new Scanner(new File(bikeParkingOnStreetFileName));\n\t\tSystem.out.println(\"hello\" + \"\\n\" + \"Testing Client.java\" +\"\\n\");\n\t\t//System.out.println(input.hasNextLine());\n\t\tthrowout = input.nextLine().split(\",\");\n\t\t\n\t\twhile (input.hasNextLine()){\n\t\t\tString[] line = input.nextLine().split(\",\");\n\t\t\tLatLong l = new LatLong(Double.parseDouble(line[6]), Double.parseDouble(line[5]));\n\t\t\t\n\t\t\t//Find intersection closest to bike parking\n\t\t\tInteger bpNodeID = PathCalculation.closestIntersection(l, intersections);\n\t\t\tbikeParkingNodeIDs.add(bpNodeID);\n\t\t\tbikeParkingCoordinates.add(intersections.get(bpNodeID));\n\t\t\t\n\t\t\t//System.out.println(l + \" \" + intersections.get(bpNodeID));\n\t\t\t\n\t\t\tbikeNodes.put(bpNodeID, intersections.get(bpNodeID));\n\t\t\t\n\t\t\t\n\t\t}\n\t\tinput.close();\n\t\t\n\t\t\n\t\t\n\t\t/*for (Integer e : bikeNodes.keySet()){\n\t\t\tSystem.out.println(e);\n\t\t}*/\n\t\t\n\t\t\n\t\t//Ask user for beginning and end address\n\t\tString userString = null; //for storage of user's desired input\n\t\t\n\t\tScanner s = new Scanner(new File(\"data/testData.txt\")); //Data file with addresses, source and destination\n\t\tint n = 1; // Test case number\n\t\twhile(s.hasNextLine()){\n\t\t\tBoolean INvalidinput = true; // used for while loop, loop while the input is not good\n\t\t\t\n\t\t\tLatLong StartCoords = new LatLong(0,0);\n\t\t\tLatLong EndCoords = new LatLong(0,0);\n\t\t\tAddresses.init();\n\t\t\twhile(INvalidinput){\n\t\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Testing case: \" + n);\n\t\t\t\tuserString = s.nextLine();\n\t\t\t\tStartCoords = Addresses.getLatLong(userString);\n\t\t\t\tINvalidinput = false; // essentially if it GETS one it's valid. OTHERWISE it will throw an exception\n\t\t\t\t}\n\t\t\t\tcatch(InvalidStreetException | NumberFormatException e){\n\t\t\t\t\tSystem.out.println(\"INVALID STREET: \" + userString + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t\tcatch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"PLEASE ENTER: StreetNumber,StreetName\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t\tcatch(StringIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"PLEASE ENTER: StreetNumber,StreetName\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tINvalidinput = true;\n\t\t\twhile(INvalidinput){\n\t\t\t\ttry{\n\t\t\t\tuserString = s.nextLine();\n\t\t\t\tEndCoords = Addresses.getLatLong(userString);\n\t\t\t\tINvalidinput = false; // essentially if it GETS one it's valid. OTHERWISE it will throw an exception\n\t\t\t\t}\n\t\t\t\tcatch(InvalidStreetException | NumberFormatException e){\n\t\t\t\t\tSystem.out.println(\"INVALID STREET\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t\tcatch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"PLEASE ENTER: StreetNumber,StreetName\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t\tcatch(StringIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"PLEASE ENTER: StreetNumber,StreetName\" + \"\\n\");\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Call path calculation --> should return list of lat/long points given two lat/long points and a graph\n\t\t\t\n\t\t/*\tInteger source = 30075902;\n\t\t\tInteger destination = 13469577;\n\t\t*/\n\t\t\tInteger source = PathCalculation.closestIntersection(StartCoords, intersections);\n\t\t\tInteger destination = PathCalculation.closestIntersection(EndCoords, intersections);\n\t\t\t\n\t\t\t/*Integer source = nodeIDs.get(nodeCoordinates.indexOf(StartCoords));\n\t\t\tInteger destination = nodeIDs.get(nodeCoordinates.indexOf(EndCoords));*/\n\t\t\t\n\t\t\t//Determine bike parking location by finding shortest path\n\t\t\t\t\t//Integer chosenBikeParkingNodeID = PathCalculation.closestBikeParking(destination, bikeParkingLocations);\n\t\t\t\n\t\t\tBreadthFirstSearch bfsDestinationToBikeParking = new BreadthFirstSearch(G, destination);\n\t\t\tInteger closestDistance = Integer.MAX_VALUE;\n\t\t\tInteger closestBPNodeID = 0;\n\t\t\t\n\t\t\tfor (Integer bpNodeID : bikeNodes.keySet()){\n\t\t\t\tInteger distance = bfsDestinationToBikeParking.distTo(bpNodeID);\n\t\t\t\tif (distance < closestDistance){\n\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\tclosestBPNodeID = bpNodeID;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*for (Integer e : bfsDestinationToBikeParking.getDistTo().keySet()){\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t\t\t*/\n\t\t\t//Get path from bpNodeID to destination in array list\n\t\t\tArrayList<Integer> destToBP = bfsDestinationToBikeParking.pathToArray(closestBPNodeID); //path from dest --> BP\n\t\t\t\n\t\t\t//Get path from source to bpNodeID in array list\n\t\t\tBreadthFirstSearch bfsSourceToBikeParking = new BreadthFirstSearch(G, source);\n\t\t\tArrayList<Integer> sourceToBP = bfsSourceToBikeParking.pathToArray(closestBPNodeID);\n\t\t\t//create final path in nodeId's\n\t\t\tArrayList<Integer> finalPath = new ArrayList<Integer>();\n\t\t\t\n\t\t\tfor (int i = 0; i < sourceToBP.size(); i++){\n\t\t\t\tfinalPath.add(sourceToBP.get(i));\n\t\t\t}\n\t\t\t//want path from BP to dest, so reverse array list:\n\t\t\tfor (int i = destToBP.size() - 1; i < 0; i++){\n\t\t\t\tfinalPath.add(destToBP.get(i));\n\t\t\t}\t\t\n\t\t\t\n\t\t\t//create array list of lat/long points:\n\t\t\tArrayList<LatLong> finalLatLongPath = new ArrayList<LatLong>();\n\t\t\tfor (int i = 0; i < finalPath.size(); i++){\n\t\t\t\tfinalLatLongPath.add(intersections.get(finalPath.get(i)));\n\t\t\t}\n\t\t\t\n\t\t\tfor (LatLong e : finalLatLongPath){\n\t\t\t\t//System.out.print(e + \", \");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Test case \" +n + \" passed.\" + \"\\n\");\n\t\t\tn++;\n\t\t}\n\t\t\n//\t\tDesktop d = Desktop.getDesktop();\n//\t\ttry {\n//\t\t\td.browse(new URI(\"https://jsfiddle.net/rmLtu9t7/6/\"));\n//\t\t} catch (URISyntaxException e1) {\n//\t\t\tSystem.out.println(\"Invalid Website URL\");\n//\t\t}\n\t}", "private static int getConfigFromFile(){\n\t\tint ret = -1;\n\t\ttry(BufferedReader r = new BufferedReader(new FileReader(\"./configFile\"))){\n\t\t\tTCPIP = new String(r.readLine().split(\":\")[1]);\n\t\t\tTCPSERVERPORT = Integer.parseInt((r.readLine().split(\":\")[1]));\n\t\t\tMCPORT = Integer.parseInt((r.readLine().split(\":\")[1]));\n\t\t\tMCIP = new String(r.readLine().split(\":\")[1]);\n\t\t\tRMISERVERPORT = Integer.parseInt((r.readLine().split(\":\")[1]));\n\t\t\tret = 0;\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Config file not found. Please put it in the execution directory then restart.\");\n\t\t} catch(NumberFormatException e){\n\t\t\tSystem.out.println(\"Config file has an unsupported format. Please check it and restart.\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Some error occurred while reading from config file: \"+e.getMessage()+\"\\nPlease restart.\");\n\t\t}\n\t\treturn ret;\n\t}", "public void loadMemory(String inputFile){\n\t\tint pc = 0;\n\t\ttry{\n\t\t\tRandomAccessFile raf = new RandomAccessFile(new File(inputFile),\"rw\");\n\t\t\tString strLine;\n\t\t\tint decimalNumber;\n\t\t\twhile ((strLine = raf.readLine())!=null){\n\t\t\t\tstrLine = strLine.substring(0, 8); //get the first 8 char(hex instruction)\n\t\t\t\tdecimalNumber = new BigInteger(strLine, 16).intValue(); //decode the hex into integer\n\t\t\t\tloadInstructionInMemory(pc, decimalNumber);\n\t\t\t\tpc += 4;\n\t\t\t}\n\t\t\traf.close();\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tSystem.out.println(\"Error:\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "Cluster getUpcomingCluster() throws TimeoutException, InterruptedException;", "void exec3(DeletedDirectoryEntry entry, String outdir, String file) throws Exception {\r\n\r\n byte[] buffer = new byte[fat32.getBytesPerCluster()]; \r\n\r\n //\r\n // startClusterHigh を見つける\r\n //\r\n if (!entry.resolveStartCluster(id3v2MatchingStrategy) || !entry.isStartClusterValid()) {\r\nSystem.err.println(\"start cluster not found: \" + file);\r\n return;\r\n }\r\n int startCluster = entry.getStartCluster();\r\n\r\n //\r\n // 連続しているクラスターを書き出す\r\n // 途切れたら次の使われていないところ\r\n //\r\n\r\nSystem.err.println(entry.getName() + \": \" + entry.getStartCluster() + \", \" + entry.length());\r\n\r\n int block = 0;\r\n boolean continued = false;\r\nouter:\r\n for (int cluster = 0; cluster < fat32.getLastCluster(); cluster++) {\r\n int targetCluster = startCluster + cluster;\r\nSystem.err.print(\"cluster: \" + targetCluster);\r\n\r\n // 途切れたら次の使われていないところ\r\n\r\n if (fat32.isUsing(targetCluster)) {\r\nSystem.err.println(\" has used, skip\");\r\n continued = false;\r\n continue;\r\n } else {\r\n if (continued == false) {\r\n continued = true;\r\n block++;\r\nSystem.err.println(\" block: \" + block);\r\n }\r\n fat32.readCluster(buffer, targetCluster);\r\nif (block > 1) {\r\n System.err.println(\"\\n\" + StringUtil.getDump(buffer, 128));\r\n}\r\n }\r\n\r\nSystem.err.println();\r\n }\r\n\r\n }", "private void readConstantPool() throws IOException, ClassFormatException {\n constant_pool = new ConstantPool(dataInputStream);\n }", "public static void getCustomerCluster(ZkClient zkClient, String[] queueNames) {\n \tif(queueNames != null && queueNames.length > 0){\n \t\tgetCluster(zkClient);\n \t\ttry {\n \t\t\tfor(String queue : queueNames){\n \t\t\tif(StringUtils.isNotBlank(queue)){\n \t\t\t\tList<String> childrens = zkClient.getChildren(ZkTopicQueueReadIndex.ZK_INDEX + \"/\" + queue);\n \t\t\t\tif(childrens != null){\n \t\t\t\t\tList<String> sortChildrens = new ArrayList<String>();\n \t\t\t\t\tSet<String> remove = new HashSet<String>();\n \t\t\t\t\tfor(String ip:Cluster.getMasterIps()){\n \t\t\t\t\t\tfor(String sip:childrens){\n \t\t\t\t\t\t\tif(sip.startsWith(Group.QUEUE_INDEX_PREFIX)){\n \t\t\t\t\t\t\t\tsip = sip.replace(Group.QUEUE_INDEX_PREFIX, \"\");\n \t\t\t\t\t\t\t\tString[] ips = sip.split(\":\");\n \t\t\t\t\t\t\tif(ip.equals(ips[0])){\n \t\t\t\t\t\t\t\tsortChildrens.add(sip);\n \t\t\t\t\t\t\t\tremove.add(sip);\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\tfor(String yip:childrens){\n \t\t\t\t\t\tif(yip.startsWith(Group.QUEUE_INDEX_PREFIX)){\n \t\t\t\t\t\t\tyip = yip.replace(Group.QUEUE_INDEX_PREFIX, \"\");\n \t\t\t\t\t\t\tif(!remove.contains(yip)){\n \t\t\t\t\t\t\tsortChildrens.add(yip);\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\tfor(String child:sortChildrens){\n \t\t\t\t\tString[] ips = child.split(\":\");\n \t\t\t\t\tif(ips != null){\n \t\t\t\t\t\tif(ips.length == 1){\n \t\t\t\t\t\t\tCluster.putSlave(queue, ips[0], null);\n \t\t\t\t\t\t}else{\n \t\t\t\t\t\t\tCluster.putSlave(queue, ips[0], ips[1]);\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}\n \t\t}\n \t\tConcurrentHashMap<String, List<Group>> maps = Cluster.getQueueGroups();\n \t\tif(maps != null && maps.size() > 0){\n \t\t\tLOGGER.debug(\"Customer load success, list:\");\n \t\tfor(Entry<String, List<Group>> entry:maps.entrySet()){\n \t\t\tLOGGER.debug(entry.getKey()+\"=>\"+entry.getValue().toString());\n \t\t}\n \t\t}\n \t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tLOGGER.error(\"get customer cluster error\", e);\n\t\t\t}\n \t}\n }", "public static void main(String[] args) throws IOException\n\t {\t\n\t try{\t\n\t\t FileReader f=new FileReader(path);\n\t\t @SuppressWarnings(\"resource\")\n\t\tBufferedReader br=new BufferedReader(f);\n\t\t String text;\n\t\t String dot=\"\\\\.\";\n\t\t \n\t\t while((text=br.readLine())!=null)\n\t\t {\n\t\t\tfor(String retval: text.split(dot))\n\t \n\t\t\t System.out.println(\"Ip Address:\"+retval);\n\t \n\t\t\t\n\t\t\n\t\t }}\n\t catch(Exception e)\n\t {\n\t \te.printStackTrace();\n\t }\n\t\t\t \n\t\t \n\t \n\t }", "synchronized ByteBuffer readPage(int clusterId, int pageId, long offset, long length,\n boolean cachePage)\n throws IOException {\n pageLoads++;\n ByteBuffer cachedPage = null;\n if (mode == READMODE.MR) {\n cachedPage = pcp[clusterId].getPage(pageId);\n } else if (mode == READMODE.POINTQUERY) {\n cachedPage = pagecache.getBlock(makePageName(segId, clusterId, pageId));\n }\n if (cachedPage != null) {\n cacheHits++;\n if (reporter != null) {\n if (clusterId < 16) {\n reporter.incrCounter(SegmentCacheHitCounter.values()[clusterId], 1);\n } else {\n reporter.incrCounter(SegmentCacheHitCounter.OTHERCLUSTERS, 1);\n }\n }\n return cachedPage.duplicate();\n }\n\n /**\n * Report the related activities to M/R frameworks, so we will know\n * what happened during query processing\n */\n if (reporter != null) {\n if (clusterId < 16) {\n reporter.incrCounter(SegmentReadPageCounter.values()[clusterId], 1);\n } else {\n reporter.incrCounter(SegmentReadPageCounter.OTHERCLUSTERS, 1);\n }\n\n if (istream.getPos() - offset > 0) {\n reporter.incrCounter(SegmentPosSeekCounter.MOVEBACK, 1);\n } else {\n reporter.incrCounter(SegmentPosSeekCounter.MOVEON, 1);\n }\n }\n\n // ByteBuffer buf = ByteBuffer.allocate(longToInt(length));\n // istream.readFully(offset, buf.array());\n\n // Read the page from filesystem\n InputStream is = new BoundedRangeFileInputStream(istream, offset, length);\n ByteBuffer buf = ByteBuffer.allocate(longToInt(length));\n IOUtils.readFully(is, buf.array(), 0, buf.capacity());\n is.close();\n\n if (cachePage) {\n if (mode == READMODE.MR) {\n pcp[clusterId].cachePage(pageId, buf.duplicate());\n } else if (mode == READMODE.POINTQUERY) {\n pagecache.cacheBlock(makePageName(segId, clusterId, pageId), buf.duplicate(), true);\n }\n }\n return buf;\n }", "public static SliceInstruction parseSliceInstructions(String file) throws IOException {\n try (FileReader fileReader = new FileReader(file)) {\n BufferedReader br = new BufferedReader(fileReader);\n String[] headerTokens = br.readLine().split(\" \");\n int minNumberOfIngredientPerSlice = Integer.parseInt(headerTokens[2]);\n int maxNumberOfCellsPerSlice = Integer.parseInt(headerTokens[3]);\n return new SliceInstruction(minNumberOfIngredientPerSlice, maxNumberOfCellsPerSlice);\n }\n }", "boolean isAllowClusterGet();", "private static void readFile(ArrayList<Process> processList, int availableRes[]){\n String processInfo;\n Scanner inputFile = openFile();\n if(inputFile == null){System.exit(-1);}\n\n initializeResArray(availableRes, inputFile);\n\n int processID = 0;\n while(inputFile.hasNextLine()){\n processInfo = inputFile.nextLine();\n Process toAdd = createProcessFromInput(processInfo);\n toAdd.setPID(processID);\n processList.add(toAdd);\n processID++;\n }\n inputFile.close();\n }", "private Process startCreateClusterTaskForAks(ProvisionRequest provisionRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(provisionRequest);\n\t\t\tString provisionRequestStrWithQt = \"'\" + clusterRequestStr + \"'\";\n\t\t\tProcessBuilder builder = new ProcessBuilder(new String[0]);\n\n\t\t\tString command = \"ansible-playbook \"\n\t\t\t\t\t+ appConfig.getConfigValue(\n\t\t\t\t\t\t\t\"createClusterPlayBook\" + getPropertySuffix(provisionRequest.getCloudSrvc()))\n\t\t\t\t\t+ \" --e \" + provisionRequestStrWithQt;\n// Process p = Runtime.getRuntime().exec(ansible_run, null);\n\t\t\tlogger.info(\"Create Cluster Command:: \" + command);\n\t\t\tbuilder.command(new String[] { \"sh\", \"-c\", command });\n\t\t\tString directory = appConfig\n\t\t\t\t\t.getConfigValue(\"createClusterFolder\" + getPropertySuffix(provisionRequest.getCloudSrvc()));\n\t\t\tbuilder.directory(new File(directory));\n\n\t\t\tprocess = builder.start();\n\n\t\t\tlogger.info(\"Running create aks playbook ...\");\n\n\t\t\tStreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);\n\t\t\tExecutors.newSingleThreadExecutor().submit(streamGobbler);\n\t\t} catch (Exception ex) {\n\t\t\t// ex.printStackTrace();\n\t\t\tthrow new ClusterException(\"Exception occurred in startCreateClusterTaskForAks...\", ex);\n\t\t}\n\t\treturn process;\n\t}", "private static void getTcpPublicAddress() {\n\n\t\tString address = readFileString(FileConstant.FILE_NAME_TCP_ADDRESS_PUBLIC);\n\n\t\tif (Utils.isNotEmpty(address)) {\n\n\t\t\tint start = 0;\n\t\t\tint end = address.indexOf(FileConstant.FILE_STRING_SPLIP_SYMBOL, start);\n\n\t\t\tif (end < address.length()) {\n\n\t\t\t\tConfigureVariable.Tcp_Address_Ip_Public = address.substring(start, end);\n\n\t\t\t\tstart = end + 1;\n\t\t\t\tend = address.length();\n\n\t\t\t\tConfigureVariable.Tcp_Address_Port_Public = address.substring(start, end);\n\t\t\t}\n\t\t}\n\t}", "private List<Task> getTasksFromFile() throws FileNotFoundException{\n List<Task> loadedTasks = new ArrayList<>();\n Ui a=new Ui();\n try {\n List<String> lines = getLine() ;\n for (String line : lines) {\n if (line.trim().isEmpty()) { //ignore empty lines\n continue;\n }\n loadedTasks.add(createTask(line)); //convert the line to a task and add to the list\n }\n System.out.println(\"File successfully loaded\");\n } catch (DukeException e1) {\n System.out.println(\"☹ OOPS!!! Problem encountered while loading data: \" +e1.getMessage());\n }\n return loadedTasks;\n }", "public void readFile(String filename) throws IOException {\n BufferedReader buffer = new BufferedReader(new FileReader(filename));\n\n String line;\n int row = 0;\n isFirstLine = true;\n\n while ((line = buffer.readLine()) != null) {\n String[] vals = line.trim().split(\"\\\\s+\");\n int length = vals.length;\n \n if(isFirstLine) {\n \tfor(int col = 0; col < 2; col++) {\n \t\tif(col == 0)\n \t\t\trowSize = Integer.parseInt(vals[col]);\n \t\telse\n \t\t\tcolSize = Integer.parseInt(vals[col]);\n \t}\n \tskiMap = new int[rowSize][colSize];\n \tisFirstLine = false;\n }\n else {\n \tfor (int col = 0; col < length; col++) {\n \tskiMap[row][col] = Integer.parseInt(vals[col]);\n }\n \t row++;\n }\n }\n \n if(buffer != null)\n \tbuffer.close();\n }", "public ArrayList<Task> readFile() throws DukeException, IOException {\n\n TaskList taskList = new TaskList();\n\n if(Files.exists(Path.of(PATH_DIRECTORY))) {\n File f = new File (PATH_DIRECTORY + \"/tasks.txt\");\n Scanner sc = new Scanner(f);\n\n while(sc.hasNext()) {\n String partialString = sc.nextLine();\n String[] data = partialString.trim().split(\"\\\\|\", 3);\n taskAssigner(data, taskList);\n }\n } else {\n File f = new File (PATH_DIRECTORY);\n boolean dirExists = f.mkdir();\n if (dirExists) {\n f = new File (PATH_DIRECTORY + \"/tasks.txt\");\n f.createNewFile();\n } else {\n throw new DukeException();\n }\n }\n\n return taskList.getTaskArrayList();\n }", "public static void main(String[] args) {\n\t\t\n\t\tInteger localNodeId = Integer.valueOf(args[0]);\n\t\tInteger localNodeMode = 0;\n\t\t\n\t\tNodeConfiguration localNodeConfig = null;\n\t\t\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader (\"all_nodes.cfg\"));\n\t\t\tString line;\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] fields = line.split(\",\");\n\t\t\t\tif (fields.length == 4) {\n\t\t\t\t\tInteger nodeId = Integer.valueOf(fields[0].trim());\n\t\t\t\t\tString host = fields[1].trim();\n\t\t\t\t\tInteger port = Integer.valueOf(fields[2].trim());\n\t\t\t\t\tInteger nodeMode = Integer.valueOf(fields[3].trim());\n\t\t\t\t\t\n\t\t\t\t\tNodeConfiguration nodeConfig = new NodeConfiguration(host, port, nodeId);\n\t\t\t\t\t//Server Node Model\n\t\t\t\t\tif (nodeMode == 0) {\n\t\t\t\t\t\tMain.getAllServerNodes().put(nodeId,nodeConfig);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tMain.getAllClientNodes().put(nodeId,nodeConfig);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Add node configuration to the global storage\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif (nodeId.equals(localNodeId)) {\n\t\t\t\t\t\tlocalNodeConfig = nodeConfig;\n\t\t\t\t\t\tlocalNodeMode = nodeMode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace(System.err);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace(System.err);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Node Id :\" + localNodeId + \" read \" + Main.getAllServerNodes().size() + \" server nodes \" + Main.getAllClientNodes().size() + \" client nodes.\");\n\n\t\tif (localNodeConfig != null || localNodeId.equals(-1)) {\n\t\t\t\n\t\t\tif (localNodeId.equals(-1)) {\n\t\t\t\tServerControlUtil serverControl = new ServerControlUtil();\n\t\t\t\tserverControl.simulate();\n\t\t\t\t\n\t\t\t}else { \t\t\t\n\t\t\t\tif (localNodeMode.equals(0)) {\n\t\t\t\t\tContentServer localNode;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlocalNode = new ContentServer(localNodeConfig);\n\t\t\t\t\t\tlocalNode.start();\n\t\t\t\t\t} catch (UnknownHostException 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} 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\t\t} else if (localNodeMode.equals(2)){\n\t\t\t\t\tAutomatedClient localNode;\n\t\t\t\t\tlocalNode = new AutomatedClient(localNodeConfig);\n\t\t\t\t\t//InteractiveClient localNode;\n\t\t\t\t\t//localNode = new InteractiveClient(localNodeConfig);\n\t\t\t\t\tInteger objectId = 0;\n\t\t\t\t\t\n\t\t\t\t\tif (args.length == 2) {\n\t\t\t\t\t\tobjectId = Integer.valueOf(args[1]);\n\t\t\t\t\t}\n\t\t\t\t\tlocalNode.simulate(objectId);\n\t\t\t\t} else {\n\t\t\t\t\t//ContentClient localNode;\n\t\t\t\t\t//localNode = new ContentClient(localNodeConfig);\n\t\t\t\t\tInteractiveClient localNode;\n\t\t\t\t\tlocalNode = new InteractiveClient(localNodeConfig);\n\t\t\t\t\tlocalNode.simulate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static boolean processPartFile(Cluster cluster, WorkloadBatch wb, int partition_numbers) \r\n\t\t\tthrows IOException {\r\n\t\t\r\n\t\tMap<Integer, Integer> keyMap = new HashMap<Integer, Integer>();\t\t\r\n\t\tString wrl_file_name = null;\r\n\t\tString part_file_name = null;\r\n\t\t\r\n\t\twrl_file_name = Global.repartitioningCycle+\"-\"+Global.simulation;\t\t\r\n\t\tpart_file_name = wrl_file_name+\".part.\"+partition_numbers;\t\r\n\t\t\t\r\n\t\tFile part_file = new File(Global.part_dir+Global.getRunDir()+part_file_name);\r\n\t\t\r\n\t\tif(part_file.exists()) {\r\n\t\t\tint key = 1;\t\t\r\n\t\t\t//System.out.println(\"@ - \"+part_file_name);\r\n\t\t\tScanner scanner = new Scanner(part_file);\r\n\t\t\ttry {\r\n\t\t\t\twhile(scanner.hasNextLine()) {\r\n\t\t\t\t\tint cluster_id = Integer.valueOf(scanner.nextLine());\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tkeyMap.put(key, cluster_id);\t\r\n\t\t\t\t\t//System.out.println(\"@debug >> key: \"+key+\" | Cluster: \"+cluster_id);\t\t\t\t\r\n\t\t\t\t\t++key;\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t} finally {\r\n\t\t\t\tscanner.close();\r\n\t\t\t}\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif(Global.associative)\r\n\t\t\t\tWorkloadBatchProcessor.processClusterElements(cluster, wb, Global.dsm.hgr, keyMap);\r\n\t\t\telse\r\n\t\t\t\tWorkloadBatchProcessor.processClusterElements(cluster, wb, wb.hgr, keyMap);\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "private static Map<Integer, Integer> readState(String stateFile) throws Exception {\n\n Map<Integer, Integer> ret = new HashMap<>();\n\n File f = new File(stateFile);\n if (f.exists()) {\n //LOG.info(\"File exists\");\n List<String> lines = FileUtils.readLines(f, null);\n for (String line: lines) {\n //LOG.info(\"Line: \" + line);\n String[] toks = line.split(\":\");\n String channelId = toks[0];\n String messageId = toks[1];\n ret.put(Integer.valueOf(channelId), Integer.valueOf(messageId));\n }\n }\n\n //LOG.info(\"Read from file into map size \" + ret.size());\n\n return ret;\n }", "private void createClusterAsyncAzureNative(ProvisionRequest provisionRequest, String processID)\n\t\t\tthrows ClusterException {\n\n\t\ttry {\n\n\t\t\t// K8SCluster cluster = new K8SCluster(processID, \"Started\");\n\t\t\t// redisRepo.save(cluster, CacheKeysEnum.CLUSTER_STATUS);\n\n\t\t\tProcess process = startProvisionTask(provisionRequest);\n\n\t\t\tK8SCluster cluster = saveAndGetProvisionStatus(processID, process,\n\t\t\t\t\tClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\n\t\t\tThread.sleep(10000);\n\n\t\t\tif (cluster.getCreateStatus().equals(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\t// to create cluster fields from provision request (kubeDashboard value) is also\n\t\t\t\t// required.\n\t\t\t\tcreateClusterForAzureNative(provisionRequest, processID);\n\n\t\t\t} else {\n\t\t\t\t// Retry once\n\t\t\t}\n\n\t\t\tlogger.info(\"Inside Async process\");\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"Exception Occurred...\", ex);\n\t\t\tthrow new ClusterException(\"Exception occurred in createClusterAsyncAzure..\", ex);\n\t\t}\n\t}", "protected void config_read(String fileParam) {\r\n\t\tFile inputFile = new File(fileParam);\r\n\r\n\t\tif (inputFile == null || !inputFile.exists()) {\r\n\t\t\tSystem.out.println(\"parameter \" + fileParam\r\n\t\t\t\t\t+ \" file doesn't exists!\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t\t// begin the configuration read from file\r\n\t\ttry {\r\n\t\t\tFileReader file_reader = new FileReader(inputFile);\r\n\t\t\tBufferedReader buf_reader = new BufferedReader(file_reader);\r\n\t\t\t// FileWriter file_write = new FileWriter(outputFile);\r\n\r\n\t\t\tString line;\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0); // avoid empty lines for processing ->\r\n\t\t\t\t\t\t\t\t\t\t\t// produce exec failure\r\n\t\t\tString out[] = line.split(\"algorithm = \");\r\n\t\t\t// alg_name = new String(out[1]); //catch the algorithm name\r\n\t\t\t// input & output filenames\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"inputData = \");\r\n\t\t\tout = out[1].split(\"\\\\s\\\"\");\r\n\t\t\tinput_train_name = new String(out[0].substring(1,\r\n\t\t\t\t\tout[0].length() - 1));\r\n\t\t\tinput_test_name = new String(out[1].substring(0,\r\n\t\t\t\t\tout[1].length() - 1));\r\n\t\t\tif (input_test_name.charAt(input_test_name.length() - 1) == '\"')\r\n\t\t\t\tinput_test_name = input_test_name.substring(0,\r\n\t\t\t\t\t\tinput_test_name.length() - 1);\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"outputData = \");\r\n\t\t\tout = out[1].split(\"\\\\s\\\"\");\r\n\t\t\toutput_train_name = new String(out[0].substring(1,\r\n\t\t\t\t\tout[0].length() - 1));\r\n\t\t\toutput_test_name = new String(out[1].substring(0,\r\n\t\t\t\t\tout[1].length() - 1));\r\n\t\t\tif (output_test_name.charAt(output_test_name.length() - 1) == '\"')\r\n\t\t\t\toutput_test_name = output_test_name.substring(0,\r\n\t\t\t\t\t\toutput_test_name.length() - 1);\r\n\r\n\t\t\t// parameters\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"k = \");\r\n\t\t\tnneigh = (new Integer(out[1])).intValue(); // parse the string into\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// a double\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"enn = \");\r\n\t\t\tennNeighbors = (new Integer(out[1])).intValue(); // parse the string\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// into a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// integer\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"eta = \");\r\n\t\t\tcleanThreshold = (new Double(out[1])).doubleValue(); // parse the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// string\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// into a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// double\r\n\r\n\t\t\tfile_reader.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"IO exception = \" + e);\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "public void removeCluster(FileEntry file, int position)\r\n\t{\r\n\t\t//Loop will continue until it reaches the end of the array\r\n\t\t//or if the index i matches that of the cluster number\r\n\t\tfor (int i = 0; i < MAX_CLUSTERS; i++)\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t//Sets the cluster at index i to false if it matches the\r\n\t\t\t\t//cluster number in the DiskClusterList at the given position\r\n\t\t\t\tif (((file.getCluster().getClusterNumber(position)) == i)\r\n\t\t\t\t && (cluster[i]) == true)\r\n\t\t\t\t\tcluster[i] = false;\r\n\t\t\t}\r\n\t\t\tcatch (InvalidPositionException ipe)\t{\t}\r\n\t\t}\t\r\n\t}", "protected boolean isClusterRequired() {\n return true;\n }", "private Process startCreateClusterTaskAzure(CreateClusterRequest clusterRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(clusterRequest);\n\t\t\tString provisionRequestStrWithQt = \"'\" + clusterRequestStr + \"'\";\n\t\t\tProcessBuilder builder = new ProcessBuilder(new String[0]);\n\n\t\t\tString command = \"ansible-playbook -i \" + \"\\\"\" + getInventoryPath(clusterRequest.getClusterID()) + \"\\\" \"\n\t\t\t\t\t+ appConfig\n\t\t\t\t\t\t\t.getConfigValue(\"createClusterPlayBook\" + getPropertySuffix(clusterRequest.getCloudSrvc()))\n\t\t\t\t\t+ \" --e \" + provisionRequestStrWithQt;\n// Process p = Runtime.getRuntime().exec(ansible_run, null);\n\t\t\tlogger.info(\"Create Cluster Command:: \" + command);\n\t\t\tbuilder.command(new String[] { \"sh\", \"-c\", command });\n\t\t\tlogger.info(\"Config param for directory:\" + \"createClusterFolder\"\n\t\t\t\t\t+ getPropertySuffix(clusterRequest.getCloudSrvc()));\n\t\t\tString directory = appConfig\n\t\t\t\t\t.getConfigValue(\"createClusterFolder\" + getPropertySuffix(clusterRequest.getCloudSrvc()));\n\n\t\t\tlogger.info(\"Create cluster directory::\" + directory);\n\t\t\tbuilder.directory(new File(directory));\n\n\t\t\tprocess = builder.start();\n\n\t\t\tlogger.info(\"Running create azure cluster playbook ...\");\n\n\t\t\tStreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);\n\t\t\tExecutors.newSingleThreadExecutor().submit(streamGobbler);\n\t\t} catch (Exception ex) {\n\t\t\t// ex.printStackTrace();\n\t\t\tthrow new ClusterException(\"Exception occurred in startCreateClusterTaskAzure\", ex);\n\t\t}\n\t\treturn process;\n\t}", "public yandex.cloud.api.mdb.clickhouse.v1.ClusterOuterClass.Cluster get(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.GetClusterRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getGetMethod(), getCallOptions(), request);\n }", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.mdb.clickhouse.v1.ClusterOuterClass.Cluster> get(\n yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.GetClusterRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getGetMethod(), getCallOptions()), request);\n }", "public void readInput(String fileName){\n\n BufferedReader reader;\n try {\n reader = new BufferedReader(new FileReader(fileName));\n String line = reader.readLine(); //read first line\n int numLine =1; //keep track the number of line\n while (line != null) {\n String[] tokens = line.trim().split(\"\\\\s+\"); //split line into token\n if(numLine==1){ //for the first line\n intersection = Integer.parseInt(tokens[0]); //set the number of intersection\n roadways = Integer.parseInt(tokens[1]); // set the number of roadways\n coor = new Coordinates[intersection];\n g = new Graph(intersection);//create a graph\n line = reader.readLine();\n numLine++;\n }\n else if(numLine>1&&numLine<intersection+2){ //for all intersection\n while(numLine>1&&numLine<intersection+2){\n tokens = line.trim().split(\"\\\\s+\");\n coor[Integer.parseInt(tokens[0])] = new Coordinates(Integer.parseInt(tokens[1]),Integer.parseInt(tokens[2])); //add into coor array to keep track the coor of intersection\n line = reader.readLine();\n numLine++;\n }\n }\n else if(numLine ==intersection+2){ //skip the space line\n line = reader.readLine();\n numLine++;\n while(numLine<roadways+intersection+3){ // for all the roadways, only include the number of roadways mention in the first line\n tokens = line.trim().split(\"\\\\s+\");\n int fst = Integer.parseInt(tokens[0]);\n int snd = Integer.parseInt(tokens[1]);\n g.addEgde(fst,snd,coor[fst].distTo(coor[snd]));\n line = reader.readLine();\n numLine++;\n }\n }\n else if(numLine >= roadways+intersection+3)\n break;\n }\n reader.close();\n } catch (FileNotFoundException e){\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void read(Client client,String user,String filename) throws SystemException, TException {\n\t\t\n\t\tString keyString = user + \":\" + filename;\n\t\tString key = sha_256(keyString);\n\t\t\n\t\t\n\t\tNodeID succNode = client.findSucc(key);\n\t\tString predIP = succNode.ip;\n\t\t// predIP = \"127.0.0.1\";\n\t\tint predPort = succNode.port;\n\t\ttry {\n\t\t\tTSocket transport = new TSocket(predIP, predPort);\n\t\t\ttransport.open();\n\t\t\tTBinaryProtocol protocol = new TBinaryProtocol(transport);\n\t\t\tchord_auto_generated.FileStore.Client client1 = new chord_auto_generated.FileStore.Client(protocol);\n\t\t\tSystem.out.println(\"Reading file location : \" + predPort + \" File :\"+filename+\"Owner : \"+user);\n\t\t\tRFile rFile = new RFile();\n\t\t\trFile = client1.readFile(filename, user);\n\t\t\tSystem.out.println(rFile.getContent());\n\t\t\tSystem.out.println(rFile.getMeta().getVersion());\n\t\t\tSystem.out.println(rFile.getMeta().getContentHash());\n\t\t\tSystem.out.println(\"Reading file Done----------\");\n\t\t\ttransport.close();\n\t\t} catch (TTransportException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();", "private ReadBlockingTask newReadBlockingTask(boolean initialize){\n \n ReadBlockingTask task = new ReadBlockingTask();\n task.setSelectorThread(this);\n task.setPipeline(getProcessorPipeline());\n \n task.setRecycle(isRecycleTasks());\n task.attachProcessor(newProcessorTask(initialize));\n task.setPipelineStatistic(getPipelineStat());\n task.setSecure(secure);\n \n return task;\n }", "public byte[] read(String filePath, int offset, int dataLength) throws IOException {\n\t\tint ret;\n\t\t\n\t\tTFSClientFile file = getFileFromCache(filePath);\n\t\tif (file == null) {\t\t// cannot find the file, try to get file info from the master\n\t\t\tret = getFileInfo(filePath);\n\t\t\t\n\t\t\tif (ret != OK)\n\t\t\t\treturn null;\n\t\t\telse {\n\t\t\t\tfile = getFileFromCache(filePath);\t\t\t\t\n\t\t\t\tassert(file != null);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// now the file info is ready\n\t\t// pick-up a chunkserver to read from\n\t\tList<String> servers = new LinkedList<String>();\n\t\tfor (String server : file.getChunkServers())\n\t\t\tservers.add(server);\n\t\t\n\t\tRandom rand = new Random();\n\t\tint index = 0;\n\t\twhile (!servers.isEmpty()) {\n\t\t\tindex = rand.nextInt(servers.size());\n\t\t\t\n\t\t\tString[] strs = servers.get(index).split(\" \");\n\t\t\tservers.remove(index);\n\t\t\t\n\t\t\tSocketIO sockIO = new SocketIO(strs[0], Integer.parseInt(strs[1]));\n\t\t\t\n\t\t\tif (dataLength > 0)\n\t\t\t\tsockIO.write((READ + \" \" + filePath + \" \" + offset + \" \" + dataLength + \"\\r\\n\").getBytes());\n\t\t\telse\n\t\t\t\tsockIO.write((READ + \" \" + filePath + \" \" + offset + \"\\r\\n\").getBytes());\n\t\t\t\n\t\t\tsockIO.flush();\n\t\t\t\n\t\t\tString line = sockIO.readLine();\n\t\t\tif (line.startsWith(STR_OK)) {\n\t\t\t\tstrs = line.split(\" \");\n\t\t\t\tint length = Integer.parseInt(strs[1]);\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[length];\n\t\t\t\tsockIO.read(data);\n\t\t\t\tsockIO.close();\n\t\t\t\treturn data;\n\t\t\t} else {\n\t\t\t\tsockIO.close();\n\t\t\t\treturn null;\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public Cluster(Cluster source) {\n if (source.ClusterId != null) {\n this.ClusterId = new String(source.ClusterId);\n }\n if (source.ClusterName != null) {\n this.ClusterName = new String(source.ClusterName);\n }\n if (source.ClusterType != null) {\n this.ClusterType = new String(source.ClusterType);\n }\n if (source.ClusterTag != null) {\n this.ClusterTag = new String(source.ClusterTag);\n }\n if (source.Zone != null) {\n this.Zone = new String(source.Zone);\n }\n if (source.Network != null) {\n this.Network = new String(source.Network);\n }\n if (source.MaxConn != null) {\n this.MaxConn = new Long(source.MaxConn);\n }\n if (source.MaxInFlow != null) {\n this.MaxInFlow = new Long(source.MaxInFlow);\n }\n if (source.MaxInPkg != null) {\n this.MaxInPkg = new Long(source.MaxInPkg);\n }\n if (source.MaxOutFlow != null) {\n this.MaxOutFlow = new Long(source.MaxOutFlow);\n }\n if (source.MaxOutPkg != null) {\n this.MaxOutPkg = new Long(source.MaxOutPkg);\n }\n if (source.MaxNewConn != null) {\n this.MaxNewConn = new Long(source.MaxNewConn);\n }\n if (source.HTTPMaxNewConn != null) {\n this.HTTPMaxNewConn = new Long(source.HTTPMaxNewConn);\n }\n if (source.HTTPSMaxNewConn != null) {\n this.HTTPSMaxNewConn = new Long(source.HTTPSMaxNewConn);\n }\n if (source.HTTPQps != null) {\n this.HTTPQps = new Long(source.HTTPQps);\n }\n if (source.HTTPSQps != null) {\n this.HTTPSQps = new Long(source.HTTPSQps);\n }\n if (source.ResourceCount != null) {\n this.ResourceCount = new Long(source.ResourceCount);\n }\n if (source.IdleResourceCount != null) {\n this.IdleResourceCount = new Long(source.IdleResourceCount);\n }\n if (source.LoadBalanceDirectorCount != null) {\n this.LoadBalanceDirectorCount = new Long(source.LoadBalanceDirectorCount);\n }\n if (source.Isp != null) {\n this.Isp = new String(source.Isp);\n }\n if (source.ClustersZone != null) {\n this.ClustersZone = new ClustersZone(source.ClustersZone);\n }\n if (source.ClustersVersion != null) {\n this.ClustersVersion = new String(source.ClustersVersion);\n }\n if (source.DisasterRecoveryType != null) {\n this.DisasterRecoveryType = new String(source.DisasterRecoveryType);\n }\n }", "public NexusReaderDistances(String filePath) throws IOException, NexusFormatException {\n\n BufferedReader bufferedReader = null;\n FileReader fileReader = null;\n try {\n fileReader = new FileReader(filePath);\n bufferedReader = new BufferedReader(fileReader);\n\n int state = 0; //0=start of file, 1=after #NEXUS. 2=inside block\n boolean commentMode = false;\n TreeMap<Integer, String> blockLines = null;\n String blockName = null;\n Matcher beginBlockMatcher = Pattern.compile(\"^(?i)BEGIN ([A-Z]+);\").matcher(\"\");\n String line = bufferedReader.readLine();\n int lineNumber = 0;\n while (line != null) {\n lineNumber++;\n line = line.trim();\n //end multiline comments\n if (commentMode) {\n int endIndex = line.indexOf(\"]\");\n if (endIndex == -1) {\n line = bufferedReader.readLine();\n continue;\n } else {\n line = line.substring(endIndex);\n commentMode = false;\n }\n }\n //remove one line comments\n line = line.replaceAll(\"\\\\[.*]\", \"\");\n //remove multi line comments\n int startIndex = line.indexOf(\"[\");\n if (startIndex != -1) {\n line = line.substring(0, startIndex);\n commentMode = true;\n }\n //skip emtpy lines\n if (line.isEmpty()) {\n line = bufferedReader.readLine();\n continue;\n }\n\n //===read lines===\n switch (state) { //0=start of file, 1=after #NEXUS. 2=inside block\n case 0:\n if (!line.equalsIgnoreCase(\"#NEXUS\")) {\n throw new NexusFormatException(\"File must start with #NEXUS. Line: \" + lineNumber);\n } else {\n state++;\n }\n break;\n case 1:\n beginBlockMatcher.reset(line);\n if (beginBlockMatcher.matches()) {\n blockLines = new TreeMap<Integer, String>();\n blockName = beginBlockMatcher.group(1);\n state++;\n } else {\n throw new NexusFormatException(\"Error parsing BEGIN statement. Line \" + lineNumber);\n }\n break;\n case 2:\n if (line.equalsIgnoreCase(\"END;\")) {\n makeBlock(blockName, blockLines);\n state--;\n } else {\n blockLines.put(lineNumber, line);\n }\n break;\n default:\n throw new RuntimeException(\"NexusReader reached illegal state: \" + state);\n }\n\n line = bufferedReader.readLine();\n }\n if (state == 2) {\n throw new NexusFormatException(\"Didn't close block at end of file.\");\n }\n if (state == 0) {\n throw new NexusFormatException(\"File seems empty.\");\n }\n\n bufferedReader.close();\n\n } catch (IOException e) {\n if (bufferedReader != null) {\n bufferedReader.close();\n }\n if (fileReader != null) {\n fileReader.close();\n }\n throw e;\n } catch (NexusFormatException e) {\n if (bufferedReader != null) {\n bufferedReader.close();\n }\n if (fileReader != null) {\n fileReader.close();\n }\n throw e;\n }\n }", "public synchronized ClusterReader newClusterReader(int clusterId, boolean cachePage) {\n long clusterLength;\n if (clusterId == numClusters - 1) {\n clusterLength = segmentPMSOffset - clusterOffsets[clusterId];\n } else {\n clusterLength = clusterOffsets[clusterId + 1] - clusterOffsets[clusterId];\n }\n ScanMode[] modes = null;\n if (scanMap != null) {\n modes = scanMap.get(clusterId);\n }\n return new ClusterReader(this, clusterId, clusterOffsets[clusterId],\n clusterLength, pms.getPageMetaLists()[clusterId], modes, cachePage);\n }", "private ITaskCluster createTaskCluster(ITaskObject... taskObjects) {\n ITaskCluster taskCluster = getTaskManagerConfiguration().getTaskFactory().newTaskCluster();\n taskCluster = getTaskManagerConfiguration().getTaskManagerWriter().saveNewTaskCluster(taskCluster);\n\n return createTaskGraphForTaskCluster(taskCluster, taskObjects);\n }", "@Nullable private CheckpointEntry parseFromFile(ByteBuffer buf, File file) throws IgniteCheckedException {\n Matcher matcher = CP_FILE_NAME_PATTERN.matcher(file.getName());\n\n if (!matcher.matches())\n return null;\n\n CheckpointEntryType type = CheckpointEntryType.valueOf(matcher.group(3));\n\n if (type != CheckpointEntryType.START)\n return null;\n\n long cpTs = Long.parseLong(matcher.group(1));\n UUID cpId = UUID.fromString(matcher.group(2));\n\n WALPointer ptr = readPointer(file, buf);\n\n return createCheckPointEntry(cpTs, ptr, cpId, null, CheckpointEntryType.START);\n }", "public List<Task> readFile() throws FileNotFoundException, DukeException {\n List<Task> output = new ArrayList<>();\n Scanner sc = new Scanner(file);\n while (sc.hasNext()) {\n output.add(readTask(sc.nextLine()));\n }\n return output;\n }", "public Clusters()\r\n\t{\r\n\t\tcluster = new boolean[MAX_CLUSTERS];\r\n\t}", "public static void readfile(String FILENAME) {\n\t\tString[] parts = null;\n\t\t// Initialising s as 9100 since the cardinality for a src is 9060\n\t\tint s = 2500;\n\t\t// Choosing m\n\t\tint m = 500000000;\n\t\tArrayList<ArrayList<Integer>> UniversalHashList = new ArrayList<ArrayList<Integer>>();\n\t\tArrayList<ArrayList<Integer>> XsrcMasterList = new ArrayList<ArrayList<Integer>>();\n\t\tList masterDstList = new ArrayList<ArrayList<String>>();\n\t\tString[] BitArray = new String[m];\n\t\tPrintStream out = null;\n\t\ttry {\n\t\t\tout = new PrintStream(new FileOutputStream(\"output_virbitmap.csv\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString src = null;\n\t\tHashMap<String, List> srcDstMap = new HashMap<String, List>();\n\t\tArrayList<Integer> R = new ArrayList<Integer>();\n\t\tR = genRandomArray(s);\n\t\t// initializing bit array\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tBitArray[i] = \"False\";\n\t\t}\n\t\t// reading input file and writing to HashMap<src,dstlist>\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(FILENAME))) {\n\n\t\t\tString sCurrentLine;\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t\tparts = sCurrentLine.trim().split(\"\\\\s+\");\n\t\t\t\tsrc = parts[0];\n\t\t\t\tString dst = parts[1];\n\t\t\t\tif (!srcDstMap.containsKey(src)) {\n\t\t\t\t\tArrayList<String> dstList = new ArrayList<String>();\n\t\t\t\t\tdstList.add(dst);\n\t\t\t\t\tsrcDstMap.put(src, dstList);\n\t\t\t\t\t// hashing(B,convertIPAddress(tokens[0]));\n\t\t\t\t} else\n\t\t\t\t\tsrcDstMap.get(src).add(dst);\n\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfor (int i = 0; i < srcDstMap.size(); i++) {\n\t\t\tArrayList<Integer> masterHashList = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> XsrcList = new ArrayList<Integer>();\n\t\t\tUniversalHashList.add(masterHashList);\n\t\t\tXsrcMasterList.add(XsrcList);\n\t\t\t// System.out.println(\"XsrcmasterList\" + XsrcList);\n\n\t\t}\n\t\tIterator srcDstMapIt = srcDstMap.entrySet().iterator();\n\t\tfor (int i = 0; i < srcDstMap.size(); i++) {\n\t\t\tArrayList<Integer> XsrcList = XsrcMasterList.get(i);\n\t\t\tArrayList<Integer> masterHashList = UniversalHashList.get(i);\n\t\t\twhile (srcDstMapIt.hasNext()) {\n\t\t\t\tMap.Entry pair = (Map.Entry) srcDstMapIt.next();\n\t\t\t\tsrc = pair.getKey().toString();\n\t\t\t\tList dstList = (List) pair.getValue();\n\t\t\t\tmasterDstList.add(dstList);\n\t\t\t\tIterator dstListIt = dstList.iterator();\n\t\t\t\twhile (dstListIt.hasNext()) {\n\t\t\t\t\tint hashedSrc = masterHashSetGen(src, dstListIt.next().toString(), s, R);\n\t\t\t\t\t// String[] partsGeneratedStuff =\n\t\t\t\t\t// generatedStuff.trim().split(\":\");\n\t\t\t\t\t// String generatedIndex = partsGeneratedStuff[0];\n\t\t\t\t\t// String hashedSrc = partsGeneratedStuff[1];\n\t\t\t\t\tmasterHashList.add(hashedSrc % BitArray.length);\n\t\t\t\t\t// System.out.println(masterHashList);\n\t\t\t\t\tXsrcList.add(hashedSrc);\n\t\t\t\t\t// System.out.println(XsrcList);\n\t\t\t\t\tBitArray[Math.abs(hashedSrc % (BitArray.length))] = \"True\";\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tdouble bitMapCount = BitMapCount(BitArray, BitArray.length, s);\n\t\t// System.out.println(\"bitMapCount\"+bitMapCount);\n\n\t\tint XsrcIndexperDst = 0;\n\t\tIterator srcDstMapItrecons = srcDstMap.entrySet().iterator();\n\t\twhile (srcDstMapItrecons.hasNext()) {\n\t\t\tdouble XsrcRatio;\n\t\t\tMap.Entry pair = (Map.Entry) srcDstMapItrecons.next();\n\t\t\tsrc = pair.getKey().toString();\n\t\t\t// System.out.println(\"src\" + src);\n\t\t\tList dstList = (List) pair.getValue();\n\t\t\tmasterDstList.add(dstList);\n\t\t\tIterator dstListIt = dstList.iterator();\n\t\t\tString[] srcArray = new String[s];\n\t\t\tdouble count = 0;\n\t\t\t\twhile(dstListIt.hasNext()) {\n\t\t\t\t\tXsrcIndexperDst = XsrcIndexperDst(XsrcMasterList, masterDstList, s, BitArray, src,dstListIt.next().toString(), R) % m;\n\t\t\t\t\t// System.out.println(\"Value\"+BitArray[XsrcIndexperDst]);\n\t\t\t\t\tif (BitArray[XsrcIndexperDst] == \"True\") {\n\t\t\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\t}\n\t\t\t//System.out.println(\"count per source\" + count + \",\" + (s - count));\n\t\t\tXsrcRatio = -s * Math.log((s-count)/s);\n\t\t\tdouble estimatedSpread = -bitMapCount + XsrcRatio;\n\t\t\tif(estimatedSpread<=0)\n\t\t\t{\n\t\t\t\testimatedSpread=0;\n\t\t\t}\n\t\t\tout.println(dstList.size() + \",\" + estimatedSpread);\n\t\t}\n\n\t}", "public HpccFile(String fileName, Connection espconninfo, String targetColumnList, String filter, RemapInfo remap_info, int maxParts, String targetfilecluster) throws HpccFileException\n {\n this.fileName = fileName;\n this.recordDefinition = new RecordDef(); // missing, the default\n projectList = new ColumnPruner(targetColumnList);\n this.espConnInfo = espconninfo;\n this.filter = new FileFilter(filter);\n clusterRemapInfo = remap_info;\n }", "private static ArrayList<Node> getNodes(File path)\n {\n //log the event happining\n Start.log(\"Getting Nodes\");\n ArrayList<Node> tempNodes = new ArrayList<Node>();\n ArrayList<String> file = getFile(path);\n for (int i =0; i < file.size();i++)\n {\n //use scanner to pharse the string into the relivant bits for getting the node data\n Scanner parse = new Scanner(file.get(i));\n tempNodes.add(new Node(parse.nextInt(),CPType.valueOf(parse.next())));\n }\n return tempNodes;\n }", "private static void performChefComputeServiceBootstrapping(Properties properties) throws \n IOException, InstantiationException, IllegalAccessException, \n NoSuchMethodException, IllegalArgumentException, InvocationTargetException {\n String rsContinent = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), \n RS_CONTINENT, \"rackspace-cloudservers-us\");\n String rsUser = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_USERNAME, \"asf-gora\");\n String rsApiKey = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_APIKEY, null);\n String rsRegion = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), RS_REGION, \"DFW\");\n String client = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), CHEF_CLIENT, System.getProperty(\"user.name\"));\n String organization = DataStoreFactory.findProperty(properties, MemStore.class.getDeclaredConstructor().newInstance(), CHEF_ORGANIZATION, null);\n String pemFile = System.getProperty(\"user.home\") + \"/.chef/\" + client + \".pem\";\n String credential = Files.toString(new File(pemFile), Charsets.UTF_8);\n\n // Provide the validator information to let the nodes to auto-register themselves\n // in the Chef server during bootstrap\n String validator = organization + \"-validator\";\n String validatorPemFile = System.getProperty(\"user.home\") + \"/.chef/\" + validator + \".pem\";\n String validatorCredential = Files.toString(new File(validatorPemFile), Charsets.UTF_8);\n\n Properties chefConfig = new Properties();\n chefConfig.put(ChefProperties.CHEF_VALIDATOR_NAME, validator);\n chefConfig.put(ChefProperties.CHEF_VALIDATOR_CREDENTIAL, validatorCredential);\n\n // Create the connection to the Chef server\n ChefApi chefApi = ContextBuilder.newBuilder(new ChefApiMetadata())\n .endpoint(\"https://api.opscode.com/organizations/\" + organization)\n .credentials(client, credential)\n .overrides(chefConfig)\n .buildApi(ChefApi.class);\n\n // Create the connection to the compute provider. Note that ssh will be used to bootstrap chef\n ComputeServiceContext computeContext = ContextBuilder.newBuilder(rsContinent)\n .endpoint(rsRegion)\n .credentials(rsUser, rsApiKey)\n .modules(ImmutableSet.<Module> of(new SshjSshClientModule()))\n .buildView(ComputeServiceContext.class);\n\n // Group all nodes in both Chef and the compute provider by this group\n String group = \"jclouds-chef-goraci\";\n\n // Set the recipe to install and the configuration values to override\n String recipe = \"apache2\";\n JsonBall attributes = new JsonBall(\"{\\\"apache\\\": {\\\"listen_ports\\\": \\\"8080\\\"}}\");\n\n // Check to see if the recipe you want exists\n List<String> runlist = null;\n Iterable< ? extends CookbookVersion> cookbookVersions =\n chefApi.chefService().listCookbookVersions();\n if (any(cookbookVersions, CookbookVersionPredicates.containsRecipe(recipe))) {\n runlist = new RunListBuilder().addRecipe(recipe).build();\n }\n for (Iterator<String> iterator = runlist.iterator(); iterator.hasNext();) {\n String string = (String) iterator.next();\n LOG.info(string);\n }\n\n // Update the chef service with the run list you wish to apply to all nodes in the group\n // and also provide the json configuration used to customize the desired values\n BootstrapConfig config = BootstrapConfig.builder().runList(runlist).attributes(attributes).build();\n chefApi.chefService().updateBootstrapConfigForGroup(group, config);\n\n // Build the script that will bootstrap the node\n Statement bootstrap = chefApi.chefService().createBootstrapScriptForGroup(group);\n\n TemplateBuilder templateBuilder = computeContext.getComputeService().templateBuilder();\n templateBuilder.options(runScript(bootstrap));\n // Run a node on the compute provider that bootstraps chef\n try {\n Set< ? extends NodeMetadata> nodes =\n computeContext.getComputeService().createNodesInGroup(group, 1, templateBuilder.build());\n for (NodeMetadata nodeMetadata : nodes) {\n LOG.info(\"<< node %s: %s%n\", nodeMetadata.getId(),\n concat(nodeMetadata.getPrivateAddresses(), nodeMetadata.getPublicAddresses()));\n }\n } catch (RunNodesException e) {\n throw new RuntimeException(e.getMessage());\n }\n\n // Release resources\n chefApi.close();\n computeContext.close();\n\n }", "public TFSClient(String masterIpAddress, int masterPort) {\n\t\tthis.masterIpAddress = masterIpAddress;\n\t\tthis.masterPort = masterPort;\n\t\tthis.filesCache = new ArrayList<TFSClientFile>();\n\t\t\n\t\tinit();\n\t}" ]
[ "0.55334955", "0.53275955", "0.51480687", "0.5119401", "0.511571", "0.49982673", "0.49464402", "0.4932239", "0.48820713", "0.4875787", "0.48366827", "0.48348117", "0.4807064", "0.48031867", "0.47899687", "0.4787326", "0.4782522", "0.47448385", "0.46979687", "0.46851", "0.46749568", "0.4671522", "0.46573687", "0.4652841", "0.46488273", "0.46404925", "0.46374077", "0.46323967", "0.46199375", "0.45985404", "0.4587376", "0.45613232", "0.4531004", "0.45199248", "0.4519639", "0.4514834", "0.4493425", "0.44617897", "0.44575763", "0.442964", "0.44141993", "0.4411318", "0.44107962", "0.4405457", "0.4393465", "0.43894586", "0.4381987", "0.4375687", "0.4375036", "0.43741158", "0.43730375", "0.4369599", "0.43626663", "0.43607888", "0.43497655", "0.4340558", "0.4325506", "0.4322968", "0.43204978", "0.43203887", "0.4312345", "0.4300259", "0.429739", "0.42928365", "0.42904902", "0.4285991", "0.42794865", "0.4277278", "0.42731395", "0.42701694", "0.42654496", "0.4263567", "0.42598447", "0.4250742", "0.42494383", "0.42491364", "0.4247855", "0.42411202", "0.42401904", "0.42365703", "0.42334658", "0.4230856", "0.42293492", "0.4227518", "0.4226069", "0.42252702", "0.42192242", "0.4217812", "0.4217477", "0.42139745", "0.42055133", "0.42041484", "0.42026868", "0.41993198", "0.41959408", "0.41938967", "0.4192038", "0.4185666", "0.4178263", "0.41754764" ]
0.5196459
2
Create cluster command structure is different for Azure and AKS this method is for Azure
private Process startCreateClusterTaskAzure(CreateClusterRequest clusterRequest) throws ClusterException { Process process = null; try { ObjectMapper mapper = new ObjectMapper(); String clusterRequestStr = mapper.writeValueAsString(clusterRequest); String provisionRequestStrWithQt = "'" + clusterRequestStr + "'"; ProcessBuilder builder = new ProcessBuilder(new String[0]); String command = "ansible-playbook -i " + "\"" + getInventoryPath(clusterRequest.getClusterID()) + "\" " + appConfig .getConfigValue("createClusterPlayBook" + getPropertySuffix(clusterRequest.getCloudSrvc())) + " --e " + provisionRequestStrWithQt; // Process p = Runtime.getRuntime().exec(ansible_run, null); logger.info("Create Cluster Command:: " + command); builder.command(new String[] { "sh", "-c", command }); logger.info("Config param for directory:" + "createClusterFolder" + getPropertySuffix(clusterRequest.getCloudSrvc())); String directory = appConfig .getConfigValue("createClusterFolder" + getPropertySuffix(clusterRequest.getCloudSrvc())); logger.info("Create cluster directory::" + directory); builder.directory(new File(directory)); process = builder.start(); logger.info("Running create azure cluster playbook ..."); StreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println); Executors.newSingleThreadExecutor().submit(streamGobbler); } catch (Exception ex) { // ex.printStackTrace(); throw new ClusterException("Exception occurred in startCreateClusterTaskAzure", ex); } return process; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "private CreateClusterRequest createClusterForAzureNative(ProvisionRequest provisionRequest, String processID) {\n\t\tCreateClusterRequest clusterRequest = new CreateClusterRequest();\n\t\t// Populate other fields\n\t\tclusterRequest.setClusterID(processID);\n\t\tclusterRequest.setKubeDashboard(provisionRequest.getKubeDashboard());\n\t\tclusterRequest.setCloudSrvc(provisionRequest.getCloudSrvc());\n\t\t// set cluster after replacing - with _\n\t\tclusterRequest.setClusterName(provisionRequest.getClusterName().replace('-', '_'));\n\t\tlogger.info(\"provisionRequest.getMonitoringEnabled()::\" + provisionRequest.getMonitoringEnabled());\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tclusterRequest.setKubeMonitoring(\"Grafana\");\n\t\t\tlogger.info(\"setKubeMonitoring::Grafana\");\n\t\t}\n\t\t// Populate other constant params\n\t\tpopulateCreateClusterRequest(clusterRequest);\n\n\t\tstartCreateClusterTaskAzure(clusterRequest);\n\n\t\treturn clusterRequest;\n\n\t}", "public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>\n createAzureCluster(com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getCreateAzureClusterMethod(), getCallOptions()), request);\n }", "public com.google.longrunning.Operation createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getCreateAzureClusterMethod(), getCallOptions(), request);\n }", "default void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getCreateAzureClusterMethod(), responseObserver);\n }", "public void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateAzureClusterMethod(), getCallOptions()),\n request,\n responseObserver);\n }", "@Test(groups = {\"rest-commands\"})\n public void createClusterInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandCreateInstance(INSTANCE_NAME, TestDomainV4Constants.CLUSTER,\n TestDomainV4Constants.NODE_NAME);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandCreateInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandCreateInstance command execution failed: \" + gfie.getMessage());\n }\n }", "private void createClusterForAks(ProvisionRequest provisionRequest, String processID) {\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tprovisionRequest.setKubeMonitoring(\"Grafana\");\n\t\t}\n\t\tstartCreateClusterTaskForAks(provisionRequest);\n\t}", "public yandex.cloud.api.operation.OperationOuterClass.Operation create(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getCreateMethod(), getCallOptions(), request);\n }", "@PostMapping\n public KubeClusterDto create(@RequestBody ClusterCreationRequest clusterCreationRequest) {\n return kubeClusterMapper.map(kubeClusterService.create(clusterCreationRequest));\n }", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.operation.OperationOuterClass.Operation> create(\n yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getCreateMethod(), getCallOptions()), request);\n }", "public CreateClusterRequest(CreateClusterRequest source) {\n if (source.ClusterName != null) {\n this.ClusterName = new String(source.ClusterName);\n }\n if (source.ClusterType != null) {\n this.ClusterType = new String(source.ClusterType);\n }\n if (source.VpcId != null) {\n this.VpcId = new String(source.VpcId);\n }\n if (source.ClusterCIDR != null) {\n this.ClusterCIDR = new String(source.ClusterCIDR);\n }\n if (source.ClusterDesc != null) {\n this.ClusterDesc = new String(source.ClusterDesc);\n }\n if (source.TsfRegionId != null) {\n this.TsfRegionId = new String(source.TsfRegionId);\n }\n if (source.TsfZoneId != null) {\n this.TsfZoneId = new String(source.TsfZoneId);\n }\n if (source.SubnetId != null) {\n this.SubnetId = new String(source.SubnetId);\n }\n if (source.ClusterVersion != null) {\n this.ClusterVersion = new String(source.ClusterVersion);\n }\n if (source.MaxNodePodNum != null) {\n this.MaxNodePodNum = new Long(source.MaxNodePodNum);\n }\n if (source.MaxClusterServiceNum != null) {\n this.MaxClusterServiceNum = new Long(source.MaxClusterServiceNum);\n }\n if (source.ProgramId != null) {\n this.ProgramId = new String(source.ProgramId);\n }\n if (source.KuberneteApiServer != null) {\n this.KuberneteApiServer = new String(source.KuberneteApiServer);\n }\n if (source.KuberneteNativeType != null) {\n this.KuberneteNativeType = new String(source.KuberneteNativeType);\n }\n if (source.KuberneteNativeSecret != null) {\n this.KuberneteNativeSecret = new String(source.KuberneteNativeSecret);\n }\n if (source.ProgramIdList != null) {\n this.ProgramIdList = new String[source.ProgramIdList.length];\n for (int i = 0; i < source.ProgramIdList.length; i++) {\n this.ProgramIdList[i] = new String(source.ProgramIdList[i]);\n }\n }\n }", "private void createClusterAsyncAzureNative(ProvisionRequest provisionRequest, String processID)\n\t\t\tthrows ClusterException {\n\n\t\ttry {\n\n\t\t\t// K8SCluster cluster = new K8SCluster(processID, \"Started\");\n\t\t\t// redisRepo.save(cluster, CacheKeysEnum.CLUSTER_STATUS);\n\n\t\t\tProcess process = startProvisionTask(provisionRequest);\n\n\t\t\tK8SCluster cluster = saveAndGetProvisionStatus(processID, process,\n\t\t\t\t\tClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\n\t\t\tThread.sleep(10000);\n\n\t\t\tif (cluster.getCreateStatus().equals(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\t// to create cluster fields from provision request (kubeDashboard value) is also\n\t\t\t\t// required.\n\t\t\t\tcreateClusterForAzureNative(provisionRequest, processID);\n\n\t\t\t} else {\n\t\t\t\t// Retry once\n\t\t\t}\n\n\t\t\tlogger.info(\"Inside Async process\");\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"Exception Occurred...\", ex);\n\t\t\tthrow new ClusterException(\"Exception occurred in createClusterAsyncAzure..\", ex);\n\t\t}\n\t}", "@Override\n public BrokerCluster generateCluster(String clusterId, int numReplicas, Address address, AddressPlan addressPlan, StandardInfraConfig standardInfraConfig) throws Exception {\n\n KubernetesListBuilder resourcesBuilder = new KubernetesListBuilder();\n\n if (standardInfraConfig != null) {\n String templateName = getTemplateName(address, addressPlan, standardInfraConfig);\n KubernetesList newResources = processTemplate(clusterId, numReplicas, address, templateName, standardInfraConfig);\n resourcesBuilder.addAllToItems(newResources.getItems());\n }\n return new BrokerCluster(clusterId, resourcesBuilder.build());\n }", "private Process startCreateClusterTaskForAks(ProvisionRequest provisionRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(provisionRequest);\n\t\t\tString provisionRequestStrWithQt = \"'\" + clusterRequestStr + \"'\";\n\t\t\tProcessBuilder builder = new ProcessBuilder(new String[0]);\n\n\t\t\tString command = \"ansible-playbook \"\n\t\t\t\t\t+ appConfig.getConfigValue(\n\t\t\t\t\t\t\t\"createClusterPlayBook\" + getPropertySuffix(provisionRequest.getCloudSrvc()))\n\t\t\t\t\t+ \" --e \" + provisionRequestStrWithQt;\n// Process p = Runtime.getRuntime().exec(ansible_run, null);\n\t\t\tlogger.info(\"Create Cluster Command:: \" + command);\n\t\t\tbuilder.command(new String[] { \"sh\", \"-c\", command });\n\t\t\tString directory = appConfig\n\t\t\t\t\t.getConfigValue(\"createClusterFolder\" + getPropertySuffix(provisionRequest.getCloudSrvc()));\n\t\t\tbuilder.directory(new File(directory));\n\n\t\t\tprocess = builder.start();\n\n\t\t\tlogger.info(\"Running create aks playbook ...\");\n\n\t\t\tStreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);\n\t\t\tExecutors.newSingleThreadExecutor().submit(streamGobbler);\n\t\t} catch (Exception ex) {\n\t\t\t// ex.printStackTrace();\n\t\t\tthrow new ClusterException(\"Exception occurred in startCreateClusterTaskForAks...\", ex);\n\t\t}\n\t\treturn process;\n\t}", "private ITaskCluster createTaskCluster(ITaskObject... taskObjects) {\n ITaskCluster taskCluster = getTaskManagerConfiguration().getTaskFactory().newTaskCluster();\n taskCluster = getTaskManagerConfiguration().getTaskManagerWriter().saveNewTaskCluster(taskCluster);\n\n return createTaskGraphForTaskCluster(taskCluster, taskObjects);\n }", "public void create(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.operation.OperationOuterClass.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateMethod(), getCallOptions()), request, responseObserver);\n }", "public CreateServiceRequest withCluster(String cluster) {\n setCluster(cluster);\n return this;\n }", "public void create(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.operation.OperationOuterClass.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateMethod(), responseObserver);\n }", "interface WithCluster {\n /**\n * Specifies cluster.\n * @param cluster the cluster parameter value\n * @return the next definition stage\n*/\n WithNodeCount withCluster(ResourceId cluster);\n }", "public static void main(String[] args) throws IOException{\n\t\tString accessToken = \"<YOUR_ACCESS_TOKEN>\";\n\t\t// The IBM Cloud organization & space to query - case sensitive.\n\t\tString org = \"<YOUR_ORG>\"; // Example: [email protected]\n\t\tString space = \"<YOUR_SPACE>\"; // Example: dev \n\n\t\t// Use TLSv1.2.\n\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t// Create the URL.\n\t\tURL orgsURL = new URL(apiEndpoint + \"/organizations/\" + org + \"/spaces/\" + space + \"/serviceinstances\");\n\t\tHttpURLConnection con = (HttpURLConnection) orgsURL.openConnection();\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"Authorization\", \"Bearer \" + accessToken);\n\t\tcon.setRequestProperty(\"Content-Type\",\"application/json\");\n\t\tcon.setDoOutput(true);\n\n\t\t/* CREATE OPTIONS\n\t\t * Type: The plan type to create.\n\t\t * \t\t\t\t\t\t\tEnum: [\"LibertyCollective\", \"LibertyCore\", \"LibertyNDServer\", \"WASBase\", \"WASCell\", \"WASNDServer\"]\n\t\t *\n\t\t * Name: Name your new service icon in IBM Cloud.\n\t\t *\n\t\t * ApplicationServerVMSize: The size of the virtual machine.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * ControlServerVMSize: The size of the Virtual Machine containing the Collective Controller for a LibertyCollective service instance,\n\t\t * \t\t\t\t\t\t\tor the size of the Virtual Machine containing the DMGR for a WASCell service instance. This is required for\n\t\t * \t\t\t\t\t\t \ttypes \"LibertyCollective\" and \"WASCell\", Illegal argument for the other Types.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * NumberOfApplicationVMs: The number (integer) of application server Virtual Machines to create This is required for types \"LibertyCollective\"\n\t\t * \t\t\t\t\t\t\tand \"WASCell\", Illegal argument for the other Types.\n\t\t *\n\t\t * Software_Level: This is optional for types \"WASBase\", \"WASNDServer\", and \"WASCell\". If one is not specified version \"9.0.0\" will be default.\n\t\t * \t\t\t\t\t\t\tEnum: [\"8.5.5\", \"9.0.0\"]\n\t\t */\n\t\tString createOptionsJSON = \"{\\\"Type\\\":\\\"LibertyCore\\\",\\\"Name\\\":\\\"MyFirstAPIServiceInstance\\\",\\\"ApplicationServerVMSize\\\":\\\"S\\\"}\";\n\n\t\t// Add JSON POST data.\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(createOptionsJSON);\n\t\twr.flush();\n\t\twr.close();\n\n\t\tBufferedReader br = null;\n\t\tif (HttpURLConnection.HTTP_OK == con.getResponseCode()) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t}\n\t\telse {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getErrorStream()));\n\t\t}\n\n\t\tStringBuffer response = new StringBuffer();\n\t\tString line;\n\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tresponse.append(line);\n\t\t}\n\t\tbr.close();\n\n\t\t// Response from the request.\n\t\tSystem.out.println(response.toString());\n\n\t\t/* Example Response for creating a service instance of type \"LibertyCore\"\n\t\t * {\n\t\t * \t\"Status\":\"Active\",\n\t\t * \t\"ApplicationVMInfo\":\n\t\t * \t{\n\t\t * \t\t\"disk\":12.0,\n\t\t * \t\t\"memory\":2048,\"vcpu\":1\n\t\t * \t},\n\t\t * \t\"ServiceInstance\":\n\t\t * \t{\n\t\t * \t\t\"ServiceInstanceID\":\"8b80bac5-4e78-4a87-bb3e-0e4a8fd6d13a\",\n\t\t * \t\t\"ServiceType\":\"LibertyCore\",\n\t\t * \t\t\"SpaceID\":\"esw7jc13-b12a-47jn-9627-06jdu78d98ed\",\n\t\t * \t\t\"OrganizationID\":\"a23w6701-5324-4af8-b593-e9fdffer36a2\",\n\t\t * \t\t\"Name\":\"MyFirstAPIServiceInstance\"\n\t\t * \t}\n\t\t * }\n\t\t */\n\t}", "public void updateClusterDetails(UpdateClusterRequest callbackRequest) throws JsonProcessingException, IOException {\n\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tString callbackRequestStr = mapper.writeValueAsString(callbackRequest);\n\t\tlogger.info(\"Update Request: \" + callbackRequestStr);\n\t\tArrayList<String> masterNodes = new ArrayList<String>();\n\t\tArrayList<String> workderNodes = new ArrayList<String>();\n\t\t// set cluster id and inventory path.\n\t\tClusterEnv clusterEnv = new ClusterEnv(callbackRequest.getClusterID());\n\t\tclusterEnv.setInventoryPath(getInventoryPath(callbackRequest.getClusterID()));\n\t\t// if provision details are present set it. If request is posted after\n\t\t// provisioning\n\t\tK8SCluster cluster = clusterRepository.findById(callbackRequest.getClusterID());\n\n\t\tif (cluster == null) {\n\t\t\tlogger.info(\"Cluster could not be found in Database... \");\n\t\t\tthrow new ClusterException(\"Cluster could not be found in database..\");\n\t\t}\n\n\t\tif (callbackRequest.getProvisionDetails() != null) {\n\t\t\tfor (ProvisionDetails provDetails : callbackRequest.getProvisionDetails()) {\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"MASTER\") && masterNodes.size() <= 1) {\n\t\t\t\t\tmasterNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"WORKER\")) {\n\t\t\t\t\tworkderNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] kubeMasterIps = new String[masterNodes.size()];\n\t\t\tString[] kubeNodeIps = new String[workderNodes.size()];\n\t\t\tmasterNodes.toArray(kubeMasterIps);\n\t\t\tworkderNodes.toArray(kubeNodeIps);\n\t\t\tclusterEnv.setKubeMasterIps(kubeMasterIps);\n\t\t\tclusterEnv.setKubeNodeIps(kubeNodeIps);\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t}\n\t\t// if request is posted after create cluster\n\t\tif (callbackRequest.getCreateClusterDetails() != null) {\n//\t\t\tclusterDetails = (ClusterEnv) redisRepo.findById(clusterRequest.getClusterID(),\n//\t\t\t\t\tCacheKeysEnum.CLUSTER_DETAILS);\t\n\n\t\t\tclusterEnv.setApiServerUrl(callbackRequest.getCreateClusterDetails().getKubeApiServerUrl());\n\t\t\t// clusterEnv.setK8sAdminToken(clusterRequest.getCreateClusterDetails().getK8sAdminToken());\n\t\t\tclusterEnv.setK8sDashboardUrl(callbackRequest.getCreateClusterDetails().getK8sDashboadUrl());\n\t\t\t// clusterEnv.setDashboardToken(clusterRequest.getCreateClusterDetails().getDashboardToken());\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\n\t\t\t// If provisioning completed, that means, Azure Native flow. Already record\n\t\t\t// present in clusterenv - hence update\n\t\t\tif (cluster.getCreateStatus().equalsIgnoreCase(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\tclusterRepository.updateClusterEnv(clusterEnv);\n\t\t\t} else {\n\t\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\t\t\t}\n\n\t\t\t// SAVE Tokens to Vault\n\t\t\tsaveTokensToVault(callbackRequest);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.READY.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t\tif (callbackRequest.getCreateClusterDetails().getKubeConfig() != null) {\n\n\t\t\t\tlogger.info(\"Kube Cofig from callback request::\"\n\t\t\t\t\t\t+ callbackRequest.getCreateClusterDetails().getKubeConfig().asText());\n\t\t\t} else {\n\t\t\t\tlogger.info(\"Kube Cofig from callback request is null::\");\n\t\t\t}\n\t\t}\n\n\t\tif (callbackRequest.getMonitoringDetails() != null) {\n\t\t\t// TODO - Save montiroting details in database\n\t\t\tlogger.info(\"Monitoring details - Grafana URL- from callback request::\"\n\t\t\t\t\t+ callbackRequest.getMonitoringDetails().getGrafanaUrl());\n\t\t}\n\t\t// redisRepo.save(clusterEnv, CacheKeysEnum.CLUSTER_DETAILS);\n\n\t}", "public interface ClusterDefinitionService {\n\n /**\n * Returns the local controller node.\n * @return local controller node\n */\n ControllerNode localNode();\n\n /**\n * Returns the set of seed nodes that should be used for discovering other members\n * of the cluster.\n * @return set of seed controller nodes\n */\n Set<ControllerNode> seedNodes();\n\n /**\n * Forms cluster configuration based on the specified set of node\n * information. Assumes subsequent restart for the new configuration to\n * take hold.\n *\n * @param nodes set of nodes that form the cluster\n * @param ipPrefix IP address prefix, e.g. 10.0.1.*\n */\n void formCluster(Set<ControllerNode> nodes, String ipPrefix);\n}", "public Ms2Cluster() { super(); }", "public Builder setCluster(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n cluster_ = value;\n onChanged();\n return this;\n }", "public void createClusters() {\n\t\t/*\n\t\t * double simAvg = documentDao.getSimilarity(avg); double simMax =\n\t\t * documentDao.getSimilarity(max); double simMin =\n\t\t * documentDao.getSimilarity(min);\n\t\t */\n\n\t\t// initClusters();\n\n\t\tList<Document> docList = documentDao.getDocumentListOrderBySimilarity();\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tint i = 0;\n\t\tCluster cluster = clusterList.get(i);\n\t\tfor (Document document : docList) {\n\t\t\twhile (document.getSimilarity() < cluster.getLow()) {\n\t\t\t\tcluster = clusterList.get(++i);\n\t\t\t}\n\t\t\tif (document.getSimilarity() < cluster.getHigh() && document.getSimilarity() >= cluster.getLow()) {\n\t\t\t\tdocument.setClusterId(cluster.getId());\n\t\t\t\tdocumentDao.insertDocument(document);\n\t\t\t}\n\t\t}\n\n\t}", "public CreateDedicatedBlockStorageClusterResponse createDedicatedBlockStorageClusterWithOptions(CreateDedicatedBlockStorageClusterRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {\n com.aliyun.teautil.Common.validateModel(request);\n java.util.Map<String, Object> query = new java.util.HashMap<>();\n if (!com.aliyun.teautil.Common.isUnset(request.azone)) {\n query.put(\"Azone\", request.azone);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.capacity)) {\n query.put(\"Capacity\", request.capacity);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.dbscId)) {\n query.put(\"DbscId\", request.dbscId);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.dbscName)) {\n query.put(\"DbscName\", request.dbscName);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.period)) {\n query.put(\"Period\", request.period);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.periodUnit)) {\n query.put(\"PeriodUnit\", request.periodUnit);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.regionId)) {\n query.put(\"RegionId\", request.regionId);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.resourceGroupId)) {\n query.put(\"ResourceGroupId\", request.resourceGroupId);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.tag)) {\n query.put(\"Tag\", request.tag);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.type)) {\n query.put(\"Type\", request.type);\n }\n\n com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(\n new TeaPair(\"query\", com.aliyun.openapiutil.Client.query(query))\n ));\n com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(\n new TeaPair(\"action\", \"CreateDedicatedBlockStorageCluster\"),\n new TeaPair(\"version\", \"2021-07-30\"),\n new TeaPair(\"protocol\", \"HTTPS\"),\n new TeaPair(\"pathname\", \"/\"),\n new TeaPair(\"method\", \"POST\"),\n new TeaPair(\"authType\", \"AK\"),\n new TeaPair(\"style\", \"RPC\"),\n new TeaPair(\"reqBodyType\", \"formData\"),\n new TeaPair(\"bodyType\", \"json\")\n ));\n return TeaModel.toModel(this.callApi(params, req, runtime), new CreateDedicatedBlockStorageClusterResponse());\n }", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "public void addCluster()\r\n\t{\r\n\t\tcluster[nextAvailableCluster()] = true;\r\n\t}", "public static void main(String[] args) throws Exception{\n\t\t\n\t\tSystem.out.println(\"Clustering started\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tArrayList<SyntacticCluster> clusters = (ArrayList<SyntacticCluster>) MinerUtil\n\t\t\t\t.deserialize(\"all_cluster\", false);\n\t\t//ArrayList<SyntacticCluster> allList = allCluster.doClustering();\n\n\t\tArrayList<SemanticCluster> semanticClusterList = new SemanticClusteringer().doClustering(clusters);\n\t\tfor (SemanticCluster semC : semanticClusterList) {\n\t\t\tfor (ICluster clus : semC.getUnits()) {\n\t\t\t\tSyntacticCluster synC = (SyntacticCluster) clus;\n\t\t\t\tsynC.doInnerClustering();\n\t\t\t\t// System.out.print(\"\");\n\t\t\t}\n\t\t\t// System.out.print(\"\");\n\t\t}\n\t\tSystem.out.println(\"Clustering finished\");\n\t\tLogger.log2(semanticClusterList, \"syntactic_semantic_clustering\");\n\t\t\n\t\tCloneSets sets = semanticClusterList.get(0).getUnits().get(0).getCloneSets().get(0).getCloneSets();\n\t\t\n\t\tMinerUtil.serialize(semanticClusterList, \"semantic_clusters\", false);\n\t\tMinerUtil.serialize(sets, \"sets\", false);\n\t\t//ConsoleFormatter.displayClusters(clustersByTopic);\n\t}", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();", "public CmdCluster(final EncogAnalyst analyst) {\n super(analyst);\n }", "static Cluster clusterProvider(String neptune, int BATCH_SIZE) {\n java.security.Security.setProperty(\"networkaddress.cache.ttl\", \"0\");\n java.security.Security.setProperty(\"networkaddress.cache.negative.ttl\", \"0\");\n\n Cluster.Builder clusterBuilder = Cluster.build()\n .addContactPoint(neptune) // add more ro contact points for load balancing\n .port(8182)\n .enableSsl(true)\n// .keyStore(keyStore) // optional as amazon cert will be used and should be in truststore of server\n// .keyStorePassword(keyStorePassword)\n .channelizer(SigV4WebSocketChannelizer.class)\n .serializer(Serializers.GRAPHBINARY_V1D0)\n .maxInProcessPerConnection(1) // ensure no contention for connections per batch\n .minInProcessPerConnection(1)\n .maxSimultaneousUsagePerConnection(1)\n .minSimultaneousUsagePerConnection(1)\n .maxWaitForConnection(15000)\n .minConnectionPoolSize(BATCH_SIZE)\n .maxConnectionPoolSize(BATCH_SIZE);\n\n return clusterBuilder.create();\n }", "public static void main(String... args) throws SQLException {\n new CreateCluster().runTool(args);\n }", "Cloud createCloud();", "Cluster getRuntimeCluster() throws TimeoutException, InterruptedException;", "String getClusterName();", "@Override\n protected void before() {\n LOGGER.info(\"Creating cluster operator {} before test per @ClusterOperator annotation on {}\", cc, name(element));\n for (Map.Entry<File, String> entry : yamls.entrySet()) {\n LOGGER.info(\"creating possibly modified version of {}\", entry.getKey());\n deletable.push(entry.getValue());\n\n kubeClient().namespace(annotations(element, Namespace.class).get(0).value());\n kubeClient().clientWithAdmin().applyContent(entry.getValue());\n }\n applyMultipleNamespacesWatcher(element);\n kubeClient().waitForDeployment(CO_DEPLOYMENT_NAME, 1);\n }", "java.lang.String getClusterName();", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "DescribeClustersResult describeClusters(DescribeClustersRequest describeClustersRequest);", "ClusterSet() {\n }", "public CreateTaskSetRequest withCluster(String cluster) {\n setCluster(cluster);\n return this;\n }", "@Override\n protected void before() {\n LOGGER.info(\"Creating cluster operator with Helm Chart {} before test per @ClusterOperator annotation on {}\", cc, name(element));\n Path pathToChart = new File(HELM_CHART).toPath();\n String oldNamespace = kubeClient().namespace(\"kube-system\");\n InputStream helmAccountAsStream = getClass().getClassLoader().getResourceAsStream(\"helm/helm-service-account.yaml\");\n String helmServiceAccount = TestUtils.readResource(helmAccountAsStream);\n kubeClient().applyContent(helmServiceAccount);\n helmClient().init();\n kubeClient().namespace(oldNamespace);\n helmClient().install(pathToChart, HELM_RELEASE_NAME, allValues);\n }", "public Builder setClusterName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n endpointConfigCase_ = 2;\n endpointConfig_ = value;\n onChanged();\n return this;\n }", "public static void main(String[] args) throws Exception {\n zooKeeper = new ZooKeeper(\"192.168.24.120:2181\",500,new CreateNodeSyn());\n countDownLatch.await();\n String path = zooKeeper.create(\"/zk-test-book-\", \"123\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);\n System.out.println(\"Success create zNode:\" + path);\n String path2 = zooKeeper.create(\"/zk-test-book-\", \"123\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);\n System.out.println(\"Success create zNode:\" + path2);\n }", "private Datacenter createDatacenter(String name){\n List<Host> hostList = new ArrayList<Host>();\n\n for (int i=0; i<HostCount; i++){\n\n // 2. A Machine contains one or more PEs or CPUs/Cores.\n List<Pe> peList = new ArrayList<Pe>();\n\n // 3. Create PEs and add these into a list.\n for (int j=0; j<HostCoreCount; j++){\n peList.add(new Pe(j, new PeProvisionerSimple(HostCoreMips)));\n }\n\n\n //in this example, the VMAllocatonPolicy in use is SpaceShared. It means that only one VM\n //is allowed to run on each Pe. As each Host has only one Pe, only one VM can run on each Host.\n hostList.add(\n new Host(\n i,\n new RamProvisionerSimple(HostRam),\n new BwProvisionerSimple(HostBandwidth),\n HostStorage,\n peList,\n new VmSchedulerSpaceShared(peList)\n )\n );\n }\n\n\n // 5. Create a DatacenterCharacteristics object that stores the\n // properties of a data center: architecture, OS, list of\n // Machines, allocation policy: time- or space-shared, time zone\n // and its price (G$/Pe time unit).\n String arch = \"x86\"; // system architecture\n String os = \"Linux\"; // operating system\n String vmm = \"Xen\";\n double time_zone = 10.0; // time zone this resource located\n double cost = 3.0; // the cost of using processing in this resource\n double costPerMem = 0.05;\t\t// the cost of using memory in this resource\n double costPerStorage = 0.001;\t// the cost of using storage in this resource\n double costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n LinkedList<Storage> storageList = new LinkedList<Storage>();\t//we are not adding SAN devices by now\n\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n // 6. Finally, we need to create a PowerDatacenter object.\n Datacenter datacenter = null;\n\n try {\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return datacenter;\n }", "void formCluster(Set<ControllerNode> nodes, String ipPrefix);", "public static void main(String args[]){\n ClientConfig remoteConfig = getCluster2();\n\n remoteClient = HazelcastClient.newHazelcastClient(remoteConfig);\n\n Map usCarMap = remoteClient.getMap(\"cars\");\n\n System.out.println(usCarMap.size());\n\n //ClientConfig localConfig = getEUClientConfig();\n Config localConfig = getHCCluster1();\n\n localClient = Hazelcast.newHazelcastInstance(localConfig);\n localClient.getMap(\"cars\");\n\n ClusterReconTask clusterReconTask = new ClusterReconTask(localClient, localClusterName, remoteClient, remoteClusterName);\n\n ClusterReconTask clusterReconTask1 = clusterReconTask;\n\n ClusterReconResults reconResults = null;\n\n try {\n reconResults = clusterReconTask1.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n System.out.println(reconResults.getMissingKeysByMap().size());\n\n System.out.println(reconResults.getMissingKeysByMap().toString());\n\n // Run Repair Task if needed\n if (reconResults.getMissingKeysByMap().size() > 0){\n ClusterRepairTask clusterRepairTask = new ClusterRepairTask(localClient, localClusterName, remoteClient, remoteClusterName, reconResults);\n try {\n clusterRepairTask.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n\n }", "private Collection<TopicResource> getClusterTopics(final KafkaSpecsRunnerOptions options) throws ExecutionException, InterruptedException {\n Collection<String> topicNames = (options.topics().isEmpty()) ?\r\n client.listTopics().names().get() :\r\n options.topics();\r\n List<TopicResource> topics = topicNames.stream().map(TopicResource::new).collect(Collectors.toList());\r\n\r\n return new DescribeTopicOperation()\r\n .execute(client, new ResourcesIterable<>(topics), DescribeOperationOptions.withDescribeDefaultConfigs(true), namespace);\r\n }", "private static Datacenter Create_Datacenter(String name){\n\t\t// creating list of host machine \n\t\tList<Host> hostList = new ArrayList<Host>();\n\t\t// creating list of CPU for each host machine, In our simulation with choose 1 core per machine \n\t\tList<Pe> peList1 = new ArrayList<Pe>();\n\t\tint mips = 1000; // computing power of each core\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\tpeList1.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t}\n\t\t// configuring host\n\t\tint hostId=0;\n\t\tint ram = 56320; //host memory 40 GB\n\t\tlong storage = 10240000; //host storage 10000 GB\n\t\tint bw = 102400; // bandwidth 100 Gbps\n\t\t// create first host machine with 4 cores \n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList1,\n \t\t\t\tnew VmSchedulerTimeShared(peList1)\n \t\t\t)\n \t\t);\n\t\t// create another host machine with 1 cores\n\t\tList<Pe> peList2 = new ArrayList<Pe>();\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\t\tpeList2.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t\t}\n\t\thostId++;\n\n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList2,\n \t\t\t\tnew VmSchedulerTimeShared(peList2)\n \t\t\t)\n \t\t);\n\t\t\n\t // configuring datacenter \n\t\tString arch = \"x86\"; // system architecture\n\t\tString os = \"Linux\"; // operating system\n\t\tString vmm = \"Xen\";\n\t\tdouble time_zone = 10.0; // time zone this resource located\n\t\tdouble cost = 3.0; // the cost of using processing in this resource\n\t\tdouble costPerMem = 0.05;\t\t// the cost of using memory in this resource\n\t\tdouble costPerStorage = 0.001;\t// the cost of using storage in this resource\n\t\tdouble costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n\t\tLinkedList<Storage> storageList = new LinkedList<Storage>();\n\t\tDatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n\t\t// creating data center \n\t\tDatacenter datacenter = null;\n\t\ttry {\n\t\t\tdatacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn datacenter;\n\t\t\n\t}", "public CreateClusterOperator pretty(String pretty) {\n put(\"pretty\", pretty);\n return this;\n }", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.ClusterOrBuilder getClusterOrBuilder();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "private static Map<String, Object> createClusterTemplateArtifact(Object configuration1, Object configuration2, Object configuration3) {\n return\n map(\n \"mpack_instances\",\n list(\n map(\n \"name\", \"HDPCORE\",\n \"version\", \"1.0.0.0\",\n \"configurations\", configuration1,\n \"service_instances\", list(\n map(\n \"name\", \"ZK1\",\n \"type\", \"ZOOKEEPER\",\n \"configurations\", configuration2\n )\n )\n )\n ),\n \"host_groups\",\n list(\n map(\n \"name\", \"hostgroup1\",\n \"host_count\", \"1\"\n )\n ),\n \"configurations\", configuration3\n );\n }", "public Builder addClusteringKey(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureClusteringKeyIsMutable();\n clusteringKey_.add(value);\n onChanged();\n return this;\n }", "public static void setupV1Crds(KubeClusterResource cluster) {\n cluster.replaceCustomResources(CRD_V1_KAFKA);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT_S2I);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER_2);\n cluster.replaceCustomResources(CRD_V1_KAFKA_BRIDGE);\n cluster.replaceCustomResources(CRD_V1_TOPIC);\n cluster.replaceCustomResources(CRD_V1_KAFKA_USER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECTOR);\n cluster.replaceCustomResources(CRD_V1_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "@Override\n\tpublic void execute(DelegateExecution execution) throws Exception {\n\t\tString ip = (String) execution.getVariable(\"ip\");\n\t\tString serviceHome = (String) execution.getVariable(\"serviceHome\");\n\t\tString coRoot = (String) execution.getVariable(\"coRoot\");\n\t\tString customizationId = (String) execution.getVariable(\"customizationId\");\n\t\tHashMap<String, String> data = toscaService.getCloudData(customizationId);\n\n\t\t// TODO al momento è vuoto perchè non lo leggiamo da nulla valutare se\n\t\t// leggerlo dinamicamente o da file di configurazione\n\t\tString privateKeyPath = (String) execution.getVariable(\"privateKeyPath\");\n\t\tString passphrase = (String) execution.getVariable(\"passphrase\");\n\n\t\t// prepare the certificates\n\t\tshellCert(serviceHome, caPath, data.get(\"vmname\"), ip, caPassword);\n\t\t// send the key\n\t\ttransferFile(serviceHome, \"key.pem\", privateKeyPath, passphrase, ip);\n\t\t// send the cert\n\t\ttransferFile(serviceHome, \"cert.pem\", privateKeyPath, passphrase, ip);\n\n\t\t// now that all the pieces are in the machine we can join it to swarm\n\t\tString remote_command = \"systemctl start docker && /usr/bin/docker run -itd --name=swarm-agent --expose=2376 -e SWARM_HOST=:2376 swarm join --advertise=\"\n\t\t\t\t+ ip + \":\" + dockerPort + \" consul://\" + hostip + \":8500\";\n\n\t\tProperties config = new Properties();\n\t\tconfig.put(\"StrictHostKeyChecking\", \"no\"); // without this it cannot\n\t\t\t\t\t\t\t\t\t\t\t\t\t// connect because the host\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key verification fails\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the right way would be to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// somehow get the server\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key and add it to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// trusted keys\n\t\t\t\t\t\t\t\t\t\t\t\t\t// jsch.setKnownHosts()\n\t\t\t\t\t\t\t\t\t\t\t\t\t// https://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/JSch.html#setKnownHosts-java.lang.String-\n\t\t\t\t\t\t\t\t\t\t\t\t\t// see also\n\t\t\t\t\t\t\t\t\t\t\t\t\t// http://stackoverflow.com/a/32858953/28582\n\t\tJSch jsch = new JSch();\n\t\tjsch.addIdentity(privateKeyPath, passphrase);\n\n\t\tSession session = jsch.getSession(ROOT_USER, ip, SSH_PORT);\n\t\tsession.setConfig(config);\n\t\tsession.connect();\n\n\t\tChannelExec channel = (ChannelExec) session.openChannel(\"exec\");\n\t\tint exitStatus = sendCommand(remote_command, channel);\n\t\tlog.debug(\"Command: [\" + remote_command + \"]\");\n\t\tif (exitStatus != 0) {\n\t\t\tlog.debug(\"FAILED - exit status: \" + exitStatus);\n\t\t} else {\n\t\t\tlog.debug(\"Executed successfully\");\n\t\t}\n\t\tchannel.disconnect();\n\t\tsession.disconnect();\n\n\t\tlog.debug(\"in DeployDockerSwarm\");\n\t\t// toscaService.getNodeType(\"\");\n\t\t// dockerService.addMachine(ip, 2376); //SSL\n\t\tString clusterToken = dockerService.addMachine(swarmIp, Integer.parseInt(swarmPort)); // no SSL\n\t\texecution.setVariable(\"clusterToken\", clusterToken);\n\t\tString clusterInfo = dockerService.clusterDetail(clusterToken);\n\t}", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "private void signalAndCreateCoordinator(Cluster pCluster)\n \t{\n \t\tRandom tRandom = new Random(System.currentTimeMillis());\n \t\tHRMController tHRMController = pCluster.getHRMController();\n \t\tNode tNode = tHRMController.getPhysicalNode();\n \t\tint tToken = tRandom.nextInt();\n \t\t\n \t\tpCluster.setToken(tToken);\n \t\tLogging.log(this, \"INIT COORDINATOR functions for cluster \" + pCluster);\n \n \t\tif(pCluster.getHRMController().getIdentity() == null) {\n \t\t\tString tName = tNode.getName();\n \t\t\tHRMIdentity tIdentity= new HRMIdentity(tName);\n \t\t\tpCluster.getHRMController().setIdentity(tIdentity);\n \t\t}\n \t\t\n \n \t\t/**\n \t\t * Create signature of cluster\n \t\t */\n \t\tHRMSignature tSignature = null;\n \t\ttry {\n \t\t\ttSignature = tHRMController.getIdentity().createSignature(tNode.toString(), null, pCluster.getHierarchyLevel());\n \t\t} catch (AuthenticationException tExc) {\n \t\t\tpCluster.getHRMController().getLogger().err(this, \"Unable to create signature for coordinator\", tExc);\n \t\t}\n \t\t\n \t\t/**\n \t\t * Send BULLY ANNOUNCE in order to signal that we are the coordinator\n \t\t */\n \t\tBullyAnnounce tAnnounce = new BullyAnnounce(tNode.getCentralFN().getName(), pCluster.getBullyPriority(), tSignature, pCluster.getToken());\n \t\tfor(CoordinatorCEPChannel tCEP : pCluster.getParticipatingCEPs()) {\n \t\t\ttAnnounce.addCoveredNode(tCEP.getPeerName());\n \t\t}\n \t\tif(tAnnounce.getCoveredNodes() == null || (tAnnounce.getCoveredNodes() != null && tAnnounce.getCoveredNodes().isEmpty())) {\n \t\t\tpCluster.getHRMController().getLogger().log(this, \"Sending announce that does not cover anyhting\");\n \t\t}\n \t\tpCluster.sendClusterBroadcast(tAnnounce, null);\n \t\tName tAddress = tNode.getRoutingService().getNameFor(tNode.getCentralFN());; \n \t\tpCluster.setCoordinatorCEP(null, tSignature, tNode.getCentralFN().getName(), (L2Address)tAddress);\n \t\tLinkedList<HRMSignature> tSignatures = tHRMController.getApprovedSignatures();\n \t\ttSignatures.add(tSignature);\n \t\tif(getHierarchLevel().isHigherLevel()) {\n \t\t\tpCluster.getHRMController().getLogger().log(pCluster, \"has the coordinator and will now announce itself\");\n \t\t\tfor(ICluster tToAnnounce : pCluster.getNeighbors()) {\n //\t\t\t\t\tList<VirtualNode> tNodesBetween = pCluster.getCoordinator().getClusterMap().getIntermediateNodes(pCluster, tToAnnounce);\n \t\t\t\t/*\n \t\t\t\t * OK: Because of the formerly sent \n \t\t\t\t */\n \t\t\t\tif(tToAnnounce instanceof NeighborCluster) {\n \t\t\t\t\tBullyAnnounce tBullyAnnounce = new BullyAnnounce(tNode.getCentralFN().getName(), pCluster.getBullyPriority(), tSignature, pCluster.getToken());\n \t\t\t\t\tfor(CoordinatorCEPChannel tCEP: pCluster.getParticipatingCEPs()) {\n \t\t\t\t\t\ttBullyAnnounce.addCoveredNode(tCEP.getPeerName());\n \t\t\t\t\t}\n \t\t\t\t\tfor(CoordinatorCEPChannel tCEP : ((NeighborCluster)tToAnnounce).getAnnouncedCEPs()) {\n \t\t\t\t\t\ttCEP.sendPacket(tBullyAnnounce);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t\n \t\tif(!mPleaseInterrupt) {\n \t\t\t/*\n \t\t\t * synchronized(mPleaseInterrupt) {\n \t\t\t *\n \t\t\t\ttry {\n \t\t\t\t\tmPleaseInterrupt.wait(WAIT_BEFORE_ADDRESS_DISTRIBUTION);\n \t\t\t\t} catch (InterruptedException tExc) {\n \t\t\t\t\tLogging.trace(this, \"interrupted before address distribution\");\n \t\t\t\t}\n \t\t\t}\n \t\t\t */\n \t\t\t\n \t\t\t\n \t\t\tCoordinator tElectedCoordinator = new Coordinator(pCluster, pCluster.getHierarchyLevel(), pCluster.getHrmID());\n \t\t\tint tClusterHierLvl = pCluster.getHierarchyLevel().getValue() + 1;\n \t\t\t\n \t\t\tpCluster.setCoordinator(tElectedCoordinator);\n \t\t\tpCluster.getHRMController().setSourceIntermediateCluster(tElectedCoordinator, pCluster);\n \t\t\ttElectedCoordinator.setPriority(pCluster.getBullyPriority());\n \t\t\tpCluster.getHRMController().addCluster(tElectedCoordinator);\n \t\t\tif(tClusterHierLvl != HRMConfig.Hierarchy.HEIGHT) {\n \t\t\t\t// stepwise hierarchy creation\n \t\t\t\tLogging.log(this, \"Will now wait because hierarchy build up is done stepwise\");\n \t\t\t\tmWillInitiateManager = true;\n \t\t\t\tLogging.log(this, \"Reevaluating whether other processes settled\");\n \t\t\t\tElectionManager.getElectionManager().reevaluate(pCluster.getHierarchyLevel().getValue());\n \t\t\t\tsynchronized(this) {\n \t\t\t\t\ttry {\n \t\t\t\t\t\twait();\n \t\t\t\t\t} catch (InterruptedException tExc) {\n \t\t\t\t\t\tLogging.err(this, \"Unable to fulfill stepwise hierarchy preparation\", tExc);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\ttElectedCoordinator.prepareAboveCluster(tClusterHierLvl);\n \t\t\t} else {\n \t\t\t\tLogging.log(this, \"Beginning address distribution\");\n \t\t\t\ttry {\n \t\t\t\t\ttElectedCoordinator.setHRMID(new HRMID(0));\n \t\t\t\t\tsynchronized(mPleaseInterrupt) {\n \t\t\t\t\t\tLogging.log(this, \"ACTIVE WAITING (init) - \" + WAIT_BEFORE_ADDRESS_DISTRIBUTION);\n \t\t\t\t\t\tmPleaseInterrupt.wait(WAIT_BEFORE_ADDRESS_DISTRIBUTION);\n \t\t\t\t\t}\n \t\t\t\t\ttElectedCoordinator.distributeAddresses();\n \t\t\t\t} catch (RemoteException tExc) {\n \t\t\t\t\tLogging.err(this, \"Remoe problem - error when trying to distribute addresses\", tExc);\n \t\t\t\t} catch (RoutingException tExc) {\n \t\t\t\t\tLogging.err(this, \"Routing problem - error when trying to distribute addresses\", tExc);\n \t\t\t\t} catch (RequirementsException tExc) {\n \t\t\t\t\tLogging.err(this, \"Requirements problem - error when trying to distribute addresses\", tExc);\n \t\t\t\t} catch (InterruptedException tExc) {\n \t\t\t\t\tLogging.err(this, \"interrupt problem - error when trying to distribute addresses\", tExc);\n \t\t\t\t}\n \t\t\t}\n \t\t}\t\n \t}", "public ClusterServicePlanSpec() {\n }", "public void addClusterBox(final Cluster cluster) {\n final JPanel label = new JPanel();\n label.setBackground(Browser.PANEL_BACKGROUND);\n label.setLayout(new BoxLayout(label, BoxLayout.Y_AXIS));\n label.add(new JLabel(cluster.getName()));\n for (final Host h : cluster.getHosts()) {\n final StringBuilder hostLabel = new StringBuilder();\n if (!h.isRoot()) {\n hostLabel.append(h.getUsername());\n hostLabel.append('@');\n }\n hostLabel.append(h.getName());\n final String port = h.getSSHPort();\n if (port != null && !\"22\".equals(port)) {\n hostLabel.append(':');\n hostLabel.append(port);\n }\n \n final JLabel nl = new JLabel(\" \" + hostLabel);\n final Font font = nl.getFont();\n final Font newFont = font.deriveFont(\n Font.PLAIN,\n (float) (font.getSize() / 1.2));\n nl.setFont(newFont);\n label.add(nl);\n }\n final JPanel startPanel = new JPanel(new BorderLayout());\n startPanel.setBackground(Browser.PANEL_BACKGROUND);\n clusterBackgrounds.put(cluster, startPanel);\n startPanel.setBorder(new LineBorder(Tools.getDefaultColor(\n \"EmptyBrowser.StartPanelTitleBorder\")));\n final JPanel left = new JPanel();\n left.setBackground(Browser.PANEL_BACKGROUND);\n clusterBackgrounds.put(cluster, startPanel);\n final JCheckBox markWi = new JCheckBox();\n markWi.setBackground(Browser.PANEL_BACKGROUND);\n allCheckboxes.put(cluster, markWi);\n left.add(markWi);\n left.add(label);\n startPanel.add(left, BorderLayout.LINE_START);\n final MyButton loadClusterBtn = loadClusterButton(cluster, markWi);\n startPanel.add(loadClusterBtn, BorderLayout.LINE_END);\n c.fill = GridBagConstraints.HORIZONTAL;\n mainPanel.add(startPanel, c);\n c.gridx++;\n if (c.gridx > 2) {\n c.gridx = 0;\n c.gridy++;\n }\n }", "public ProvisionedClustersPropertiesWithoutSecrets() {\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "private ITaskCluster createTaskGraphForTaskCluster(ITaskCluster taskCluster, ITaskObject... taskObjects) {\n List<IStatusTask> statusTasks = null;\n List<Pair<ITaskObject, IStatusTask>> taskObjectNodes = new ArrayList<>();\n if (taskObjects != null && taskObjects.length > 0) {\n statusTasks = new ArrayList<>();\n for (ITaskObject taskObject : taskObjects) {\n IStatusTask initTask = createInitTask(taskObject);\n taskObjectNodes.add(Pair.of(taskObject, initTask));\n }\n }\n\n ITaskCluster res = getTaskManagerConfiguration().getTaskManagerWriter().saveNewGraphFromTaskCluster(taskCluster, taskObjectNodes);\n\n onTodoTasks(res, statusTasks);\n onCurrentTasks(res, statusTasks);\n\n return res;\n }", "public void createHostSet(String clustName, String hostName) throws Exception {\n _log.info(\"3PARDriver:createHostSet enter\");\n ClientResponse clientResp = null;\n String body = \"{\\\"name\\\": \\\"\" + clustName + \"\\\", \\\"setmembers\\\": [\\\"\" + hostName + \"\\\"]}\";\n _log.info(\"3PARDriver: createHostSet body is {}\", body);\n \n try {\n clientResp = post(URI_HOSTSETS, body);\n if (clientResp == null) {\n _log.error(\"3PARDriver:There is no response from 3PAR\");\n throw new HP3PARException(\"There is no response from 3PAR\");\n } else if (clientResp.getStatus() != 201) {\n String errResp = getResponseDetails(clientResp);\n throw new HP3PARException(errResp);\n } else {\n String responseString = getHeaderFieldValue(clientResp, \"Location\");\n _log.info(\"3PARDriver:createHostSet 3PAR response is {}\", responseString);\n }\n } catch (Exception e) {\n throw e;\n } finally {\n if (clientResp != null) {\n clientResp.close();\n }\n _log.info(\"3PARDriver:createHostSet leave\");\n } //end try/catch/finally\n }", "public CreateClusterOperator dryRun(String dryRun) {\n put(\"dryRun\", dryRun);\n return this;\n }", "public yandex.cloud.api.operation.OperationOuterClass.Operation createShardGroup(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterShardGroupRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getCreateShardGroupMethod(), getCallOptions(), request);\n }", "@Override // Client and Server\n public void validateClusterSpec(ClusterDescription clusterSpec) throws\n HoyaException {\n super.validateClusterSpec(clusterSpec);\n Set<String> unknownRoles = clusterSpec.getRoleNames();\n unknownRoles.removeAll(knownRoleNames);\n if (!unknownRoles.isEmpty()) {\n throw new BadCommandArgumentsException(\"There is unknown role: %s\",\n unknownRoles.iterator().next());\n }\n providerUtils.validateNodeCount(HBaseKeys.ROLE_WORKER,\n clusterSpec.getDesiredInstanceCount(\n HBaseKeys.ROLE_WORKER,\n 0), 0, -1);\n\n\n providerUtils.validateNodeCount(HBaseKeys.ROLE_MASTER,\n clusterSpec.getDesiredInstanceCount(\n HBaseKeys.ROLE_MASTER,\n 0),\n 0,\n -1);\n }", "protected boolean isClusterRequired() {\n return true;\n }", "public interface SwiftClusterNode {\n\n String getId();\n\n String getName();\n\n String getIp();\n\n int getPort();\n\n}", "private JPanelCluster(String buttonName, java.awt.event.ActionListener a) {\r\n\t\t\t\tthis.setLayout(new BorderLayout());\r\n\t\t\t\tclusterOutput.setEditable(false);\r\n\t\t\t\tJPanel upPanel = new JPanel();\r\n\t\t\t\tupPanel.setLayout(new FlowLayout());\r\n\t\t\t\tJPanel centralPanel = new JPanel();\r\n\t\t\t\tcentralPanel.setLayout(new FlowLayout());\r\n\t\t\t\tJPanel downPanel = new JPanel();\r\n\t\t\t\tdownPanel.setLayout(new FlowLayout());\r\n\t\t\t\tupPanel.add(labelTable);\r\n\t\t\t\tupPanel.add(tableText);\r\n\t\t\t\tif (buttonName.equals(\"mine\")) {\r\n\t\t\t\t\tupPanel.add(labelk);\r\n\t\t\t\t\tupPanel.add(kText);\r\n\t\t\t\t}\r\n\t\t\t\tcentralPanel.add(clusterOutput);\r\n\t\t\t\texecuteButton = new JButton(buttonName);\r\n\t\t\t\tdownPanel.add(executeButton);\r\n\t\t\t\texecuteButton.addActionListener(a);\r\n\t\t\t\tthis.add(upPanel, BorderLayout.NORTH);\r\n\t\t\t\tthis.add(centralPanel, BorderLayout.CENTER);\r\n\t\t\t\tthis.add(downPanel, BorderLayout.SOUTH);\r\n\t\t\t\tJScrollPane sp = new JScrollPane(clusterOutput);\r\n\t\t\t\tthis.add(sp);\r\n\t\t\t\tsetVisible(true);\r\n\t\t\t}", "public String zkCluster(String clusterAlias) {\n\t\tString[] zks = SystemConfigUtils.getPropertyArray(clusterAlias + \".zk.list\", \",\");\n\t\tJSONArray targets = new JSONArray();\n\t\tint id = 1;\n\t\tfor (String zk : zks) {\n\t\t\tJSONObject object = new JSONObject();\n\t\t\tobject.put(\"id\", id++);\n\t\t\tobject.put(\"host\", zk.split(\":\")[0]);\n\t\t\tobject.put(\"port\", zk.split(\":\")[1].split(\"/\")[0]);\n\t\t\tobject.put(\"mode\", status(zk.split(\":\")[0], zk.split(\":\")[1]));\n\t\t\tobject.put(\"version\", version(zk.split(\":\")[0], zk.split(\":\")[1]));\n\t\t\ttargets.add(object);\n\t\t}\n\t\treturn targets.toJSONString();\n\t}", "public Cluster startCluster() throws Exception\n {\n createCluster();\n cluster.start();\n cluster.awaitLeader();\n return cluster;\n }", "Swarm createSwarm();", "public String createTopic(String topicName) throws Exception{\r\n\r\n\t\tpropTopic.put(\"bootstrap.servers\", config.getProperty(\"bootstrap.servers\"));\r\n\t\tpropTopic.put(\"group.id\", config.getProperty(\"group.id\"));\r\n\t\tpropTopic.put(\"key.deserializer\", \"org.apache.kafka.common.serialization.StringDeserializer\");\r\n\t\tpropTopic.put(\"value.deserializer\", \"org.apache.kafka.common.serialization.StringDeserializer\");\r\n\r\n\t\tif(getTopic(topicName)){\r\n\t\t\tSystem.out.println(\"Topic \"+topicName +\" already exists!!\");\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.println(\"Creating Topic : \"+topicName);\r\n\t\t\t\r\n\t\t\tAdminClient adminClient = AdminClient.create(prop);\r\n\t\t\tNewTopic newTopic = new NewTopic(topicName, 1, (short)1);\r\n\r\n\t\t\tList<NewTopic> newTopics = new ArrayList<NewTopic>();\r\n\t\t\tnewTopics.add(newTopic);\r\n\r\n\t\t\tadminClient.createTopics(newTopics);\r\n\t\t\tadminClient.close();\r\n\t\t}\r\n\t\t\r\n\t\treturn topicName;\r\n\t}", "public Builder setClusterBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n cluster_ = value;\n onChanged();\n return this;\n }", "public Builder clearClusterName() {\n if (endpointConfigCase_ == 2) {\n endpointConfigCase_ = 0;\n endpointConfig_ = null;\n onChanged();\n }\n return this;\n }", "SqlElasticPoolOperations.DefinitionStages.WithCreate withNewDatabase(String databaseName);", "UpdateClusterResult updateCluster(UpdateClusterRequest updateClusterRequest);", "public interface ClusterControl extends ClusterMetrics {\n\n\t/** \n\t * Used by the master to determine if he is still the master.\n\t * Updates the cluster status last processed timestamp. Cancels\n\t * any usurp actions.\n\t * @param heartBeat true if this message is a heartbeat\n\t */\n\tpublic boolean verifyStatus(boolean heartbeat);\n\t\n\t/**\n\t * Used to send a heartbeat message when no traffic detected.\n\t * Should be configured to send a special message to the main\n\t * cluster thread so the lastProcessed timestamp will be \n\t * updated. \n\t */\n\tpublic void sendHeartbeat();\n\t\n\t/**\n\t * Called when the monitor detects the main thread is not \n\t * processing; stop the soInbound adapter so another instance\n\t * can take over.\n\t */\n\tpublic void stopInbound();\n\t\n\t/**\n\t * Called when a usurper successfully takes over the master\n\t * role; start the soInbound adapter.\n\t */\n\tpublic void startInbound();\n\n\t/**\n\t * Pause the application/instance - if this is a single-source\n\t * application, all instances will be paused; otherwise just\n\t * this instance will be paused.\n\t */\n\tpublic String pause();\n\t\n\t/**\n\t * Resume the application/instance - if this is a single-source\n\t * application, normal master election will occur (if the previous\n\t * master is available, it will most likely resume that role); \n\t * otherwise, just this instance is resumed.\n\t */\n\tpublic String resume();\n\t\n\t/**\n\t * Pause all (non-single-source) application instances. For single-\n\t * source applications, use {@link #pause()}.\n\t * @return\n\t */\n\tpublic String pauseAll();\n\t\n\t/**\n\t * Resume all (non-single-source) application instances. For single-\n\t * source applications, use {@link #resume()}.\n\t * @return\n\t */\n\tpublic String resumeAll();\n\t\n\t/**\n\t * Monitor the state of the master.\n\t */\n\tpublic void doMonitor();\n\n\t/**\n\t * @return the application id.\n\t */\n\tpublic String getApplicationId();\n\n\t/**\n\t * @return a string representing the current status of the application\n\t */\n\tpublic String obtainApplicationStatus();\n /**\n * \n */\n\tpublic int getMessageCount();\n}", "public Clusters()\r\n\t{\r\n\t\tcluster = new boolean[MAX_CLUSTERS];\r\n\t}", "public void writeClusters(List<Cluster> clusters)\n {\n deleteAllFileFolders();\n \n \n // root elements\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"ClusterInfo\");\n doc.appendChild(rootElement);\n Element numClusters=doc.createElement(\"NumOfClusters\");\n numClusters.appendChild(doc.createTextNode(clusters.size()+\"\"));\n rootElement.appendChild(numClusters); \n// Element clusterelem=doc.createElement(\"cluster\");\n int attribCnt=1;\n \n String writeText = \"\";\n for (Cluster cluster : clusters) {\n \n Element clusterelem=doc.createElement(\"cluster\");\n rootElement.appendChild(clusterelem);\n// Attr attr=doc.createAttribute(\"id\");\n// attr.setValue(\"\"+attribCnt++);\n// clusterelem.setAttributeNode(attr);\n clusterelem.setAttribute(\"id\", \"\"+attribCnt++);\n \n Index Firstindex = cluster.getFirstIndex();\n List<Index> indexes = cluster.getIndexLists();\n double rSpec = ((Double) Firstindex.getMeanRGB().get(0)).doubleValue();\n double gSpec = ((Double) Firstindex.getMeanRGB().get(1)).doubleValue();\n double bSpec = ((Double) Firstindex.getMeanRGB().get(2)).doubleValue();\n \n Element rspec=doc.createElement(\"rspec\");\n rspec.appendChild(doc.createTextNode(rSpec+\"\"));\n clusterelem.appendChild(rspec);\n \n Element gspec=doc.createElement(\"gspec\");\n gspec.appendChild(doc.createTextNode(gSpec+\"\"));\n clusterelem.appendChild(gspec);\n \n Element bspec=doc.createElement(\"bspec\");\n bspec.appendChild(doc.createTextNode(bSpec+\"\"));\n clusterelem.appendChild(bspec);\n \n \n String fileNames = \"\\n\\t\\t\";\n for (Index index : indexes) {\n fileNames += index.getFilePath() + \";\\n\\t\\t\";\n }\n// String record = \"@\" + rSpec + \":\" + gspec + \":\" + bspec + \":\" + fileNames + \"#\";\n// writeText += record;\n \n Element imgSrc=doc.createElement(\"ImageSrc\");\n imgSrc.appendChild(doc.createTextNode(fileNames+\"\"));\n clusterelem.appendChild(imgSrc);\n \n }\n \n WriteXML(doc);\n }", "public Builder setClusteringKey(\n int index, String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureClusteringKeyIsMutable();\n clusteringKey_.set(index, value);\n onChanged();\n return this;\n }", "public void createConsistencyGroup(String cgName, String clusterName,\n boolean isDistributed) throws VPlexApiException {\n s_logger.info(\"Request to create consistency group on VPlex at {}\", _baseURI);\n _cgMgr.createConsistencyGroup(cgName, clusterName, isDistributed);\n }", "private static Datacenter createDatacenter(String name) {\n List<Host> hostList = new ArrayList<Host>();\r\n\r\n // 2. A Machine contains one or more PEs or CPUs/Cores.\r\n // In this example, it will have only one core.\r\n List<Pe> peList = new ArrayList<Pe>();\r\n\r\n\r\n // 3. Create PEs and add these into a list.\r\n peList.add(new Pe(0, new PeProvisionerSimple(mips+100))); // need to store Pe id and MIPS Rating\r\n\r\n // 4. Create Host with its id and list of PEs and add them to the list\r\n // of machines\r\n long storage = 1000000; // host storage\r\n\r\n\r\n for (int hostId = 0; hostId < vmNum; hostId++) {\r\n hostList.add(\r\n new Host(\r\n hostId,\r\n new RamProvisionerSimple((int)((ram*1.1)/Constants.MB)),\r\n new BwProvisionerSimple(bw+10),\r\n storage,\r\n peList,\r\n new VmSchedulerTimeShared(peList)\r\n )\r\n ); // This is our machine\r\n }\r\n\r\n\r\n // 5. Create a DatacenterCharacteristics object that stores the\r\n // properties of a data center: architecture, OS, list of\r\n // Machines, allocation policy: time- or space-shared, time zone\r\n // and its price (G$/Pe time unit).\r\n String arch = \"x86\"; // system architecture\r\n String os = \"Linux\"; // operating system\r\n String vmm = \"Xen\";\r\n double time_zone = 10.0; // time zone this resource located\r\n double cost = 3.0; // the cost of using processing in this resource\r\n double costPerMem = 0.05; // the cost of using memory in this resource\r\n double costPerStorage = 0.001; // the cost of using storage in this\r\n // resource\r\n double costPerBw = 0.0; // the cost of using bw in this resource\r\n LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN\r\n // devices by now\r\n\r\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\r\n arch, os, vmm, hostList, time_zone, cost, costPerMem,\r\n costPerStorage, costPerBw);\r\n\r\n // 6. Finally, we need to create a PowerDatacenter object.\r\n Datacenter datacenter = null;\r\n try {\r\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return datacenter;\r\n }", "WithPartitionsAndCreate withStandardSku();", "public static void main(String... args) {\n String endpoint = \"cb.<your endpoint address>.dp.cloud.couchbase.com\";\n String bucketName = \"couchbasecloudbucket\";\n String username = \"user\";\n String password = \"password\";\n // User Input ends here.\n\n ClusterEnvironment env = ClusterEnvironment.builder()\n .securityConfig(SecurityConfig.enableTls(true)\n .trustManagerFactory(InsecureTrustManagerFactory.INSTANCE))\n .ioConfig(IoConfig.enableDnsSrv(true))\n .build();\n\n // Initialize the Connection\n Cluster cluster = Cluster.connect(endpoint,\n ClusterOptions.clusterOptions(username, password).environment(env));\n Bucket bucket = cluster.bucket(bucketName);\n bucket.waitUntilReady(Duration.parse(\"PT10S\"));\n Collection collection = bucket.defaultCollection();\n\n cluster.queryIndexes().createPrimaryIndex(bucketName, CreatePrimaryQueryIndexOptions.createPrimaryQueryIndexOptions().ignoreIfExists(true));\n\n // Create a JSON Document\n JsonObject arthur = JsonObject.create()\n .put(\"name\", \"Arthur\")\n .put(\"email\", \"[email protected]\")\n .put(\"interests\", JsonArray.from(\"Holy Grail\", \"African Swallows\"));\n\n // Store the Document\n collection.upsert(\n \"u:king_arthur\",\n arthur\n );\n\n // Load the Document and print it\n // Prints Content and Metadata of the stored Document\n System.out.println(collection.get(\"u:king_arthur\"));\n\n // Perform a N1QL Query\n QueryResult result = cluster.query(\n String.format(\"SELECT name FROM `%s` WHERE $1 IN interests\", bucketName),\n queryOptions().parameters(JsonArray.from(\"African Swallows\"))\n );\n\n // Print each found Row\n for (JsonObject row : result.rowsAsObject()) {\n System.out.println(row);\n }\n }" ]
[ "0.76954734", "0.7191008", "0.69068277", "0.68712693", "0.6788854", "0.6762635", "0.67322856", "0.65705234", "0.64173913", "0.63063985", "0.62882245", "0.62283874", "0.61707973", "0.6149781", "0.606707", "0.60566217", "0.6006399", "0.5998957", "0.5969771", "0.5903784", "0.5737321", "0.57103413", "0.5705629", "0.56197447", "0.5599728", "0.55861616", "0.5532914", "0.5530172", "0.54647803", "0.545213", "0.5425715", "0.53715557", "0.5361403", "0.53523403", "0.53436625", "0.5332131", "0.52840775", "0.5282749", "0.5277829", "0.52544117", "0.525166", "0.525166", "0.525166", "0.525166", "0.525166", "0.525166", "0.524538", "0.5222311", "0.52101475", "0.51955193", "0.5190316", "0.5182666", "0.51749545", "0.51716316", "0.51469696", "0.51385635", "0.5125307", "0.51219124", "0.5120747", "0.51132244", "0.51132244", "0.51132244", "0.51132244", "0.51132244", "0.51132244", "0.5103838", "0.5097731", "0.50668585", "0.50586975", "0.5057454", "0.50563115", "0.50525224", "0.50416017", "0.50256383", "0.5024875", "0.5024875", "0.5017754", "0.500628", "0.4996657", "0.49953598", "0.49867418", "0.49657977", "0.4964232", "0.4963697", "0.49545097", "0.495156", "0.49505654", "0.49503767", "0.49458963", "0.49388102", "0.49324417", "0.4931378", "0.4919049", "0.4911242", "0.4911138", "0.49080622", "0.49045324", "0.49038407", "0.48924428", "0.4890535" ]
0.63897634
9
Create cluster command structure is different for Azure and AKS
private Process startCreateClusterTaskForAks(ProvisionRequest provisionRequest) throws ClusterException { Process process = null; try { ObjectMapper mapper = new ObjectMapper(); String clusterRequestStr = mapper.writeValueAsString(provisionRequest); String provisionRequestStrWithQt = "'" + clusterRequestStr + "'"; ProcessBuilder builder = new ProcessBuilder(new String[0]); String command = "ansible-playbook " + appConfig.getConfigValue( "createClusterPlayBook" + getPropertySuffix(provisionRequest.getCloudSrvc())) + " --e " + provisionRequestStrWithQt; // Process p = Runtime.getRuntime().exec(ansible_run, null); logger.info("Create Cluster Command:: " + command); builder.command(new String[] { "sh", "-c", command }); String directory = appConfig .getConfigValue("createClusterFolder" + getPropertySuffix(provisionRequest.getCloudSrvc())); builder.directory(new File(directory)); process = builder.start(); logger.info("Running create aks playbook ..."); StreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println); Executors.newSingleThreadExecutor().submit(streamGobbler); } catch (Exception ex) { // ex.printStackTrace(); throw new ClusterException("Exception occurred in startCreateClusterTaskForAks...", ex); } return process; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "private CreateClusterRequest createClusterForAzureNative(ProvisionRequest provisionRequest, String processID) {\n\t\tCreateClusterRequest clusterRequest = new CreateClusterRequest();\n\t\t// Populate other fields\n\t\tclusterRequest.setClusterID(processID);\n\t\tclusterRequest.setKubeDashboard(provisionRequest.getKubeDashboard());\n\t\tclusterRequest.setCloudSrvc(provisionRequest.getCloudSrvc());\n\t\t// set cluster after replacing - with _\n\t\tclusterRequest.setClusterName(provisionRequest.getClusterName().replace('-', '_'));\n\t\tlogger.info(\"provisionRequest.getMonitoringEnabled()::\" + provisionRequest.getMonitoringEnabled());\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tclusterRequest.setKubeMonitoring(\"Grafana\");\n\t\t\tlogger.info(\"setKubeMonitoring::Grafana\");\n\t\t}\n\t\t// Populate other constant params\n\t\tpopulateCreateClusterRequest(clusterRequest);\n\n\t\tstartCreateClusterTaskAzure(clusterRequest);\n\n\t\treturn clusterRequest;\n\n\t}", "default void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getCreateAzureClusterMethod(), responseObserver);\n }", "public com.google.longrunning.Operation createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getCreateAzureClusterMethod(), getCallOptions(), request);\n }", "public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>\n createAzureCluster(com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getCreateAzureClusterMethod(), getCallOptions()), request);\n }", "public void createAzureCluster(\n com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateAzureClusterMethod(), getCallOptions()),\n request,\n responseObserver);\n }", "private void createClusterForAks(ProvisionRequest provisionRequest, String processID) {\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tprovisionRequest.setKubeMonitoring(\"Grafana\");\n\t\t}\n\t\tstartCreateClusterTaskForAks(provisionRequest);\n\t}", "@Test(groups = {\"rest-commands\"})\n public void createClusterInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandCreateInstance(INSTANCE_NAME, TestDomainV4Constants.CLUSTER,\n TestDomainV4Constants.NODE_NAME);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandCreateInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandCreateInstance command execution failed: \" + gfie.getMessage());\n }\n }", "private Process startCreateClusterTaskAzure(CreateClusterRequest clusterRequest) throws ClusterException {\n\t\tProcess process = null;\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tString clusterRequestStr = mapper.writeValueAsString(clusterRequest);\n\t\t\tString provisionRequestStrWithQt = \"'\" + clusterRequestStr + \"'\";\n\t\t\tProcessBuilder builder = new ProcessBuilder(new String[0]);\n\n\t\t\tString command = \"ansible-playbook -i \" + \"\\\"\" + getInventoryPath(clusterRequest.getClusterID()) + \"\\\" \"\n\t\t\t\t\t+ appConfig\n\t\t\t\t\t\t\t.getConfigValue(\"createClusterPlayBook\" + getPropertySuffix(clusterRequest.getCloudSrvc()))\n\t\t\t\t\t+ \" --e \" + provisionRequestStrWithQt;\n// Process p = Runtime.getRuntime().exec(ansible_run, null);\n\t\t\tlogger.info(\"Create Cluster Command:: \" + command);\n\t\t\tbuilder.command(new String[] { \"sh\", \"-c\", command });\n\t\t\tlogger.info(\"Config param for directory:\" + \"createClusterFolder\"\n\t\t\t\t\t+ getPropertySuffix(clusterRequest.getCloudSrvc()));\n\t\t\tString directory = appConfig\n\t\t\t\t\t.getConfigValue(\"createClusterFolder\" + getPropertySuffix(clusterRequest.getCloudSrvc()));\n\n\t\t\tlogger.info(\"Create cluster directory::\" + directory);\n\t\t\tbuilder.directory(new File(directory));\n\n\t\t\tprocess = builder.start();\n\n\t\t\tlogger.info(\"Running create azure cluster playbook ...\");\n\n\t\t\tStreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);\n\t\t\tExecutors.newSingleThreadExecutor().submit(streamGobbler);\n\t\t} catch (Exception ex) {\n\t\t\t// ex.printStackTrace();\n\t\t\tthrow new ClusterException(\"Exception occurred in startCreateClusterTaskAzure\", ex);\n\t\t}\n\t\treturn process;\n\t}", "private void createClusterAsyncAzureNative(ProvisionRequest provisionRequest, String processID)\n\t\t\tthrows ClusterException {\n\n\t\ttry {\n\n\t\t\t// K8SCluster cluster = new K8SCluster(processID, \"Started\");\n\t\t\t// redisRepo.save(cluster, CacheKeysEnum.CLUSTER_STATUS);\n\n\t\t\tProcess process = startProvisionTask(provisionRequest);\n\n\t\t\tK8SCluster cluster = saveAndGetProvisionStatus(processID, process,\n\t\t\t\t\tClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\n\t\t\tThread.sleep(10000);\n\n\t\t\tif (cluster.getCreateStatus().equals(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\t// to create cluster fields from provision request (kubeDashboard value) is also\n\t\t\t\t// required.\n\t\t\t\tcreateClusterForAzureNative(provisionRequest, processID);\n\n\t\t\t} else {\n\t\t\t\t// Retry once\n\t\t\t}\n\n\t\t\tlogger.info(\"Inside Async process\");\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"Exception Occurred...\", ex);\n\t\t\tthrow new ClusterException(\"Exception occurred in createClusterAsyncAzure..\", ex);\n\t\t}\n\t}", "public CreateClusterRequest(CreateClusterRequest source) {\n if (source.ClusterName != null) {\n this.ClusterName = new String(source.ClusterName);\n }\n if (source.ClusterType != null) {\n this.ClusterType = new String(source.ClusterType);\n }\n if (source.VpcId != null) {\n this.VpcId = new String(source.VpcId);\n }\n if (source.ClusterCIDR != null) {\n this.ClusterCIDR = new String(source.ClusterCIDR);\n }\n if (source.ClusterDesc != null) {\n this.ClusterDesc = new String(source.ClusterDesc);\n }\n if (source.TsfRegionId != null) {\n this.TsfRegionId = new String(source.TsfRegionId);\n }\n if (source.TsfZoneId != null) {\n this.TsfZoneId = new String(source.TsfZoneId);\n }\n if (source.SubnetId != null) {\n this.SubnetId = new String(source.SubnetId);\n }\n if (source.ClusterVersion != null) {\n this.ClusterVersion = new String(source.ClusterVersion);\n }\n if (source.MaxNodePodNum != null) {\n this.MaxNodePodNum = new Long(source.MaxNodePodNum);\n }\n if (source.MaxClusterServiceNum != null) {\n this.MaxClusterServiceNum = new Long(source.MaxClusterServiceNum);\n }\n if (source.ProgramId != null) {\n this.ProgramId = new String(source.ProgramId);\n }\n if (source.KuberneteApiServer != null) {\n this.KuberneteApiServer = new String(source.KuberneteApiServer);\n }\n if (source.KuberneteNativeType != null) {\n this.KuberneteNativeType = new String(source.KuberneteNativeType);\n }\n if (source.KuberneteNativeSecret != null) {\n this.KuberneteNativeSecret = new String(source.KuberneteNativeSecret);\n }\n if (source.ProgramIdList != null) {\n this.ProgramIdList = new String[source.ProgramIdList.length];\n for (int i = 0; i < source.ProgramIdList.length; i++) {\n this.ProgramIdList[i] = new String(source.ProgramIdList[i]);\n }\n }\n }", "@PostMapping\n public KubeClusterDto create(@RequestBody ClusterCreationRequest clusterCreationRequest) {\n return kubeClusterMapper.map(kubeClusterService.create(clusterCreationRequest));\n }", "@Override\n public BrokerCluster generateCluster(String clusterId, int numReplicas, Address address, AddressPlan addressPlan, StandardInfraConfig standardInfraConfig) throws Exception {\n\n KubernetesListBuilder resourcesBuilder = new KubernetesListBuilder();\n\n if (standardInfraConfig != null) {\n String templateName = getTemplateName(address, addressPlan, standardInfraConfig);\n KubernetesList newResources = processTemplate(clusterId, numReplicas, address, templateName, standardInfraConfig);\n resourcesBuilder.addAllToItems(newResources.getItems());\n }\n return new BrokerCluster(clusterId, resourcesBuilder.build());\n }", "public static void main(String[] args) throws IOException{\n\t\tString accessToken = \"<YOUR_ACCESS_TOKEN>\";\n\t\t// The IBM Cloud organization & space to query - case sensitive.\n\t\tString org = \"<YOUR_ORG>\"; // Example: [email protected]\n\t\tString space = \"<YOUR_SPACE>\"; // Example: dev \n\n\t\t// Use TLSv1.2.\n\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t// Create the URL.\n\t\tURL orgsURL = new URL(apiEndpoint + \"/organizations/\" + org + \"/spaces/\" + space + \"/serviceinstances\");\n\t\tHttpURLConnection con = (HttpURLConnection) orgsURL.openConnection();\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"Authorization\", \"Bearer \" + accessToken);\n\t\tcon.setRequestProperty(\"Content-Type\",\"application/json\");\n\t\tcon.setDoOutput(true);\n\n\t\t/* CREATE OPTIONS\n\t\t * Type: The plan type to create.\n\t\t * \t\t\t\t\t\t\tEnum: [\"LibertyCollective\", \"LibertyCore\", \"LibertyNDServer\", \"WASBase\", \"WASCell\", \"WASNDServer\"]\n\t\t *\n\t\t * Name: Name your new service icon in IBM Cloud.\n\t\t *\n\t\t * ApplicationServerVMSize: The size of the virtual machine.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * ControlServerVMSize: The size of the Virtual Machine containing the Collective Controller for a LibertyCollective service instance,\n\t\t * \t\t\t\t\t\t\tor the size of the Virtual Machine containing the DMGR for a WASCell service instance. This is required for\n\t\t * \t\t\t\t\t\t \ttypes \"LibertyCollective\" and \"WASCell\", Illegal argument for the other Types.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * NumberOfApplicationVMs: The number (integer) of application server Virtual Machines to create This is required for types \"LibertyCollective\"\n\t\t * \t\t\t\t\t\t\tand \"WASCell\", Illegal argument for the other Types.\n\t\t *\n\t\t * Software_Level: This is optional for types \"WASBase\", \"WASNDServer\", and \"WASCell\". If one is not specified version \"9.0.0\" will be default.\n\t\t * \t\t\t\t\t\t\tEnum: [\"8.5.5\", \"9.0.0\"]\n\t\t */\n\t\tString createOptionsJSON = \"{\\\"Type\\\":\\\"LibertyCore\\\",\\\"Name\\\":\\\"MyFirstAPIServiceInstance\\\",\\\"ApplicationServerVMSize\\\":\\\"S\\\"}\";\n\n\t\t// Add JSON POST data.\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(createOptionsJSON);\n\t\twr.flush();\n\t\twr.close();\n\n\t\tBufferedReader br = null;\n\t\tif (HttpURLConnection.HTTP_OK == con.getResponseCode()) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t}\n\t\telse {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getErrorStream()));\n\t\t}\n\n\t\tStringBuffer response = new StringBuffer();\n\t\tString line;\n\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tresponse.append(line);\n\t\t}\n\t\tbr.close();\n\n\t\t// Response from the request.\n\t\tSystem.out.println(response.toString());\n\n\t\t/* Example Response for creating a service instance of type \"LibertyCore\"\n\t\t * {\n\t\t * \t\"Status\":\"Active\",\n\t\t * \t\"ApplicationVMInfo\":\n\t\t * \t{\n\t\t * \t\t\"disk\":12.0,\n\t\t * \t\t\"memory\":2048,\"vcpu\":1\n\t\t * \t},\n\t\t * \t\"ServiceInstance\":\n\t\t * \t{\n\t\t * \t\t\"ServiceInstanceID\":\"8b80bac5-4e78-4a87-bb3e-0e4a8fd6d13a\",\n\t\t * \t\t\"ServiceType\":\"LibertyCore\",\n\t\t * \t\t\"SpaceID\":\"esw7jc13-b12a-47jn-9627-06jdu78d98ed\",\n\t\t * \t\t\"OrganizationID\":\"a23w6701-5324-4af8-b593-e9fdffer36a2\",\n\t\t * \t\t\"Name\":\"MyFirstAPIServiceInstance\"\n\t\t * \t}\n\t\t * }\n\t\t */\n\t}", "interface WithCluster {\n /**\n * Specifies cluster.\n * @param cluster the cluster parameter value\n * @return the next definition stage\n*/\n WithNodeCount withCluster(ResourceId cluster);\n }", "public yandex.cloud.api.operation.OperationOuterClass.Operation create(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getCreateMethod(), getCallOptions(), request);\n }", "private ITaskCluster createTaskCluster(ITaskObject... taskObjects) {\n ITaskCluster taskCluster = getTaskManagerConfiguration().getTaskFactory().newTaskCluster();\n taskCluster = getTaskManagerConfiguration().getTaskManagerWriter().saveNewTaskCluster(taskCluster);\n\n return createTaskGraphForTaskCluster(taskCluster, taskObjects);\n }", "public CreateServiceRequest withCluster(String cluster) {\n setCluster(cluster);\n return this;\n }", "public interface ClusterDefinitionService {\n\n /**\n * Returns the local controller node.\n * @return local controller node\n */\n ControllerNode localNode();\n\n /**\n * Returns the set of seed nodes that should be used for discovering other members\n * of the cluster.\n * @return set of seed controller nodes\n */\n Set<ControllerNode> seedNodes();\n\n /**\n * Forms cluster configuration based on the specified set of node\n * information. Assumes subsequent restart for the new configuration to\n * take hold.\n *\n * @param nodes set of nodes that form the cluster\n * @param ipPrefix IP address prefix, e.g. 10.0.1.*\n */\n void formCluster(Set<ControllerNode> nodes, String ipPrefix);\n}", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.operation.OperationOuterClass.Operation> create(\n yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getCreateMethod(), getCallOptions()), request);\n }", "public Ms2Cluster() { super(); }", "public void updateClusterDetails(UpdateClusterRequest callbackRequest) throws JsonProcessingException, IOException {\n\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tString callbackRequestStr = mapper.writeValueAsString(callbackRequest);\n\t\tlogger.info(\"Update Request: \" + callbackRequestStr);\n\t\tArrayList<String> masterNodes = new ArrayList<String>();\n\t\tArrayList<String> workderNodes = new ArrayList<String>();\n\t\t// set cluster id and inventory path.\n\t\tClusterEnv clusterEnv = new ClusterEnv(callbackRequest.getClusterID());\n\t\tclusterEnv.setInventoryPath(getInventoryPath(callbackRequest.getClusterID()));\n\t\t// if provision details are present set it. If request is posted after\n\t\t// provisioning\n\t\tK8SCluster cluster = clusterRepository.findById(callbackRequest.getClusterID());\n\n\t\tif (cluster == null) {\n\t\t\tlogger.info(\"Cluster could not be found in Database... \");\n\t\t\tthrow new ClusterException(\"Cluster could not be found in database..\");\n\t\t}\n\n\t\tif (callbackRequest.getProvisionDetails() != null) {\n\t\t\tfor (ProvisionDetails provDetails : callbackRequest.getProvisionDetails()) {\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"MASTER\") && masterNodes.size() <= 1) {\n\t\t\t\t\tmasterNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t\tif (provDetails.getNodeType().toUpperCase().equals(\"WORKER\")) {\n\t\t\t\t\tworkderNodes.add(provDetails.getPublicIP());\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] kubeMasterIps = new String[masterNodes.size()];\n\t\t\tString[] kubeNodeIps = new String[workderNodes.size()];\n\t\t\tmasterNodes.toArray(kubeMasterIps);\n\t\t\tworkderNodes.toArray(kubeNodeIps);\n\t\t\tclusterEnv.setKubeMasterIps(kubeMasterIps);\n\t\t\tclusterEnv.setKubeNodeIps(kubeNodeIps);\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.PROV_COMPLETED.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t}\n\t\t// if request is posted after create cluster\n\t\tif (callbackRequest.getCreateClusterDetails() != null) {\n//\t\t\tclusterDetails = (ClusterEnv) redisRepo.findById(clusterRequest.getClusterID(),\n//\t\t\t\t\tCacheKeysEnum.CLUSTER_DETAILS);\t\n\n\t\t\tclusterEnv.setApiServerUrl(callbackRequest.getCreateClusterDetails().getKubeApiServerUrl());\n\t\t\t// clusterEnv.setK8sAdminToken(clusterRequest.getCreateClusterDetails().getK8sAdminToken());\n\t\t\tclusterEnv.setK8sDashboardUrl(callbackRequest.getCreateClusterDetails().getK8sDashboadUrl());\n\t\t\t// clusterEnv.setDashboardToken(clusterRequest.getCreateClusterDetails().getDashboardToken());\n\t\t\tclusterEnv.setClusterseqid(cluster.getId());\n\n\t\t\t// If provisioning completed, that means, Azure Native flow. Already record\n\t\t\t// present in clusterenv - hence update\n\t\t\tif (cluster.getCreateStatus().equalsIgnoreCase(ClusterStatusEnum.PROV_COMPLETED.getKeyValue())) {\n\t\t\t\tclusterRepository.updateClusterEnv(clusterEnv);\n\t\t\t} else {\n\t\t\t\tclusterRepository.saveClusterEnv(clusterEnv);\n\t\t\t}\n\n\t\t\t// SAVE Tokens to Vault\n\t\t\tsaveTokensToVault(callbackRequest);\n\n\t\t\tcluster.setCreateStatus(ClusterStatusEnum.READY.getKeyValue());\n\t\t\tclusterRepository.updateClusterStatus(cluster);\n\t\t\tif (callbackRequest.getCreateClusterDetails().getKubeConfig() != null) {\n\n\t\t\t\tlogger.info(\"Kube Cofig from callback request::\"\n\t\t\t\t\t\t+ callbackRequest.getCreateClusterDetails().getKubeConfig().asText());\n\t\t\t} else {\n\t\t\t\tlogger.info(\"Kube Cofig from callback request is null::\");\n\t\t\t}\n\t\t}\n\n\t\tif (callbackRequest.getMonitoringDetails() != null) {\n\t\t\t// TODO - Save montiroting details in database\n\t\t\tlogger.info(\"Monitoring details - Grafana URL- from callback request::\"\n\t\t\t\t\t+ callbackRequest.getMonitoringDetails().getGrafanaUrl());\n\t\t}\n\t\t// redisRepo.save(clusterEnv, CacheKeysEnum.CLUSTER_DETAILS);\n\n\t}", "public void create(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.operation.OperationOuterClass.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateMethod(), getCallOptions()), request, responseObserver);\n }", "Cloud createCloud();", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "public CreateDedicatedBlockStorageClusterResponse createDedicatedBlockStorageClusterWithOptions(CreateDedicatedBlockStorageClusterRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {\n com.aliyun.teautil.Common.validateModel(request);\n java.util.Map<String, Object> query = new java.util.HashMap<>();\n if (!com.aliyun.teautil.Common.isUnset(request.azone)) {\n query.put(\"Azone\", request.azone);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.capacity)) {\n query.put(\"Capacity\", request.capacity);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.dbscId)) {\n query.put(\"DbscId\", request.dbscId);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.dbscName)) {\n query.put(\"DbscName\", request.dbscName);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.period)) {\n query.put(\"Period\", request.period);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.periodUnit)) {\n query.put(\"PeriodUnit\", request.periodUnit);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.regionId)) {\n query.put(\"RegionId\", request.regionId);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.resourceGroupId)) {\n query.put(\"ResourceGroupId\", request.resourceGroupId);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.tag)) {\n query.put(\"Tag\", request.tag);\n }\n\n if (!com.aliyun.teautil.Common.isUnset(request.type)) {\n query.put(\"Type\", request.type);\n }\n\n com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(\n new TeaPair(\"query\", com.aliyun.openapiutil.Client.query(query))\n ));\n com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(\n new TeaPair(\"action\", \"CreateDedicatedBlockStorageCluster\"),\n new TeaPair(\"version\", \"2021-07-30\"),\n new TeaPair(\"protocol\", \"HTTPS\"),\n new TeaPair(\"pathname\", \"/\"),\n new TeaPair(\"method\", \"POST\"),\n new TeaPair(\"authType\", \"AK\"),\n new TeaPair(\"style\", \"RPC\"),\n new TeaPair(\"reqBodyType\", \"formData\"),\n new TeaPair(\"bodyType\", \"json\")\n ));\n return TeaModel.toModel(this.callApi(params, req, runtime), new CreateDedicatedBlockStorageClusterResponse());\n }", "public void create(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.CreateClusterRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.operation.OperationOuterClass.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateMethod(), responseObserver);\n }", "String getClusterName();", "public void addCluster()\r\n\t{\r\n\t\tcluster[nextAvailableCluster()] = true;\r\n\t}", "public Builder setCluster(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n cluster_ = value;\n onChanged();\n return this;\n }", "java.lang.String getClusterName();", "DescribeClustersResult describeClusters(DescribeClustersRequest describeClustersRequest);", "public static void main(String... args) throws SQLException {\n new CreateCluster().runTool(args);\n }", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();", "SqlElasticPoolOperations.DefinitionStages.WithCreate withNewDatabase(String databaseName);", "public static void main(String[] args) throws Exception{\n\t\t\n\t\tSystem.out.println(\"Clustering started\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tArrayList<SyntacticCluster> clusters = (ArrayList<SyntacticCluster>) MinerUtil\n\t\t\t\t.deserialize(\"all_cluster\", false);\n\t\t//ArrayList<SyntacticCluster> allList = allCluster.doClustering();\n\n\t\tArrayList<SemanticCluster> semanticClusterList = new SemanticClusteringer().doClustering(clusters);\n\t\tfor (SemanticCluster semC : semanticClusterList) {\n\t\t\tfor (ICluster clus : semC.getUnits()) {\n\t\t\t\tSyntacticCluster synC = (SyntacticCluster) clus;\n\t\t\t\tsynC.doInnerClustering();\n\t\t\t\t// System.out.print(\"\");\n\t\t\t}\n\t\t\t// System.out.print(\"\");\n\t\t}\n\t\tSystem.out.println(\"Clustering finished\");\n\t\tLogger.log2(semanticClusterList, \"syntactic_semantic_clustering\");\n\t\t\n\t\tCloneSets sets = semanticClusterList.get(0).getUnits().get(0).getCloneSets().get(0).getCloneSets();\n\t\t\n\t\tMinerUtil.serialize(semanticClusterList, \"semantic_clusters\", false);\n\t\tMinerUtil.serialize(sets, \"sets\", false);\n\t\t//ConsoleFormatter.displayClusters(clustersByTopic);\n\t}", "@Override\n\tpublic void execute(DelegateExecution execution) throws Exception {\n\t\tString ip = (String) execution.getVariable(\"ip\");\n\t\tString serviceHome = (String) execution.getVariable(\"serviceHome\");\n\t\tString coRoot = (String) execution.getVariable(\"coRoot\");\n\t\tString customizationId = (String) execution.getVariable(\"customizationId\");\n\t\tHashMap<String, String> data = toscaService.getCloudData(customizationId);\n\n\t\t// TODO al momento è vuoto perchè non lo leggiamo da nulla valutare se\n\t\t// leggerlo dinamicamente o da file di configurazione\n\t\tString privateKeyPath = (String) execution.getVariable(\"privateKeyPath\");\n\t\tString passphrase = (String) execution.getVariable(\"passphrase\");\n\n\t\t// prepare the certificates\n\t\tshellCert(serviceHome, caPath, data.get(\"vmname\"), ip, caPassword);\n\t\t// send the key\n\t\ttransferFile(serviceHome, \"key.pem\", privateKeyPath, passphrase, ip);\n\t\t// send the cert\n\t\ttransferFile(serviceHome, \"cert.pem\", privateKeyPath, passphrase, ip);\n\n\t\t// now that all the pieces are in the machine we can join it to swarm\n\t\tString remote_command = \"systemctl start docker && /usr/bin/docker run -itd --name=swarm-agent --expose=2376 -e SWARM_HOST=:2376 swarm join --advertise=\"\n\t\t\t\t+ ip + \":\" + dockerPort + \" consul://\" + hostip + \":8500\";\n\n\t\tProperties config = new Properties();\n\t\tconfig.put(\"StrictHostKeyChecking\", \"no\"); // without this it cannot\n\t\t\t\t\t\t\t\t\t\t\t\t\t// connect because the host\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key verification fails\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the right way would be to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// somehow get the server\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key and add it to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// trusted keys\n\t\t\t\t\t\t\t\t\t\t\t\t\t// jsch.setKnownHosts()\n\t\t\t\t\t\t\t\t\t\t\t\t\t// https://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/JSch.html#setKnownHosts-java.lang.String-\n\t\t\t\t\t\t\t\t\t\t\t\t\t// see also\n\t\t\t\t\t\t\t\t\t\t\t\t\t// http://stackoverflow.com/a/32858953/28582\n\t\tJSch jsch = new JSch();\n\t\tjsch.addIdentity(privateKeyPath, passphrase);\n\n\t\tSession session = jsch.getSession(ROOT_USER, ip, SSH_PORT);\n\t\tsession.setConfig(config);\n\t\tsession.connect();\n\n\t\tChannelExec channel = (ChannelExec) session.openChannel(\"exec\");\n\t\tint exitStatus = sendCommand(remote_command, channel);\n\t\tlog.debug(\"Command: [\" + remote_command + \"]\");\n\t\tif (exitStatus != 0) {\n\t\t\tlog.debug(\"FAILED - exit status: \" + exitStatus);\n\t\t} else {\n\t\t\tlog.debug(\"Executed successfully\");\n\t\t}\n\t\tchannel.disconnect();\n\t\tsession.disconnect();\n\n\t\tlog.debug(\"in DeployDockerSwarm\");\n\t\t// toscaService.getNodeType(\"\");\n\t\t// dockerService.addMachine(ip, 2376); //SSL\n\t\tString clusterToken = dockerService.addMachine(swarmIp, Integer.parseInt(swarmPort)); // no SSL\n\t\texecution.setVariable(\"clusterToken\", clusterToken);\n\t\tString clusterInfo = dockerService.clusterDetail(clusterToken);\n\t}", "@Override\n protected void before() {\n LOGGER.info(\"Creating cluster operator {} before test per @ClusterOperator annotation on {}\", cc, name(element));\n for (Map.Entry<File, String> entry : yamls.entrySet()) {\n LOGGER.info(\"creating possibly modified version of {}\", entry.getKey());\n deletable.push(entry.getValue());\n\n kubeClient().namespace(annotations(element, Namespace.class).get(0).value());\n kubeClient().clientWithAdmin().applyContent(entry.getValue());\n }\n applyMultipleNamespacesWatcher(element);\n kubeClient().waitForDeployment(CO_DEPLOYMENT_NAME, 1);\n }", "static Cluster clusterProvider(String neptune, int BATCH_SIZE) {\n java.security.Security.setProperty(\"networkaddress.cache.ttl\", \"0\");\n java.security.Security.setProperty(\"networkaddress.cache.negative.ttl\", \"0\");\n\n Cluster.Builder clusterBuilder = Cluster.build()\n .addContactPoint(neptune) // add more ro contact points for load balancing\n .port(8182)\n .enableSsl(true)\n// .keyStore(keyStore) // optional as amazon cert will be used and should be in truststore of server\n// .keyStorePassword(keyStorePassword)\n .channelizer(SigV4WebSocketChannelizer.class)\n .serializer(Serializers.GRAPHBINARY_V1D0)\n .maxInProcessPerConnection(1) // ensure no contention for connections per batch\n .minInProcessPerConnection(1)\n .maxSimultaneousUsagePerConnection(1)\n .minSimultaneousUsagePerConnection(1)\n .maxWaitForConnection(15000)\n .minConnectionPoolSize(BATCH_SIZE)\n .maxConnectionPoolSize(BATCH_SIZE);\n\n return clusterBuilder.create();\n }", "public Builder setClusterName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n endpointConfigCase_ = 2;\n endpointConfig_ = value;\n onChanged();\n return this;\n }", "public CmdCluster(final EncogAnalyst analyst) {\n super(analyst);\n }", "public void createClusters() {\n\t\t/*\n\t\t * double simAvg = documentDao.getSimilarity(avg); double simMax =\n\t\t * documentDao.getSimilarity(max); double simMin =\n\t\t * documentDao.getSimilarity(min);\n\t\t */\n\n\t\t// initClusters();\n\n\t\tList<Document> docList = documentDao.getDocumentListOrderBySimilarity();\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tint i = 0;\n\t\tCluster cluster = clusterList.get(i);\n\t\tfor (Document document : docList) {\n\t\t\twhile (document.getSimilarity() < cluster.getLow()) {\n\t\t\t\tcluster = clusterList.get(++i);\n\t\t\t}\n\t\t\tif (document.getSimilarity() < cluster.getHigh() && document.getSimilarity() >= cluster.getLow()) {\n\t\t\t\tdocument.setClusterId(cluster.getId());\n\t\t\t\tdocumentDao.insertDocument(document);\n\t\t\t}\n\t\t}\n\n\t}", "public interface SwiftClusterNode {\n\n String getId();\n\n String getName();\n\n String getIp();\n\n int getPort();\n\n}", "@Override\n protected void before() {\n LOGGER.info(\"Creating cluster operator with Helm Chart {} before test per @ClusterOperator annotation on {}\", cc, name(element));\n Path pathToChart = new File(HELM_CHART).toPath();\n String oldNamespace = kubeClient().namespace(\"kube-system\");\n InputStream helmAccountAsStream = getClass().getClassLoader().getResourceAsStream(\"helm/helm-service-account.yaml\");\n String helmServiceAccount = TestUtils.readResource(helmAccountAsStream);\n kubeClient().applyContent(helmServiceAccount);\n helmClient().init();\n kubeClient().namespace(oldNamespace);\n helmClient().install(pathToChart, HELM_RELEASE_NAME, allValues);\n }", "void formCluster(Set<ControllerNode> nodes, String ipPrefix);", "private Collection<TopicResource> getClusterTopics(final KafkaSpecsRunnerOptions options) throws ExecutionException, InterruptedException {\n Collection<String> topicNames = (options.topics().isEmpty()) ?\r\n client.listTopics().names().get() :\r\n options.topics();\r\n List<TopicResource> topics = topicNames.stream().map(TopicResource::new).collect(Collectors.toList());\r\n\r\n return new DescribeTopicOperation()\r\n .execute(client, new ResourcesIterable<>(topics), DescribeOperationOptions.withDescribeDefaultConfigs(true), namespace);\r\n }", "public static void setupV1Crds(KubeClusterResource cluster) {\n cluster.replaceCustomResources(CRD_V1_KAFKA);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT_S2I);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER_2);\n cluster.replaceCustomResources(CRD_V1_KAFKA_BRIDGE);\n cluster.replaceCustomResources(CRD_V1_TOPIC);\n cluster.replaceCustomResources(CRD_V1_KAFKA_USER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECTOR);\n cluster.replaceCustomResources(CRD_V1_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "Cluster getRuntimeCluster() throws TimeoutException, InterruptedException;", "Swarm createSwarm();", "@Test\n public void cluster() throws FlywayException {\n flyway.setLocations(\"migration/dbsupport/oracle/sql/cluster\");\n flyway.migrate();\n flyway.clean();\n flyway.migrate();\n }", "private static Map<String, Object> createClusterTemplateArtifact(Object configuration1, Object configuration2, Object configuration3) {\n return\n map(\n \"mpack_instances\",\n list(\n map(\n \"name\", \"HDPCORE\",\n \"version\", \"1.0.0.0\",\n \"configurations\", configuration1,\n \"service_instances\", list(\n map(\n \"name\", \"ZK1\",\n \"type\", \"ZOOKEEPER\",\n \"configurations\", configuration2\n )\n )\n )\n ),\n \"host_groups\",\n list(\n map(\n \"name\", \"hostgroup1\",\n \"host_count\", \"1\"\n )\n ),\n \"configurations\", configuration3\n );\n }", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "public static void main(String args[]){\n ClientConfig remoteConfig = getCluster2();\n\n remoteClient = HazelcastClient.newHazelcastClient(remoteConfig);\n\n Map usCarMap = remoteClient.getMap(\"cars\");\n\n System.out.println(usCarMap.size());\n\n //ClientConfig localConfig = getEUClientConfig();\n Config localConfig = getHCCluster1();\n\n localClient = Hazelcast.newHazelcastInstance(localConfig);\n localClient.getMap(\"cars\");\n\n ClusterReconTask clusterReconTask = new ClusterReconTask(localClient, localClusterName, remoteClient, remoteClusterName);\n\n ClusterReconTask clusterReconTask1 = clusterReconTask;\n\n ClusterReconResults reconResults = null;\n\n try {\n reconResults = clusterReconTask1.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n System.out.println(reconResults.getMissingKeysByMap().size());\n\n System.out.println(reconResults.getMissingKeysByMap().toString());\n\n // Run Repair Task if needed\n if (reconResults.getMissingKeysByMap().size() > 0){\n ClusterRepairTask clusterRepairTask = new ClusterRepairTask(localClient, localClusterName, remoteClient, remoteClusterName, reconResults);\n try {\n clusterRepairTask.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n\n }", "public ProvisionedClustersPropertiesWithoutSecrets() {\n }", "WithPartitionsAndCreate withStandardSku();", "WithReplicasAndCreate withBasicSku();", "public ClusterServicePlanSpec() {\n }", "public interface ClusterControl extends ClusterMetrics {\n\n\t/** \n\t * Used by the master to determine if he is still the master.\n\t * Updates the cluster status last processed timestamp. Cancels\n\t * any usurp actions.\n\t * @param heartBeat true if this message is a heartbeat\n\t */\n\tpublic boolean verifyStatus(boolean heartbeat);\n\t\n\t/**\n\t * Used to send a heartbeat message when no traffic detected.\n\t * Should be configured to send a special message to the main\n\t * cluster thread so the lastProcessed timestamp will be \n\t * updated. \n\t */\n\tpublic void sendHeartbeat();\n\t\n\t/**\n\t * Called when the monitor detects the main thread is not \n\t * processing; stop the soInbound adapter so another instance\n\t * can take over.\n\t */\n\tpublic void stopInbound();\n\t\n\t/**\n\t * Called when a usurper successfully takes over the master\n\t * role; start the soInbound adapter.\n\t */\n\tpublic void startInbound();\n\n\t/**\n\t * Pause the application/instance - if this is a single-source\n\t * application, all instances will be paused; otherwise just\n\t * this instance will be paused.\n\t */\n\tpublic String pause();\n\t\n\t/**\n\t * Resume the application/instance - if this is a single-source\n\t * application, normal master election will occur (if the previous\n\t * master is available, it will most likely resume that role); \n\t * otherwise, just this instance is resumed.\n\t */\n\tpublic String resume();\n\t\n\t/**\n\t * Pause all (non-single-source) application instances. For single-\n\t * source applications, use {@link #pause()}.\n\t * @return\n\t */\n\tpublic String pauseAll();\n\t\n\t/**\n\t * Resume all (non-single-source) application instances. For single-\n\t * source applications, use {@link #resume()}.\n\t * @return\n\t */\n\tpublic String resumeAll();\n\t\n\t/**\n\t * Monitor the state of the master.\n\t */\n\tpublic void doMonitor();\n\n\t/**\n\t * @return the application id.\n\t */\n\tpublic String getApplicationId();\n\n\t/**\n\t * @return a string representing the current status of the application\n\t */\n\tpublic String obtainApplicationStatus();\n /**\n * \n */\n\tpublic int getMessageCount();\n}", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "public Builder setClusterId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n clusterId_ = value;\n onChanged();\n return this;\n }", "private Datacenter createDatacenter(String name){\n List<Host> hostList = new ArrayList<Host>();\n\n for (int i=0; i<HostCount; i++){\n\n // 2. A Machine contains one or more PEs or CPUs/Cores.\n List<Pe> peList = new ArrayList<Pe>();\n\n // 3. Create PEs and add these into a list.\n for (int j=0; j<HostCoreCount; j++){\n peList.add(new Pe(j, new PeProvisionerSimple(HostCoreMips)));\n }\n\n\n //in this example, the VMAllocatonPolicy in use is SpaceShared. It means that only one VM\n //is allowed to run on each Pe. As each Host has only one Pe, only one VM can run on each Host.\n hostList.add(\n new Host(\n i,\n new RamProvisionerSimple(HostRam),\n new BwProvisionerSimple(HostBandwidth),\n HostStorage,\n peList,\n new VmSchedulerSpaceShared(peList)\n )\n );\n }\n\n\n // 5. Create a DatacenterCharacteristics object that stores the\n // properties of a data center: architecture, OS, list of\n // Machines, allocation policy: time- or space-shared, time zone\n // and its price (G$/Pe time unit).\n String arch = \"x86\"; // system architecture\n String os = \"Linux\"; // operating system\n String vmm = \"Xen\";\n double time_zone = 10.0; // time zone this resource located\n double cost = 3.0; // the cost of using processing in this resource\n double costPerMem = 0.05;\t\t// the cost of using memory in this resource\n double costPerStorage = 0.001;\t// the cost of using storage in this resource\n double costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n LinkedList<Storage> storageList = new LinkedList<Storage>();\t//we are not adding SAN devices by now\n\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n // 6. Finally, we need to create a PowerDatacenter object.\n Datacenter datacenter = null;\n\n try {\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return datacenter;\n }", "ClusterSet() {\n }", "interface WithContainerSettings {\n /**\n * Specifies containerSettings.\n * @param containerSettings If the container was downloaded as part of cluster setup then the same container image will be used. If not provided, the job will run on the VM\n * @return the next definition stage\n */\n WithCreate withContainerSettings(ContainerSettings containerSettings);\n }", "SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(String databaseName);", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "@Override // Client and Server\n public void validateClusterSpec(ClusterDescription clusterSpec) throws\n HoyaException {\n super.validateClusterSpec(clusterSpec);\n Set<String> unknownRoles = clusterSpec.getRoleNames();\n unknownRoles.removeAll(knownRoleNames);\n if (!unknownRoles.isEmpty()) {\n throw new BadCommandArgumentsException(\"There is unknown role: %s\",\n unknownRoles.iterator().next());\n }\n providerUtils.validateNodeCount(HBaseKeys.ROLE_WORKER,\n clusterSpec.getDesiredInstanceCount(\n HBaseKeys.ROLE_WORKER,\n 0), 0, -1);\n\n\n providerUtils.validateNodeCount(HBaseKeys.ROLE_MASTER,\n clusterSpec.getDesiredInstanceCount(\n HBaseKeys.ROLE_MASTER,\n 0),\n 0,\n -1);\n }", "public CreateTaskSetRequest withCluster(String cluster) {\n setCluster(cluster);\n return this;\n }", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "private static Datacenter Create_Datacenter(String name){\n\t\t// creating list of host machine \n\t\tList<Host> hostList = new ArrayList<Host>();\n\t\t// creating list of CPU for each host machine, In our simulation with choose 1 core per machine \n\t\tList<Pe> peList1 = new ArrayList<Pe>();\n\t\tint mips = 1000; // computing power of each core\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\tpeList1.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t}\n\t\t// configuring host\n\t\tint hostId=0;\n\t\tint ram = 56320; //host memory 40 GB\n\t\tlong storage = 10240000; //host storage 10000 GB\n\t\tint bw = 102400; // bandwidth 100 Gbps\n\t\t// create first host machine with 4 cores \n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList1,\n \t\t\t\tnew VmSchedulerTimeShared(peList1)\n \t\t\t)\n \t\t);\n\t\t// create another host machine with 1 cores\n\t\tList<Pe> peList2 = new ArrayList<Pe>();\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\t\tpeList2.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t\t}\n\t\thostId++;\n\n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList2,\n \t\t\t\tnew VmSchedulerTimeShared(peList2)\n \t\t\t)\n \t\t);\n\t\t\n\t // configuring datacenter \n\t\tString arch = \"x86\"; // system architecture\n\t\tString os = \"Linux\"; // operating system\n\t\tString vmm = \"Xen\";\n\t\tdouble time_zone = 10.0; // time zone this resource located\n\t\tdouble cost = 3.0; // the cost of using processing in this resource\n\t\tdouble costPerMem = 0.05;\t\t// the cost of using memory in this resource\n\t\tdouble costPerStorage = 0.001;\t// the cost of using storage in this resource\n\t\tdouble costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n\t\tLinkedList<Storage> storageList = new LinkedList<Storage>();\n\t\tDatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n\t\t// creating data center \n\t\tDatacenter datacenter = null;\n\t\ttry {\n\t\t\tdatacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn datacenter;\n\t\t\n\t}", "public static void main(String... args) {\n String endpoint = \"cb.<your endpoint address>.dp.cloud.couchbase.com\";\n String bucketName = \"couchbasecloudbucket\";\n String username = \"user\";\n String password = \"password\";\n // User Input ends here.\n\n ClusterEnvironment env = ClusterEnvironment.builder()\n .securityConfig(SecurityConfig.enableTls(true)\n .trustManagerFactory(InsecureTrustManagerFactory.INSTANCE))\n .ioConfig(IoConfig.enableDnsSrv(true))\n .build();\n\n // Initialize the Connection\n Cluster cluster = Cluster.connect(endpoint,\n ClusterOptions.clusterOptions(username, password).environment(env));\n Bucket bucket = cluster.bucket(bucketName);\n bucket.waitUntilReady(Duration.parse(\"PT10S\"));\n Collection collection = bucket.defaultCollection();\n\n cluster.queryIndexes().createPrimaryIndex(bucketName, CreatePrimaryQueryIndexOptions.createPrimaryQueryIndexOptions().ignoreIfExists(true));\n\n // Create a JSON Document\n JsonObject arthur = JsonObject.create()\n .put(\"name\", \"Arthur\")\n .put(\"email\", \"[email protected]\")\n .put(\"interests\", JsonArray.from(\"Holy Grail\", \"African Swallows\"));\n\n // Store the Document\n collection.upsert(\n \"u:king_arthur\",\n arthur\n );\n\n // Load the Document and print it\n // Prints Content and Metadata of the stored Document\n System.out.println(collection.get(\"u:king_arthur\"));\n\n // Perform a N1QL Query\n QueryResult result = cluster.query(\n String.format(\"SELECT name FROM `%s` WHERE $1 IN interests\", bucketName),\n queryOptions().parameters(JsonArray.from(\"African Swallows\"))\n );\n\n // Print each found Row\n for (JsonObject row : result.rowsAsObject()) {\n System.out.println(row);\n }\n }", "public Builder addClusteringKey(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureClusteringKeyIsMutable();\n clusteringKey_.add(value);\n onChanged();\n return this;\n }", "public CreateClusterOperator pretty(String pretty) {\n put(\"pretty\", pretty);\n return this;\n }", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.ClusterOrBuilder getClusterOrBuilder();", "SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(SqlDatabase database);", "public String zkCluster(String clusterAlias) {\n\t\tString[] zks = SystemConfigUtils.getPropertyArray(clusterAlias + \".zk.list\", \",\");\n\t\tJSONArray targets = new JSONArray();\n\t\tint id = 1;\n\t\tfor (String zk : zks) {\n\t\t\tJSONObject object = new JSONObject();\n\t\t\tobject.put(\"id\", id++);\n\t\t\tobject.put(\"host\", zk.split(\":\")[0]);\n\t\t\tobject.put(\"port\", zk.split(\":\")[1].split(\"/\")[0]);\n\t\t\tobject.put(\"mode\", status(zk.split(\":\")[0], zk.split(\":\")[1]));\n\t\t\tobject.put(\"version\", version(zk.split(\":\")[0], zk.split(\":\")[1]));\n\t\t\ttargets.add(object);\n\t\t}\n\t\treturn targets.toJSONString();\n\t}", "protected boolean isClusterRequired() {\n return true;\n }", "public static void main(String[] args) throws Exception {\n zooKeeper = new ZooKeeper(\"192.168.24.120:2181\",500,new CreateNodeSyn());\n countDownLatch.await();\n String path = zooKeeper.create(\"/zk-test-book-\", \"123\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);\n System.out.println(\"Success create zNode:\" + path);\n String path2 = zooKeeper.create(\"/zk-test-book-\", \"123\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);\n System.out.println(\"Success create zNode:\" + path2);\n }", "public Builder clearClusterName() {\n if (endpointConfigCase_ == 2) {\n endpointConfigCase_ = 0;\n endpointConfig_ = null;\n onChanged();\n }\n return this;\n }", "default void deleteAzureCluster(\n com.google.cloud.gkemulticloud.v1.DeleteAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getDeleteAzureClusterMethod(), responseObserver);\n }", "UpdateClusterResult updateCluster(UpdateClusterRequest updateClusterRequest);", "default void getAzureCluster(\n com.google.cloud.gkemulticloud.v1.GetAzureClusterRequest request,\n io.grpc.stub.StreamObserver<com.google.cloud.gkemulticloud.v1.AzureCluster>\n responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getGetAzureClusterMethod(), responseObserver);\n }", "void setHAPartition(HAPartition clusterPartition);", "private void initSCMHAConfig() {\n // Set configurations required for starting OM HA service, because that\n // is the serviceID being passed to start Ozone HA cluster.\n // Here setting internal service and OZONE_OM_SERVICE_IDS_KEY, in this\n // way in OM start it uses internal service id to find it's service id.\n conf.set(ScmConfigKeys.OZONE_SCM_SERVICE_IDS_KEY, scmServiceId);\n conf.set(ScmConfigKeys.OZONE_SCM_DEFAULT_SERVICE_ID, scmServiceId);\n String scmNodesKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_NODES_KEY, scmServiceId);\n StringBuilder scmNodesKeyValue = new StringBuilder();\n StringBuilder scmNames = new StringBuilder();\n\n for (int i = 1; i <= numOfSCMs; i++) {\n String scmNodeId = SCM_NODE_ID_PREFIX + i;\n scmNodesKeyValue.append(\",\").append(scmNodeId);\n\n String scmAddrKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_ADDRESS_KEY, scmServiceId, scmNodeId);\n String scmHttpAddrKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_HTTP_ADDRESS_KEY, scmServiceId, scmNodeId);\n String scmHttpsAddrKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_HTTPS_ADDRESS_KEY, scmServiceId, scmNodeId);\n String scmRatisPortKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_RATIS_PORT_KEY, scmServiceId, scmNodeId);\n String dnPortKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_DATANODE_ADDRESS_KEY,\n scmServiceId, scmNodeId);\n String blockClientKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY,\n scmServiceId, scmNodeId);\n String ssClientKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY,\n scmServiceId, scmNodeId);\n String scmGrpcPortKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_GRPC_PORT_KEY, scmServiceId, scmNodeId);\n String scmSecurityAddrKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY, scmServiceId,\n scmNodeId);\n\n conf.set(scmAddrKey, \"127.0.0.1\");\n conf.set(scmHttpAddrKey, localhostWithFreePort());\n conf.set(scmHttpsAddrKey, localhostWithFreePort());\n conf.set(scmSecurityAddrKey, localhostWithFreePort());\n conf.set(\"ozone.scm.update.service.port\", \"0\");\n\n int ratisPort = getFreePort();\n conf.setInt(scmRatisPortKey, ratisPort);\n //conf.setInt(\"ozone.scm.ha.ratis.bind.port\", ratisPort);\n\n int dnPort = getFreePort();\n conf.set(dnPortKey, \"127.0.0.1:\" + dnPort);\n scmNames.append(\",localhost:\").append(dnPort);\n\n conf.set(ssClientKey, localhostWithFreePort());\n conf.setInt(scmGrpcPortKey, getFreePort());\n\n String blockAddress = localhostWithFreePort();\n conf.set(blockClientKey, blockAddress);\n conf.set(ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY,\n blockAddress);\n }\n\n conf.set(scmNodesKey, scmNodesKeyValue.substring(1));\n conf.set(ScmConfigKeys.OZONE_SCM_NAMES, scmNames.substring(1));\n }", "boolean hasClusterName();", "DeleteClusterResult deleteCluster(DeleteClusterRequest deleteClusterRequest);", "public static void setupAllCrds(KubeClusterResource cluster) {\n cluster.createCustomResources(TestUtils.CRD_KAFKA);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECT);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECT_S2I);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_MIRROR_MAKER);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_MIRROR_MAKER_2);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_BRIDGE);\n cluster.createCustomResources(TestUtils.CRD_TOPIC);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_USER);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECTOR);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "public void testRuntimeConfigurationClusterName()\n {\n RuntimeConfiguration runtimeConfiguration = new Jonas4xRuntimeConfiguration();\n runtimeConfiguration.setProperty(JonasPropertySet.JONAS_SERVER_NAME, \"foo\");\n runtimeConfiguration.setProperty(JonasPropertySet.JONAS_DOMAIN_NAME, \"bar\");\n runtimeConfiguration.setProperty(JonasPropertySet.JONAS_CLUSTER_NAME, \"jar\");\n\n AbstractRemoteContainer remoteContainer = new Jonas4xRemoteContainer(runtimeConfiguration);\n AbstractJonasRemoteDeployer remoteDeployer = new TestDeployer(remoteContainer);\n RemoteDeployerConfig deployerConfig = remoteDeployer.getConfig();\n\n assertEquals(\"foo\", deployerConfig.getServerName());\n assertEquals(\"bar\", deployerConfig.getDomainName());\n assertEquals(\"jar\", deployerConfig.getClusterName());\n }", "public void addClusterBox(final Cluster cluster) {\n final JPanel label = new JPanel();\n label.setBackground(Browser.PANEL_BACKGROUND);\n label.setLayout(new BoxLayout(label, BoxLayout.Y_AXIS));\n label.add(new JLabel(cluster.getName()));\n for (final Host h : cluster.getHosts()) {\n final StringBuilder hostLabel = new StringBuilder();\n if (!h.isRoot()) {\n hostLabel.append(h.getUsername());\n hostLabel.append('@');\n }\n hostLabel.append(h.getName());\n final String port = h.getSSHPort();\n if (port != null && !\"22\".equals(port)) {\n hostLabel.append(':');\n hostLabel.append(port);\n }\n \n final JLabel nl = new JLabel(\" \" + hostLabel);\n final Font font = nl.getFont();\n final Font newFont = font.deriveFont(\n Font.PLAIN,\n (float) (font.getSize() / 1.2));\n nl.setFont(newFont);\n label.add(nl);\n }\n final JPanel startPanel = new JPanel(new BorderLayout());\n startPanel.setBackground(Browser.PANEL_BACKGROUND);\n clusterBackgrounds.put(cluster, startPanel);\n startPanel.setBorder(new LineBorder(Tools.getDefaultColor(\n \"EmptyBrowser.StartPanelTitleBorder\")));\n final JPanel left = new JPanel();\n left.setBackground(Browser.PANEL_BACKGROUND);\n clusterBackgrounds.put(cluster, startPanel);\n final JCheckBox markWi = new JCheckBox();\n markWi.setBackground(Browser.PANEL_BACKGROUND);\n allCheckboxes.put(cluster, markWi);\n left.add(markWi);\n left.add(label);\n startPanel.add(left, BorderLayout.LINE_START);\n final MyButton loadClusterBtn = loadClusterButton(cluster, markWi);\n startPanel.add(loadClusterBtn, BorderLayout.LINE_END);\n c.fill = GridBagConstraints.HORIZONTAL;\n mainPanel.add(startPanel, c);\n c.gridx++;\n if (c.gridx > 2) {\n c.gridx = 0;\n c.gridy++;\n }\n }", "public static void main(String args[]) throws IOException {\n Settings settings = Settings.builder().put(\"cluster.name\", \"elasticsearch\").build();\r\n //.put(\"xpack.security.user\", \"elastic:changeme\").build();\r\n TransportClient client = new PreBuiltTransportClient(settings)\r\n // client.addTransportAddress(new TransportAddress(InetAddress.getByName(\"localhost\"), 9300));\r\n \r\n //TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)\r\n .addTransportAddress(new TransportAddress(InetAddress.getByName(\"localhost\"), 9300));\r\n //.addTransportAddress(new TransportAddress(InetAddress.getByName(\"host2\"), 9300));\r\n \r\n // client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(\"localhost1\"), 9300));\r\n\r\n // TransportClient client = TransportClient.builder().settings(settings).build()\r\n // .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(\"localhost\"), 9300));\r\n // .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(\"host2\"), 9300));\r\n\r\n client.prepareIndex(\"java-example\", \"_doc\", \"1\")\r\n .setSource(putJsonDocument(\"ElasticSearch: Java\",\r\n \"ElasticSeach provides Java API, thus it executes all operations \"\r\n + \"asynchronously by using client object..\",\r\n new Date(), new String[] { \"elasticsearch\" }, \"Hüseyin Akdoğan\"))\r\n .execute().actionGet();\r\n //\r\n // client.prepareIndex(\"kodcucom\", \"article\", \"2\")\r\n // .setSource(putJsonDocument(\"Java Web Application and ElasticSearch (Video)\",\r\n // \"Today, here I am for exemplifying the usage of ElasticSearch which is an open source, distributed \" +\r\n // \"and scalable full text search engine and a data analysis tool in a Java web application.\",\r\n // new Date(),\r\n // new String[]{\"elasticsearch\"},\r\n // \"Hüseyin Akdoğan\")).execute().actionGet();\r\n\r\n getDocument(client, \"java-example\", \"_doc\", \"1\");\r\n\r\n // updateDocument(client, \"java-example\", \"article\", \"1\", \"title\", \"ElasticSearch: Java API\");\r\n //getDocument(client, \"java-example\", \"_doc\", \"1\");\r\n // updateDocument(client, \"kodcucom\", \"article\", \"1\", \"tags\", new String[]{\"bigdata\"});\r\n\r\n // getDocument(client, \"kodcucom\", \"article\", \"1\");\r\n\r\n //searchDocument(client, \"cars\", \"_doc\", \"title\", \"honda is a korean company\");\r\n\r\n // deleteDocument(client, \"kodcucom\", \"article\", \"1\");\r\n\r\n client.close();\r\n }" ]
[ "0.7459931", "0.7029379", "0.6686843", "0.66780263", "0.6622976", "0.65842104", "0.65315104", "0.63852733", "0.634054", "0.6250504", "0.6017553", "0.59980327", "0.5941573", "0.5847473", "0.58246535", "0.5808297", "0.57972383", "0.5773711", "0.57218", "0.5689991", "0.5651985", "0.5498482", "0.547738", "0.5461519", "0.5433314", "0.53951687", "0.5371246", "0.53683704", "0.5362099", "0.5348056", "0.5323741", "0.5310785", "0.5287572", "0.5273373", "0.52533555", "0.52518517", "0.5245119", "0.52346593", "0.5225613", "0.52031577", "0.5197262", "0.51760405", "0.51720196", "0.5162325", "0.5158313", "0.51510656", "0.5149022", "0.5144557", "0.51222664", "0.5120542", "0.5104153", "0.509567", "0.5092892", "0.5092892", "0.5092892", "0.5092892", "0.5092892", "0.5092892", "0.5086169", "0.5081778", "0.507941", "0.5073224", "0.5066186", "0.50551736", "0.50437915", "0.50437915", "0.50437915", "0.50437915", "0.50437915", "0.50437915", "0.50345874", "0.502859", "0.50246555", "0.50243825", "0.49992347", "0.49992347", "0.49905804", "0.49821788", "0.49790716", "0.49717912", "0.49589127", "0.49569786", "0.49545285", "0.4952945", "0.49354762", "0.4933627", "0.49298742", "0.49275506", "0.49242887", "0.49223492", "0.48959652", "0.48953608", "0.48935488", "0.48815176", "0.48802286", "0.48786628", "0.48754776", "0.483923", "0.48379928", "0.4822011" ]
0.58828264
13
created by dduru on 26/09/2018
@Repository public interface StateRepository extends JpaRepository<State, Long> { Optional<State> findByName(String name); Optional<State> findByNameContaining(String name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void func_104112_b() {\n \n }", "public final void mo51373a() {\n }", "@Override\n public void perish() {\n \n }", "public void mo38117a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void mo4359a() {\n }", "private stendhal() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n protected void getExras() {\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}", "protected boolean func_70814_o() { return true; }", "private void poetries() {\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 }", "public void mo12628c() {\n }", "@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}", "public void mo12930a() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public void mo6081a() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo1531a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void m50366E() {\n }", "public void mo9848a() {\n }", "protected void mo6255a() {\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "public void mo55254a() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public Pitonyak_09_02() {\r\n }", "private void kk12() {\n\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void mo21877s() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private void getStatus() {\n\t\t\n\t}", "private zza.zza()\n\t\t{\n\t\t}", "public void gored() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "public final void mo91715d() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo21878t() {\n }", "public static void listing5_14() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public abstract void mo70713b();", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public void mo115190b() {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "public void mo21825b() {\n }", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "public void mo3376r() {\n }", "public void mo3749d() {\n }", "public void mo21794S() {\n }", "static void feladat4() {\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "public void mo23813b() {\n }", "public void mo21779D() {\n }", "@Override\n\t\t\tpublic int describeContents() {\n\t\t\t\treturn 0;\n\t\t\t}", "public void skystonePos6() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public void skystonePos4() {\n }", "public abstract void mo56925d();", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\n public int getOrder() {\n return 0;\n }", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "public void mo21795T() {\n }" ]
[ "0.5638022", "0.55852723", "0.5583161", "0.5471768", "0.5429931", "0.5401798", "0.5392817", "0.5381514", "0.53715146", "0.5356211", "0.53315574", "0.53315574", "0.5329959", "0.5325976", "0.526626", "0.526626", "0.526626", "0.526626", "0.526626", "0.526626", "0.526626", "0.5224856", "0.5209814", "0.5205735", "0.52054304", "0.5203102", "0.5193352", "0.51877344", "0.5185574", "0.51536375", "0.51460063", "0.51442194", "0.51290184", "0.5126935", "0.5117822", "0.51146597", "0.5110044", "0.5102765", "0.5082173", "0.5076711", "0.5074023", "0.50601196", "0.5059243", "0.5051745", "0.5042957", "0.5041672", "0.50368", "0.5034075", "0.5018741", "0.50004303", "0.50001526", "0.49989158", "0.49934775", "0.49892882", "0.4982488", "0.4978611", "0.49596483", "0.49535063", "0.4952442", "0.49514255", "0.49383557", "0.49285686", "0.4925816", "0.49130136", "0.4910872", "0.49095464", "0.49074286", "0.48963255", "0.48944634", "0.48879892", "0.48877743", "0.48877743", "0.48877743", "0.48877743", "0.48877743", "0.48877743", "0.48801863", "0.48776454", "0.4867997", "0.48586544", "0.48522598", "0.48522598", "0.48500127", "0.4849963", "0.48482376", "0.48415238", "0.483944", "0.48365474", "0.48354068", "0.48346132", "0.48320752", "0.48313522", "0.48251325", "0.4823721", "0.48220474", "0.48220474", "0.48150086", "0.4813931", "0.4812346", "0.4808388", "0.48071736" ]
0.0
-1
Generateur de cle RSA
public String[] keyGen(){ p1 = BigInteger.probablePrime(N / 2, random); p2 = BigInteger.probablePrime(N / 2, random); phi0 = (p1.subtract(one)).multiply(p2.subtract(one)); BigInteger modulus = p1.multiply(p2); BigInteger privateKey = setPrivateKey(modulus); BigInteger publicKey = privateKey.modInverse(phi0); /* Retourne un tableau de 3 chaine de caractere contenant dans cette ordre */ /* cle publique, modulus, cle prive */ String tab[] = {publicKey + "", modulus + "", privateKey + ""}; return tab; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }", "static void generate() throws Exception {\n\t\t\n\t\tKeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyGenerator.initialize(2048);\n\t\tKeyPair kp = keyGenerator.genKeyPair();\n\t\tRSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();\n\t\tRSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();\n\t\t\n\t\tSystem.out.println(\"RSA_public_key=\"+Base64.getEncoder().encodeToString(publicKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_private_key=\"+Base64.getEncoder().encodeToString(privateKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_public_key_exponent=\"+ Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(publicKey.getPublicExponent())));\n\t\tSystem.out.println(\"RSA_private_key_exponent=\"+Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(privateKey.getPrivateExponent())));\n\t}", "public GenRSAKey() {\n initComponents();\n }", "public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }", "public ProyectoRSA(int tamPrimo) {\n this.tamPrimo = tamPrimo;\n\n generaClaves(); //Generamos e y d\n\n }", "public void generateKey() {\n\twhile(true){\n\t rsaKeyA = (int)(Math.random()*20000 + 26);\n\t if(isPrime(rsaKeyA)){\n\t\tbreak;\n\t }\n\t}\n\twhile(true){\n\t rsaKeyB = (int)(Math.random()* 20000 + 26);\n\t if(isPrime(rsaKeyB)&& rsaKeyB != rsaKeyA){\n\t\tbreak;\n\t }\n\t}\n \n }", "public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }", "public KeyPair generadorAleatori() {\n KeyPair keys = null;\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(2048);\n keys = keyGen.genKeyPair();\n } catch (Exception e) {\n System.err.println(\"Generador no disponible.\");\n }\n return keys;\n }", "public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}", "public void generateKeys()\n\t{\n\t\tmyP = BigInteger.probablePrime(myView.getBitLength(), rand());\n\t\tmyQ = BigInteger.probablePrime(myView.getBitLength(), rand());\n\t\tif(confirmPrimes(myP, myQ))\n\t\t{\n\t\t\tpublicKey = myP.multiply(myQ);\n\t\t\tmyView.displayPublicKey(publicKey.toString());\n\t\t\tmyPhi = (myP.subtract(BigInteger.ONE).multiply(myQ.subtract(BigInteger.ONE)));\n\t\t\tprivateKey = E.modInverse(myPhi);\n\t\t\tmyView.displayPrivateKey(privateKey.toString());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgenerateKeys();\n\t\t}\n\t}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "public RSAKeyContents generateKeys() {\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\tButtermilkRSAKeyPairGenerator kpGen = new ButtermilkRSAKeyPairGenerator();\r\n\t\t\tkpGen.init(new RSAKeyGenerationParameters(DEFAULT_PUBLIC_EXPONENT, rand, KEY_STRENGTH, CERTAINTY));\r\n\t\t\treturn kpGen.generateKeys();\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}", "String publicKey();", "public RSAKeyPairGenerator() {\n }", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void generateKeys() {\r\n try {\r\n SecureRandom random = SecureRandom.getInstance(Constants.SECURE_RANDOM_ALGORITHM);\r\n KeyPairGenerator generator = KeyPairGenerator.getInstance(Constants.ALGORITHM);\r\n generator.initialize(Constants.KEY_BIT_SIZE, random);\r\n \r\n KeyPair keys = generator.genKeyPair();\r\n \r\n persistPrivateKey(keys.getPrivate().getEncoded());\r\n persistPublicKey(keys.getPublic().getEncoded());\r\n logger.log(Level.INFO, \"Done with generating persisting Public and Private Key.\");\r\n \r\n } catch (NoSuchAlgorithmException ex) {\r\n logger.log(Level.SEVERE, \"En error occured while generating the Public and Private Key\");\r\n }\r\n }", "OpenSSLKey mo134201a();", "private BigInteger setPrivateKey(BigInteger modulus){\n BigInteger privateKey = null;\n \n do {\n \tprivateKey = BigInteger.probablePrime(N / 2, random);\n }\n /* n'a aucun autre diviseur que 1 */\n while (privateKey.gcd(phi0).intValue() != 1 ||\n /* qu'il est plus grand que p1 et p2 */\n privateKey.compareTo(modulus) != -1 ||\n /* qu'il est plus petit que p1 * p2 */\n privateKey.compareTo(p1.max(p2)) == -1);\n \n return privateKey;\n }", "public void generateKeys() {\n\t\t// p and q Length pairs: (1024,160), (2048,224), (2048,256), and (3072,256).\n\t\t// q must be a prime; choosing 160 Bit for q\n\t\tSystem.out.print(\"Calculating q: \");\n\t\tq = lib.generatePrime(160);\n\t\tSystem.out.println(q + \" - Bitlength: \" + q.bitLength());\n\t\t\n\t\t// p must be a prime\n\t\tSystem.out.print(\"Calculating p \");\n\t\tp = calculateP(q);\n\t System.out.println(\"\\np: \" + p + \" - Bitlength: \" + p.bitLength());\n\t System.out.println(\"Test-Division: ((p-1)/q) - Rest: \" + p.subtract(one).mod(q));\n\t \n\t // choose an h with (1 < h < p−1) and try again if g comes out as 1.\n \t// Most choices of h will lead to a usable g; commonly h=2 is used.\n\t System.out.print(\"Calculating g: \");\n\t BigInteger h = BigInteger.valueOf(2);\n\t BigInteger pMinusOne = p.subtract(one);\n\t do {\n\t \tg = h.modPow(pMinusOne.divide(q), p);\n\t \tSystem.out.print(\".\");\n\t }\n\t while (g == one);\n\t System.out.println(\" \"+g);\n\t \n\t // Choose x by some random method, where 0 < x < q\n\t // this is going to be the private key\n\t do {\n\t \tx = new BigInteger(q.bitCount(), lib.getRandom());\n }\n\t while (x.compareTo(zero) == -1);\n\t \n\t // Calculate y = g^x mod p\n\t y = g.modPow(x, p);\n\t \n System.out.println(\"y: \" + y);\n System.out.println(\"-------------------\");\n System.out.println(\"Private key (x): \" + x);\n\t}", "public int generateKey() {\n SecureRandom secureRandom = new SecureRandom();\n try {\n secureRandom = SecureRandom.getInstance(\"SHA1PRNG\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return secureRandom.nextInt(26);\n }", "public void genKeyPair(BigInteger p, BigInteger q)\n {\n n = p.multiply(q);\n BigInteger PhiN = RSA.bPhi(p, q);\n do {\n e = new BigInteger(2 * SIZE, new Random());\n } while ((e.compareTo(PhiN) != 1)\n || (Utils.bigGCD(e,PhiN).compareTo(BigInteger.ONE) != 0));\n d = RSA.bPrivateKey(e, p, q);\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }", "@Override\n public String generateKey(int round) {\n return this.key.substring(4 * round, 4 * round + 16);\n }", "RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }", "private byte[][] ECDSAgeneratePublicAndPrivateKey(){\r\n int length = 0;\r\n byte[][] keys;\r\n \r\n do{\r\n \r\n\tECKeyPairGenerator gen = new ECKeyPairGenerator();\r\n\tSecureRandom secureRandom = new SecureRandom();\r\n X9ECParameters secnamecurves = SECNamedCurves.getByName(\"secp256k1\");\r\n\tECDomainParameters ecParams = new ECDomainParameters(secnamecurves.getCurve(), secnamecurves.getG(), secnamecurves.getN(), secnamecurves.getH());\r\n\tECKeyGenerationParameters keyGenParam = new ECKeyGenerationParameters(ecParams, secureRandom);\r\n\tgen.init(keyGenParam);\r\n\tAsymmetricCipherKeyPair kp = gen.generateKeyPair();\r\n\tECPrivateKeyParameters privatekey = (ECPrivateKeyParameters)kp.getPrivate();\r\n\tECPoint dd = secnamecurves.getG().multiply(privatekey.getD());\r\n\tbyte[] publickey=new byte[65];\r\n\tSystem.arraycopy(dd.getY().toBigInteger().toByteArray(), 0, publickey, 64-dd.getY().toBigInteger().toByteArray().length+1, dd.getY().toBigInteger().toByteArray().length);\r\n\tSystem.arraycopy(dd.getX().toBigInteger().toByteArray(), 0, publickey, 32-dd.getX().toBigInteger().toByteArray().length+1, dd.getX().toBigInteger().toByteArray().length);\r\n\tpublickey[0]=4;\r\n length = privatekey.getD().toByteArray().length;\r\n keys = new byte[][]{privatekey.getD().toByteArray(),publickey};\r\n \r\n }while(length != 32);\r\n\treturn keys;\r\n}", "BigInteger getCEP();", "private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }", "public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }", "java.lang.String getPubkey();", "private static void keyPairGenerator() throws NoSuchAlgorithmException, IOException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n kpg.initialize(2048);\n KeyPair keyPair = kpg.generateKeyPair();\n\n //Get public and private keys\n Key publicKey = keyPair.getPublic();\n Key privateKey = keyPair.getPrivate();\n\n String outFile = files_path + \"/Client_public\";\n PrintStream out = null;\n out = new PrintStream(new FileOutputStream(outFile + \".key\"));\n out.write(publicKey.getEncoded());\n out.close();\n\n outFile = files_path + \"/Client_private\";\n out = new PrintStream(new FileOutputStream(outFile + \".key\"));\n out.write(privateKey.getEncoded());\n out.close();\n\n System.err.println(\"Private key format: \" + privateKey.getFormat());\n // prints \"Private key format: PKCS#8\" on my machine\n\n System.err.println(\"Public key format: \" + publicKey.getFormat());\n // prints \"Public key format: X.509\" on my machine\n\n }", "public int generateOTP(String key){\n int len =4;\n\n int OTP;\n String numbers = \"0123456789\";\n Random rndm_method = new Random();\n\n char[] otp = new char[len];\n\n for (int i = 0; i < len; i++)\n {\n otp[i] =\n numbers.charAt(rndm_method.nextInt(numbers.length()));\n }\n OTP = Integer.parseInt(String.valueOf(otp));\n otpCache.put(key, OTP);\n return OTP;\n }", "public C4252xc mo41790a() {\n return C4252xc.AES_RSA;\n }", "protected String generateKey(){\n Random bi= new Random();\n String returnable= \"\";\n for(int i =0;i<20;i++)\n returnable += bi.nextInt(10);\n return returnable;\n }", "private void prga(){\n int i = 0;\n int a = 0;\n int b = 0;\n StringBuilder sb = new StringBuilder();\n fileEncrypted.clear();\n\n byte[] code = new byte[filePlain.size()];\n while (i<filePlain.size()){\n a = (a + 1) % 256;\n b = (b + s_box.get(a)) % 256;\n Collections.swap(s_box, a, b);\n\n int key_int = s_box.get((s_box.get(a) + s_box.get(b))% 256);\n byte cypher = (byte) (key_int^filePlain.get(i));\n\n fileEncrypted.add(cypher);\n sb.append((char)cypher);\n code[i] = cypher;\n i++;\n }\n\n System.out.println(\"aaa\");\n// export file\n Helper.exportFile(code, extension, true);\n }", "String getPublicKey();", "BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }", "private static String encode(String license,String D, String N) {\n int MAX_ENCRYPT_BLOCK = 128;\n int offSet = 0;\n byte[] cache;\n int i = 0;\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n\n try {\n RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\n KeyFactory keyFactory = java.security.KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\n\n Cipher cipher = javax.crypto.Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.ENCRYPT_MODE,privateKey);\n\n byte[] data = license.getBytes(StandardCharsets.UTF_8);\n int inputLen = data.length;\n // 对数据分段加密\n while (inputLen - offSet > 0) {\n if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\n cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\n } else {\n cache = cipher.doFinal(data, offSet, inputLen - offSet);\n }\n out.write(cache, 0, cache.length);\n i++;\n offSet = i * MAX_ENCRYPT_BLOCK;\n }\n byte[] datas = out.toByteArray();\n out.close();\n\n System.out.println(\"datas:\"+datas.length);\n\n // byte[] datas = datas = cipher.doFinal(license.getBytes());\n datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\n return new String(datas,StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n } catch (NoSuchPaddingException e) {\n e.printStackTrace();\n } catch (InvalidKeyException e) {\n e.printStackTrace();\n } catch (BadPaddingException e) {\n e.printStackTrace();\n } catch (IllegalBlockSizeException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public String generateMP() {\n\t\t\tString characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~`!@#$%^&*()-_=+[{]}\\\\|;:\\'\\\",<.>/?\";\n\t\t\tString pwd = RandomStringUtils.random(15, 0, 0, false, false, characters.toCharArray(), new SecureRandom());\n\t\t\treturn pwd;\n\t\t}", "java.lang.String getPublicEciesKey();", "@Test\n public void testRandomization() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Set<String> signatures = new HashSet<String>();\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n signer.initSign(priv);\n signer.update(messageBytes);\n byte[] signature = signer.sign();\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"Failed to generat signatures:\" + ex);\n return;\n }\n }", "public String encrypt(String word){\n\tint modulus = rsaKeyA * rsaKeyB;\n\tint totient = (rsaKeyA - 1)*(rsaKeyB - 1);\n\tpublicE = calculateExponent(totient);\n\tprivateD = 1 + ((int)Math.random()*10)*totient;\n \n\tif(word == null||word.length()==0) throw new IllegalArgumentException();\n\tString result = \"\";\n\tString wordLower = word.toLowerCase();\n\n\tfor(int i=0; i<wordLower.length(); i++){\n\t if(wordLower.charAt(i)<97 || wordLower.charAt(i)>122)\n\t\tthrow new IllegalArgumentException();\n\t int a = (wordLower.charAt(i)-97);\n\t int b = (int)Math.pow(a,publicE);\n\t int k = (b%26)+97;\n\t result += Character.toString((char)k);\n\t}\n\treturn result;\n }", "private String generateSecretKey(){\n SecureRandom random = new SecureRandom();\n byte[] bytes = new byte[20];\n\n random.nextBytes(bytes);\n Base32 base32 = new Base32();\n return base32.encodeToString(bytes);\n }", "public RSAKeyContents generateKeys(char [] password) {\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\tButtermilkRSAKeyPairGenerator kpGen = new ButtermilkRSAKeyPairGenerator(password);\r\n\t\t\tkpGen.init(new RSAKeyGenerationParameters(DEFAULT_PUBLIC_EXPONENT, rand, KEY_STRENGTH, CERTAINTY));\r\n\t\t\treturn kpGen.generateKeys();\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}", "public ICMGenerator() {\n super(Registry.ICM_PRNG);\n }", "java.lang.String getPublicKey();", "static KeyPair generateKeyPair() throws NoSuchAlgorithmException {\n\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(ALGORITHM);\n\n keyGen.initialize(2048);\n\n //Log.e(TAG, \"generateKeyPair: this is public key encoding \" + Arrays.toString(generateKeyPair.getPrivate().getEncoded()));\n\n return keyGen.generateKeyPair();\n }", "ArrayList<ExportedKeyData> generatePublicKeyList();", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "public void generateEphemeralKey(){\n esk = BIG.randomnum(order, rng); //ephemeral secret key, x\n epk = gen.mul(esk); //ephemeral public key, X = x*P\n }", "public String getPublicKey();", "public RSAKey(BigInteger n, BigInteger ed) {\n this.n = n;\n this.ed = ed;\n }", "public ECP getKGCRandomKey(){return R;}", "public void generateKeyPair() {\n\t\ttry {\n\t\t\tKeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"DSA\", \"SUN\");\n\t\t\tSecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n\t\t\tkeyGen.initialize(1024, random);\n\t\t\tKeyPair pair = keyGen.generateKeyPair();\n\t\t\tprivateKey = pair.getPrivate();\n\t\t\tpublicKey = pair.getPublic();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public byte[] getRSAKeyById(String id) throws IOException, DecoderException {\n // TODO: bring that back after LocalEGA key server becomes able to register itself against Eureka\n // ResponseEntity<Resource> responseEntity =\n // restTemplate.getForEntity(keyServiceURL + \"/temp/rsa/\" + id, Resource.class);\n\n String rawKey = IOUtils.toString(new URL(keyServiceURL + \"/temp/rsa/\" + id).openStream(), Charset.defaultCharset());\n System.out.println(\"DEBUG getRSAKey: rawKey=\" + rawKey);\n String privateKey = String.valueOf(rawKey);\n byte[] privateKeyBytes = Hex.decodeHex(privateKey.toCharArray());\n try (PemReader pemReader = new PemReader(new InputStreamReader(new ByteArrayInputStream(privateKeyBytes)))) {\n return pemReader.readPemObject().getContent();\n }\n }", "@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }", "public java.security.cert.X509Certificate generate(java.security.PrivateKey r1, java.lang.String r2, java.security.SecureRandom r3) throws java.security.cert.CertificateEncodingException, java.lang.IllegalStateException, java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generate(java.security.PrivateKey, java.lang.String, java.security.SecureRandom):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generate(java.security.PrivateKey, java.lang.String, java.security.SecureRandom):java.security.cert.X509Certificate\");\n }", "public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }", "public java.security.cert.X509Certificate generate(java.security.PrivateKey r1, java.security.SecureRandom r2) throws java.security.cert.CertificateEncodingException, java.lang.IllegalStateException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generate(java.security.PrivateKey, java.security.SecureRandom):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generate(java.security.PrivateKey, java.security.SecureRandom):java.security.cert.X509Certificate\");\n }", "public static void main(String[] args) {\r\n\t\tUHEPRNG prng = new NumberHg();\r\n\r\n\t\tString key = prng.getKey(UHEPRNG.DEFAULT_KEY_LENGTH);\r\n\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t}", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-08-13 13:14:15.603 -0400\", hash_original_method = \"9CA51125BBD9928A127E75CF99CB1D14\", hash_generated_method = \"10D7CA0C3FC5B5A6A133BC7DAAF5C8C5\")\n \npublic PublicKey getPublicKey() {\n return subjectPublicKey;\n }", "private static String genString(){\n final String ALPHA_NUMERIC_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n int pwLength = 14; //The longer the password, the more likely the user is to change it.\n StringBuilder pw = new StringBuilder();\n while (pwLength-- != 0) {\n int character = (int)(Math.random()*ALPHA_NUMERIC_STRING.length());\n pw.append(ALPHA_NUMERIC_STRING.charAt(character));\n }\n return pw.toString(); //\n }", "public String generate(String user_id) {\n\t\t\n\t\tbyte[] buffer = new byte[5 + 5 * 5];\n\t\tnew Random().nextBytes(buffer);\n\t\tBase32 codec = new Base32();\n\t\tbyte[] secretKey = Arrays.copyOf(buffer, 10);\n\t\tbyte[] bEncodedKey = codec.encode(secretKey);\n\n\t\treturn new String(bEncodedKey);\n//\t\tString url = getQRBarcodeURL(user_id, HOST, encodedKey);\n/*\t\t\n \t\ttry {\n\t\t\tconn = dataSrc.getConnection();\n\t\t\tpreStmt = conn.prepareStatement(UpdateOTPKeyQuery);\n\t\t\tpreStmt.setString(1, encodedKey);\n\t\t\tpreStmt.setString(2, user_id);\n\t\t\tret = preStmt.executeUpdate();\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif(preStmt != null) preStmt.close();\n\t\t\t\tif(conn != null) conn.close();\n\t\t\t}catch(Exception e2) {\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// Google OTP 앱에 userName@hostName 으로 저장됨\n\t\t// key를 입력하거나 생성된 QR코드를 바코드 스캔하여 등록\n\t\tmap.put(\"encodedKey\", encodedKey);\n\t\tmap.put(\"url\", url);\n\t\t*/\n//\t\treturn map;\n\t}", "public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);", "public String getKeyPrivate() throws LibMCryptException {\n\t\t\r\n\t\tString privateK = priK.getModulus().toString(16);\r\n\t\treturn privateK;\r\n\t}", "public static void main(String[] args) {\n generateKeys(\"DSA\", 1024);\n\n // Generate a 576-bit DH key pair\n generateKeys(\"DH\", 576);\n\n // Generate a 1024-bit RSA key pair\n generateKeys(\"RSA\", 1024);\n }", "public ECP getPublicKGCKey(){return pkS;}", "public String generateKey(long duration) throws Exception;", "@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 jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n btn_1 = new javax.swing.JButton();\n txt_1 = new javax.swing.JTextField();\n txt_2 = new javax.swing.JTextField();\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 txt_3 = new javax.swing.JTextField();\n txt_4 = new javax.swing.JTextField();\n txt_5 = new javax.swing.JTextField();\n txt_6 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jLabel8 = new javax.swing.JLabel();\n caja_1 = new javax.swing.JComboBox<>();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n btn_3 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"CIFRADO RSA\");\n\n jLabel2.setText(\"Número p: \");\n\n jLabel3.setText(\"Número q:\");\n\n btn_1.setText(\"Generar números\");\n btn_1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_1ActionPerformed(evt);\n }\n });\n\n jLabel4.setText(\"Módulo n:\");\n\n jLabel5.setText(\"Cálculo de phi por fórmula:\");\n\n jLabel6.setText(\"Clave pública e:\");\n\n jLabel7.setText(\"Clave privada d:\");\n\n jButton1.setText(\"Generar claves\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jLabel8.setText(\"Logitud de bits de su cifrado\");\n\n caja_1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"8\", \"16\", \"64\", \"512\" }));\n caja_1.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n caja_1ItemStateChanged(evt);\n }\n });\n\n jLabel9.setText(\"Claves\");\n\n jLabel10.setText(\"Primos\");\n\n btn_3.setText(\"Encriptar mensaje\");\n btn_3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_3ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Desencriptar mensaje\");\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 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel8)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(caja_1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txt_4))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txt_3, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel6)\n .addComponent(jLabel7))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btn_3, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txt_5)\n .addComponent(txt_6)))))))\n .addGroup(layout.createSequentialGroup()\n .addGap(124, 124, 124)\n .addComponent(jButton1)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, 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_1)\n .addGap(116, 116, 116))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(143, 143, 143))))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel9))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel10))\n .addGroup(layout.createSequentialGroup()\n .addGap(38, 38, 38)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jLabel3))\n .addGap(3, 3, 3)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txt_1, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)\n .addComponent(txt_2)))\n .addGroup(layout.createSequentialGroup()\n .addGap(86, 86, 86)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 181, 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 .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(12, 12, 12)\n .addComponent(jLabel10)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel8)\n .addComponent(caja_1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txt_1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txt_2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btn_1)\n .addGap(29, 29, 29)\n .addComponent(jLabel9)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(txt_3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(txt_4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(txt_5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7)\n .addComponent(txt_6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jButton1)\n .addGap(18, 18, 18)\n .addComponent(btn_3)\n .addGap(18, 18, 18)\n .addComponent(jButton2)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public static byte[] getEncryptRawKey() {\n\n try {\n /*byte[] bytes64Key = App.RealmEncryptionKey.getBytes(\"UTF-8\");\n KeyGenerator kgen = KeyGenerator.getInstance(\"AES\");\n SecureRandom sr = SecureRandom.getInstance(\"SHA1PRNG\");\n sr.setSeed(bytes64Key);\n kgen.init(128, sr);\n SecretKey skey = kgen.generateKey();\n byte[] raw = skey.getEncoded();*/\n\n byte[] key = new BigInteger(App.RealmEncryptionKey, 16).toByteArray();\n return key;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "void mo33731Pw();", "public String mineSolution(String str) throws NoSuchAlgorithmException {\n String nonce;\n do{\n nonce = str + genString();\n //key = hash(genString());\n } while(!checkHash(hash(nonce)));\n return nonce;\n }", "@Override\r\n\tpublic byte[] nextBytes(int len) {\n\t\tbyte[] bs = new byte[len];\r\n\t\ttry{\r\n\t\t\tSecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\");\t\r\n\t\t\trandom.nextBytes(bs);\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn bs;\r\n\t}", "public String generateOTP(String key) {\n Random random = new Random();\n int otp = 100000 + random.nextInt(900000);\n otpCache.put(key, otp);\n return String.valueOf(otp);\n }", "void genKey(){\n Random rand = new Random();\n int key_length = 16;\n String key_alpha = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n StringBuilder sb = new StringBuilder(key_length);\n for(int i = 0; i < key_length; i++){\n int j = rand.nextInt(key_alpha.length());\n char c = key_alpha.charAt(j);\n sb.append(c);\n }\n this.key = sb.toString();\n }", "private static String m5297cj() {\n try {\n KeyGenerator instance = KeyGenerator.getInstance(\"AES\");\n instance.init(128);\n return Base64.encodeToString(instance.generateKey().getEncoded(), 0);\n } catch (Throwable unused) {\n return null;\n }\n }", "public static KeyPair GenrateandEncrypt(String keyname) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException\n\t {\n\t \tKeyPairGenerator kpg;\n\t kpg = KeyPairGenerator.getInstance(\"RSA\");\n kpg.initialize(4096);\n \n KeyPair kp = kpg.genKeyPair();\n PublicKey publicKey = kp.getPublic();\n PrivateKey privateKey = kp.getPrivate();\n\n //save keys \n \n \n String sPublic = Base64.getEncoder().encodeToString( publicKey.getEncoded());\n String sPrivate = Base64.getEncoder().encodeToString( privateKey.getEncoded());\n\n File file1 = new File(keyname+\"public.txt\");\n\t\t\tFileWriter fileWriter1 = new FileWriter(file1);\n\t\t\tfileWriter1.write(sPublic);\n\t\t\t\n\t\t\t\n\t\t\tFile file2 = new File(keyname+\"private.txt\");\n\t\t\tFileWriter fileWriter2 = new FileWriter(file2);\n\t\t\tfileWriter2.write(sPrivate);\n\t\t\t \n fileWriter1.flush();\n fileWriter1.close();\n \n fileWriter2.flush();\n fileWriter2.close();\n ////////////\n \n return kp;\n\t }", "public void testExtensionsRSA() throws Exception\n\t{\n\t\t//TODO: test does not validate: either fix test or fix the function\n\t\tm_random.setSeed(355582912);\n\t\ttestExtensions(new RSATestKeyPairGenerator(m_random));\n\t}", "public KpubData generateKpub(String dataToKpubCheck)\r\n\t\t\tthrows LibMCryptException {\n\r\n\t\tKeyPair keyPair = CryptoTools.generateKeyPair();\r\n\t\t\r\n\t\tRSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();\r\n\t\t\r\n\r\n\t\tString publicK = publicKey.getModulus().toString(16);\r\n\t\t\r\n\t\tString kPubCheck = null;\r\n\r\n\t\tKpubData ret = new KpubData(publicK, kPubCheck);\r\n\r\n\t\tthis.priK = ((RSAPrivateKey) keyPair.getPrivate());\r\n\r\n\t\t//Log.v(\"generateKpub\", \"key pair generated successfully\");\r\n\r\n\t\treturn ret;\r\n\t}", "@Override\n\tpublic boolean mskSetup(\n\t\t\tBufferedWriter mskWriter,\n\t\t\tBufferedWriter mpkWriter,\n\t\t\tString skparam\n\t)throws NoSuchAlgorithmException, IOException{\n\t\tint bits;\n\n\t\ttry{\n\t\t\tbits = Integer.parseInt(skparam);\n\t\t}catch(Exception e){\n\t\t\tlog.error(\"error parsing skparam for RSA: \"+skparam);\n\t\t\tbits = 2048; //default key size\n\t\t}\n\n\t\tBigInteger p, q, phi;\n\t\tswitch(bits){\n\t\t\tcase 1024:\n\t\t\tcase 2048:\n\t\t\tcase 3072:\n\t\t\tcase 4096:\n// KEYGEN START\nSecureRandom rand = new SecureRandom();\ndo{\n\tdo{\n\t\tq = new BigInteger(bits/2, 16, rand);\n\t\tp = new BigInteger(bits/2, 16, rand);\n\t\tn = p.multiply(q);\n\t}while(!q.isProbablePrime(16)||!p.isProbablePrime(16)||n.bitLength()<bits);\n\tphi = p.subtract(BigInteger.ONE).multiply(q.subtract(BigInteger.ONE));\n\te = new BigInteger(\"65537\");\n}while(!e.gcd(phi).equals(BigInteger.ONE));\n//clear p, q\np = BigInteger.ZERO;\nq = BigInteger.ZERO;\nd = e.modInverse(phi);\n//clear phi\nphi = BigInteger.ZERO;\nbreak;\n// KEYGEN END\n\t\t \tdefault:\n\t \t\t\tthrow new NoSuchAlgorithmException(\"RSA keyGen only supports 1024, 2048, 3072 and 4096 bits.\");\n\t\t}\n\n\t\t//write to msk\n\t\tmskWriter.write(mType + newline);\n\t\tmskWriter.write(d.toString() + newline);\n\t\td = BigInteger.ZERO;\n\t\tmskWriter.write(e.toString() + newline);\n\t\tmskWriter.write(n.toString() + newline);\n\n\t\t//write to mpk\n\t\tmpkWriter.write(mType + newline);\n\t\tmpkWriter.write(e.toString() + newline);\n\t\tmpkWriter.write(n.toString() + newline);\n\t\treturn false;\n\t}", "private static String RSAdecrypt(byte[] signedhash) {\n String ab = new String(signedhash);\n //private keys\n BigInteger e = new BigInteger(\"65537\");\n BigInteger n = new BigInteger(\"2688520255179015026237478731436571621031218154515572968727588377065598663770912513333018006654248650656250913110874836607777966867106290192618336660849980956399732967369976281500270286450313199586861977623503348237855579434471251977653662553\");\n BigInteger m = new BigInteger(ab);\n BigInteger dataHash = m.modPow(e, n);\n String ComputeddataHash = new String(dataHash.toByteArray());\n return ComputeddataHash;\n }", "OctetString getPublicKey();", "public PublicKey makePublicKey() {\n return new PublicKey(encryptingBigInt, primesMultiplied);\n }", "public static KeyPair generatePublicKeyPair(){\r\n\t\ttry {\r\n\t\t\tKeyPairGenerator keyGen = KeyPairGenerator.getInstance(publicKeyAlgorithm);\r\n\t\t\tkeyGen.initialize(PUBLIC_KEY_LENGTH, new SecureRandom());\r\n\t\t\treturn keyGen.generateKeyPair();\r\n\t\t} catch (Exception e) {\r\n\t\t\t// should not happen\r\n\t\t\tthrow new ModelException(\"Internal key generation error - \"+publicKeyAlgorithm+\"[\"+PUBLIC_KEY_LENGTH+\"]\",e);\r\n\t\t}\r\n\t}", "private int generateSecret() {\n int secret = secretGenerator.nextInt();\n while (secretToNumber.containsKey(secret)) {\n secret = secretGenerator.nextInt();\n }\n return secret;\n }", "public static String generateTOTP512(String key, int returnDigits) throws GeneralSecurityException {\n Calendar currentDateTime = getCalendar();\n long timeInMilis = currentDateTime.getTimeInMillis();\n\n String steps = \"0\";\n long T = (timeInMilis - TIME_ZERO) / TIME_SLICE_X;\n steps = Long.toHexString(T).toUpperCase();\n\n // Just get a 16 digit string\n while (steps.length() < 16)\n steps = \"0\" + steps;\n return TOTP.generateTOTP512(key, steps, returnDigits);\n }", "PEKSInitial() {\n\t\tprimeP = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tprimeQ = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tgenerator = new BigInteger(512, new Random());// a 512 bit number, may\n\t\t \t\t\t\t\t\t\t\t\t\t// not prime\n\t\tprimeM = primeP.multiply(primeQ);// compute m=p*q\n\t\tfainM = (primeP.subtract(BigInteger.ONE)).multiply(primeQ\n\t\t\t\t.subtract(BigInteger.ONE));// eluer function of m\n\t\t//keyVector.add(generator);\n\t\t//File outputFile = new File(\"Data Records\\\\123456.txt\");\n\t\t//ht.put(generator,outputFile.getAbsolutePath());\n\t}", "public static X509V3CertificateGenerator GenerateSelfSignedCerteficate(X500Principal dnName1,X500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey, PrivateKey myprivateKey, KeyUsage Keyus ) throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t \n\n\t\t\t //certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new DERSequence(new DERObjectIdentifier(\"2.23.43.6.1.2\")));\n\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t certGen.setIssuerDN(dnName1); // use the same\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t // yesterday\n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t // in 2 years\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\n\t\t\t \n\t \treturn certGen;\n\t \t\n\t }", "private String generateToken () {\n SecureRandom secureRandom = new SecureRandom();\n long longToken;\n String token = \"\";\n for ( int i = 0; i < 3; i++ ) {\n longToken = Math.abs( secureRandom.nextLong() );\n token = token.concat( Long.toString( longToken, 34 + i ) );//max value of radix is 36\n }\n return token;\n }", "public BigInteger getPublicKey()\n {\n\treturn publicKey;\n }", "private static BigInteger[] getPublicKeyOriginal(BigInteger in) \r\n{\r\n\tECNamedCurveParameterSpec spec = ECNamedCurveTable.getParameterSpec(\"secp256k1\"); \r\n\tbyte[] pubKey = spec.getG().multiply(in).getEncoded(false);\r\n\tbyte[] a = new byte[32];\r\n\tbyte[] b = new byte[32];\r\n\tSystem.arraycopy(pubKey, 1, a, 0, 32);\r\n\tSystem.arraycopy(pubKey, 33, b, 0, 32);\r\n\tBigInteger[] erg = new BigInteger[2];\r\n\terg[0] = new BigInteger(1,a);\r\n\terg[1] = new BigInteger(1,b);\r\n\treturn erg;\r\n}", "public java.security.cert.X509Certificate generate(java.security.PrivateKey r1) throws java.security.cert.CertificateEncodingException, java.lang.IllegalStateException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "Encryption encryption();", "public final java.security.AlgorithmParameters generateParameters() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: java.security.AlgorithmParameterGenerator.generateParameters():java.security.AlgorithmParameters, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.AlgorithmParameterGenerator.generateParameters():java.security.AlgorithmParameters\");\n }", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "public static String generateTOTP256(String key, int returnDigits) throws GeneralSecurityException {\n Calendar currentDateTime = getCalendar();\n long timeInMilis = currentDateTime.getTimeInMillis();\n\n String steps = \"0\";\n long T = (timeInMilis - TIME_ZERO) / TIME_SLICE_X;\n steps = Long.toHexString(T).toUpperCase();\n\n // Just get a 16 digit string\n while (steps.length() < 16)\n steps = \"0\" + steps;\n return TOTP.generateTOTP256(key, steps, returnDigits);\n }" ]
[ "0.7560179", "0.7143197", "0.7062719", "0.69894546", "0.68554175", "0.6818818", "0.67810524", "0.6682186", "0.66546065", "0.6612754", "0.6588604", "0.64530474", "0.6441281", "0.6384353", "0.63754994", "0.63354903", "0.63136315", "0.6306024", "0.6236772", "0.6236638", "0.6218464", "0.615935", "0.6132029", "0.60904825", "0.6050664", "0.6018462", "0.6014306", "0.5993775", "0.5980984", "0.5918002", "0.5906843", "0.58980083", "0.58967143", "0.58869743", "0.5874445", "0.5871738", "0.5867218", "0.5843823", "0.5841871", "0.5831648", "0.5830537", "0.5806074", "0.5755431", "0.5693461", "0.5689701", "0.5689143", "0.56880414", "0.5682344", "0.56482285", "0.56362844", "0.5633004", "0.5626012", "0.5607014", "0.5598753", "0.5594039", "0.5593395", "0.5584095", "0.5584044", "0.55820286", "0.55728656", "0.55644506", "0.5557845", "0.553515", "0.55318594", "0.55156386", "0.5512659", "0.5509664", "0.5504082", "0.549692", "0.549427", "0.54868394", "0.5483502", "0.5482974", "0.5478354", "0.54781276", "0.5476867", "0.54761934", "0.5469879", "0.5469404", "0.54668623", "0.5464157", "0.5452622", "0.54463404", "0.54439515", "0.54417026", "0.54254615", "0.5425441", "0.5421174", "0.54211235", "0.5416698", "0.54153955", "0.5409661", "0.5407033", "0.5400138", "0.53992754", "0.5388323", "0.53804064", "0.5377747", "0.5377119", "0.5376052" ]
0.6706177
7
Generation de cles privee
private BigInteger setPrivateKey(BigInteger modulus){ BigInteger privateKey = null; do { privateKey = BigInteger.probablePrime(N / 2, random); } /* n'a aucun autre diviseur que 1 */ while (privateKey.gcd(phi0).intValue() != 1 || /* qu'il est plus grand que p1 et p2 */ privateKey.compareTo(modulus) != -1 || /* qu'il est plus petit que p1 * p2 */ privateKey.compareTo(p1.max(p2)) == -1); return privateKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generate() {\n\t}", "protected abstract void generate();", "@Override\n public String generaCodigo() {\n return \"\";\n }", "public Generateur() {\n }", "public static void generateCode()\n {\n \n }", "public void generarCodigo(){\r\n this.setCodigo(\"c\"+this.getNombre().substring(0,3));\r\n }", "public abstract void generate();", "StringBuffer generateVc(){\n\n StringBuffer r = new StringBuffer();\n\n for(int i = 0; i <= sons.size() - 1; i++)\n r.append(getChildAt(i).toDot());\n \n return r;\n }", "Compleja createCompleja();", "public AbstractGenerateurAbstractSeule() {\r\n\t\tsuper();\r\n\t}", "public int generateRoshambo(){\n ;]\n\n }", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "public String generateCode(){\n return \"P\" + repository.getCount();\n }", "private static void generModeloDePrueba() {\n\t\tCSharpArchIdPackageImpl.init();\n // Retrieve the default factory singleton\n\t\tCSharpArchIdFactory factory = CSharpArchIdFactory.eINSTANCE;\n // create an instance of myWeb\n\t\tModel modelo = factory.createModel();\n\t\tmodelo.setName(\"Prueba\"); \n // create a page\n\t\tCompileUnit cu = factory.createCompileUnit();\n\t\tcu.setName(\"archivo.cs\");\n\t\tClassDeclaration clase = factory.createClassDeclaration();\n\t\t//clase.setName(\"Sumar\");\n\t\t//cu.getTypeDeclaration().add(clase);\n modelo.getCompileUnits().add(cu);\n \n Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;\n Map<String, Object> m = reg.getExtensionToFactoryMap();\n m.put(\"model\", new XMIResourceFactoryImpl());\n\n // Obtain a new resource set\n ResourceSet resSet = new ResourceSetImpl();\n\n // create a resource\n Resource resource = resSet.createResource(URI\n .createURI(\"CSharpArchId.model\"));\n // Get the first model element and cast it to the right type, in my\n // example everything is hierarchical included in this first node\n resource.getContents().add(modelo);\n\n // now save the content.\n try {\n resource.save(Collections.EMPTY_MAP);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\t\t\n // and so on, and so on\n // as you can see the EMF model can be (more or less) used as standard Java\n\t}", "@Override\n\tpublic void generate() {\n\t\tJavaObject object = new JavaObject(objectType);\n\n\t\t// Fields\n\t\taddFields(object);\n\n\t\t// Empty constructor\n\t\taddEmptyConstructor(object);\n\n\t\t// Types constructor\n\t\taddTypesConstructor(object);\n\n\t\t// Clone constructor\n\t\taddCloneConstructor(object);\n\n\t\t// Setters\n\t\taddSetters(object);\n\n\t\t// Build!\n\t\taddBuild(object);\n\n\t\t// Done!\n\t\twrite(object);\n\t}", "public GenerateurImpl() {\n\t\tsuper();\n\t\tthis.value = 0;\n\t}", "@Override\n\tpublic void createccuntNum() {\n\t\t\n\t}", "@Override\n\t\t\tpublic String generate(int depth) {\n\t\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\t\tif(depth == 0) {\n\t\t\t\t\treturn axiom;\n\t\t\t\t}\n\t\t\t\tbuilder.append(generate(depth-1));\n\t\t\t\t\n\t\t\t\tchar[] array = builder.toString().toCharArray();\n\t\t\t\tString result = new String();\n\t\t\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\t\t\tString production = (String) productions.get(array[i]);\n\t\t\t\t\tif(production != null) {\n\t\t\t\t\t\tresult += production;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tresult += array[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}", "public ECP getGen(){return gen;}", "public final String deu() {\n String str;\n AppMethodBeat.i(26738);\n String str2 = \"\";\n synchronized (this) {\n try {\n if (this.iPr == null || this.iPr.size() <= 0) {\n str = \"\";\n } else {\n int i = 0;\n while (i < this.iPr.size()) {\n com.tencent.mm.plugin.wenote.model.a.c cVar = (com.tencent.mm.plugin.wenote.model.a.c) this.iPr.get(i);\n switch (cVar.getType()) {\n case -1:\n str = str2 + \"<hr/>\";\n break;\n case 1:\n i iVar = (i) cVar;\n if (!bo.isNullOrNil(iVar.content)) {\n str2 = str2 + iVar.content;\n if (i + 1 < this.iPr.size() && ((com.tencent.mm.plugin.wenote.model.a.c) this.iPr.get(i + 1)).getType() == 1 && !bo.isNullOrNil(((i) this.iPr.get(i + 1)).content)) {\n str = str2 + \"<br/>\";\n break;\n }\n }\n str = str2 + \"<br/>\";\n break;\n case 2:\n str = str2 + dO(((f) cVar).uOo, 2);\n break;\n case 3:\n str = str2 + dO(((g) cVar).uOo, 3);\n break;\n case 4:\n l lVar = (l) cVar;\n str = str2 + dO(lVar.uOo, lVar.getType());\n break;\n case 5:\n str = str2 + dO(((d) cVar).uOo, 5);\n break;\n case 6:\n str = str2 + dO(((k) cVar).uOo, 6);\n break;\n case 20:\n str = str2 + dO(((com.tencent.mm.plugin.wenote.model.a.b) cVar).uOo, 20);\n break;\n default:\n str = str2;\n break;\n }\n i++;\n str2 = str;\n }\n str = str2.replaceAll(IOUtils.LINE_SEPARATOR_UNIX, \"<br/>\");\n AppMethodBeat.o(26738);\n }\n } finally {\n while (true) {\n AppMethodBeat.o(26738);\n }\n }\n }\n return str;\n }", "public abstract String generate(Object... args);", "protected void generar() {\n generar(1, 1);\n }", "abstract String mo1748c();", "@Override\r\n\tpublic String toString() {\n\t\treturn this.titolo + \" \" +this.autore + \" \" + this.genere;\r\n\t}", "public String generateString() {\n List<Trip<String, String, String>> sequence = super.generateSequence(startTrip, endTrip);\n sequence = sequence.subList(1, sequence.size()-1);\n String generated = \"\";\n for (int i = 0; i<sequence.size()-2; i++) generated += sequence.get(i).getThird() + \" \";\n return generated.substring(0, generated.length()-1);\n }", "private void generateSolution() {\n\t\t// TODO\n\n\t}", "public String toString()\r\n/* 189: */ {\r\n/* 190:321 */ return this.autorizacion;\r\n/* 191: */ }", "private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }", "public void generar() throws Exception {\n\t\tAnalizador_Sintactico.salida.generar(\".DATA\", \"genero los datos estaticos para la clase \"+this.nombre);\r\n\t\tAnalizador_Sintactico.salida.generar(\"VT_\"+nombre+\":\",\" \");\r\n\t\t\r\n\t\tboolean esDinamico=false;\r\n\t\t\r\n\t\t//para cada metodo, genero la etiqueta dw al codigo\r\n\t\tfor (EntradaMetodo m: entradaMetodo.values()) {\r\n\t\t\tif (m.getModificador().equals(\"dynamic\")) {\r\n\t\t\t\tAnalizador_Sintactico.salida.gen_DW(\"DW \"+m.getEtiqueta(),\"offset: \"+m.getOffsetMetodo(),m.getOffsetMetodo());\r\n\t\t\t\tesDinamico=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tAnalizador_Sintactico.salida.agregar_DW();\r\n\t\t\r\n\t\t//si NO hay ningun metodo dinamico -> VT con NOP\r\n\t\tif (! esDinamico)\r\n\t\t\tAnalizador_Sintactico.salida.generar(\"NOP\",\"no hago nada\");\r\n\t\t\r\n\t\t//genero codigo para todos los metodos\r\n\t\tAnalizador_Sintactico.salida.generar(\".CODE\",\"seccion codigo de la clase \"+this.nombre);\r\n\t\t\r\n\t\tList<EntradaPar> listaParams;\r\n\t\tfor(EntradaMetodo m: entradaMetodo.values()) {\r\n\t\t\t//metodo actual es m\r\n\t\t\tAnalizador_Sintactico.TS.setMetodoActual(m);\r\n\t\t\t\r\n\t\t\t//SETEO el offset de sus parametros\r\n\t\t\tlistaParams= m.getEntradaParametros();\r\n\t\t\t\r\n\t\t\tfor(EntradaPar p: listaParams) {\r\n\t\t\t\t//seteo offset de p\r\n\t\t\t\t\r\n\t\t\t\t//si es dinamico m -> offset desde 3\r\n\t\t\t\tif (m.getModificador().equals(\"dynamic\")) {\r\n\t\t\t\t\tp.setOffset((listaParams.size() +4) - p.getUbicacion());\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t//si es estatico m -> offset desde 2\r\n\t\t\t\t\tp.setOffset((listaParams.size() +3) - p.getUbicacion());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//genero el codigo del cuerpo de ese metodo\r\n\t\t\tm.generar();\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//genero codigo para todos los constructores\r\n\t\tfor(EntradaCtor c: entradaCtor.values()) {\r\n\t\t\t//metodo actual es m\r\n\t\t\tAnalizador_Sintactico.TS.setMetodoActual(c);\r\n\t\t\t\r\n\t\t\t//SETEO el offset de sus parametros\r\n\t\t\tlistaParams= c.getEntradaParametros();\r\n\t\t\t\r\n\t\t\tfor(EntradaPar p: listaParams) {\r\n\t\t\t\t//seteo offset de p\r\n\t\t\t\tp.setOffset(listaParams.size() +4 - p.getUbicacion());\t// +4 porque el ctor tiene this\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t//genero el codigo de ese metodo\r\n\t\t\tc.generar();\r\n\t\t}\t\r\n\t}", "public Cgg_jur_anticipo(){}", "public void generTirarDados() {\n\r\n\t}", "private TipoAtaque generateTipoAtaque() {\n\t\treturn null;\r\n\t}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "public void generate() {\n\t\tthis.initializePathBindingClass();\n\t\t// managed at abstract level ; name provided at binding generation time\n\t\t// this.addGetName();\n\t\t// this.addGetType();\n\n\t\t// add all properties methods\n\t\tthis.addProperties();\n\t\t// add getter that provides property list\n\t\tthis.addGetChildBindings();\n\n\t\t// initialize class declaration (*Binding)\n\t\tthis.initializeRootBindingClass();\n\t\t// add constructors\n\t\tthis.addConstructors();\n\t\t// add getWithRoot method\n\t\tthis.addGetWithRoot();\n\t\t// add getSafelyWithRoot method\n\t\tthis.addGetSafelyWithRoot();\n\n\t\tthis.addGeneratedTimestamp();\n\t\tthis.addSerialVersionUID();\n\t\tthis.saveCode(this.pathBindingClass);\n\t\tthis.saveCode(this.rootBindingClass);\n\t}", "public String genCode() {\n StringBuilder childCode = new StringBuilder();\n for (Node node : this.getChildren()) {\n childCode.append(node.genCode());\n }\n return childCode.toString();\n }", "@Override\n\tpublic String parler() {\n\t\treturn \"Je suis un Orc\";\n\t}", "public void genCode(CodeFile code) {\n\t\t\n\t}", "@Override\n public String codeGeneration() {\n StringBuilder localDeclarations = new StringBuilder();\n StringBuilder popLocalDeclarations = new StringBuilder();\n\n if (declarationsArrayList.size() > 0) {\n for (INode dec : declarationsArrayList) {\n localDeclarations.append(dec.codeGeneration());\n popLocalDeclarations.append(\"pop\\n\");\n }\n }\n\n //parametri in input da togliere dallo stack al termine del record di attivazione\n StringBuilder popInputParameters = new StringBuilder();\n for (int i = 0; i < parameterNodeArrayList.size(); i++) {\n popInputParameters.append(\"pop\\n\");\n }\n\n\n String funLabel = Label.nuovaLabelFunzioneString(idFunzione.toUpperCase());\n\n if (returnType instanceof VoidType) {\n // siccome il return è Void vengono rimosse le operazioni per restituire returnvalue\n FunctionCode.insertFunctionsCode(funLabel + \":\\n\" +\n \"cfp\\n\" + //$fp diventa uguale al valore di $sp\n \"lra\\n\" + //push return address\n localDeclarations + //push dichiarazioni locali\n body.codeGeneration() +\n popLocalDeclarations +\n \"sra\\n\" + // pop del return address\n \"pop\\n\" + // pop dell'access link, per ritornare al vecchio livello di scope\n popInputParameters +\n \"sfp\\n\" + // $fp diventa uguale al valore del control link\n \"lra\\n\" + // push del return address\n \"js\\n\" // jump al return address per continuare dall'istruzione dopo\n );\n } else {\n //inserisco il codice della funzione in fondo al main, davanti alla label\n FunctionCode.insertFunctionsCode(funLabel + \":\\n\" +\n \"cfp\\n\" + //$fp diventa uguale al valore di $sp\n \"lra\\n\" + //push return address\n localDeclarations + //push dichiarazioni locali\n body.codeGeneration() +\n \"srv\\n\" + //pop del return value\n popLocalDeclarations +\n \"sra\\n\" + // pop del return address\n \"pop\\n\" + // pop dell'access link, per ritornare al vecchio livello di scope\n popInputParameters +\n \"sfp\\n\" + // $fp diventa uguale al valore del control link\n \"lrv\\n\" + // push del risultato\n \"lra\\n\" + // push del return address\n \"js\\n\" // jump al return address per continuare dall'istruzione dopo\n );\n }\n\n return \"push \" + funLabel + \"\\n\";\n }", "@Override\n public String toString(){\n return \"G(\"+this.getVidas()+\")\";\n }", "@Override\n protected void codeGenMain(DecacCompiler compiler, Registres regs, Pile p) {\n }", "public void generarContrato() {\r\n\t\ttry {\r\n\t\t\tString nombre = Contrato.generarContrato(estudiante, periodo, reserva.getArrSitioPeriodo().getSitNombre());\r\n\t\t\tnombre = \"Contrato_\" + estudiante.getId().getPerDni() + \".zip\";\r\n\t\t\tthis.zip(estudiante.getId().getPerDni(), periodo.getPrdId());\r\n\t\t\tFunciones.descargarZip(url_contrato+ nombre);\r\n\t\t\t// MODIFICAR NOMBRE CONTRATO\r\n\t\t\tmngRes.agregarContratoReserva(estudiante, periodo.getPrdId());\r\n\t\t} catch (Exception e) {\r\n\t\t\tFunciones.descargarPdf(url_contrato + \"error.pdf\");\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public void generete() {\n int minQuantFig = 1,\r\n maxQuantFig = 10,\r\n minNum = 1,\r\n maxNum = 100,\r\n minColor = 0,\r\n maxColor = (int)colors.length - 1,\r\n\r\n // Initialize figures property for random calculations\r\n randomColor = 0,\r\n randomFigure = 0,\r\n\r\n // Squere property\r\n randomSideLength = 0,\r\n\r\n // Circle property\r\n randomRadius = 0,\r\n \r\n // IsoscelesRightTriangle property \r\n randomHypotenus = 0,\r\n \r\n // Trapizoid properties\r\n randomBaseA = 0,\r\n randomBaseB = 0,\r\n randomAltitude = 0;\r\n\r\n // Generate random number to set figueres's quantaty\r\n setFigureQuantaty( generateWholoeNumInRange(minQuantFig, maxQuantFig) );\r\n\r\n for( int i = 0; i < getFigureQuantaty(); i++ ) {\r\n\r\n // Convert double random value to int and close it in range from 1 to number of elements in array\r\n randomFigure = (int)( Math.random() * figures.length );\r\n \r\n randomColor = generateWholoeNumInRange( minColor, maxColor ); // Get random color's index from colors array\r\n\r\n // Create new figure depending on randomFigure \r\n switch (figures[randomFigure]) {\r\n\r\n case \"Circle\":\r\n\r\n randomRadius = generateWholoeNumInRange( minNum, maxNum ); // Get random value of circle's radius;\r\n\r\n Circle newCircle = new Circle( colors[randomColor], randomRadius ); // Initialize Circle with random parameters\r\n\r\n newCircle.drawFigure();\r\n \r\n break;\r\n\r\n case \"Squere\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n Squere newSquere = new Squere( colors[randomColor], randomSideLength ); // Initialize Circle with random parameters\r\n\r\n newSquere.drawFigure();\r\n\r\n break;\r\n\r\n case \"Triangle\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n randomHypotenus = generateWholoeNumInRange( minNum, maxNum ); // Get random value of hypotenus;\r\n\r\n IsoscelesRightTriangle newTriangle = new IsoscelesRightTriangle( colors[randomColor], randomSideLength, randomHypotenus ); // Initialize Circle with random parameters\r\n\r\n newTriangle.drawFigure();\r\n\r\n break;\r\n\r\n case \"Trapezoid\":\r\n\r\n randomBaseA = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side A;\r\n\r\n randomBaseB = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side B;\r\n\r\n randomAltitude = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's altitude;\r\n\r\n Trapezoid newTrapezoid = new Trapezoid( colors[randomColor], randomBaseA, randomBaseB, randomAltitude ); // Create new Trapezoid with random parameters\r\n\r\n newTrapezoid.drawFigure();\r\n\r\n break;\r\n\r\n };\r\n };\r\n }", "@Override\r\n\tpublic void billGenerate() {\n\t\t\r\n\t}", "public String Dime_datos_generales() {\n\t\t\n\t\treturn \"la plataforma del veiculo tiene \"+ rueda+\" ruedas\"+\n\t\t\"\\nmide \"+ largo/1000+\" metros con un ancho de \"+ancho+\n\t\t\"cm\"+\"\\nun peso de platafrorma de \"+peso;\n\t}", "Petunia() {\r\n\t\t}", "Compuesta createCompuesta();", "@Generated\n public Anotacion() {\n }", "protected String toStringAsCode() {\r\n \t\treturn \"<\"+toStringAsElement()+\">\";\r\n \t}", "public Genero getGenero()\r\n/* 143: */ {\r\n/* 144:261 */ return this.genero;\r\n/* 145: */ }", "private static String generateCRString (CRType<?> cr) {\r\n\t\tString res = \"\";\r\n\t\tif (cr.getAU_A() == null) {\r\n\t\t\tif (cr.getAU_L() != null) res += cr.getAU_L() + \", \" + cr.getAU_F().replaceAll(\"([A-Z])\", \"$1.\"); \r\n\t\t} else {\r\n\t\t\tres += cr.getAU_A().replaceAll(\";\", \",\");\r\n\t\t}\r\n\t\tres += \",\";\r\n\t\tif (cr.getTI() != null)\tres += cr.getTI();\r\n\t\tif (cr.getRPY() != null) res += \" (\" + cr.getRPY() + \") \";\r\n\t\tif (cr.getJ_N() != null) res += cr.getJ_N();\r\n\t\tif (cr.getVOL() != null) res += \", \" + cr.getVOL();\r\n\t\tif (cr.getPAG() != null) res += \", pp.\" + cr.getPAG();\r\n\t\tif (cr.getDOI() != null) res += \", DOI \" + cr.getDOI();\r\n\r\n\t\treturn res;\r\n\t}", "public static String generateData() {\n\t\tStringBuilder res = new StringBuilder();\n\t\tres.append(generateID(9));\n\t\tres.append(\",\");\n\t\tres.append(\"Galsgow\");\n\t\tres.append(\",\");\n\t\tres.append(\"UK\");\n\t\tres.append(\",\");\n\t\tres.append(generateDate());\n\t\treturn res.toString();\n\t}", "public static String generatePlate() {\n\t\t\n\t\tString s = \"\";\n\t\t\n\t\tfor (int i=0; i < 3; i++)\n\t\t\ts += generateLetter();\n\t\t\n\t\ts += '-';\n\t\t\n\t\tfor (int i=0; i < 4; i++)\n\t\t\ts += generateDigit();\n\t\t\n\t\treturn s;\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Transactional\n\tprivate void generateGodSet() {\n\t\tMinionCard ex1 = createMinionCard(\"Chatton transcendent\", -2, 1 , 1 , -1, \"Utilise mon energie\",\"img/cardImg/godSet/glow.jpg\");\n\t\tMinionCard ex2 = createMinionCard(\"Reda EX\", -7, 1,1, -2, \"Oh la la.\",\"img/cardImg/godSet/Reda.png\");\n\t\tMinionCard ex3 = createMinionCard(\"François EX\", -12, 1, 1, -3, \"Aujourd'hui On a Oncle Bob\",\"img/cardImg/godSet/Francois.png\");\n\t\t\n\t\tcardRepository.save(ex1);\n\t\tcardRepository.save(ex2);\n\t\tcardRepository.save(ex3);\n\t\t\n\t}", "public void enfoncerRaz() {\n\t\tthis.valC = 0;\n\t\tthis.op = null;\n\t}", "public interface Generator {\n String prepareSql();\n\n String getTemplateName();\n\n String prepareCategorySql();\n\n String getExcludedProductIds();\n\n String getDiscounts();\n\n String fixImageUrl(String imageUrl);\n}", "private IOferta buildOfertaEjemplo4() {\n\t\tPredicate<Compra> condicion = Predicates.alwaysTrue();\n\t\tFunction<Compra, Float> descuento = new DescuentoLlevaXPagaY(\"11-111-1111\", 3, 2);\n\t\treturn new OfertaDinero(\"Lleva 3 paga 2 en Coca-Cola\", condicion,\n\t\t\t\tdescuento);\n\t}", "protected void generate() {\n\t\tcpGenerator( nx, ny, nz, ClosePackedLattice.HCP);\n\t}", "@Override\n\tpublic void generarFactura() {\n\t\t\n\t}", "@Override\n protected String elaboraBody() {\n String text = CostBio.VUOTO;\n int numCognomi = mappaCognomi.size();\n int numVoci = Bio.count();\n int taglioVoci = Pref.getInt(CostBio.TAGLIO_NOMI_ELENCO);\n\n text += A_CAPO;\n text += \"==Cognomi==\";\n text += A_CAPO;\n text += \"Elenco dei \";\n text += LibWiki.setBold(LibNum.format(numCognomi));\n text += \" cognomi '''differenti''' utilizzati nelle \";\n text += LibWiki.setBold(LibNum.format(numVoci));\n text += \" voci biografiche con occorrenze maggiori di \";\n text += LibWiki.setBold(taglioVoci);\n text += A_CAPO;\n text += creaElenco();\n text += A_CAPO;\n\n return text;\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:55:06.831 -0500\", hash_original_method = \"E7A2FB4AC135D29D78CE09D5448C290F\", hash_generated_method = \"74B066602ECC20A74FD97E770D65E8BD\")\n \npublic String encodeBody() {\n return encodeBody(new StringBuffer()).toString();\n }", "public String generarEstadisticasGenerales(){\n \n String estadisticaGeneral = \"En general en la universidad del valle: \\n\";\n estadisticaGeneral += \"se encuentran: \" + EmpleadosPrioridadAlta.size() + \" empleados en prioridad alta\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadAlta)\n + \"se encuentran: \" + EmpleadosPrioridadMediaAlta.size() + \" empleados en prioridad media alta\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadMediaAlta)\n + \"se encuentran: \" + EmpleadosPrioridadMedia.size() + \" empleados en prioridad media\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadMedia)\n + \"se encuentran: \" + EmpleadosPrioridadBaja.size() + \" empleados en prioridad baja\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadBaja);\n return estadisticaGeneral;\n }", "@Override\n\tpublic void createCpteEpargne(CompteEpargne cpt) {\n\t\t\n\t}", "@Override\r\n\tpublic void crearVehiculo() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "public Regla2(){ /*ESTE ES EL CONSTRUCTOR POR DEFECTO */\r\n\r\n /* TODAS LAS CLASES TIENE EL CONSTRUCTOR POR DEFECTO, A VECES SE CREAN AUTOMATICAMENTE, PERO\r\n PODEMOS CREARLOS NOSOTROS TAMBIEN SI NO SE HUBIERAN CREADO AUTOMATICAMENTE\r\n */\r\n \r\n }", "@Override\n public String toString() {\n return getAcideAmine()+\", \"+ getCodon() +\", \"+ getNucleotide1()+ \", \"\n + getNucleotide2() +\", \"+ getNucleotide3();\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "private IOferta buildOfertaEjemplo7() {\n\t\tPredicate<Compra> condicion = Predicates.alwaysTrue();\n\t\tFunction<Compra, Float> descuento = new DescuentoEnSegundoProducto(\"11-111-1111\", \"11-111-1112\", 50);\n\t\treturn new OfertaDinero(\"50% en Sprite, comprando 1 Coca\", condicion,\tdescuento);\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn denominacion + \" [prop: \" + propietario + \", sup: \" + superficie + \"]\";\r\n\t}", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }", "public Generation(){\n\t\twords = new ArrayList<String>();\n\t}", "public Zadatak1() {\r\n\t\tSystem.out.println(ucitajBroj(\"1. broj\") + ucitajBroj(\"2. broj\"));\r\n\t}", "public void generaClaves()\n {\n n = p.multiply(q);\n // ed = (p-1)*(q-1)\n ed = p.subtract(BigInteger.valueOf(1));\n ed = ed.multiply(q.subtract(BigInteger.valueOf(1)));\n // Elegimos un numero primo entre 1 menor que ed\n do e = new BigInteger(2 * tamPrimo, new Random());\n while((e.compareTo(ed) != -1) ||\n\t\t (e.gcd(ed).compareTo(BigInteger.valueOf(1)) != 0));\n // d = e^1 mod ed\n d = e.modInverse(ed);\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void generateData()\n {\n }", "private void generate(){\n\n nurses.add(new Nurse(1, \"ZUZANNA\", \"KOWALSKA\", \"normalna\"));\n nurses.add(new Nurse(2, \"ZOFIA\", \"WISNIEWSKA\", \"normalna\"));\n nurses.add(new Nurse(3, \"MAJA\", \"WOJCIK\", \"normalna\"));\n nurses.add(new Nurse(4, \"HANNA\", \"KOWALCZYK\", \"normalna\"));\n nurses.add(new Nurse(5, \"AMELIA\", \"KAMINSKA\", \"normalna\"));\n nurses.add(new Nurse(6, \"ALICJA\", \"LEWANDOWSKA\", \"normalna\"));\n nurses.add(new Nurse(7, \"MARIA\", \"ZIELINSKA\", \"normalna\"));\n nurses.add(new Nurse(8, \"ALEKSANDRA\", \"WOZNIAK\", \"normalna\"));\n nurses.add(new Nurse(9, \"OLIWIA\", \"SZYMANSKA\", \"normalna\"));\n nurses.add(new Nurse(10, \"NATALIA\", \"DABROWSKA\", \"normalna\"));\n nurses.add(new Nurse(11, \"WIKTORIA\", \"KOZLOWSKA\", \"normalna\"));\n nurses.add(new Nurse(12, \"EMILIA\", \"JANKOWSKA\", \"bez_nocnych\"));\n nurses.add(new Nurse(13, \"ANTONINA\", \"WOJCIECHOWSKA\", \"normalna\", 32));\n nurses.add(new Nurse(14, \"LAURA\", \"KWIATKOWSKA\", \"normalna\", 24));\n nurses.add(new Nurse(15, \"POLA\", \"MAZUR\", \"normalna\", 24));\n nurses.add(new Nurse(16, \"IGA\", \"KRAWCZYK\", \"normalna\", 24));\n// nurses.add(new Nurse(17, \"ANNA\", \"KACZMAREK\", \"normalna\"));\n// nurses.add(new Nurse(18, \"LILIANA\", \"PIOTROWSKA\", \"normalna\"));\n// nurses.add(new Nurse(19, \"MARCELINA\", \"GRABOWSKA\", \"normalna\"));\n// nurses.add(new Nurse(20, \"GABRIELA\", \"PAWLOWSKA\", \"normalna\"));\n// nurses.add(new Nurse(21, \"MICHALINA\", \"MICHALSKA\", \"normalna\"));\n// nurses.add(new Nurse(22, \"KORNELIA\", \"ZAJAC\", \"normalna\"));\n// nurses.add(new Nurse(23, \"NIKOLA\", \"KROL\", \"normalna\"));\n// nurses.add(new Nurse(24, \"HELENA\", \"JABLONSKA\", \"normalna\"));\n// nurses.add(new Nurse(25, \"JULIA\", \"WIECZOREK\", \"normalna\"));\n// nurses.add(new Nurse(26, \"JULIA\", \"NOWAKOWSKA\", \"normalna\"));\n// nurses.add(new Nurse(27, \"MILENA\", \"MAJEWSKA\", \"normalna\"));\n// nurses.add(new Nurse(28, \"MARTYNA\", \"WROBEL\", \"normalna\"));\n// nurses.add(new Nurse(29, \"JAGODA\", \"STEPIEN\", \"normalna\"));\n// nurses.add(new Nurse(30, \"MAGDALENA\", \"OLSZEWSKA\", \"normalna\"));\n\n }", "@SuppressWarnings(\"static-access\")\r\n\tpublic static void main(String args[]) {\n//\t koenig1.getHP();\r\n//\t \r\n//\t koenig1.getAttribute();\r\n//\t \r\n\t Generator.Generate(Generator.Anzahl(), Generator.Tier());\r\n\t \r\n\t\t \r\n\t }", "public String toString(){\r\n\t\t\t\t\treturn \"перший в черзі і шлях вільний\";\r\n\t\t\t\t}", "public BPELGeneratorImpl() {\r\n \t\tsuper(GENERATOR_NAME);\r\n \t}", "public void genC(PW pw) {\n \tfor(Variable var: paramList) {\r\n \t\tpw.print(var.getType().getCname() + \" _\" + var.getName());\r\n \t\tif(var != paramList.get(getSize() - 1)) {\r\n \t\t\tpw.print(\", \");\r\n \t\t}\r\n \t}\r\n }", "public static void main (String args []) {\n\r\n String str = \"\\\"क\\\", \\\"का\\\", \\\"कि\\\", \\\"की\\\", \\\"कु\\\", \\\"कू\\\", \\\"के\\\", \\\"कै\\\", \\\"को\\\", \\\"कौ\\\", \\\"कं\\\", \\\"क:\\\"\" ;\r\n String strEng = \"\\\"ka\\\", \\\"kā\\\", \\\"ki\\\", \\\"kī\\\", \\\"ku\\\", \\\"kū\\\", \\\"kē\\\", \\\"kai\\\", \\\"ko\\\", \\\"kau\\\", \\\"kṁ\\\", \\\"ka:\\\"\" ;\r\n\r\n String additionalConsonants = \"\\\"क़\\\", \\\"क़ा\\\", \\\"क़ि\\\", \\\"क़ी\\\", \\\"क़ु\\\", \\\"क़ू\\\", \\\"क़े\\\", \\\"क़ै\\\", \\\"क़ो\\\", \\\"क़ौ\\\", \\\"क़ं\\\", \\\"क़:\\\"\"; \r\n String additionalConsonantsEng = \"\\\"qa\\\", \\\"qā\\\", \\\"qi\\\", \\\"qī\\\", \\\"qu\\\", \\\"qū\\\", \\\"qē\\\", \\\"qai\\\", \\\"qo\\\", \\\"qau\\\", \\\"qṁ\\\", \\\"qa:\\\"\" ;\r\n\r\n //String str = \"क, का, कि, की, कु, कू, के, कै, को, कौ, कं, क:\" ;\r\n \r\n \r\n \r\n //generateNP(str);\r\n //generateEN(strEng);\r\n //System.out.println();\r\n generateNPAdditionalConsonants(additionalConsonants);\r\n generateENAdditionalConsonants(additionalConsonantsEng);\r\n\r\n\r\n\r\n }", "public void generate() {\n\t\t// Print generation stamp\n\t\tcontext.getNaming().putStamp(elementInterface, out);\n\t\t// Print the code\n\t\t// Print header\n\t\tout.println(\"package \"+modelPackage+\";\");\n\t\tout.println();\n\t\tout.println(\"public interface \"+elementInterface);\n\t\tif (context.isGenerateVisitor()) {\n\t\t\tout.println(indent+\"extends \"+context.getNaming().getVisitableInterface(modelName));\n\t\t}\n\t\tout.println(\"{\");\n\t\tif (context.isGenerateID()) {\n\t\t\tout.println(indent+\"/** Get the id */\");\n\t\t\tout.println(indent+\"public String getId();\");\n\t\t\tout.println(indent+\"/** Set the id */\");\n\t\t\tout.println(indent+\"public void setId(String id);\");\n\t\t\tout.println();\n\t\t}\n\t\tif (context.isGenerateBidirectional()) {\n\t\t\tout.println(indent+\"/** Delete */\");\n\t\t\tout.println(indent+\"public void delete();\");\n\t\t}\n\t\tout.println(indent+\"/** Override toString */\");\n\t\tout.println(indent+\"public String toString();\");\n//\t\tif (context.isGenerateInvariant()) {\n//\t\t\tout.println();\n//\t\t\tout.println(indent+\"/** Parse all invariants */\");\n//\t\t\tout.println(indent+\"public Boolean parseInvariants(ILog log);\");\n//\t\t\tout.println(indent+\"/** Evaluate all invariants */\");\n//\t\t\tout.println(indent+\"public Boolean evaluateInvariants(ILog log);\");\n//\t\t}\n\t\tout.println(\"}\");\n\t}", "public String toString2 () {\n\t\tString a = \"ChampionnatComplexe : [\";\n\t\ta = a + \" { ( \" ;\n\t\tfor ( int i = 0 ; i < 3 ; i++ ) {\n\t\t\ta = a + grpA1 [i] +\" \" ;\n\t\t}\n\t\ta = a + \") ( \" ;\n\t\tfor ( int i = 0 ; i < 3 ; i++ ) {\n\t\t\ta = a + grpA2 [i] +\" \" ;\n\t\t}\n\t\ta = a + \") } { ( \" ;\n\t\tfor ( int i = 0 ; i < 3 ; i++ ) {\n\t\t\ta = a + grpB1 [i] +\" \" ;\n\t\t}\n\t\ta = a + \") ( \" ;\n\t\tfor ( int i = 0 ; i < 3 ; i++ ) {\n\t\t\ta = a + grpB2 [i] +\" \" ;\n\t\t}\n\t\ta = a + \") } ] \\n\" ;\n\t\ta = a + \"\\tNote Equilibre:\\t\"+this.getNoteEquilibre()+\"\\n\" ;\n\t\ta = a + \"\\tNote Distance:\\t\"+this.getNoteDistance()+\"\\n\" ;\n\t\ta = a + \"\\tMoyenne pondérée:\\t\" +getNoteMoyennePondereeEqDist()+\" (coefDist=\"+opt.getPourcentageDistance()+\", coefEq=\"+(100-opt.getPourcentageDistance())+\")\\n\" ;\n\t\treturn a;\n\t}", "@Override\n public Question generate() {\n return new Question(\"Why do Canadians prefer their jokes in hexadecimal?\",\n \"Because 7 8 9 A!\");\n }", "public String toString() {\n\t\treturn \"de remerciement \";\n\t}", "protected void genWriter() {\n\t\t\n\t\tfixWriter_h();\n\t\tfixWriter_cpp();\n\t}", "@Override\r\n\tpublic void makerear() {\n\t\t\r\n\t}", "private void generateData(){\n generateP50boys();\n generateP50girls();\n generateP97boys();\n generateP97girls();\n }", "public contrustor(){\r\n\t}", "@Override\r\n public String toString() {\r\n// ritorna una stringa\r\n return \"pollo\";\r\n }", "public String generateConclusion(ConclusionController objects) {\n\t\tpronoun = objects.getGender().getPronoun();\n\t\t\n\t\tArrayList<DocumentElement> list = new ArrayList<DocumentElement>();\n\t\t\n\t\tlist.add(LikesPhrase(objects.getLikes()));\n\t\tlist.add(EventGoingPhrase(objects.getGoingEvents()));\n\t\tlist.add(EventInterested(objects.getInterestedEvents()));\n\t\t\n\t\tDocumentElement par = nlgFactory.createParagraph(list);\n\t\t\n\t\treturn realiser.realise(par).getRealisation();\n\t}", "static void generate(Proc proc, PrintWriter outData)\r\n {\r\n for (int i=0; i < proc.lines.size(); i++)\r\n {\r\n //String l = (String) proc.lines.elementAt(i);\r\n Line line = \tproc.lines.elementAt(i);\r\n outData.println(line.line);\r\n }\r\n outData.println();\r\n }", "@Override\n public Object generate(Object o, Method method, Object... objects) {\n StringBuilder sb = new StringBuilder();\n sb.append(o.getClass().getName());\n sb.append(method.getName());\n for (Object obj : objects) {\n sb.append(obj.toString());\n }\n return sb.toString();\n }", "public void genLists() {\n\t}", "private void generateID(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String t : terms.keySet())\n\t\t\tsb.append(t.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, t.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tfor (String s : sources)\n\t\t\tsb.append(s.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, s.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tsb.deleteCharAt(sb.length()-1);\n\t\tif (yearFrom > -1) sb.append(\"_\" + yearFrom);\n\t\tif (yearTo > -1) sb.append(\"_\" + yearTo);\n\t\tif (useCompounds) sb.append(\"_COMP\");\n\t\tif (useStopwords) sb.append(\"_STOP\");\n\t\tsb.append(\"_CNT\" + contextSize);\n\t\tsb.append(\"_\" + System.currentTimeMillis());\n\t\tthis.id = sb.toString();\n\t}", "public Pitonyak_09_02() {\r\n }", "private void crearGen(int id){\n Random random = new Random();\n int longitud = random.nextInt(6) + 5;\n\n random = null;\n\n Gen gen = new Gen(id, longitud);\n agregarGen(gen);\n }", "@Override//sobrescribir metodo\n public String getDescripcion(){\n return hamburguesa.getDescripcion()+\" + lechuga\";//retorna descripcion del oobj hamburguesa y le agrega +lechuga\n }", "@Override\n\tpublic void pausaParaComer() {\n\n\t}", "private void poetries() {\n\n\t}" ]
[ "0.6484577", "0.6449677", "0.6429502", "0.6260175", "0.62341714", "0.62286335", "0.62144035", "0.60375977", "0.6032117", "0.5948039", "0.5938105", "0.5931619", "0.5918453", "0.58992696", "0.5893407", "0.5869554", "0.586568", "0.58631784", "0.5842603", "0.5840476", "0.5807298", "0.5799419", "0.57954246", "0.57831997", "0.57679045", "0.5757005", "0.5704047", "0.56695837", "0.56649", "0.5663881", "0.56628", "0.56599194", "0.56455404", "0.56440955", "0.5643895", "0.5622065", "0.561384", "0.5600798", "0.55931747", "0.5590387", "0.55877894", "0.5573353", "0.5572645", "0.5561041", "0.55605024", "0.555912", "0.5558541", "0.5550822", "0.5541631", "0.5536958", "0.5527024", "0.552353", "0.5521398", "0.55197924", "0.55021983", "0.5490938", "0.548492", "0.54801184", "0.54773384", "0.5475973", "0.5465764", "0.5465386", "0.5460699", "0.5451454", "0.5443568", "0.54428285", "0.5436814", "0.54298955", "0.54289466", "0.5422849", "0.54153055", "0.5414675", "0.54125625", "0.5403952", "0.5403091", "0.54024583", "0.54009205", "0.5400656", "0.5395047", "0.5382298", "0.53814465", "0.53790426", "0.5377374", "0.5373541", "0.5372208", "0.53715295", "0.537063", "0.5364554", "0.535785", "0.5357104", "0.5355157", "0.5354709", "0.5353354", "0.53517926", "0.5350047", "0.53359437", "0.53338665", "0.5329259", "0.5328806", "0.5326797", "0.5326419" ]
0.0
-1
Chiffre une phrase complete caractere par caractere
public String encrypt(String message, String publicKey, String modulus){ char a; BigInteger b; String c = ""; for(int i = 0; i < message.length(); i++){ a = message.charAt(i); b = new BigInteger("" + (int)a); c += "" + encrypt(b, new BigInteger(publicKey), new BigInteger(modulus)) + (char)29; } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void reagir(String frase) {\n if (frase.equals(\"toma comida\") || frase.equals(\"olá\")) {\n System.out.println(\"abanar e latir\");\n } else {\n System.out.println(\"rosnar\");\n }\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 }", "public void reagir(String frase) {\n\t\tif (frase.equals(\"toma comida\") || frase.equals(\"ola\")) {\n\t\t\tSystem.out.println(\"Abanar e latir\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Rosnar\");\n\t\t}\n\t\t\n\t}", "private void SolveTranslation(){\n\n int Cursor=0;\n Pattern pt = Pattern.compile(\"\\\"(.*?)\\\"\");\n Matcher matcher = pt.matcher(Input);\n while(matcher.find()){\n this.Undone[Cursor++] = matcher.group();\n //System.out.println(Undone[Cursor-1]);\n }\n Input = matcher.replaceAll(\"CCC\");\n }", "private String SuppressionMot(String Mot, String Texte) throws InterruptedException {\n\t\tboolean trouve = false;\n\t\tString newCh =\"\";\n\t\tint i =0;\n\t\tif(Texte.equalsIgnoreCase(Mot)) { \t// Recherche dans le message si le mot est présent. \n\t\t\tnewCh=Texte.replaceAll(Mot, \"**\");\t// Remplace le mot par un espace. \n\t\t\ttrouve= true;\n\t\t} else {\n\t\t\tnewCh = Texte;\t//Sinon, on remplace la nouvelle chaîne de caractères par l'ancienne. \n\t\t}\n\t\treturn newCh;\t//Retourne la nouvelle chaîne de caractère modifiée ou pas. \n\t}", "String getWordIn(String schar, String echar);", "private String searchString(String inWord)\n {\n String line = null;\n StringBuffer rtn = new StringBuffer();\n int len = inWord.length();\n boolean found = false;\n\n if(len == 1)\n {\n if(Character.isDigit(inWord.charAt(0)))\n {\n rtn.append(inWord).append(\"I\");\n found = true;\n } // fi\n\n else if(Character.isLetter(inWord.charAt(0)))\n {\n rtn.append(inWord.toLowerCase()).append(\"S\");\n found = true;\n } // else fi\n } // fi\n\n if(!found)\n {\n int\tnum_A = 0; // Upper case\n int\tnum_L = 0; // Lower case\n int\tnum_N = 0; // Numbers\n int\tnum_P = 0; // Punctuation (numeric)\n int\tnum_Q = 0; // Quotes\n int\tnum_O = 0; // Other\n char last_ch = ' ';\n\n for(int i = 0; i < len; i++)\n {\n if((i == 0) && (inWord.charAt(i) == '-'))\n num_L++;\n\n else if(Character.isLowerCase(inWord.charAt(i)))\n num_L++;\n\n else if(Character.isUpperCase(inWord.charAt(i)))\n num_A++;\n\n else if(Character.isDigit(inWord.charAt(i)))\n num_N++;\n\n else if((inWord.charAt(i) == '=')||(inWord.charAt(i) == ':') ||\n (inWord.charAt(i) == '+')||(inWord.charAt(i) == '.') ||\n (inWord.charAt(i) == ','))\n num_P++;\n\n else if((inWord.charAt(i) == '\\'') ||\n (inWord.charAt(i) == '`') || (inWord.charAt(i) == '\"'))\n num_Q++;\n\n else\n num_O++;\n\n last_ch = inWord.charAt(i);\n } // for\n\n int pos = 0;\n if((len - ntail) > 0)\n pos = len - ntail;\n\n rtn.append(inWord.substring(pos).toLowerCase());\n\n if((num_L + num_Q) == len)\n rtn.append(\"\");\n\n else if((num_A + num_Q) == len)\n rtn.append(\"A\");\n\n else if((num_N + num_P + num_Q) == len)\n rtn.append(\"N\");\n\n else if((num_L + num_A + num_Q) == len)\n rtn.append(\"B\");\n\n else if((num_A + num_N + num_P + num_Q) == len)\n rtn.append(\"C\");\n\n else if((num_L + num_N + num_P + num_Q) == len)\n rtn.append(\"E\");\n\n else if((num_A + num_L + num_N + num_P + num_Q) == len)\n rtn.append(\"D\");\n\n else if((num_O == 0) && (last_ch == '+'))\n rtn.append(\"F\");\n\n else\n rtn.append(\"O\");\n } // else\n\n rtn.append(\"_\");\n\n return(rtn.toString());\n }", "public static void main(String[] args) {\n//\n// String pattern = \"abba\";\n// String s = \"dog cat cat fish\";\n\n\n// String pattern = \"aaaa\";\n// String s = \"dog cat cat dog\";\n\n String pattern = \"abba\";\n String s = \"dog dog dog dog\";\n\n// String pattern = \"e\";\n// String s = \"eukera\";\n\n boolean flag = wordPattern(pattern, s);\n\n System.out.println(flag);\n }", "private String[] getSearchPhrase(boolean split) {\n return split ? getPhrase().split(\" \") : new String[]{getPhrase()};\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = 0;\n\t\tSystem.out.println(\"Veillez saisir une phrase :\");\n\t\tString phrase = sc.nextLine();\n\t\tSystem.out.println(phrase);\n\t\tSystem.out.println(\"M : \" + phrase.toUpperCase());\n\t\tfor(int i = 0; i < phrase.length(); i++)\n\t\t{\n\t\t\tif(phrase.charAt(i) == 'e')\n\t\t\t\tcount++;\n\t\t}\n\t\tSystem.out.println(\"C : \" + phrase.length());\n\t\tSystem.out.println(\"Le nombre de 'e' dans la phrase : \" + count);\n\t\tif(count > 0)\n\t\t\tSystem.out.println(\"R : \" + phrase.replace('e', '*'));\n\t}", "private String buildWordMatch(Matcher matcher, String word){\n return \"(\" + matcher.replaceAll(\"% \"+word+\" %\")\n + \" or \" + matcher.replaceAll(word+\" %\")\n + \" or \" + matcher.replaceAll(word)\n + \" or \" + matcher.replaceAll(\"% \"+word) + \")\" ;\n }", "public static String findMultipleOccorancesOfGivenWord(String sentence,String word)\n {\n if(sentence == null || word == null || sentence == \"\" || word == \"\"){\n return \"Please enter valid sentence and word.It should not be empty and null\";\n }\n String result = \"\";\n Pattern pattern = Pattern.compile(word);\n Matcher matcher = pattern.matcher(sentence);\n while(matcher.find()) {\n\n result = result + \"Found at:\"+ matcher.start() + \" - \" + matcher.end() + \" \";\n }\n\n return result.trim();\n\n }", "public static boolean Comprobar(String frase){\n\t\t\n\t\tStringBuffer copia = new StringBuffer(frase);\n\t\tString reverse = copia.reverse().toString();\n\n\t\treturn frase.equals(reverse);\n\t\t\n\t}", "public static void main(String[] args) {\n String frase;\n String frase2 = \"\";//debe ser inicializada\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"Ingrese una frase\");\n frase = sc.nextLine();\n\n int i = 0;\n\n while (i < frase.length()) {//ou con for et if y else, los i++ estarian solo en el for\n if (frase.charAt(i) != ' ') {\n frase2 = frase2.concat(frase.substring(i, i + 1));\n } else {//el else solo pedia tranformar los espacios en alterisco que se hace solo con\n frase2 = frase2.concat(\"*\");//esto//y esto\n while (frase.charAt(i) == ' ') {\n i++;\n }\n frase2 = frase2.concat(frase.substring(i, i + 1));\n }\n i++;\n }//faltaria una primera condicion como en los 2 ejercicios precedentes pa que no imprima asteriscos antes de la 1era letra\n System.out.println(frase2);\n }", "public void invertirFrase(Cadena C1, String frase) {\r\n\r\n char aux;\r\n String resp = \"\";\r\n\r\n for (int i = C1.getFrase().length() - 1; i >= 0; i--) {\r\n\r\n aux = C1.getFrase().charAt(i);\r\n resp = resp + aux;\r\n\r\n }\r\n System.out.println(resp);\r\n\r\n }", "public static void main(String[] args) {\n Pattern pattern = Pattern.compile(\"\\\\b(\\\\w+)(\\\\W+\\\\1\\\\b)+\",Pattern.CASE_INSENSITIVE);\r\n\r\n Scanner in = new Scanner(System.in);\r\n int numSentences = Integer.parseInt(in.nextLine());\r\n \r\n while (numSentences-- > 0) {\r\n String input = in.nextLine();\r\n \r\n Matcher matcher = pattern.matcher(input);\r\n \r\n while (matcher.find()) \r\n input = input.replaceAll(matcher.group(),matcher.group(1));\r\n // Prints the modified sentence.\r\n System.out.println(input);\r\n }\r\n \r\n in.close();\r\n }", "public String getCorrectionWord(String misspell);", "@Test\n\tpublic void phraseConcatTest() {\n\t\tString query1 = \"\\\" hello my \\\"\";\n\t\tString query2 = \"\\\" I am the king \\\"\";\n\t\tString query3 = \"\\\" yes you are \\\" \";\n\t\t\n\t\tString query1Result = \"hello+my\";\n\t\tString query2Result = \"I+am+the+king\";\n\t\tString query3Result = \"yes+you+are\";\n\t\t\n\t\tassertEquals(query1Result, queryTest.fixPhrases(query1));\n\t\tassertEquals(query2Result, queryTest.fixPhrases(query2));\n\t\tassertEquals(query3Result, queryTest.fixPhrases(query3));\n\t}", "public boolean pass(String word);", "void solution() {\n\t\t/* Write a RegEx matching repeated words here. */\n\t\tString regex = \"(?i)\\\\b([a-z]+)\\\\b(?:\\\\s+\\\\1\\\\b)+\";\n\t\t/* Insert the correct Pattern flag here. */\n\t\tPattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);\n\n\t\tString[] in = { \"I love Love to To tO code\", \"Goodbye bye bye world world world\",\n\t\t\t\t\"Sam went went to to to his business\", \"Reya is is the the best player in eye eye game\", \"in inthe\",\n\t\t\t\t\"Hello hello Ab aB\" };\n\t\tfor (String input : in) {\n\t\t\tMatcher m = p.matcher(input);\n\n\t\t\t// Check for subsequences of input that match the compiled pattern\n\t\t\twhile (m.find()) {\n\t\t\t\t// /* The regex to replace */, /* The replacement. */\n\t\t\t\tinput = input.replaceAll(m.group(), m.group(1));\n\t\t\t}\n\n\t\t\t// Prints the modified sentence.\n\t\t\tSystem.out.println(input);\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tString str1=\"This is the thread that given\";\n\t\tSystem.out.println(\"original String :\\n\" +str1);\n\t\tString str2=\"th\";\n\t\twhile(str1.toLowerCase().contains(str2)) {\n\t\t\tint i1=str1.toLowerCase().indexOf(str2);\n\t\t\tString temp=\"\"+str1.charAt(i1+1)+str1.charAt(i1);\n\t\t\tstr1=str1.replaceAll((str1.substring(i1, i1+2)), temp);\n\t\t}\n\t\tSystem.out.println(\"String after replace HT with TH :\\n\"+str1);\n\t}", "private String encodageMot(String message) {\n if (message == null || message.equals(\"\")) {\n throw new AssertionError(\"Texte non saisie\");\n } \n return transformWords(message, 1); \n }", "public void process(String s)//check if the phrase guess equals the actual phrase\n {\n String phraseGuess = s.toUpperCase();\n String phraseUp = phrase.toUpperCase();\n //comparing guess and actual\n if (phraseGuess.equals(phraseUp))\n {\n System.out.println(\"You Guessed correctly!\");\n screen = phraseUp.toCharArray();\n GamePlay.letterInPhrase = true;\n showPhrase();\n// System.out.println(\"The phrase is: \"+phrase);\n }\n else\n {System.out.println(\"Incorrect Guess Next Player's turn\");\n GamePlay.letterInPhrase = false;\n }\n }", "private boolean isSubSequence(String s, String word){\n int startPointer = 0;\n for(int i=0; i<word.length(); i++){\n int location = s.indexOf(word.charAt(i), startPointer);\n if(location < 0)\n return false;\n startPointer = location+1;\n }\n return true;\n }", "public boolean contem(String chave);", "public boolean isAccepted2(String word) {\r\n\t return word.endsWith(\"baa\");\r\n \r\n }", "public void firstSem2a6(){\n chapter = \"firstSem2a6\";\n String firstSem2a6 = \"\\\"Well? Are we friends, like that guy said?\\\"\";\n getTextIn(firstSem2a6);\n }", "private String decodageMot(String message) {\n if (message == null || message.equals(\"\")) {\n throw new AssertionError(\"Texte non saisie\");\n } \n return transformWords(message, 2);\n }", "public static void main(String[] args) {\n\r\n\t\tScanner sc = new Scanner(System.in);\r\n\r\n\t\tString phrase = sc.nextLine();\r\n\t\tchar caract = sc.nextLine().charAt(0);\r\n\r\n\t\tint length = phrase.length();\r\n\t\tint sum = 0;\r\n\r\n\t\tfor (int i = 0; i < length; i++) {\r\n\r\n\t\t\tif ((phrase.charAt(i) == caract))\r\n\t\t\t\tsum = sum + 1;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(sum);\r\n\t}", "String highlightTerm(String term);", "@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 }", "public static void main(String[] args) {\n\t\tBoolean[] b= new Boolean[26];\n\t\tArrays.fill(b, false);\n\t\tint index=0;\n\t\tString test =\"aabbcc\";\n\t\tfor(int i=0;i<test.length();i++)\n\t\t{\n\t\t\tindex=(int)test.charAt(i)-'a';\n\t\t\tb[index]=true;\n\t\t}\n\t\tfor(int i=0;i<b.length;i++)\n\t\t{\n\t\t\tif(b[i]==false)\n\t\t\t{\n\t\t\t//\tSystem.out.println(\"Not pangram\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t String str = \"Happy%^&*Christmas*&*&*)NewYear\"; \n \n\t // similar to Matcher.replaceAll \n\t str = str.replaceAll(\"\\\\p{Punct}\",\" \"); \n\t \n\t System.out.println(str); \n\n\t}", "boolean hasHadithText();", "@Test\n public void wordPatternTest() {\n String pattern = \"aaa\", str = \"aa aa aa aa\";\n boolean ans = instance.wordPattern(pattern, str);\n System.out.println(ans);\n }", "public static String removeNonWord(String message)\r\n {\r\n int start = getLetterIndex(message, head); //get the fist index that contain English letter\r\n int end = getLetterIndex(message, tail); //get the last index that contain English letter\r\n if (start == end) // if only contain one letter\r\n return String.valueOf(message.charAt(start)); // return the letter\r\n return message.substring(start, end + 1); // return the content that contain English letter\r\n }", "public boolean isAccepted1(String word) {\r\n\t return (tranzition_extended(word)==3) ;\r\n\r\n }", "public String propergram(String word){\n // word.toLowerCase();\n String[] tempstr =word.split(\"_\");\n String tempstr2;\n\n for(int i=0;i<tempstr.length;i++){\n if((tempstr[i].charAt(0))>='A'&&(tempstr[i].charAt(0))<='Z') {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0)));\n }\n else {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0))).toUpperCase();\n }\n tempstr[i] = tempstr2.concat(tempstr[i].substring(1));\n if (i != 0) {\n word=word.concat(\" \").concat(tempstr[i]);\n } else {\n word = tempstr[i];\n }\n\n }\n return word;\n\n\n }", "public String getSearchString() {\r\n return super.getSearchString();\r\n \r\n// String searchStr = \"\";\r\n// //put exact phrase at the very beginning\r\n// if(exactphrase != null && exactphrase.length() > 0)\r\n// {\r\n// searchStr += \"\\\"\" + exactphrase + \"\\\"\";\r\n// }\r\n//\r\n// String allwordsSearchStr = \"\";\r\n// if(allwords != null && allwords.length() > 0)\r\n// {\r\n// String [] words = allwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// allwordsSearchStr += \"+\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// String withoutwordsSearchStr = \"\";\r\n// if(withoutwords != null && withoutwords.length() > 0)\r\n// {\r\n// String [] words = withoutwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// withoutwordsSearchStr += \"+-\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// searchStr += allwordsSearchStr + withoutwordsSearchStr; //need to add other string\r\n// \r\n// String oneofwordsSearchStr = \"\";\r\n// if(oneofwords != null && oneofwords.length() > 0)\r\n// {\r\n// String [] words = oneofwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// oneofwordsSearchStr = \"(\";\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// oneofwordsSearchStr += words[i] + \" \";\r\n// }\r\n// oneofwordsSearchStr = oneofwordsSearchStr.trim();\r\n// oneofwordsSearchStr += \")\";\r\n// }\r\n// }\r\n// if(oneofwordsSearchStr.length() > 0)\r\n// {\r\n// searchStr += \"+\" + oneofwordsSearchStr;\r\n// }\r\n//\r\n// return searchStr;\r\n }", "public String acronym(String phrase) {\n /*StringBuilder acronymFeed = new StringBuilder(\"\");\n String wordHolder = \"\";\n int spaceIndex;\n char firstLetter;\n do{\n spaceIndex = phrase.indexOf(\" \");\n wordHolder = phrase.substring(0,spaceIndex);\n acronymFeed.append(wordHolder.charAt(0));\n phrase = phrase.replaceFirst(wordHolder, \"\");\n } while (spaceIndex != -1 && wordHolder != \"\" && phrase != \"\");\n \n \n \n \n \n String acronymResult = acronymFeed.toString().toUpperCase();\n return acronymResult;\n */\n \n char[] letters = phrase.toCharArray();\n String firstLetters = \"\";\n firstLetters += String.valueOf(letters[0]);\n for (int i = 1; i < phrase.length();i++){\n if (letters[i-1] == ' '){\n firstLetters += String.valueOf(letters[i]);\n }\n }\n firstLetters = firstLetters.toUpperCase();\n return firstLetters;\n }", "public static Boolean Word(String arg){\n\t\tif(arg.matches(\"^[a-zA-ZåÅäÄöÖüÜéÉèÈ]*\")){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\n\t}", "private static String handlePhrases(String PubmedQuery) {\r\n //Find phrases \"between double quotes\"\r\n String[] phrases = PubmedQuery.split(\"\\\"\");\r\n for(int i = 0 ; i < phrases.length ; i++){\r\n phrases[i] = phrases[i].trim();\r\n if(!phrases[i].equals(\"\")){ // String not Empty\r\n if(i%2 != 0){ // String surrounded by quotes, i.e. a phrase\r\n phrases[i] = \"\\\"\" + phrases[i] + \"\\\"\";\r\n } else { // not a phrase, i.e. a bag of terms, operator or [field of index] (inside brackets)\r\n if(phrases[i].startsWith(\"[\")){ //index field of previus component contained (i.e. case: \"...\"[...])\r\n boolean perviusPhraseFound = false; // True if index field was added to previus phrase element\r\n // Get index field of previus component and handle proprietly\r\n String [] tokens = phrases[i].split(\"]\");\r\n String indexField = tokens[0].replace(\"[\", \"\");\r\n String luceneField = supportedIndexFields.get(indexField);\r\n if(luceneField != null){ \r\n //add \"indexField:\" as a prefix in previus (not empty) phrase\r\n int tmp = i-1;\r\n while(!perviusPhraseFound & tmp >= 0){\r\n if(!phrases[tmp].equals(\"\")){\r\n perviusPhraseFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n phrases[tmp] = luceneField + \":\" + phrases[tmp] + \"\";\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n // Remove from current phrase this index field (prefix)\r\n phrases[i] = phrases[i].substring(indexField.length()+2 );\r\n } \r\n // Further handling...\r\n phrases[i] = handleNonPhraseToken(phrases[i]);\r\n }\r\n } //else { /* Empty token, do nothing with this */ System.out.println(\"\\t\\t\\t empty\"); }\r\n }\r\n \r\n String luceneQuery = \"\";\r\n boolean fisrtPhrase = true;\r\n for(int i = 0 ; i < phrases.length ; i ++){\r\n if(phrases[i].length() > 0){\r\n if(!phrases[i].startsWith(\" OR \") & !phrases[i].startsWith(\" -\") & !phrases[i].startsWith(\" +\") ){\r\n if(fisrtPhrase){\r\n luceneQuery += \" +\";\r\n fisrtPhrase = false;\r\n } else {\r\n if(!phrases[i-1].endsWith(\" OR \") & !phrases[i-1].endsWith(\" -\") & !phrases[i-1].endsWith(\" +\")){\r\n luceneQuery += \" +\";\r\n }\r\n } \r\n } // add default operator + when required (no OR or - is present for that term)\r\n luceneQuery += phrases[i];\r\n }// else empty phrase : skip\r\n }\r\n return luceneQuery;\r\n }", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n String word = \"Tenet\";\n String word3 = \"tenet\";\n System.out.println(\"word \" + word);\n word.toLowerCase(); //porównanie bez wielkosci znakow\n //charAt(0) - zero,\n String[] Tablica = new String[word.length()];\n for (int i = 0; i < word.length(); i++) {\n Tablica[i] = String.valueOf(word.charAt(i));\n }\n String word2 = \"\";\n\n for (int i = (word.length() - 1); i >= 0; i--) {\n //System.out.print(Tablica[i]);\n word2 = word2 + Tablica[i];\n }\n //System.out.println();\n System.out.println(\"word 2 \" + word2);\n System.out.println(\"word 3 \" + word3);\n\n System.out.print(\"word 3 i word 2 \");\n if (word3.toLowerCase().equals(word2.toLowerCase())) {\n System.out.println(\"jest palidronem\");\n } else {\n System.out.println(\"nie jest palidronem\");\n }\n\n//koniec\n\n }", "public void firstSem10a(){\n chapter = \"firstSem10a\";\n String firstSem10a = \"There's a commotion outside your room - your door looks like it's been smashed down, and your RA is standing outside, looking \" +\n \"distressed. You can hear a shout from inside - your roommate - and sounds of a struggle. \\\"Get in there and help!\\\" you shout to the RA, \" +\n \"but he just shakes his head. \\\"Sorry, I can't. I'm anti-violence. You can't fight hate with hate, you know.\\\"\\tPushing past him, you \" +\n \"run into your room to see your roommate grappling with a large beast. THE beast. It is real. What do you want to do?\";\n getTextIn(firstSem10a);\n }", "public static void main(String[] args) {\nString s1 = \"java gg\";\nchar[] ch ={'g','r','d'};\nString s2 = new String(ch);\n//length\nSystem.out.println(s1.length());\nSystem.out.println(s2.length());\n//charAt\nchar c = s1.charAt(2);\nSystem.out.println(c);\n//String format\nString cd = String.format(\"value %32.11f\",32.5654);\nSystem.out.println(cd);\n//Substring.........start index starts with 0 and end index starts with 1\nSystem.out.println(s1.substring(1));\nSystem.out.println(s1.substring(1, 3));\n//Contains\nSystem.out.println(\"contains example\" +s1.contains(\"gg\"));\n//Join\nString joint = String.join(\"-\", \"Welcome\",\"to\",\"india\");\nSystem.out.println(joint);\n//Equals\nSystem.out.println(s1.equals(s2));\n//is empty\nSystem.out.println(s1.isEmpty());\n//Concat\ns1.concat(\"hello\");\nSystem.out.println(s1);\ns1 = s1.concat(\" home\");\nSystem.out.println(s1);\n//char replace\nString sf=\"javatpoint is a very good website\"; \nString replaceString=sf.replace('a','e');//replaces all occurrences of 'a' to 'e' \nSystem.out.println(replaceString);\n//charSequence replace\nString sg=\"my name is khan my name is java\"; \nString replaceString1=sg.replace(\"is\",\"was\");//replaces all occurrences of \"is\" to \"was\" \nSystem.out.println(replaceString1); \n// trim: string with omitted leading and trailing spaces\nString df = \" Hello java \";\nSystem.out.println(df+\"javapoint\");\nSystem.out.println(df.trim()+\"javapoint\");\n//Split\nString g1 = \"Strike with bang\";\nString[] words = g1.split(\"\\\\s\");//regular expression\nfor (String m:words){\n\tSystem.out.println(m);\n}\n\tfor(String m1:g1.split(\"\\\\s\", 2)){\n\t\tSystem.out.println(m1);\n\t}\n\t\n//indexof\n\tString sw1=\"this is index of example\"; \n\t//passing substring \n\tint index1=sw1.indexOf(\"dex o\");//returns the index of is substring \n\tint index2=sw1.indexOf(\"index\");//returns the index of index substring \n\tSystem.out.println(index1+\" \"+index2);//2 8 \n\t \n\t//passing substring with from index \n\tint index3=sw1.indexOf(\"is\",4);//returns the index of is substring after 4th index \n\tSystem.out.println(index3);//5 i.e. the index of another is \n\t \n\t//passing char value \n\tint index4=sw1.indexOf('x');//returns the index of s char value \n\tSystem.out.println(index4);//3 \n//To lower case\n\tString sf1=\"JAVATPOINT HELLO stRIng\"; \n\tString s1lower=sf1.toLowerCase(); \n\tSystem.out.println(s1lower); \n//To upper case\n\tString sf2 =\"john cenA\";\n\tSystem.out.println(sf2.toUpperCase());\n\t}", "private String firstWord(String userMessage) {\n if (userMessage.contains(\" \"))\n return userMessage.substring(0, userMessage.indexOf(\" \"));\n return userMessage;\n }", "public abstract boolean isStopWord(String term);", "public static void upperCaseFirstOfWord() {\n\t\tString isExit = \"\";\n\t\twhile (!isExit.equals(\"N\")) {\n\t\t\tStringBuffer bf = readInput();\n\t\t\tStringBuffer result = new StringBuffer();\n\t\t\tString str = bf.toString();\n\t\t\tString char_prev = \"\";\n\t\t\tString char_current = \"\";\n\t\t\tString key = \" ,.!?:\\\"\";\n\t\t\tresult.append(String.valueOf(str.charAt(0)).toUpperCase());\n\t\t\tfor (int i = 1; i < str.length(); i++) {\n\t\t\t\tchar_prev = String.valueOf(str.charAt(i - 1));\n\t\t\t\tchar_current = String.valueOf(str.charAt(i));\n\t\t\t\tif (key.contains(char_prev)) {\n\t\t\t\t\tchar_current = char_current.toUpperCase();//uppercase first letter each word\n\t\t\t\t}\n\t\t\t\tresult.append(char_current);\n\t\t\t}\n\t\t\tSystem.out.println(\"Chuỗi có chữ cái đầu viết hoa: \\n\" + result);\n\t\t\tSystem.out.println(\"Bạn có muốn nhập tiếp không(0/1):\");\n\t\t\tisExit= scan.next().toString();\n\t\t}\n\t}", "private String keywordFound(){\r\n\t\tString rtn = \"\";\r\n\t\tString tmp = \"\";\r\n\t\tint carr_pos = getCaretPosition();\r\n\t\t//estract part of text for keyword search\r\n\t\ttry { \r\n\t\tif(carr_pos>50)\r\n\t\t\ttmp = doc.getText(carr_pos-50,50);\r\n\t\telse\r\n\t\t\ttmp = doc.getText(0,carr_pos);\r\n\t\t}catch(BadLocationException a){\r\n\t\t\tSystem.out.println(\"exception\");\r\n\t\t\treturn rtn;\r\n\t\t};\r\n\t\t//Start check\r\n\t\tint i = 0;\r\n\t\tif(tmp.length() >= 2)i = tmp.length()-2;\t\r\n\t\twhile(checkOperator(tmp.charAt(i)) && i > 0){\r\n\t\t\trtn += tmp.charAt(i);\r\n\t\t\ti--;\r\n\t\t}\r\n\t\tif(i == 0)rtn += tmp.charAt(i);\t\t\r\n\t\treturn mirrorString(rtn);\r\n\t}", "private String processWord(String word){\r\n\t\tString lword = word.toLowerCase();\r\n\t\tfor (int i = 0;i<word.length();++i){\r\n\t\t\tstemmer.add(lword.charAt(i));\r\n\t\t}\r\n\t\tstemmer.stem();\r\n\t\treturn stemmer.toString();\r\n\t}", "private String construyeCaracter(String palabra) throws IOException {\n\t\tToken aux = null;\n \t\twhile(!((aux = this.nextTokenWithWhites()).get_lexema().equals(\"'\"))) {\n \t\t\tif (aux.get_lexema().equals(\"fin\"))\n \t\t\t\treturn palabra;\n \t\t\tpalabra = palabra + aux.get_lexema();\n \t\t\t// Si vemos que el caracter se alarga mucho, paramos de leer\n \t\t\tif (palabra.length() > 4) {\n \t\t\t\treturn palabra;\n \t\t\t}\n \t\t}\n \t\tpalabra = palabra + aux.get_lexema();\n\t\treturn palabra;\n\t}", "private static boolean matchSearchWord(String word, String matchWord) {\n // The regex is to match words even though they contain special characters.\n // If this wasn't done the function would not match e.g. Java to \"Java\"\n return word.toLowerCase().replaceAll(\"[^a-zA-Z0-9]\", \"\").equals(matchWord.toLowerCase());\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}", "public String acronym(String phrase) {\n\t\tString[] p = phrase.split(\"[\\\\W\\\\s]\");\n\t\tString returner = \"\";\n\t\tfor (String s : p) {\n\t\t\tif (!s.isEmpty())\n\t\t\t\treturner = returner + s.charAt(0);\n\t\t}\n\t\treturn returner.toUpperCase();\n\t}", "static String question(String sentence) {\r\n\t\tString result = null;\r\n\t\tif (sentence.contains(\"can you tell me\")) {\r\n\t\t\tint index = sentence.indexOf(\"can you tell me\");\r\n\t\t\tString search = sentence.substring(index + 15);\r\n\t\t\tresult = googleFind(search);\r\n\t\t} else if (sentence.contains(\"do you know\")) {\r\n\t\t\tint index = sentence.indexOf(\"do you know\");\r\n\t\t\tString search = sentence.substring(index + \"do you know\".length());\r\n\t\t\tresult = googleFind(search);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "String replaceInString(String s) {\n\t\tString newS = s.replaceAll(\"[a-zA-Z]+\", \"WORT\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}", "void setVersesWithWord(Word word);", "void translate(Sentence sentence);", "boolean hasWord();", "private void find(char[] m, String message, Trie cur, Trie root, int index, List<String> results) {\n // Base case 1. No match with any dictionary word. if cur == null -> no match ; return\n if (cur == null) {\n return;\n }\n // Base case 2. if out of bounds, check previously collected word and return\n if (index == message.length()) {\n // result only in case matches word\n if (cur.word != null) {\n results.add(new String(m));\n }\n return;\n }\n char c = message.charAt(index);\n if (c == SPACE) {\n // matches word or character 'e'\n // check if matches word from dictionary\n if (cur.word != null) {\n m[index] = SPACE;\n // if space - start collecting new word from beginning of Trie\n find(m, message, root, root, index + 1, results);\n }\n // otherwise ' ' -> 'e'\n c = 'e';\n }\n // considered non-space character (backtracking)\n m[index] = c;\n // get next element from try\n Trie next = cur.get(c);\n find(m, message, next, root, index + 1, results);\n }", "public static void main(String[] args) {\n\n\t\tString s=\"jai hello njcn jeelos hellos\";\n\t\tString c[]=s.split(\" \");\n\t\t\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\t\n\t\t\tif(c[i].equals(\"hellos\")) {\n\t\t\t\tSystem.out.println(\"preset\");\n\t\t\t}\n\t\t}\n\t}", "static String abbreviation(String a, String b) {\r\n \r\n HashSet<Character> aSet = new HashSet<>();\r\n\r\n for(int i = 0 ; i< a.length() ; i++){\r\n aSet.add(a.charAt(i));\r\n }\r\n \r\n for(int i = 0 ; i < b.length() ; i++){\r\n \r\n if(aSet.contains(b.charAt(i)) ){\r\n aSet.remove(b.charAt(i));\r\n }\r\n else if(aSet.contains(Character.toLowerCase(b.charAt(i)))){\r\n aSet.remove(Character.toLowerCase(b.charAt(i)));\r\n }\r\n else{\r\n return \"NO\";\r\n }\r\n \r\n\r\n }\r\n\r\n Iterator<Character> it = aSet.iterator();\r\n while(it.hasNext()){\r\n\r\n if(!isLowerCase(it.next())){\r\n return \"NO\";\r\n }\r\n }\r\n return \"YES\";\r\n \r\n /*\r\n String regex = \"\";\r\n for(int i = 0 ; i < b.length() ; i++){\r\n regex += \"[a-z]*\" + \"[\" + b.charAt(i) + \"|\" + Character.toLowerCase(b.charAt(i)) + \"]\";\r\n }\r\n regex += \"[a-z]*\";\r\n Pattern ptrn = Pattern.compile(regex);\r\n Matcher matcher = ptrn.matcher(a);\r\n\r\n return matcher.matches() ? \"YES\" : \"NO\";\r\n*/\r\n \r\n /*\r\n int aPtr = 0;\r\n\r\n //b e F g H\r\n // E F H\r\n for(int i = 0 ; i < b.length() ; i++){\r\n\r\n if(aPtr + 1 >= a.length())\r\n return \"NO\";\r\n //if(aPtr + 1 == a.length() && i + 1 == b.length())\r\n // return \"YES\";\r\n\r\n System.out.println(b.charAt(i) + \" \" + a.charAt(aPtr));\r\n if(b.charAt(i) == a.charAt(aPtr)){\r\n aPtr++;\r\n }else if(b.charAt(i) == Character.toUpperCase(a.charAt(aPtr)) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n\r\n } else if(b.charAt(i) != a.charAt(aPtr) && !isLowerCase(a.charAt(aPtr))){\r\n return \"NO\";\r\n }else if(b.charAt(i) != a.charAt(aPtr) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n i--;\r\n }\r\n\r\n\r\n\r\n }\r\n for(int i = aPtr ; i < a.length() ; i++){\r\n if(!isLowerCase(a.charAt(i)))\r\n return \"NO\";\r\n }\r\n\r\n return \"YES\";\r\n */\r\n\r\n }", "public boolean isDeActivationString(String word);", "public void test_extractKeyphrase_A$String() throws Exception {\n\t\tYahooAuctionService target = new YahooAuctionService();\r\n\t\tString text = \"せどり初心者は中古と新品ではどちらが向いているか?\";\r\n\t\tList<String> actual = target.extractKeyphrase(text);\r\n\t\tList<String> expected = null;\r\n\t\tassertEquals(expected, actual);\r\n\t}", "public static String remplaceChaine(String p_texte, String p_old, String p_new) {\n\n\t\tStringBuffer ret = new StringBuffer(p_texte);\n\t\tif (ret!=null){\n\t\t\tfor (int i=0; i< ret.length(); ) {\n\t\t\t\tint deb = ret.toString().indexOf(p_old,i);\n\t\t\t\tif (deb<0) break;\n\t\t\t\tret.replace(deb,deb+p_old.length(),p_new);\n\t\t\t\ti= deb + p_new.length();\n\t\t\t}\n\t\t}\n\n\t\treturn ret.toString();\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}", "public abstract boolean isSingleCharMatcher();", "private String findFrom(String from) {\n\t\tPattern UNIT = Pattern.compile(\"^\\\\w+.\\\\w+(?=\\\\ )\"); // Match two words\n\t\tMatcher m = UNIT.matcher(from);\n\t\twhile (m.find()) {\n\t\t\tfrom = m.group(0);\n\t\t}\n\t\treturn from;\n\t}", "public static void main(String[] args) {\n\n \tString str = \"123abc你好efc\";\n\n \tString reg = \"[\\u4e00-\\u9fa5]\";\n\n \tPattern pat = Pattern.compile(reg); \n\n \tMatcher mat=pat.matcher(str); \n\n \tString repickStr = mat.replaceAll(\"\");\n\n \tSystem.out.println(\"去中文后:\"+repickStr);\n\n}", "public static void main(String[] args) {\n Pattern p = Pattern.compile(\"\\\\bis\\\\b\"); // эффект тот же\n\n Matcher m = p.matcher(\"this island is beautiful\");\n while (m.find()){\n System.out.println(m.start() + \" \" + m.group());\n }\n }", "java.lang.String getNewSentence();", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"This program will replace the word 'hate' with the word 'love' in your text once.\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Please enter a sentence that includes the word 'hate.'\");\n\t\tSystem.out.println();\n\t\t\n\t\tString sentenceHate;\n\t\tsentenceHate = scan.nextLine();\n\t\t\n\t\tString sentenceLove = sentenceHate.replaceFirst(\"hate\", \"love\");\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println(\"I have rephrased that to read \"+ sentenceLove + \".\");\n\t\t\n\t}", "public static void main(String[] args) {\nString word = \"aabbaaaccbbaacc\";\n String result = \"\";\n\n for (int i = 0; i <=word.length()-1 ; i++) {\n\n if(!result.contains(\"\"+word.charAt(i))){ //if the character is not contained in the result yet\n result+=word.charAt(i); //then add the character to the result\n }\n\n }\n System.out.println(result);\n\n\n\n }", "public void process() {\n int secondSpace = songLine.indexOf(' ', (songLine.indexOf(' ') + 1));\n \n if(secondSpace != -1) {\n String firstTwoWords = songLine.substring(0, secondSpace);\n String rest = songLine.substring(secondSpace);\n System.out.printf(\"First two words: %s%n\",firstTwoWords);\n System.out.printf(\"Rest of the words: %s%n\",rest.substring(1));\n }\n \n int thirdSpace = songLine.indexOf(' ', (songLine.indexOf(' ') + 2));\n char firstLetterThirdWord = songLine.charAt(thirdSpace + 1);\n \n int firstOccurance = songLine.indexOf('b');\n \n System.out.printf(\"Length is: %d%n\", songLine.length());\n \n System.out.printf(\"Last character is: %c%n\", songLine.charAt(songLine.length() - 1) );\n \n System.out.printf(\"First letter of the third word: %c%n\",firstLetterThirdWord);\n \n System.out.printf(\"Replaced spaces with x's: %s%n\", songLine.replace(\" \", \"x\"));\n \n System.out.printf(\"Uppercase: %s%n\", songLine.toUpperCase());\n \n System.out.printf(\"Index of first occurence of 'b': %d%n%n\", firstOccurance);\n \n }", "@Test\n public void spacesInKeywordTest() {\n tester.correct(\"Laaa Laaa Laaaa Li\" );\n }", "public boolean isActivationString(String word);", "public String extractSubString(String original,String toTake) {\n String str=\"\";\n boolean condition = true;\n int i =0;\n while(condition)\n {\n if(i>original.length()-1)\n {\n condition=false;\n \n }\n else{\n char c= original.charAt(i);\n if(str.equalsIgnoreCase(toTake)){\n return original.substring(i+1);\n \n }\n \n else if (c!=' ')\n {\n str = str+c;\n }\n i++;\n }\n }\n return null;\n }", "public static String addPuctuation(String input) {\n // Sentence Openers \n input = input.replace(\"hello\", \"hello,\");\n input = input.replace(\"hi\", \"hi!\");\n input = input.replace(\"heya\", \"heya!\");\n input = input.replace(\"hey\", \"hey,\");\n input = input.replace(\"greetings\", \"greetings,\");\n input = input.replace(\"good morning\", \"good morning,\");\n input = input.replace(\"good evening\", \"good evening,\");\n input = input.replace(\"good afternoon\", \"good afternoon!\");\n \n\n // Words ending in nt \n input = input.replace(\"isnt\", \"isn't\");\n input = input.replace(\"cant\", \"can't\");\n input = input.replace(\"wont\" , \"won't\");\n input = input.replace(\"dont\" , \"don't\");\n input = input.replace(\"would\", \"wouldn't\");\n input = input.replace(\"hadnt\", \"hadn't\");\n input = input.replace(\"aint\", \"ain't\");\n input = input.replace(\"arent\", \"aren't\");\n input = input.replace(\"didnt\", \"didn't\");\n input = input.replace(\"doesnt\" , \"doesn't\");\n input = input.replace(\"dont\" , \"don't\");\n input = input.replace(\"dont\", \"don't\");\n input = input.replace(\"hasnt\", \"hasn't\");\n input = input.replace(\"shoudlnt\", \"shouldn't\");\n input = input.replace(\"couldnt\", \"couldn't\");\n input = input.replace(\"wasnt\", \"wasn't\");\n input = input.replace(\"werent\" , \"were't\");\n input = input.replace(\"wouldnt\" , \"wouldn't\");\n\n //Questions\n String q1 = \"what\";\n String q2 = \"when\";\n String q3 = \"where\";\n String q4 = \"which\";\n String q5 = \"who\";\n String q6 = \"whom\";\n String q7 = \"whose\";\n String q8 = \"why\";\n String q9 = \"how\";\n\n if (input.contains(q1) || input.contains(q2) || input.contains(q3) \n || input.contains(q4) || input.contains(q5) || input.contains(q6) \n || input.contains(q7) || input.contains(q8) || input.contains(q9)) \n {\n input = input + \"?\";\n }\n\n else\n {\n input = input + \".\";\n }\n\n\n //Other\n input = input.replace(\"however\", \"however,\");\n input = input.replace(\"ill\" , \"i'll\");\n input = input.replace(\"im\", \"i'm\");\n return input;\n }", "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 int tranzition_extended(String word) {\t\r\n \tint q=0;\r\n \tint i=0;\r\n \tint lenghtOfWord=word.length();\r\n \twhile(i<lenghtOfWord) {\r\n \t\tq=tranzition(q, String.valueOf(word.charAt(i++)));\r\n \t}\r\n \treturn q;\r\n \t\r\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n oldPasword = s.toString();\n }", "public static String getPotentialCommandInText(String text) {\n if (text.charAt(0) == '/') {\n text = text.substring(1);\n }\n Pattern pattern = Pattern.compile(\"^[a-zA-Zа-яА-Я0-9Ёё]+\", Pattern.UNICODE_CHARACTER_CLASS);\n Matcher matcher = pattern.matcher(text);\n if (matcher.find()) {\n String buf = matcher.group(0).trim();\n pattern = Pattern.compile(\"\\\\W$\", Pattern.UNICODE_CHARACTER_CLASS);\n matcher = pattern.matcher(buf);\n if (matcher.find()) {\n return buf.substring(0, buf.length() - 1).toLowerCase();\n }\n return buf.toLowerCase();\n }\n\n return null;\n }", "public void verifyText(VerifyEvent e) {\n\t\t\tboolean ret = true;\r\n\t\t\tfor(int i=0; i < e.text.length(); i ++){\r\n\t\t\t\tret = \"0123456789.\".indexOf(e.text.charAt(i)) >= 0;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\te.doit = ret;\r\n\t\t}", "boolean matchDecomp(String str, String pat, String lines[]) {\n if (! EString.match(pat, \"*@* *\", lines)) {\n // no synonyms in decomp pattern\n return EString.match(str, pat, lines);\n }\n // Decomp pattern has synonym -- isolate the synonym\n String first = lines[0];\n String synWord = lines[1];\n String theRest = \" \" + lines[2];\n // Look up the synonym\n WordList syn = find(synWord);\n if (syn == null) {\n System.out.println(\"Could not fnd syn list for \" + synWord);\n return false;\n }\n for (String word : syn) {\n // Make a modified pattern\n pat = first + word + theRest;\n if (EString.match(str, pat, lines)) {\n int n = EString.count(first, '*');\n // Make room for the synonym in the match list.\n for (int j = lines.length-2; j >= n; j--)\n lines[j+1] = lines[j];\n // The synonym goes in the match list.\n lines[n] = word;\n return true;\n }\n }\n return false;\n }", "@Test\n public void testPatter(){\n String str = \"select * from t_user where deletea dropa\";\n str = str.toUpperCase();\n // String re = \"(update|delete|insert|drop|alter)\";\n // String re = \"(update\\\\b)|(delete\\\\b)|(insert)|(drop)|(alter)\";\n // String re = \"\\\\b[(update)|(delete)|(insert)|(drop)|(alter)\\\\b\";\n // System.out.println(str.indexOf(\"updatea\"));\n // System.out.println(\"update\".matches(str));\n // System.out.println(str.matches(re));\n /* System.out.println(re.matches(str));\n String[] ss = str.split(re);\n System.out.println(ss.length);\n for(String s: ss){\n System.out.println(s);\n }*/\n\n String re =\"(\\\\bupdate\\\\b)|(\\\\bdelete\\\\b)|(\\\\binsert\\\\b)|(\\\\bdrop\\\\b)|(\\\\balter\\\\b)\";\n Pattern p = Pattern.compile(re,Pattern.CASE_INSENSITIVE );\n Matcher m = p.matcher(str);\n System.out.println(m.find());\n\n }", "public String acronym(String phrase) {\n String accrStr = phrase.replaceAll(\"\\\\B.|\\\\P{L}\", \"\").toUpperCase();\n return accrStr;\n }", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"Ingrese Frase\");\n String frase = sc.nextLine();\n\n System.out.println(frase.replace(\" \",\"\"));\n }", "private boolean verificarText(String text,String campo) {\n\t\tif(text.length()==0) {\n\t\t\tJOptionPane.showMessageDialog(null,\"Error \"+campo +\": campo vacio\");\n\t\t\treturn false;\n\t\t}\n\t\t//\n\t\tfor(int i =0;i<text.length();i++) {\n\t\t\tif(text.charAt(i)!=' ') {\n\t\t\t\tif((text.charAt(i)<'a' || text.charAt(i)>'z'&& (text.charAt(i)<'A' || text.charAt(i)>'Z') ) ) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"Error \"+campo +\": Se ingreso un numero o caracter especial\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "private static String analyzeTerm(String term) {\n String ret = term.toLowerCase();\n if (stopWords.contains(ret) || ret.isEmpty())\n return \"\";\n return stemmer.stem(ret);\n }", "@Test\n public void shouldTranslateWithRegionalVariant() {\n List<String> sentence = Arrays.asList(\"it\", \"is\", \"cold\");\n String result = \"\";\n for (String token : sentence) {\n result += manager.message(Locale.CANADA_FRENCH, token, token) + \" \";\n }\n assertEquals(\"Il fait frette \", result);\n }", "String stemOf (String word);", "public static void main(String[] args) {\n\t\tint hate = TEXT.indexOf(\"hate\");\n\t\tString newText = TEXT.substring(0, hate)+ \"love\" + TEXT.substring(hate+4);\n\t\t\n\t\tSystem.out.println(\"The line of text to be changed is: \\n\" + TEXT);\n\t\tSystem.out.println(\"I have rephrased that line to read: \\n\" + newText);\n\t}", "public static String getWord(String sentence, char word) {\n\t\tString[] words;\n\t\twords = sentence.split(\" \");\n\t\tString cleanedWord=\"\";\n\t\t\n\t\tif(word=='f') {//return the first word\n\t\t\tString temp = words[0];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else {//return the last word\n\t\t\tString temp = words[words.length -1];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn cleanedWord;\n\t}", "private static String convertToLatin(String word)\n {\n return word.substring(1) + word.substring(0,1) + \"ay\";\n }", "java.lang.String getWord();", "public String traduciraMorse(String texto, Boolean condicion) {\n String cadena = \"\";\n Boolean encontrada;\n\n // TEXTO a MORSE\n if (condicion == false) {\n for (int i = 0; i < texto.length(); i++) {\n String refuerzo = String.valueOf(texto.charAt(i));\n encontrada = false;\n for (Morse aux : AccesoFichero.lMorse) {\n if (aux.getLetra().equalsIgnoreCase(refuerzo)) {\n cadena += aux.getCodigo() + \" \";\n encontrada = true;\n }\n }\n if (encontrada == false) {\n cadena += \" \";\n }\n\n }\n // MORSE a TEXTO\n } else {\n String[] refuerzo = texto.split(\" \");\n for (int i = 0; i < refuerzo.length; i++) {\n\n encontrada = false;\n for (Morse aux : AccesoFichero.lMorse) {\n if (aux.getCodigo().equalsIgnoreCase(refuerzo[i])) {\n cadena += aux.getLetra() + \" \";\n encontrada = true;\n }\n }\n if (encontrada == false) {\n cadena += \" \";\n }\n\n }\n }\n\n return cadena;\n }", "public static boolean isFirstWordInSentence(String word) {\n return word.matches(\"\\\\p{Punct}*\\\\p{Lu}[\\\\p{L}&&[^\\\\p{Lu}]]*\");\n }", "public String getEngWordFromThaiWord(String thaiWord) {\n Cursor cursor = mDatabase.query(\n TABLE_NAME,\n new String[]{COL_ENG_WORD},\n COL_THAI_WORD + \"=?\",\n new String[]{thaiWord},\n null,\n null,\n null\n );\n if (cursor.getCount() > 0) {\n cursor.moveToFirst();\n return cursor.getString(cursor.getColumnIndex(COL_ENG_WORD));\n } else {\n return thaiWord;\n }\n }", "static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}", "public boolean closeString(String word1, String word2) {\n\n \n }", "public static void main(String[] args) {\nScanner scn=new Scanner(System.in);\nSystem.out.println(\"你好 請問你是\");\nString a = scn.next();\nSystem.out.println(\"你好\"+a+\"請問你就讀哪所學校\");\nString b=scn.next();\nSystem.out.println(a+\"原來你是\"+b+\"畢業的阿\");\nSystem.out.println(\"請問你就讀甚麼科系\");\nString c=scn.next();\nSystem.out.println(\"挖~~\"+c+\"是很好的科系耶,你實在太厲害了:)\");\nSystem.out.println(\"你畢業後要做甚麼工作啊?\");\nString d=scn.next();\nSystem.out.println(d+\"這個工作不錯啊,真羨慕你!~~\");\n\t}" ]
[ "0.64361817", "0.59564024", "0.58805484", "0.5596933", "0.55140996", "0.5489735", "0.5448024", "0.536752", "0.5353045", "0.532371", "0.5290184", "0.5283836", "0.52837396", "0.5276189", "0.52539456", "0.5239388", "0.5236741", "0.5224229", "0.5216409", "0.51682466", "0.51316106", "0.51170045", "0.51167285", "0.51041025", "0.5089103", "0.5083083", "0.5080222", "0.50711954", "0.50496876", "0.5040111", "0.5030731", "0.50300634", "0.50275594", "0.5023163", "0.5015222", "0.501322", "0.50025654", "0.49913505", "0.4988734", "0.4971431", "0.49650156", "0.49556464", "0.49400285", "0.49233413", "0.49185354", "0.4909932", "0.49040097", "0.4888399", "0.48859945", "0.48838577", "0.48759836", "0.48597455", "0.48578173", "0.48348314", "0.48310158", "0.48280698", "0.4814553", "0.48109734", "0.48109347", "0.48050457", "0.48029694", "0.4800381", "0.4800174", "0.4800149", "0.47974738", "0.47920835", "0.47893503", "0.47764546", "0.47754756", "0.47740072", "0.47667152", "0.47610164", "0.4751733", "0.47489354", "0.47476068", "0.474741", "0.47472012", "0.4746874", "0.47465158", "0.47451395", "0.4736187", "0.47345465", "0.47341606", "0.4732064", "0.4731494", "0.4730818", "0.47301713", "0.47287115", "0.47180668", "0.47179833", "0.47128606", "0.4711383", "0.47083673", "0.47082913", "0.4703206", "0.46985945", "0.46925578", "0.46925098", "0.46897227", "0.46883893", "0.46799105" ]
0.0
-1
Decrypte un caractere avec les clees prive
private BigInteger decrypt(BigInteger encrypted, BigInteger privateKey, BigInteger modulus){ return encrypted.modPow(privateKey, modulus); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String Decrypt(String s);", "public String decrypt(String key);", "public String decrypt(String cipherText);", "String decryptString(String toDecrypt) throws NoUserSelectedException, IllegalValueException;", "@Override\n public void decrypt() {\n algo.decrypt();\n String cypher = vigenereAlgo(false);\n this.setValue(cypher);\n }", "public String decrypt(String msg) {\n \n StringBuilder sb = new StringBuilder(msg);\n \n for (int i=0; i< sb.length(); i++) {\n char decrypted = decrypt(sb.charAt(i));\n sb.setCharAt(i, decrypted);\n }\n \n return sb.toString();\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}", "char decipher(int charToDeCipher);", "String decryptHiddenField(String encrypted);", "public String decrypt(String input)\n {\n CaesarCipherTwo cipher = new CaesarCipherTwo(26 - mainKey1, 26 - mainKey2);\n return cipher.encrypt(input);\n }", "void decryptCode() {\n StringBuilder temp = new StringBuilder(\"\");\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // append char to temp if char at i is not a multiple of z\n if (!(i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) || i == 0)\n temp.append(this.getText().charAt(i));\n }\n\n this.setText(temp);\n\n \n // Step 2:\n\n // split phrase up into words\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if y1x3x4 is at the end of the word, remove it from word\n \n if (words.get(i).substring(words.get(i).length() - 3, words.get(i).length())\n .equals(this.getSecretKey().substring(3, 6)))\n words.set(i, words.get(i).substring(0, words.get(i).length() - 3));\n\n // if x1x2 is at the end of the word\n else {\n // remove x1x2 from end\n words.set(i, words.get(i).substring(0, words.get(i).length() - 2));\n \n // move last char to beginning\n words.set(i, words.get(i).charAt(words.get(i).length() - 1) + words.get(i).substring(0, words.get(i).length() - 1));\n }\n }\n\n temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n }", "private static String decrypt(String in){\n\n\t\t\tString alphabet = \"1234567890\";\n\n\t\t\tString scramble1 = \"<;\\'_$,.?:|)\";\n\t\t String scramble2 = \"XYZVKJUTHM\";\n\t\t String scramble3 = \"tuvwxyz&*}\";\n\t\t String scramble4 = \"~!-+=<>%@#\";\n\t\t String scramble5 = \"PUDHCKSXWZ\";\n\n\t\t char messageIn[] = in.toCharArray();\n\t\t String r = \"\";\n\n\t\t for(int i = 0; i < in.length(); i++){\n\t\t if(i % 3 == 0){\n\t\t int letterIndex = scramble1.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }else if (i % 3 == 1){\n\t\t int letterIndex = scramble2.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }else if (i % 3 == 2){\n\t\t int letterIndex = scramble3.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }\n\t\t }\n\t\treturn r;\n\t}", "@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 decryptMsg(String encryptedMsg) {\n encryptedMsg.toLowerCase(Locale.ROOT);\n\n //replace the things with the properties\n encryptedMsg = encryptedMsg.replace(\"1\", \"a\");\n encryptedMsg = encryptedMsg.replace(\"3\", \"e\");\n encryptedMsg = encryptedMsg.replace(\"5\", \"i\");\n encryptedMsg = encryptedMsg.replace(\"7\", \"o\");\n encryptedMsg = encryptedMsg.replace(\"9\", \"u\");\n\n //return the right value\n return encryptedMsg;\n }", "void decryptMessage(String Password);", "public String decrypt(String word){\n\tString result = \"\";\n\tString wordLower = word.toLowerCase(); \n\tfor(int i=0; i<wordLower.length(); i++){\n\t if(wordLower.charAt(i)<97 || wordLower.charAt(i)>122)\n\t\tthrow new IllegalArgumentException();\n\t int a = (wordLower.charAt(i)-97);\n\t int b = (int)Math.pow(a,privateD);\n\t int k = (b%26)+97;\n\t result += Character.toString((char)k);\n\t}\n\treturn result;\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 static String decrypt(String text) {\r\n\t\tString originalText = \"\";\r\n\t\tchar character;\r\n\t\tint code = 0;\r\n\t\tfor (int i = 0; i < text.length(); i++) {\r\n\t\t\tcharacter = text.charAt(i);\r\n\t\t\tcode = character - 7;\r\n\t\t\tcharacter = (char) code;\r\n\t\t\toriginalText += Character.toString(character);\r\n\t\t}\r\n\t\treturn originalText;\r\n\t}", "@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = new char[msg.length()];\n int actKey = key % 65536;\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n decMsg[ind] = (char) ((letter - actKey < 0) ? letter - actKey + 65536 : letter - actKey);\n }\n return new String(decMsg);\n }\n }", "String decrypt(String text) {\n\t\tchar letter;\n\t\tString finalString = \"\";\t\t\t\t\t// slutliga klartexten\n\t\tint start = key.getStart();\t\t\t\t\t// deklarerar nyckelns startläge\n\t\tint k ;\t\t\t\t\t\t\t\t\t\t// variabel för bokstavens startläge i vanliga alfabetet\n\t\tStringBuilder sb = new StringBuilder();\t\t\t\t\t// skapar en stringbuilder som kan modifieras, bygger upp textsträngar av olika variabler\n\t\t\t\t\t\t\n\t\t// loopen går igenom alla tecken i min krypterade text \t\t\t\n\t\tfor(int i = 0; i < text.length(); i++) {\t\t\t// for-loop för att gå igenom hela texten\t\t\t\t\n\t\t\tletter = text.charAt(i);\t\t\t\t\t\t// ger bokstaven på platsen 0,1,2,3.....\n\t\t\tif(letter == ' ') {\t\t\t\t\t\t\t\t// om det är ett blanktecken så ska det vara ett blanktecken\n\t\t\t\tsb.append(' ');\t\t\t\t\t\t\t\t// sparar blanksteg i en stringBuilder\n\t\t\t} else {\n\t\t\t\tint index=0;\n\t\t\t\tstart=start%26;\t\t\t\t\t\t\t\t// vi behöver endast 26 värden\n\t\t\t\tkey.getStart();\n\n\t\t\t\t\n\t\t\t\twhile(index<26 &&(letter!=key.getLetter(index))) {\t\t// så länge som chiffret inte motsvarar förskjutningen\n\t\t\t\t\tindex++;\t\t\t\t\t\t\t\t\t\t\t// så fortsätter den leta\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tk=index-start;\n\t\t\t\t\n\t\t\t\tif(k>=0)\n\t\t\t\t\tletter=(char)('A'+k);\n\t\t\t\telse letter=(char)('Z'-(start-1-index));\t\t\t\t// räknar från index, om index mindre än start så räknar den bakåt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// så att det inte blir tokigt mellan Z och A.\n\t\t\t\t\n\t\t\t\tsb.append(letter);\t\t\t\t\t\t\t\t\t\t//lagrar bokstav i stringBuilder\n\t\t\t\tstart++;\t\t\t\t\t\t\t\t\t\t\t\t//chiffret börjar om\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\n\t\t\t}\n\t\treturn sb.toString();\t\t\t\t\t\t\t\t\t\t// returnerar sluttexten\n\t\t}", "public String Decrypt(String Message, int PrimeNo, String EncoderKeyPath) throws IOException\r\n {\r\n Scanner sc = new Scanner(System.in);\r\n Key key1 = new Key();\r\n char[] msg=new char[Message.length()];\r\n int s, x;\r\n System.out.println(\"Enter Your Secret Key To Decode \");\r\n x=sc.nextInt();\r\n int key = key1.Skey(PrimeNo, x, EncoderKeyPath);\r\n char s1;\r\n int len=Message.length();\r\n int res=0;\r\n\tfor(int i=0;i<len;i++)\r\n\t{\r\n res=i%key;\r\n s=Message.charAt(i);\r\n s-=res;\r\n s1= (char) s;\r\n msg[i]=s1;\t\r\n\t}\r\n String msg1 = new String(msg);\r\n return msg1; \r\n }", "public static String decryptBellaso(String encryptedText, String bellasoStr) {\r\n String decryptedText = \"\";\r\n\t\t\r\n\t\tchar [] deText = new char[encryptedText.length()];\r\n\t\t\r\n\t mappingKeyToMessage(bellasoStr,encryptedText);\r\n\t \r\n\t char [] enText = encryptedText.toCharArray();\r\n\t\tchar [] blText = bellasoStr.toCharArray();\r\n\t\t\r\n\t\tint i=0;\r\n\t\tint diff = 0;\r\n\t\t\r\n\t\tdiff = diff + enText[i];\r\n\t\tdiff = diff + blText[1];\r\n\t\tdiff += RANGE;\r\n\t\tSystem.out.print(diff);\r\n\t\tdo {\r\n\t\t\tfor(char m: enText) {\r\n\t\t\t\r\n\t\t\t\tif (diff <32) {\r\n\t\t\t\t\tdiff += RANGE;\r\n\t\t\t\t\tm += diff;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tm +=diff;\r\n\t\t\t\t\tdeText[i] = m;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}while(i<encryptedText.length());\r\n\t\tdecryptedText = String.valueOf(deText);\r\n\t\t\r\n\t \r\n\t return decryptedText; \r\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 String decrypt (String input) {\n return new CaesarCipherTwo(ALPHABET_LENGTH-mainKey1, ALPHABET_LENGTH-mainKey2).encrypt(input);\n }", "public static String decrypt(String input) {\n\t\t Base64.Decoder decoder = Base64.getMimeDecoder();\n\t String key = new String(decoder.decode(input));\n\t return key;\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}", "@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 text) {\n return content.decrypt(text);\n }", "public static String decryptCaesar(String encryptedText, int key) {\r\n\t\tchar [] eText = encryptedText.toCharArray();\r\n\t\tchar [] pText = new char[encryptedText.length()];\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tdo {\r\n\t\t\tfor(char t: eText) {\r\n\t\t\t\t\r\n\t\t\t\tt -=key;\r\n\t\t\t\tpText[i] = t;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}while(i<encryptedText.length());\r\n\t\tString st = String.valueOf(pText);\r\n\t\treturn st;\r\n\t}", "public abstract String decryptMsg(String msg);", "@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = 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 int temp = letter - 'a' - key;\n decMsg[ind] = (char) ('a' + (char) ((temp < 0) ? temp + 26 : temp));\n } else if (letter >= 'A' && letter <= 'Z') {\n int temp = letter - 'A' - key;\n decMsg[ind] = (char) ('A' + (char) ((temp < 0) ? temp + 26 : temp));\n } else {\n decMsg[ind] = letter;\n }\n }\n return new String(decMsg);\n }\n }", "void decrypt(ChannelBuffer buffer, Channel c);", "public static String caesar3decrypt(String x) {\n char y[]=x.toCharArray();\n for (int i = 0; i < x.length(); i++) {\n int asciivalue = (int) y[i];\n if ((asciivalue >= 68 && asciivalue <= 90) || (asciivalue >= 100 && asciivalue <= 122)) {\n y[i] = (char) (asciivalue - 3);\n } else if ((asciivalue >= 65 && asciivalue <= 67) || (asciivalue >= 97 && asciivalue <= 99)) {\n y[i] = (char) (asciivalue + 23);\n }\n }\n return (new String(y));\n }", "private char decrypt(char ch) {\n char chUC = Character.toUpperCase(ch);\n int cind = ALPHABET.indexOf(chUC);\n // do not decrypt non letters\n if (cind == -1) return ch;\n \n // index of decrypted character\n int dind = (cind - key) % 26;\n \n // java can return negative from modulo:\n if (dind <0) dind+=26;\n \n // decrypted uppercase character\n char dch = ALPHABET.charAt(dind);\n \n // check original case and return decrypted char\n if (Character.isUpperCase(ch)) return dch;\n else return Character.toLowerCase(dch);\n }", "public String Decryption(BigInteger text){\n \tStringBuilder str = new StringBuilder();\n BigInteger decryptor = text.multiply(r.modInverse(q)).mod(q);\n int ch = 0;\n int cursor2 = 1;\n /*\n * Traverse w list, if element is small or equal to decryptor, then subtract\n * decryptor with the element. If cursor2 arrive to 128, it means we already\n * traverse 8 bits, convert the 8 bits to char and append to str, finally\n * reverse the str\n */\n for(int i = w.length;i > 0;i--){\n \t\tif(w[i-1].compareTo(decryptor) < 1){\n \t\t\tdecryptor = decryptor.subtract(w[i-1]);\n \t\t\tch += cursor2;\n \t\t}\n \t\tif(cursor2 == 128){\n \t\t\tstr.append((char) ch);\n \t\t\tcursor2 = 1;\n \t\t\tch = 0;\n \t\t\tcontinue;\n \t\t}\n \t\tcursor2 <<= 1;\n \t}\n return str.reverse().toString();\n }", "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 msg) {\n if (map == null) {\n getMapping();\n }\n\n // Find cipher match\n String ch = \"\";\n for (int j = 0; j < map.length; j++) {\n if ((map[j][0] + \"\").equals(msg)) {\n ch = (char)j + \"\";\n }\n }\n\n return ch;\n }", "public String decrypt(String p, String pv, String md){\n char a;\n BigInteger b;\n String c = \"\", d = \"\";\n \n for(int i = 0; i < p.length(); i++){\n if((int)p.charAt(i) != 29)\n c += p.charAt(i);\n else{\n b = new BigInteger(c);\n a = (char)decrypt(b, new BigInteger(pv), new BigInteger(md)).intValue();\n d += a;\n c = \"\";\n }\n }\n return d;\n }", "String decrypt(String input) {\n\t\treturn new String(BaseEncoding.base64().decode(input));\n\t}", "public static String decryptCaesar(String encryptedText, int key) {\r\n\t\t// copying plaintext into char array.\r\n\t\tchar[] ipArr = encryptedText.toCharArray();\r\n\t\tchar[] opArr = new char[ipArr.length];\r\n\t\tint tmp = '0';\r\n\t\twhile(key > RANGE)\r\n\t\t{\r\n\t\t\tkey=key-RANGE;\r\n\t\t}\t\t\t\r\n\t\tfor (int i = 0; i < ipArr.length; i++) {\r\n\t\t\t\r\n\t\t\t\ttmp = (ipArr[i]+RANGE)-key;\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tif(tmp>UPPER_BOUND) \r\n\t\t\t\t{\r\n\t\t\t\t\ttmp=tmp-RANGE;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(tmp<LOWER_BOUND) \r\n\t\t\t\t{\r\n\t\t\t\t\ttmp=tmp+RANGE;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\topArr[i]=(char)tmp;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn new String(opArr);\r\n\t}", "@GetMapping(\"/decrypt\")\n public String decrypt(String uid, String data) {\n return \"\";\n }", "public String entschlüsseln(SecretKey key, String nachricht) throws Exception{\n BASE64Decoder myDecoder2 = new BASE64Decoder();\n byte[] crypted2 = myDecoder2.decodeBuffer(nachricht);\n\n // Entschluesseln\n Cipher cipher2 = Cipher.getInstance(\"AES\");\n cipher2.init(Cipher.DECRYPT_MODE, key);\n byte[] cipherData2 = cipher2.doFinal(crypted2);\n String erg = new String(cipherData2);\n\n // Klartext\n return(erg);\n\n}", "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 }", "@Override\n\tpublic void Decrypt(Object key) {\n\n\t}", "public String ebcDecrypt(String ciphertext, String key) {\n\t\treturn AESEBC.AESDecrypt(ciphertext, key);\n\t}", "public static String decrypt(String str)\n {\n return encrypt(str);\n }", "public static String decrypt(String s, char key) {\n \treturn Utilities.decrypt(s, (byte) key);\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}", "private String decodageCesar(String text) {\n if (text == null || text.equals(\"\")) {\n throw new AssertionError(\"Aucun texte n'est saisie\");\n }\n String decoding = decodageMot(text);\n SubstCipher decodingText = new SubstCipher(this.shiftAlea);\n decodingText.ensureNegativeShift();\n decodingText.buildShiftedTextFor(decoding);\n return decodingText.getLastShiftedText();\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}", "public String decode(String cipher)\n {\n \treturn null;\n }", "public String decrypt(String message) {\t\n\t\tchar [] letters = new char [message.length()];\n\t\tString newMessage = \"\";\n\n\t\t//create an array of characters from message\n\t\tfor(int i=0; i< message.length(); i++){\n\t\t\tletters[i]= message.charAt(i);\n\t\t}\n\n\t\tfor(int i=0; i<letters.length; i++){\n\t\t\tif(Character.isLetter(letters[i])){ //check to see if letter\n\t\t\t\tif(Character.isUpperCase(letters[i])){ //check to see if it is uppercase\n\t\t\t\t\tnewMessage += letters[i]; //add that character to new string\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//new message is the string that needs to be decrypted now \n\t\t//change the letters into numbers\n\t\tint [] decryptNums = new int[newMessage.length()];\n\t\tString alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t\tfor(int i=0; i < newMessage.length(); i++){\n\t\t\tchar c = newMessage.charAt(i);\n\t\t\tint x = alphabet.indexOf(c) + 1;\n\t\t\tdecryptNums[i] = x;\n\t\t}\n\n\n\t\t//generate key from those numbers\n\t\tint[] keyNum = new int [decryptNums.length];\n\t\tfor(int i=0; i<decryptNums.length; i++){\n\t\t\tint x = getKey();\n\t\t\tkeyNum[i] = x;\n\t\t}\n\n\t\t//subtract letter number from key number\n\t\tint[] finalNum = new int [keyNum.length];\n\t\tfor(int i=0; i<keyNum.length; i++){\n\t\t\tint x= decryptNums[i]-keyNum[i];\n\t\t\tif(keyNum[i] >=decryptNums[i] ){\n\t\t\t\tx = x+26;\n\t\t\t\tfinalNum[i]=x;\n\t\t\t}else{\n\t\t\t\tfinalNum[i]=x;\n\t\t\t}\n\t\t}\n\n\t\t//now re match the alphabet to it \n\t\tchar[] finalChar = new char [finalNum.length];\n\n\t\tfor(int i=0; i< finalNum.length; i++){\n\t\t\tint x = finalNum[i]-1;\n\t\t\tchar c = alphabet.charAt(x);\n\t\t\tfinalChar[i]=c;\n\t\t}\n\n\t\tString decrypt = \"\";\n\t\tfor(int i=0; i< finalChar.length; i++){\n\t\t\tdecrypt += finalChar[i];\n\t\t}\n\t\t\n\t\treturn decrypt;\n\t}", "public static String decrypt(String text, int key) {\n return encrypt(text, -key);\n }", "public String preprocessingDecryptToDisplay(String in);", "public static String decryptBellaso(String encryptedText, String bellasoStr) {\r\n\t\t// Variables\r\n\t\tString decrypted = \"\"; // To be built, char by char\r\n\t\tint bl = bellasoStr.length(); // Bellaso string length\r\n\t\tint lb = (int) LOWER_BOUND; // Lower bound converted to index int\r\n\t\t\r\n\t\t// Loops\r\n\t\tfor (int i = 0; i < encryptedText.length(); i++) {\r\n\t\t\t// Variables\r\n\t\t\tchar c = encryptedText.charAt(i); // Decrypt character at index i of string encryptedText\r\n\t\t\tint dc = (int)c - (int)bellasoStr.charAt(i % bl);\r\n\t\t\t\r\n\t\t\t// Loops\r\n\t\t\twhile (dc < lb) { dc += RANGE; }\r\n\t\t\t\r\n\t\t\t// Append to string\r\n\t\t\tdecrypted += (char) dc;\r\n\t\t}\r\n\t\t\r\n\t\t// Return\r\n\t\treturn decrypted;\r\n\t}", "public byte[] Tdecryption() {\n int[] plaintext = new int[message.length];\n\n for (int j = 0, k = 1; j < message.length && k < message.length; j = j + 2, k = k + 2) {\n sum = delta << 5;\n l = message[j];\n r = message[k];\n for (int i = 0; i < 32; i++) {\n r = r - (((l << 4) + key[2]) ^ (l + sum) ^ ((l >> 5) + key[3]));\n l = l - (((r << 4) + key[0]) ^ (r + sum) ^ ((r >> 5) + key[1]));\n sum = sum - delta;\n }\n plaintext[j] = l;\n plaintext[k] = r;\n }\n return this.Inttobyte(plaintext);\n }", "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 }", "private static int decrypt(int index) {\n\t int k1_inv = 9; \n\t int k2 = 1;\n\t // add 26 to index to avoid error when (index - k2) <= 0\n\t index = (((index+26) - k2)*(k1_inv))%26;\n\t return index;\n }", "@Override\r\n\tpublic String decrypt(String cipher) {\n\t\treturn null;\r\n\t}", "@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}", "public String decrypt(final String value) {\n\t\treturn encryptor.decrypt(value);\n\t}", "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 static String decipher(String ciphertext, String key) {\n\t\treturn encipher(ciphertext, key, -1);\n\t}", "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 }", "public static String breakCipher(String input) {\n int key = getKey(input);\n System.out.println(\"Found key: \"+key);\n CaesarCipherOne cc = new CaesarCipherOne(key);\n return cc.decrypt(input);\n \n }", "public static String decryptPassword(String s)\n {\n String pass = \"\";\n int i = 0;\n while (i < s.length() - 1)\n {\n char ch = s.charAt(i);\n char ch2 = s.charAt(i + 1);\n if (Character.isLowerCase(ch2) && Character.isUpperCase(ch) && Character.isSpecia;) {\n pass = pass + ch2 + ch + \"*\";\n i = i + 2;\n }\n if (Character.isDigit(ch)) {\n pass = \"0\"+pass;\n i = i + 1;\n } else {\n pass = pass + ch;\n i = i + 1;\n }\n }\n return pass;\n }", "public EncryptorReturn decrytp(String in) throws CustomizeEncryptorException;", "String decrypt(PBEncryptStorage pbeStorage, String password, byte[] salt);", "public void onClick(View planes) {\n \tString editText1=edit1.getText().toString();\n \tString decrypting = StringTranslater.decryptString(editText1);\n \tresult.setText(decrypting);\n }", "public static void main(String[] args) \r\n {\n String message1 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n System.out.println(encrypt (message1, 3));\r\n System.out.println(decrypt (encrypt(message1,3) ,3));\r\n System.out.println(encrypt(message1.toLowerCase(),5));\r\n \r\n System.out.println(decrypt(encrypt(message1.toLowerCase() ,5 ) ,5));\r\n }", "public ArrayList<Integer> decryptCycle() {\r\n\r\n for (int i = 0; i < 416; i++) {\r\n for (int j = 0; j < 8; j++) {\r\n pulse();\r\n }\r\n updateDecrypt();\r\n }\r\n return ciphertext;\r\n }", "public String tableDecrypt(String ciphertext, String key) {\n\t\treturn AESMain2.AESDecrypt(ciphertext, key);\n\t}", "public static void main(String[] args) {\n\t\tScanner in = new Scanner (System.in);\n\t\t\n\t\tSystem.out.println(\"Please enter four digit number to be decrypted.\");\n\t\tString num = in.next();\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Your decrypted number is \" +num);\n\t\tSystem.out.print((((num.charAt(2)-48)+10)-7)%10);\n\t System.out.print((((num.charAt(3)-48)+10)-7)%10);\n\t System.out.print((((num.charAt(0)-48)+10)-7)%10);\n\t System.out.print((((num.charAt(1)-48)+10)-7)%10);\n\t\t\n\t\t\n\t\t\n\t}", "public static String decryptCaesar(String encryptedText, int key) {\r\n\t\t// Variables\r\n\t\tString decrypted = \"\"; // Decrypted text string, needs to be built character by character\r\n\t\t\r\n\t\t// Loops\r\n\t\tfor (int i = 0; i < encryptedText.length(); i++) {\r\n\t\t\tchar c = encryptedText.charAt(i); // Encrypted character at index i of string encryptedText\r\n\t\t\tint dc = (int)c - key;\r\n\t\t\t\r\n\t\t\t// Loops\r\n\t\t\twhile (dc < LOWER_BOUND) { dc += RANGE; }\r\n\t\t\t\r\n\t\t\t// Append to string\r\n\t\t\tdecrypted += (char) dc;\r\n\t\t}\r\n\t\t\r\n\t\t// Return\r\n\t\treturn decrypted;\r\n\t}", "public static String decryptCaesarShift(String s){\n String s1 = s.toUpperCase();\n \n /* Converting the string to a character sequence */\n char[] sequence = new char[s1.length()];\n for(int i = 0; i < sequence.length; i++){\n sequence[i] = s1.charAt(i);\n }\n \n for(int i = 0; i < sequence.length; i++){\n if(sequence[i] == ' ') continue;\n sequence[i] = (char)((sequence[i] - 65 - shift + 26)%26 + 65);\n }\n \n String result = \"\";\n for(int i = 0; i < sequence.length; i++){\n result = result + sequence[i];\n }\n \n return result;\n }", "public BigIntegerMod decrypt(Ciphertext ciphertext);", "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}", "public static void main(String[] args) {\n System.out.println(decryptFunction());\n //decryptFunction();\n\n }", "public static String decryptBellaso(String encryptedText, String bellasoStr) {\r\n\t\t\r\n\t\t// coping encryptedText and bellasoStr into char array.\r\n\t\t\t\t\tchar[] pTxtArray = encryptedText.toCharArray();\r\n\t\t\t\t\tchar[] bTxtArray = bellasoStr.toCharArray();\r\n\t\t\t\t\tchar[] refArray=new char[pTxtArray.length];\r\n\t\t\t\t\tchar[] ecrptArray=new char[pTxtArray.length];\r\n\t\t\t\t\tint counter=0;\r\n\t\t\t\t\tint offset=0;\r\n\t\t\t\t\tchar temp=0;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//Copy complete array into reference array as many time as required\r\n\t\t\t\t\t\t//When plain String is greater than bellaso string.\r\n\t\t\t\t\t\twhile((pTxtArray.length-counter)>=bTxtArray.length)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfor(int i=counter,j=0;j<bTxtArray.length;j++,i++) {\r\n\t\t\t\t\t\t\trefArray[i]=bTxtArray[j];\r\n\t\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t \t//gathering phase\t\t\r\n\t\t\t\t\t\tfor(int i=counter,j=0;i<pTxtArray.length;i++,j++) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trefArray[i]=bTxtArray[j];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t// Offset calculation.\r\n\t\t\t\t\tfor(int i=0;i<refArray.length;i++) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\toffset=pTxtArray[i]+RANGE;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\ttemp=(char)(offset-refArray[i]);\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(temp>UPPER_BOUND) {\r\n\t\t\t\t\t\t\ttemp=(char) (temp-RANGE);\r\n\t\t\t\t\t\t}else if (temp<LOWER_BOUND) {\r\n\t\t\t\t\t\t\ttemp=(char) (temp+RANGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tecrptArray[i]=temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\treturn new String(ecrptArray);\r\n\t\t\t\t}", "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 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 static void main(String[] args) {\n\n\t\tSystem.out.println(decreaptChar('z'));\n\t\tSystem.out.println(decreaptChar('m'));\n\t\tString normal = \"kgb\";\n\t\tString encripted = decriptWord(normal);\n\t\tSystem.out.println(\"normal: \" + normal);\n\t\tSystem.out.println(\"encreapted; \" + encripted);\n\t\tSystem.out.println(decryptSentence(\"r olev qzez\"));\n\t\tSystem.out.println(decryptSentence(\"qzez rh ufm\"));\n\t\tSystem.out.println(decryptSentence(\"dv ziv hgfwvmgh lu xbyvigvp hxsllo\"));\n\t\tSystem.out.println(decryptSentence(\"szev z tllw wzb\"));\n\t\tSystem.out.println(decryptSentence(\"ovgh tl slnv\"));\n\t\tSystem.out.println(decriptWord(\"nrihslw\"));\n\t\tSystem.out.println(decryptSentence(\"dllwvm hkllm\"));\n\t\t\n\t}", "public static String decryptString(String text, int key) {\r\n String decryptedText = \"\";\r\n String alpha = shiftAlphabet(0);\r\n String newAlpha = shiftAlphabet(key);\r\n text = ungroupify(text);\r\n for (int i = 0; i < text.length(); i++) {\r\n String currentLetter = String.valueOf(text.charAt(i));\r\n int indexOfLetter = newAlpha.indexOf(currentLetter);\r\n String letterReplacement = String.valueOf(alpha.charAt(indexOfLetter));\r\n decryptedText += letterReplacement;\r\n\r\n }\r\n return decryptedText;\r\n }", "protected void setDecripted() {\n content = this.aesKey.decrypt(this.content);\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 }", "private String decrypt(String dstr) {\n\n try {\n return PSEncryptor.decryptString(PathUtils.getRxDir().getAbsolutePath().concat(PSEncryptor.SECURE_DIR),dstr);\n\n } catch (PSEncryptionException | IllegalArgumentException e) {\n log.warn(\"Decryption failed: {}. Attempting to decrypt with legacy algorithm\",PSExceptionUtils.getMessageForLog(e));\n try {\n PSAesCBC aes = new PSAesCBC();\n return aes.decrypt(dstr, IPSPubServerDao.encryptionKey);\n } catch (PSEncryptionException psEncryptionException) {\n log.error(\"Unable to decrypt string. Error: {}\",\n PSExceptionUtils.getMessageForLog(e));\n log.debug(PSExceptionUtils.getDebugMessageForLog(e));\n return dstr;\n }\n }\n }", "public DecryptionCipherInterface decryptionCipher()\n {\n return this.decryptionCipher;\n }", "public static String decrypt(String word) {\n\t\tif(word==null || word.trim().length()<1){\n\t\t\treturn word;\n\t\t}\n\t\tint[] asciivals = new int[word.length()];\n\t\tchar[] orgchars = word.toCharArray();\n\t\t//convert to ascii val\n\t\tfor(int i=0;i<orgchars.length; i++){\n\t\t\tasciivals[i] = getASCII(orgchars[i]);\n\t\t}\n\t\t\n\t\t//subtract the value of previous element\n\t\tfor(int i=asciivals.length-1; i>0;i--){\n\t\t\tasciivals[i]-=asciivals[i-1];\n\t\t}\n\t\t//subtract 1 from the first char\n\t\tasciivals[0]-=1;\n\t\t//now keep on adding 26 until all values are in the range of a-z\n\t\tfor(int i=0;i<asciivals.length;i++){\n\t\t\twhile(asciivals[i]<getASCII('a')){\n\t\t\t\tasciivals[i]+=26;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//convert ascii vals to char\n\t\tfor(int i=0;i<asciivals.length; i++){\n\t\t\torgchars[i] = (char)asciivals[i];\n\t\t}\n\t\treturn String.valueOf(orgchars);\n\t}", "public String decode(String cipherText){\n String decodedMsg = cipherText;\n for(int i=0;i<n;i++)\n decodedMsg = reShuffle(decodedMsg);\n return decodedMsg;\n }", "public String Crypt(String s);", "public PLEncrypterDecrypter( String textParms )\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 static String decrypt(String s, char key) {\n\t\treturn Utilities.decrypt(s, (byte) key);\n\t}", "public static String decrypt(String s, char key) {\n\t\treturn Utilities.decrypt(s, (byte) key);\n\t}", "@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 }", "public char decryptChar(char v) {\r\n for (char c : this.charMap.keySet()) {\r\n if (this.charMap.get(c).equals(v)) {\r\n return c;\r\n }\r\n }\r\n // could not be decrypted (and probably wasn't encrypted in the first place)\r\n return v;\r\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 abstract void setDecryptMode();", "public String decodePassword(String encodedPassword, String key);", "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 String decryptUnicode(String input, int key) {\n StringBuilder decrypted = new StringBuilder(input);\n for (int i = 0; i < input.length(); i++) {\n char newChar = (char) (decrypted.charAt(i) - key);\n decrypted.setCharAt(i, newChar);\n }\n return decrypted.toString();\n }" ]
[ "0.7738073", "0.7182781", "0.7106706", "0.69775975", "0.6971861", "0.6919723", "0.69173944", "0.6909454", "0.6834011", "0.67769825", "0.67685187", "0.67268986", "0.667127", "0.66684186", "0.66515684", "0.6648816", "0.6628267", "0.66055274", "0.6603399", "0.65755075", "0.65590316", "0.65507567", "0.65376616", "0.65245557", "0.6513342", "0.65097773", "0.6502625", "0.6485339", "0.6478464", "0.6461226", "0.6456516", "0.6445499", "0.6444531", "0.6429957", "0.64276433", "0.64015454", "0.6381523", "0.63728124", "0.6370244", "0.6343932", "0.63275504", "0.63201505", "0.6309061", "0.6288086", "0.62862736", "0.6273489", "0.6272991", "0.62720925", "0.62608594", "0.6255286", "0.62512237", "0.62489986", "0.6243264", "0.62431103", "0.62308687", "0.622456", "0.6204912", "0.6176047", "0.6157423", "0.615243", "0.6126463", "0.6098317", "0.608563", "0.60850155", "0.6084001", "0.6082302", "0.6075205", "0.6074631", "0.60659784", "0.6050034", "0.6048402", "0.6048024", "0.6047981", "0.60323316", "0.6030017", "0.60273117", "0.6014841", "0.60114014", "0.6011023", "0.60047597", "0.6001355", "0.5996651", "0.5976586", "0.59725547", "0.59709394", "0.5966334", "0.5961892", "0.5956127", "0.59539396", "0.5952219", "0.59463537", "0.5941286", "0.59357387", "0.59357387", "0.592892", "0.59141415", "0.5905957", "0.5891897", "0.5881997", "0.58739394", "0.58735156" ]
0.0
-1
Dechiffre une phrase complete caractere par caractere
public String decrypt(String p, String pv, String md){ char a; BigInteger b; String c = "", d = ""; for(int i = 0; i < p.length(); i++){ if((int)p.charAt(i) != 29) c += p.charAt(i); else{ b = new BigInteger(c); a = (char)decrypt(b, new BigInteger(pv), new BigInteger(md)).intValue(); d += a; c = ""; } } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void reagir(String frase) {\n if (frase.equals(\"toma comida\") || frase.equals(\"olá\")) {\n System.out.println(\"abanar e latir\");\n } else {\n System.out.println(\"rosnar\");\n }\n }", "public void reagir(String frase) {\n\t\tif (frase.equals(\"toma comida\") || frase.equals(\"ola\")) {\n\t\t\tSystem.out.println(\"Abanar e latir\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Rosnar\");\n\t\t}\n\t\t\n\t}", "private String decodageMot(String message) {\n if (message == null || message.equals(\"\")) {\n throw new AssertionError(\"Texte non saisie\");\n } \n return transformWords(message, 2);\n }", "private void SolveTranslation(){\n\n int Cursor=0;\n Pattern pt = Pattern.compile(\"\\\"(.*?)\\\"\");\n Matcher matcher = pt.matcher(Input);\n while(matcher.find()){\n this.Undone[Cursor++] = matcher.group();\n //System.out.println(Undone[Cursor-1]);\n }\n Input = matcher.replaceAll(\"CCC\");\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 }", "public static String removeNonWord(String message)\r\n {\r\n int start = getLetterIndex(message, head); //get the fist index that contain English letter\r\n int end = getLetterIndex(message, tail); //get the last index that contain English letter\r\n if (start == end) // if only contain one letter\r\n return String.valueOf(message.charAt(start)); // return the letter\r\n return message.substring(start, end + 1); // return the content that contain English letter\r\n }", "private String SuppressionMot(String Mot, String Texte) throws InterruptedException {\n\t\tboolean trouve = false;\n\t\tString newCh =\"\";\n\t\tint i =0;\n\t\tif(Texte.equalsIgnoreCase(Mot)) { \t// Recherche dans le message si le mot est présent. \n\t\t\tnewCh=Texte.replaceAll(Mot, \"**\");\t// Remplace le mot par un espace. \n\t\t\ttrouve= true;\n\t\t} else {\n\t\t\tnewCh = Texte;\t//Sinon, on remplace la nouvelle chaîne de caractères par l'ancienne. \n\t\t}\n\t\treturn newCh;\t//Retourne la nouvelle chaîne de caractère modifiée ou pas. \n\t}", "private String encodageMot(String message) {\n if (message == null || message.equals(\"\")) {\n throw new AssertionError(\"Texte non saisie\");\n } \n return transformWords(message, 1); \n }", "private String[] getSearchPhrase(boolean split) {\n return split ? getPhrase().split(\" \") : new String[]{getPhrase()};\n }", "public void invertirFrase(Cadena C1, String frase) {\r\n\r\n char aux;\r\n String resp = \"\";\r\n\r\n for (int i = C1.getFrase().length() - 1; i >= 0; i--) {\r\n\r\n aux = C1.getFrase().charAt(i);\r\n resp = resp + aux;\r\n\r\n }\r\n System.out.println(resp);\r\n\r\n }", "public boolean isDeActivationString(String word);", "public String acronym(String phrase) {\n /*StringBuilder acronymFeed = new StringBuilder(\"\");\n String wordHolder = \"\";\n int spaceIndex;\n char firstLetter;\n do{\n spaceIndex = phrase.indexOf(\" \");\n wordHolder = phrase.substring(0,spaceIndex);\n acronymFeed.append(wordHolder.charAt(0));\n phrase = phrase.replaceFirst(wordHolder, \"\");\n } while (spaceIndex != -1 && wordHolder != \"\" && phrase != \"\");\n \n \n \n \n \n String acronymResult = acronymFeed.toString().toUpperCase();\n return acronymResult;\n */\n \n char[] letters = phrase.toCharArray();\n String firstLetters = \"\";\n firstLetters += String.valueOf(letters[0]);\n for (int i = 1; i < phrase.length();i++){\n if (letters[i-1] == ' '){\n firstLetters += String.valueOf(letters[i]);\n }\n }\n firstLetters = firstLetters.toUpperCase();\n return firstLetters;\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"Ingrese Frase\");\n String frase = sc.nextLine();\n\n System.out.println(frase.replace(\" \",\"\"));\n }", "public String getCorrectionWord(String misspell);", "public String acronym(String phrase) {\n\t\tString[] p = phrase.split(\"[\\\\W\\\\s]\");\n\t\tString returner = \"\";\n\t\tfor (String s : p) {\n\t\t\tif (!s.isEmpty())\n\t\t\t\treturner = returner + s.charAt(0);\n\t\t}\n\t\treturn returner.toUpperCase();\n\t}", "public static void main(String[] args) {\n String frase;\n String frase2 = \"\";//debe ser inicializada\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"Ingrese una frase\");\n frase = sc.nextLine();\n\n int i = 0;\n\n while (i < frase.length()) {//ou con for et if y else, los i++ estarian solo en el for\n if (frase.charAt(i) != ' ') {\n frase2 = frase2.concat(frase.substring(i, i + 1));\n } else {//el else solo pedia tranformar los espacios en alterisco que se hace solo con\n frase2 = frase2.concat(\"*\");//esto//y esto\n while (frase.charAt(i) == ' ') {\n i++;\n }\n frase2 = frase2.concat(frase.substring(i, i + 1));\n }\n i++;\n }//faltaria una primera condicion como en los 2 ejercicios precedentes pa que no imprima asteriscos antes de la 1era letra\n System.out.println(frase2);\n }", "private String construyeCaracter(String palabra) throws IOException {\n\t\tToken aux = null;\n \t\twhile(!((aux = this.nextTokenWithWhites()).get_lexema().equals(\"'\"))) {\n \t\t\tif (aux.get_lexema().equals(\"fin\"))\n \t\t\t\treturn palabra;\n \t\t\tpalabra = palabra + aux.get_lexema();\n \t\t\t// Si vemos que el caracter se alarga mucho, paramos de leer\n \t\t\tif (palabra.length() > 4) {\n \t\t\t\treturn palabra;\n \t\t\t}\n \t\t}\n \t\tpalabra = palabra + aux.get_lexema();\n\t\treturn palabra;\n\t}", "private String firstWord(String userMessage) {\n if (userMessage.contains(\" \"))\n return userMessage.substring(0, userMessage.indexOf(\" \"));\n return userMessage;\n }", "private static String handlePhrases(String PubmedQuery) {\r\n //Find phrases \"between double quotes\"\r\n String[] phrases = PubmedQuery.split(\"\\\"\");\r\n for(int i = 0 ; i < phrases.length ; i++){\r\n phrases[i] = phrases[i].trim();\r\n if(!phrases[i].equals(\"\")){ // String not Empty\r\n if(i%2 != 0){ // String surrounded by quotes, i.e. a phrase\r\n phrases[i] = \"\\\"\" + phrases[i] + \"\\\"\";\r\n } else { // not a phrase, i.e. a bag of terms, operator or [field of index] (inside brackets)\r\n if(phrases[i].startsWith(\"[\")){ //index field of previus component contained (i.e. case: \"...\"[...])\r\n boolean perviusPhraseFound = false; // True if index field was added to previus phrase element\r\n // Get index field of previus component and handle proprietly\r\n String [] tokens = phrases[i].split(\"]\");\r\n String indexField = tokens[0].replace(\"[\", \"\");\r\n String luceneField = supportedIndexFields.get(indexField);\r\n if(luceneField != null){ \r\n //add \"indexField:\" as a prefix in previus (not empty) phrase\r\n int tmp = i-1;\r\n while(!perviusPhraseFound & tmp >= 0){\r\n if(!phrases[tmp].equals(\"\")){\r\n perviusPhraseFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n phrases[tmp] = luceneField + \":\" + phrases[tmp] + \"\";\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n // Remove from current phrase this index field (prefix)\r\n phrases[i] = phrases[i].substring(indexField.length()+2 );\r\n } \r\n // Further handling...\r\n phrases[i] = handleNonPhraseToken(phrases[i]);\r\n }\r\n } //else { /* Empty token, do nothing with this */ System.out.println(\"\\t\\t\\t empty\"); }\r\n }\r\n \r\n String luceneQuery = \"\";\r\n boolean fisrtPhrase = true;\r\n for(int i = 0 ; i < phrases.length ; i ++){\r\n if(phrases[i].length() > 0){\r\n if(!phrases[i].startsWith(\" OR \") & !phrases[i].startsWith(\" -\") & !phrases[i].startsWith(\" +\") ){\r\n if(fisrtPhrase){\r\n luceneQuery += \" +\";\r\n fisrtPhrase = false;\r\n } else {\r\n if(!phrases[i-1].endsWith(\" OR \") & !phrases[i-1].endsWith(\" -\") & !phrases[i-1].endsWith(\" +\")){\r\n luceneQuery += \" +\";\r\n }\r\n } \r\n } // add default operator + when required (no OR or - is present for that term)\r\n luceneQuery += phrases[i];\r\n }// else empty phrase : skip\r\n }\r\n return luceneQuery;\r\n }", "private String firstSentenceSplitting(String s) {\n // Double new-line means a new sentence:\n s = paragraph.matcher(s).replaceAll(\"$1\" + EOS);\n // Punctuation followed by whitespace means a new sentence:\n s = punctWhitespace.matcher(s).replaceAll(\"$1\" + EOS);\n // New (compared to the perl module): Punctuation followed by uppercase followed\n // by non-uppercase character (except dot) means a new sentence:\n s = punctUpperLower.matcher(s).replaceAll(\"$1\" + EOS + \"$2\");\n // Break also when single letter comes before punctuation:\n s = letterPunct.matcher(s).replaceAll(\"$1\" + EOS);\n return s;\n }", "public String propergram(String word){\n // word.toLowerCase();\n String[] tempstr =word.split(\"_\");\n String tempstr2;\n\n for(int i=0;i<tempstr.length;i++){\n if((tempstr[i].charAt(0))>='A'&&(tempstr[i].charAt(0))<='Z') {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0)));\n }\n else {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0))).toUpperCase();\n }\n tempstr[i] = tempstr2.concat(tempstr[i].substring(1));\n if (i != 0) {\n word=word.concat(\" \").concat(tempstr[i]);\n } else {\n word = tempstr[i];\n }\n\n }\n return word;\n\n\n }", "String getWordIn(String schar, String echar);", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }", "private String searchString(String inWord)\n {\n String line = null;\n StringBuffer rtn = new StringBuffer();\n int len = inWord.length();\n boolean found = false;\n\n if(len == 1)\n {\n if(Character.isDigit(inWord.charAt(0)))\n {\n rtn.append(inWord).append(\"I\");\n found = true;\n } // fi\n\n else if(Character.isLetter(inWord.charAt(0)))\n {\n rtn.append(inWord.toLowerCase()).append(\"S\");\n found = true;\n } // else fi\n } // fi\n\n if(!found)\n {\n int\tnum_A = 0; // Upper case\n int\tnum_L = 0; // Lower case\n int\tnum_N = 0; // Numbers\n int\tnum_P = 0; // Punctuation (numeric)\n int\tnum_Q = 0; // Quotes\n int\tnum_O = 0; // Other\n char last_ch = ' ';\n\n for(int i = 0; i < len; i++)\n {\n if((i == 0) && (inWord.charAt(i) == '-'))\n num_L++;\n\n else if(Character.isLowerCase(inWord.charAt(i)))\n num_L++;\n\n else if(Character.isUpperCase(inWord.charAt(i)))\n num_A++;\n\n else if(Character.isDigit(inWord.charAt(i)))\n num_N++;\n\n else if((inWord.charAt(i) == '=')||(inWord.charAt(i) == ':') ||\n (inWord.charAt(i) == '+')||(inWord.charAt(i) == '.') ||\n (inWord.charAt(i) == ','))\n num_P++;\n\n else if((inWord.charAt(i) == '\\'') ||\n (inWord.charAt(i) == '`') || (inWord.charAt(i) == '\"'))\n num_Q++;\n\n else\n num_O++;\n\n last_ch = inWord.charAt(i);\n } // for\n\n int pos = 0;\n if((len - ntail) > 0)\n pos = len - ntail;\n\n rtn.append(inWord.substring(pos).toLowerCase());\n\n if((num_L + num_Q) == len)\n rtn.append(\"\");\n\n else if((num_A + num_Q) == len)\n rtn.append(\"A\");\n\n else if((num_N + num_P + num_Q) == len)\n rtn.append(\"N\");\n\n else if((num_L + num_A + num_Q) == len)\n rtn.append(\"B\");\n\n else if((num_A + num_N + num_P + num_Q) == len)\n rtn.append(\"C\");\n\n else if((num_L + num_N + num_P + num_Q) == len)\n rtn.append(\"E\");\n\n else if((num_A + num_L + num_N + num_P + num_Q) == len)\n rtn.append(\"D\");\n\n else if((num_O == 0) && (last_ch == '+'))\n rtn.append(\"F\");\n\n else\n rtn.append(\"O\");\n } // else\n\n rtn.append(\"_\");\n\n return(rtn.toString());\n }", "private String removePunctuation(String word) {\n\n StringBuffer sb = new StringBuffer(word);\n if (word.length() == 0) {\n return word;\n }\n for (String cs : COMMON_SUFFIX) {\n if (word.endsWith(\"'\" + cs) || word.endsWith(\"’\" + cs)) {\n sb.delete(sb.length() - cs.length() - 1, sb.length());\n break;\n }\n }\n if (sb.length() > 0) {\n int first = Character.getType(sb.charAt(0));\n int last = Character.getType(sb.charAt(sb.length() - 1));\n if (last != Character.LOWERCASE_LETTER\n && last != Character.UPPERCASE_LETTER) {\n sb.deleteCharAt(sb.length() - 1);\n }\n if (sb.length() > 0 && first != Character.LOWERCASE_LETTER\n && first != Character.UPPERCASE_LETTER) {\n sb.deleteCharAt(0);\n }\n }\n return sb.toString();\n }", "public String acronym(String phrase) {\n String accrStr = phrase.replaceAll(\"\\\\B.|\\\\P{L}\", \"\").toUpperCase();\n return accrStr;\n }", "public void firstSem10a(){\n chapter = \"firstSem10a\";\n String firstSem10a = \"There's a commotion outside your room - your door looks like it's been smashed down, and your RA is standing outside, looking \" +\n \"distressed. You can hear a shout from inside - your roommate - and sounds of a struggle. \\\"Get in there and help!\\\" you shout to the RA, \" +\n \"but he just shakes his head. \\\"Sorry, I can't. I'm anti-violence. You can't fight hate with hate, you know.\\\"\\tPushing past him, you \" +\n \"run into your room to see your roommate grappling with a large beast. THE beast. It is real. What do you want to do?\";\n getTextIn(firstSem10a);\n }", "public String splitAdresse(String adresse) {\n String[] array = adresse.split(\" \");\n adresse = \"\";\n int i = 0;\n for (String morceau : array) {\n morceau = Normalizer.normalize(morceau, Normalizer.Form.NFD).replaceAll(\"\\\\p{InCombiningDiacriticalMarks}+\", \"\"); // On enlève tous les accents\n adresse = adresse + morceau;\n if (i < array.length - 1) adresse = adresse + \"+\";\n i++;\n }\n return adresse;\n }", "private String removeFalseEndOfSentence(String s) {\n // Don't split at e.g. \"U. S. A.\":\n s = abbrev1.matcher(s).replaceAll(\"$1\");\n // Don't split at e.g. \"U.S.A.\": \n s = abbrev2.matcher(s).replaceAll(\"$1\");\n // Don't split after a white-space followed by a single letter followed\n // by a dot followed by another whitespace.\n // e.g. \" p. \"\n s = abbrev3.matcher(s).replaceAll(\"$1$2\");\n // Don't split at \"bla bla... yada yada\" \n s = abbrev4.matcher(s).replaceAll(\"$1$2\");\n // Don't split [.?!] when the're quoted:\n s = abbrev5.matcher(s).replaceAll(\"$1\");\n\n // Don't split at abbreviations, treat them case insensitive\n s = ABREVLIST_PATTERN.matcher(s).replaceAll(\"$1\");\n\n //a special list of abbrevs used at the end of sentence\n s = ENDABREVLIST_PATTERN.matcher(s).replaceAll(\"$1$3\");\n \n // Don't break after quote unless there's a capital letter:\n // e.g.: \"That's right!\" he said.\n s = abbrev6.matcher(s).replaceAll(\"$1$2\");\n\n // fixme? not sure where this should occur, leaving it commented out:\n // don't break: text . . some more text.\n // text=~s/(\\s\\.\\s)$EOS(\\s*)/$1$2/sg;\n\n // e.g. \"Das ist . so.\" -> assume one sentence\n s = abbrev7.matcher(s).replaceAll(\"$1\");\n\n // e.g. \"Das ist . so.\" -> assume one sentence\n s = abbrev8.matcher(s).replaceAll(\"$1\");\n \n s = ELLIPSIS.matcher(s).replaceAll(\"$1$3\");\n \n s = s.replaceAll(\"(\\\\d+\\\\.) \" + EOS + \"([\\\\p{L}&&[^\\\\p{Lu}]]+)\", \"$1 $2\");\n\n // z.B. \"Das hier ist ein(!) Satz.\"\n s = s.replaceAll(\"\\\\(([!?]+)\\\\) \" + EOS, \"($1) \");\n return s;\n }", "private String processWord(String word){\r\n\t\tString lword = word.toLowerCase();\r\n\t\tfor (int i = 0;i<word.length();++i){\r\n\t\t\tstemmer.add(lword.charAt(i));\r\n\t\t}\r\n\t\tstemmer.stem();\r\n\t\treturn stemmer.toString();\r\n\t}", "public void firstSem2a6(){\n chapter = \"firstSem2a6\";\n String firstSem2a6 = \"\\\"Well? Are we friends, like that guy said?\\\"\";\n getTextIn(firstSem2a6);\n }", "private String limpiar_texto(String texto){\n \n texto = texto.replaceAll(\"\\n\",\"\");\n texto=texto.toUpperCase();\n for(int i=0;i<texto.length();i++){\n //Se crea un for que llenara el nuevo char\n int posicion = tabla.indexOf(texto.charAt(i)); //charat regresa el valor del arreglo\n if(posicion == -1){ \n texto=texto.replace(texto.charAt(i),' ');\n //En caso que no aparezca en la tabla de caracteres\n //Tiene que ser eliminado\n }\n }\n return texto;\n }", "@Override\r\n\tpublic void frases() {\n\t\t\r\n\t\tthis.frase.add(\"Não há que ser forte. Há que ser flexível.\");\r\n this.frase.add(\"Gente todo dia arruma os cabelos, por que não o coração?\");\r\n this.frase.add(\"Há três coisas que jamais voltam; a flecha lançada, a palavra dita e a oportunidade perdida.\");\r\n this.frase.add(\"Melhor pensar alto do que não pensar nada.\");\r\n this.frase.add(\"A juventude não é uma época da vida, é um estado de espírito.\");\r\n this.frase.add(\" Podemos escolher o que semear, mas somos obrigados a colher o que plantamos.\");\r\n this.frase.add(\"Dê toda a atenção para a formação dos teus filhos, sobretudo por exemplos de tua própria vida.\");\r\n \r\n\t\t\r\n\t}", "java.lang.String getNewSentence();", "@Test\n\tpublic void phraseConcatTest() {\n\t\tString query1 = \"\\\" hello my \\\"\";\n\t\tString query2 = \"\\\" I am the king \\\"\";\n\t\tString query3 = \"\\\" yes you are \\\" \";\n\t\t\n\t\tString query1Result = \"hello+my\";\n\t\tString query2Result = \"I+am+the+king\";\n\t\tString query3Result = \"yes+you+are\";\n\t\t\n\t\tassertEquals(query1Result, queryTest.fixPhrases(query1));\n\t\tassertEquals(query2Result, queryTest.fixPhrases(query2));\n\t\tassertEquals(query3Result, queryTest.fixPhrases(query3));\n\t}", "java.lang.String getWord();", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = 0;\n\t\tSystem.out.println(\"Veillez saisir une phrase :\");\n\t\tString phrase = sc.nextLine();\n\t\tSystem.out.println(phrase);\n\t\tSystem.out.println(\"M : \" + phrase.toUpperCase());\n\t\tfor(int i = 0; i < phrase.length(); i++)\n\t\t{\n\t\t\tif(phrase.charAt(i) == 'e')\n\t\t\t\tcount++;\n\t\t}\n\t\tSystem.out.println(\"C : \" + phrase.length());\n\t\tSystem.out.println(\"Le nombre de 'e' dans la phrase : \" + count);\n\t\tif(count > 0)\n\t\t\tSystem.out.println(\"R : \" + phrase.replace('e', '*'));\n\t}", "public String spanishWord() {\n\t\treturn \"Depurar\";\n\t}", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di friggere un uovo\";\r\n }", "public String getPalavraEmbaralhada(String palavra);", "public static void main(String[] args) {\n String sentence=\"I am the best\";\n System.out.println(sentence.replace(\" \", \"\"));\n }", "public String getPhrase()\n {\n return this.phrase;\n }", "public static String cleanMovieTitle (Literal title) {\n String reTitle = \"\";\n if(null != title && title.isLiteral()) {\n reTitle = title.getString().replace(\" and \", \" & \");\n if(reTitle.contains(\"(\")) {\n int index = reTitle.indexOf(\"(\");\n reTitle = reTitle.substring(0,index);\n reTitle = reTitle.trim();\n }\n }\n return reTitle;\n }", "public static void upperCaseFirstOfWord() {\n\t\tString isExit = \"\";\n\t\twhile (!isExit.equals(\"N\")) {\n\t\t\tStringBuffer bf = readInput();\n\t\t\tStringBuffer result = new StringBuffer();\n\t\t\tString str = bf.toString();\n\t\t\tString char_prev = \"\";\n\t\t\tString char_current = \"\";\n\t\t\tString key = \" ,.!?:\\\"\";\n\t\t\tresult.append(String.valueOf(str.charAt(0)).toUpperCase());\n\t\t\tfor (int i = 1; i < str.length(); i++) {\n\t\t\t\tchar_prev = String.valueOf(str.charAt(i - 1));\n\t\t\t\tchar_current = String.valueOf(str.charAt(i));\n\t\t\t\tif (key.contains(char_prev)) {\n\t\t\t\t\tchar_current = char_current.toUpperCase();//uppercase first letter each word\n\t\t\t\t}\n\t\t\t\tresult.append(char_current);\n\t\t\t}\n\t\t\tSystem.out.println(\"Chuỗi có chữ cái đầu viết hoa: \\n\" + result);\n\t\t\tSystem.out.println(\"Bạn có muốn nhập tiếp không(0/1):\");\n\t\t\tisExit= scan.next().toString();\n\t\t}\n\t}", "public static String getWord(String sentence, char word) {\n\t\tString[] words;\n\t\twords = sentence.split(\" \");\n\t\tString cleanedWord=\"\";\n\t\t\n\t\tif(word=='f') {//return the first word\n\t\t\tString temp = words[0];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else {//return the last word\n\t\t\tString temp = words[words.length -1];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn cleanedWord;\n\t}", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n oldPasword = s.toString();\n }", "public static String dequote(String text, char opening, char closing) {\n if (text.length() > 1) {\n if (text.charAt(0) == opening && text.charAt(text.length() - 1) == closing) {\n text = text.substring(1, text.length() - 1);\n }\n }\n return text;\n }", "public static String acronym(String phrase) {\n\t\tString[] arrPhrase = phrase.split(\" \", 0);\n\t\treturn arrPhrase[2];\n\t}", "public String getPhrase() {\n return phrase;\n }", "private static String analyzeTerm(String term) {\n String ret = term.toLowerCase();\n if (stopWords.contains(ret) || ret.isEmpty())\n return \"\";\n return stemmer.stem(ret);\n }", "private String compactDescription(String sentence) {\n if (StringUtils.isNotEmpty(sentence)) {\n if (StringUtils.contains(sentence, \".\")) {\n return StringUtils.substringBefore(sentence, \".\") + \".\";\n } else {\n return sentence;\n }\n }\n return sentence;\n }", "private String quitaEspacios(String cadena) {\n String unspacedString = \"\";\t//Variable donde lee la función\n\n for (int i = 0; i < cadena.length(); i++) {\t//Le quita los espacios a la espresión que leyó\n //Si el caracter no es un espacio lo pone, sino lo quita.\n if (cadena.charAt(i) != ' ') {\n unspacedString += cadena.charAt(i);\n }\n }\n\n return unspacedString;\n }", "@Override\n\tpublic String getStemming(String phrase) {\n\t\treturn null;\n\t}", "public static String delFirstChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(1, word.length());\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}", "String stemOf (String word);", "private String getCompletePossibleTitle(List<ContactPartAllocation> notAllocatedAndTitleParts, String separationCharacter) {\n StringBuilder titleCompletionBuilder = new StringBuilder();\n notAllocatedAndTitleParts.forEach(part -> titleCompletionBuilder.append(part.getContactPart().getSecondObject()).append(separationCharacter));\n String finalString = titleCompletionBuilder.toString();\n return finalString.substring(0, finalString.length()-1);\n }", "public String catchPhrase() {\n @SuppressWarnings(\"unchecked\") List<List<String>> catchPhraseLists = (List<List<String>>) faker.fakeValuesService().fetchObject(\"company.buzzwords\");\n return joinSampleOfEachList(catchPhraseLists, \" \");\n }", "private static String getPhraseInput() {\n\t\treturn getQuery(\"Query Phrase\");\n\t}", "private String getSearchString(){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString phrase = null;\n\t\t\n\t\tSystem.out.print(\"Please enter the search phrase: \");\n\t\tphrase = scanner.nextLine();\n\t\t\n\t\tscanner.close();\n\t\t\n\t\treturn phrase;\n\t}", "public void test_extractKeyphrase_A$String() throws Exception {\n\t\tYahooAuctionService target = new YahooAuctionService();\r\n\t\tString text = \"せどり初心者は中古と新品ではどちらが向いているか?\";\r\n\t\tList<String> actual = target.extractKeyphrase(text);\r\n\t\tList<String> expected = null;\r\n\t\tassertEquals(expected, actual);\r\n\t}", "public String getSearchString() {\r\n return super.getSearchString();\r\n \r\n// String searchStr = \"\";\r\n// //put exact phrase at the very beginning\r\n// if(exactphrase != null && exactphrase.length() > 0)\r\n// {\r\n// searchStr += \"\\\"\" + exactphrase + \"\\\"\";\r\n// }\r\n//\r\n// String allwordsSearchStr = \"\";\r\n// if(allwords != null && allwords.length() > 0)\r\n// {\r\n// String [] words = allwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// allwordsSearchStr += \"+\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// String withoutwordsSearchStr = \"\";\r\n// if(withoutwords != null && withoutwords.length() > 0)\r\n// {\r\n// String [] words = withoutwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// withoutwordsSearchStr += \"+-\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// searchStr += allwordsSearchStr + withoutwordsSearchStr; //need to add other string\r\n// \r\n// String oneofwordsSearchStr = \"\";\r\n// if(oneofwords != null && oneofwords.length() > 0)\r\n// {\r\n// String [] words = oneofwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// oneofwordsSearchStr = \"(\";\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// oneofwordsSearchStr += words[i] + \" \";\r\n// }\r\n// oneofwordsSearchStr = oneofwordsSearchStr.trim();\r\n// oneofwordsSearchStr += \")\";\r\n// }\r\n// }\r\n// if(oneofwordsSearchStr.length() > 0)\r\n// {\r\n// searchStr += \"+\" + oneofwordsSearchStr;\r\n// }\r\n//\r\n// return searchStr;\r\n }", "public String getPhrase(String sentencePhraseID){\n\t\t// implement me!\n\t\treturn \" \";\n\t}", "void translate(Sentence sentence);", "public void computeParagraph(){\r\n\r\n\t\tstrBuff = new StringBuffer();\r\n\r\n\t\t//For else for ER2 rule of inserting the first letter of my last name twice before each consonant\r\n\t\tfor(int i = 0; i < paragraph.length(); i++){\r\n\r\n\t\t\tif(paragraph.charAt(i) == 'a' || paragraph.charAt(i) == 'e' || paragraph.charAt(i) == 'i'\r\n\t\t\t\t|| paragraph.charAt(i) == 'o' || paragraph.charAt(i) == 'u' || paragraph.charAt(i) == 'A'\r\n\t\t\t\t|| paragraph.charAt(i) == 'E' || paragraph.charAt(i) == 'I' || paragraph.charAt(i) == 'O'\r\n\t\t\t\t|| paragraph.charAt(i) == 'U' || paragraph.charAt(i) == ' ' || paragraph.charAt(i) == '.'\r\n\t\t\t\t|| paragraph.charAt(i) == '!' || paragraph.charAt(i) == '?'){\r\n\t\t\t\tstrBuff.append(paragraph.charAt(i));\r\n\t\t\t}\r\n\r\n\t\t\telse{\r\n\t\t\t\tstrBuff.append(\"OO\");\r\n\t\t\t\tstrBuff.append(paragraph.charAt(i));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tnewParagraph = strBuff.toString();\r\n\r\n\t\tcount = 0;\r\n\r\n\t\t//For for ER2 rule of counting the number of characters in the initial text excluding the number of vowels\r\n\t\tfor(int i = 0; i < paragraph.length(); i++){\r\n\t\t\tif(paragraph.charAt(i) != 'a' && paragraph.charAt(i) != 'e' && paragraph.charAt(i) != 'i'\r\n\t\t\t\t&& paragraph.charAt(i) != 'o' && paragraph.charAt(i) != 'u' && paragraph.charAt(i) != 'A'\r\n\t\t\t\t&& paragraph.charAt(i) != 'E' && paragraph.charAt(i) != 'I' && paragraph.charAt(i) != 'O'\r\n\t\t\t\t&& paragraph.charAt(i) != 'U'){\r\n\t\t\t\t\tcount++;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t}", "public String getGrammarText();", "private String doubleFinalConsonant(String word) {\n\t\tStringBuffer buffer = new StringBuffer(word);\n\t\tbuffer.append(buffer.charAt(buffer.length() - 1));\n\t\treturn buffer.toString();\n\t}", "private String eliminar_contenido_innecesario(String line) {\n \n \tint index_question = line.indexOf('?');\n\t\tint index_point = line.indexOf('.');\n\t\t\n\t\tline = ( index_question > 0 ) ? line.substring(0, index_question+1) : line;\n\t\tline = ( index_point > 0 ) ? line.substring(0, index_point+1) : line;\n\t\t\n \treturn line;\n }", "private static String capitaliseSingleWord(String word) {\n String capitalisedFirstLetter = word.substring(0, 1).toUpperCase();\n String lowercaseRemaining = word.substring(1).toLowerCase();\n return capitalisedFirstLetter + lowercaseRemaining;\n }", "private String validateWord (String word) {\r\n String chars = \"\";\r\n for (int i = 0; i < word.length (); ++i) {\r\n if (!Character.isLetter (word.charAt (i))) {\r\n chars += \"\\\"\" + word.charAt (i) + \"\\\" \";\r\n }\r\n }\r\n return chars;\r\n }", "public abstract boolean isStopWord(String term);", "private Spannable applyWordMarkup(String text) {\n SpannableStringBuilder ssb = new SpannableStringBuilder();\n int languageCodeStart = 0;\n int untranslatedStart = 0;\n\n int textLength = text.length();\n for (int i = 0; i < textLength; i++) {\n char c = text.charAt(i);\n if (c == '.') {\n if (++i < textLength) {\n c = text.charAt(i);\n if (c == '.') {\n ssb.append(c);\n } else if (c == 'c') {\n languageCodeStart = ssb.length();\n } else if (c == 'C') {\n ssb.setSpan(new TextAppearanceSpan(BrowseWordsActivity.this,\n R.style.language_code_tag),\n languageCodeStart, ssb.length(), 0);\n languageCodeStart = ssb.length();\n } else if (c == 'u') {\n untranslatedStart = ssb.length();\n } else if (c == 'U') {\n ssb.setSpan(new TextAppearanceSpan(BrowseWordsActivity.this,\n R.style.untranslated_word),\n untranslatedStart, ssb.length(), 0);\n untranslatedStart = ssb.length();\n } else if (c == '0') {\n Resources res = getResources();\n ssb.append(res.getString(R.string.no_translations));\n }\n }\n } else\n ssb.append(c);\n }\n\n return ssb;\n }", "static String correctParagraph(String paragraph) {\n\n\t\t\tString newText = paragraph.replaceAll(\"\\\\s{2,}+\", \" \");\n\n\t\t\tnewText = newText.replaceAll(\"\\\\s+,\", \",\");\n\t\t\tnewText = newText.replaceAll(\"\\\\s+\\\\.\", \".\");\n\n\n\t\t\tString firstLetter = newText.substring(0, 1).toUpperCase();\n\t\t\tnewText = firstLetter + newText.substring(1);\n\n\t\t\tString[] sentences = newText.split(\"\\\\.\");\n\t\t\tfor(int i = 0; i < sentences.length; i++){\n\t\t\t\tString temp = sentences[i].trim();\n\t\t\t\tfirstLetter = temp.substring(0, 1).toUpperCase();\n\t\t\t\tsentences[i] = firstLetter + temp.substring(1);\n\t\t\t}\n\t\t\tStringBuilder newParagraph = new StringBuilder(sentences[0]);\n\t\t\tfor(int i = 1; i < sentences.length; i++){\n\t\t\t\tnewParagraph.append(\". \").append(sentences[i]);\n\t\t\t}\n\t\t\tnewText = newParagraph.append(\".\").toString();\n\n\t\t\treturn newText;\n\t\t}", "private String removeSpecialCharacters(String word)\n\t{\n\t\tString newString = \"\";\n\n\t\tfor (int i = 0; i < word.length(); i++)\n\t\t{\n\t\t\tif (word.charAt(i) != '?' && word.charAt(i) != '!' && word.charAt(i) != '\"' && word.charAt(i) != '\\''\n\t\t\t\t\t&& word.charAt(i) != '#' && word.charAt(i) != '(' && word.charAt(i) != ')' && word.charAt(i) != '$'\n\t\t\t\t\t&& word.charAt(i) != '%' && word.charAt(i) != ',' && word.charAt(i) != '&')\n\t\t\t{\n\t\t\t\tnewString += word.charAt(i);\n\t\t\t}\n\t\t}\n\n\t\treturn newString;\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\tString content = ta_content.getText().toString();\r\n\r\n\t\t\t\t\tcontent = content.replaceAll(\"\\\\p{Z}\", \"\");\r\n\r\n\t\t\t\t\tcontent = content.replaceAll(\"(^\\\\p{Z}+|\\\\p{Z}+$)\", \"\");\r\n\t\t\t\t\tfor (String str : special_characters) {\r\n\t\t\t\t\t\tcontent = content.replaceAll(str, \"\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcontent = content.trim();\r\n\t\t\t\t\tint cnt = 0;\r\n\t\t\t\t\tBreakIterator it = BreakIterator.getCharacterInstance();\r\n\t\t\t\t\tit.setText(content);\r\n\r\n\t\t\t\t\twhile (it.next() != BreakIterator.DONE) {\r\n\t\t\t\t\t\tcnt++;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttextField.setText(\"\" + cnt);\r\n\t\t\t\t}", "private String eliminarEspaciosMayoresA1(String mensaje) {\n //Elimina todos los espacios mayores a 1 que se encuentren dentro del mensaje\n Pattern patron = Pattern.compile(\"[ ]+\");\n Matcher encaja = patron.matcher(mensaje);\n String resultado = encaja.replaceAll(\" \");\n return resultado;\n }", "public static void main(String[] args) {\nScanner scn=new Scanner(System.in);\nSystem.out.println(\"你好 請問你是\");\nString a = scn.next();\nSystem.out.println(\"你好\"+a+\"請問你就讀哪所學校\");\nString b=scn.next();\nSystem.out.println(a+\"原來你是\"+b+\"畢業的阿\");\nSystem.out.println(\"請問你就讀甚麼科系\");\nString c=scn.next();\nSystem.out.println(\"挖~~\"+c+\"是很好的科系耶,你實在太厲害了:)\");\nSystem.out.println(\"你畢業後要做甚麼工作啊?\");\nString d=scn.next();\nSystem.out.println(d+\"這個工作不錯啊,真羨慕你!~~\");\n\t}", "public static void main(String[] args) {\n\n \tString str = \"123abc你好efc\";\n\n \tString reg = \"[\\u4e00-\\u9fa5]\";\n\n \tPattern pat = Pattern.compile(reg); \n\n \tMatcher mat=pat.matcher(str); \n\n \tString repickStr = mat.replaceAll(\"\");\n\n \tSystem.out.println(\"去中文后:\"+repickStr);\n\n}", "public static void main(String[] args) {\n\t\tBoolean[] b= new Boolean[26];\n\t\tArrays.fill(b, false);\n\t\tint index=0;\n\t\tString test =\"aabbcc\";\n\t\tfor(int i=0;i<test.length();i++)\n\t\t{\n\t\t\tindex=(int)test.charAt(i)-'a';\n\t\t\tb[index]=true;\n\t\t}\n\t\tfor(int i=0;i<b.length;i++)\n\t\t{\n\t\t\tif(b[i]==false)\n\t\t\t{\n\t\t\t//\tSystem.out.println(\"Not pangram\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t String str = \"Happy%^&*Christmas*&*&*)NewYear\"; \n \n\t // similar to Matcher.replaceAll \n\t str = str.replaceAll(\"\\\\p{Punct}\",\" \"); \n\t \n\t System.out.println(str); \n\n\t}", "@Override\r\n\tpublic String inverseTranslateTerm(String term)\r\n\t{\r\n\t\tStringBuilder sb = new StringBuilder(term.length());\r\n\t\tMatcher matcher = s_termPattern.matcher(term);\r\n\t\tint start = 0;\r\n\t\twhile (matcher.find(start))\r\n\t\t{\r\n\t\t\t// Parse a Prolog term\r\n\t\t\tString symbol = matcher.group();\r\n\t\t\t\r\n\t\t\tif (matcher.group(\"quotedConst\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateQuotedConst(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"var\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateVariable(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"unquotedConst\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateUnquotedConst(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"number\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateNumber(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"string\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateString(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"list\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateList(symbol));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tthrow new TranslatorException(\"Unable to parse answer term: \" + term);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tstart = matcher.end();\r\n\t\t\ttry {\r\n\t\t\t\t// Parse connectors between terms\r\n\t\t\t\tchar c = term.charAt(start);\r\n\t\t\t\tif (c == ',')\r\n\t\t\t\t\tsb.append(' ');\r\n\t\t\t\telse if (c == '(')\r\n\t\t\t\t\tsb.append(c);\r\n\t\t\t\telse if (c == ')')\r\n\t\t\t\t{\r\n\t\t\t\t\tdo\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsb.append(c);\r\n\t\t\t\t\t\tc = term.charAt(++start);\r\n\t\t\t\t\t} while (c == ')');\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new TranslatorException(\"Unable to parse answer term: \" + term);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (IndexOutOfBoundsException e)\r\n\t\t\t{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (start != term.length())\r\n\t\t{\r\n\t\t\tthrow new TranslatorException(\"Unable to parse answer term: \" + term);\r\n\t\t}\r\n\t\t\r\n\t\treturn sb.toString();\r\n\t}", "public static void main(String[] args) {\n Pattern pattern = Pattern.compile(\"\\\\b(\\\\w+)(\\\\W+\\\\1\\\\b)+\",Pattern.CASE_INSENSITIVE);\r\n\r\n Scanner in = new Scanner(System.in);\r\n int numSentences = Integer.parseInt(in.nextLine());\r\n \r\n while (numSentences-- > 0) {\r\n String input = in.nextLine();\r\n \r\n Matcher matcher = pattern.matcher(input);\r\n \r\n while (matcher.find()) \r\n input = input.replaceAll(matcher.group(),matcher.group(1));\r\n // Prints the modified sentence.\r\n System.out.println(input);\r\n }\r\n \r\n in.close();\r\n }", "static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}", "@Override\n\tpublic void test() {\n String ret=reverseWords(\"the sky is blue \");\n return;\n\t}", "public static String parseDescription(String sentence) {\n int spaceIndex = sentence.indexOf(' ');\n String description = sentence.substring(spaceIndex + 1);\n return description;\n }", "private String quitarCaracteresNoImprimibles(String mensaje) {\n String newMensaje = \"\";\n int codigoLetra = 0;\n for (char letra : mensaje.toCharArray()) {\n codigoLetra = (int) letra;\n if (codigoLetra >= 32 && codigoLetra <= 128) {\n newMensaje += letra;\n }\n }\n return newMensaje;\n }", "public void setPhrase(String phrase) {\n this.phrase = phrase;\n }", "private static String withoutFor(String title) {\n\t\t\n\t\tfor (Pattern p: forSynonyms) {\n\t\t\tMatcher m = p.matcher(title);\n\t\t\tboolean found = m.find();\n\t\t\tif (found) {\n\t\t\t\ttitle = title.substring(0,m.start());\n\t\t\t}\n\t\t}\n\n\t\treturn title;\n\t\t\n\t}", "public String reverseWordsPatternMatching(String s) {\n if (s == null || s.length() == 0) {\n return \"\";\n }\n\n return buildString(s.trim().split(\"\\\\s+\"));\n }", "@Override\r\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\tString edit = keyword.getText().toString();\r\n\t\t\t\tLog.i(\"cheshi\", \"德玛edit:\" + edit);\r\n\t\t\t\tif (edit.length() == 0) {\r\n\t\t\t\t\tdelete.setVisibility(delete.GONE);\r\n\t\t\t\t\tLog.i(\"cheshi\", \"德玛\");\r\n\t\t\t\t}\r\n\t\t\t}", "private String extractQuery(String str) throws UnsupportedEncodingException {\n\t\tif (!str.isEmpty()) {\n\t\t\tstr = str.trim().replaceAll(\"[^a-zA-Z0-9\\\\s]\", \"\");\n\t\t\tstr = str.replaceAll(\"[\\\\p{Punct}]+\", \"\");\n\t\t\tstr = str.trim().replaceAll(\"[\\\\s]+\", \" \");\n\t\t}\n\n\t\treturn str;\n\t}", "private static void printLatinWord(String s) {\n\t\tif (s.length() < 2|| !s.matches(\"\\\\w*\")) {\n\t\t\tSystem.out.print(s+\" \");\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.print(s.replaceAll(\"(\\\\w)(\\\\w*)\", \"$2$1ay \"));\n\t}", "public static String NormalizeText(String Word) {\n String EditText = Word.replaceAll(\"[^a-zA-Z]\", \"\");\r\n String Capstext = EditText.toUpperCase();\r\n System.out.println(Capstext);\r\n return Capstext;\r\n }", "private static String getSingleText(CommonToken token, String name1, String name2) {\n String input = token.getText();\n\n if (StringUtils.containsWhitespace(input)) return input;\n if (\",\".equals(input)) return \" AND \";\n return name1 + \".\" + input + \"=\" + name2 + \".\" + input;\n }", "public void parler(String message) {\n if (!this.estHorsLigne() && !this.estLibre()) {//tel allumé et en appel, on parle\n System.out.println(message);\n }\n }", "public static boolean Comprobar(String frase){\n\t\t\n\t\tStringBuffer copia = new StringBuffer(frase);\n\t\tString reverse = copia.reverse().toString();\n\n\t\treturn frase.equals(reverse);\n\t\t\n\t}", "private static String spellPunctuation(String string) {\n\t\tchar[] in = string.toCharArray();\n\t\tStringBuilder out = new StringBuilder();\n\t\t\n\t\tchar b = 0; //previous\n\t\tchar c = 0; //current\n\t\tchar d = 0; //next\n\t\tint n = in.length;\n\t\t\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tc = in[i];\n\t\t\t\n\t\t\tif (i+1 < n) {\n\t\t\t\td = in[i+1];\n\t\t\t}\n\t\t\t\n\t\t\tswitch (c) {\n\t\t\t\tcase ',':\n\t\t\t\t\tif (d != ' ') {\n\t\t\t\t\t\tout.append(\" comma \");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tout.append(\" comma\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '.':\n\t\t\t\t\tif (d == ' ') { //skip periods at the end of sentences\n\t\t\t\t\t\t//skip\n\t\t\t\t\t}\n\t\t\t\t\telse { //keep number with a decimal intact\n\t\t\t\t\t\tout.append(c);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase ';':\n\t\t\t\t\tout.append(\" semicolon\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase ':':\n\t\t\t\t\tout.append(\" colon\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '\\u201c':\n\t\t\t\t\tout.append(\"begin quote \");\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '\\u201d':\n\t\t\t\t\tout.append(\" end quote\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '\"':\n\t\t\t\t\tif (b == ' ') { //previous is space; start string\n\t\t\t\t\t\tout.append(\"begin quote \");\n\t\t\t\t\t}\n\t\t\t\t\telse if (c == ' ') { //next is space; end string\n\t\t\t\t\t\tout.append(\" end quote\");\n\t\t\t\t\t}\n\t\t\t\t\telse { //mid-word\n\t\t\t\t\t\tout.append(\" double quote \");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '\\'': //single quote\n\t\t\t\tcase '\\u2019': //apostrophe\n\t\t\t\t\tif (b == ' ') { //previous is space; start string\n\t\t\t\t\t\tout.append(\"begin quote \");\n\t\t\t\t\t}\n\t\t\t\t\telse if (c == ' ') { //next is space; end string\n\t\t\t\t\t\tout.append(\" end quote\");\n\t\t\t\t\t}\n\t\t\t\t\telse { //mid-word\n\t\t\t\t\t\t//contraction apostrophe is ignored; don't -> dont\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase '%':\n\t\t\t\t\tout.append(\" percent\");\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tout.append(c);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tb = c;\n\t\t}\n\t\t\n\t\treturn out.toString();\n\t}", "public static void main(String[] args) {\nString s1 = \"java gg\";\nchar[] ch ={'g','r','d'};\nString s2 = new String(ch);\n//length\nSystem.out.println(s1.length());\nSystem.out.println(s2.length());\n//charAt\nchar c = s1.charAt(2);\nSystem.out.println(c);\n//String format\nString cd = String.format(\"value %32.11f\",32.5654);\nSystem.out.println(cd);\n//Substring.........start index starts with 0 and end index starts with 1\nSystem.out.println(s1.substring(1));\nSystem.out.println(s1.substring(1, 3));\n//Contains\nSystem.out.println(\"contains example\" +s1.contains(\"gg\"));\n//Join\nString joint = String.join(\"-\", \"Welcome\",\"to\",\"india\");\nSystem.out.println(joint);\n//Equals\nSystem.out.println(s1.equals(s2));\n//is empty\nSystem.out.println(s1.isEmpty());\n//Concat\ns1.concat(\"hello\");\nSystem.out.println(s1);\ns1 = s1.concat(\" home\");\nSystem.out.println(s1);\n//char replace\nString sf=\"javatpoint is a very good website\"; \nString replaceString=sf.replace('a','e');//replaces all occurrences of 'a' to 'e' \nSystem.out.println(replaceString);\n//charSequence replace\nString sg=\"my name is khan my name is java\"; \nString replaceString1=sg.replace(\"is\",\"was\");//replaces all occurrences of \"is\" to \"was\" \nSystem.out.println(replaceString1); \n// trim: string with omitted leading and trailing spaces\nString df = \" Hello java \";\nSystem.out.println(df+\"javapoint\");\nSystem.out.println(df.trim()+\"javapoint\");\n//Split\nString g1 = \"Strike with bang\";\nString[] words = g1.split(\"\\\\s\");//regular expression\nfor (String m:words){\n\tSystem.out.println(m);\n}\n\tfor(String m1:g1.split(\"\\\\s\", 2)){\n\t\tSystem.out.println(m1);\n\t}\n\t\n//indexof\n\tString sw1=\"this is index of example\"; \n\t//passing substring \n\tint index1=sw1.indexOf(\"dex o\");//returns the index of is substring \n\tint index2=sw1.indexOf(\"index\");//returns the index of index substring \n\tSystem.out.println(index1+\" \"+index2);//2 8 \n\t \n\t//passing substring with from index \n\tint index3=sw1.indexOf(\"is\",4);//returns the index of is substring after 4th index \n\tSystem.out.println(index3);//5 i.e. the index of another is \n\t \n\t//passing char value \n\tint index4=sw1.indexOf('x');//returns the index of s char value \n\tSystem.out.println(index4);//3 \n//To lower case\n\tString sf1=\"JAVATPOINT HELLO stRIng\"; \n\tString s1lower=sf1.toLowerCase(); \n\tSystem.out.println(s1lower); \n//To upper case\n\tString sf2 =\"john cenA\";\n\tSystem.out.println(sf2.toUpperCase());\n\t}", "public static String getPotentialCommandInText(String text) {\n if (text.charAt(0) == '/') {\n text = text.substring(1);\n }\n Pattern pattern = Pattern.compile(\"^[a-zA-Zа-яА-Я0-9Ёё]+\", Pattern.UNICODE_CHARACTER_CLASS);\n Matcher matcher = pattern.matcher(text);\n if (matcher.find()) {\n String buf = matcher.group(0).trim();\n pattern = Pattern.compile(\"\\\\W$\", Pattern.UNICODE_CHARACTER_CLASS);\n matcher = pattern.matcher(buf);\n if (matcher.find()) {\n return buf.substring(0, buf.length() - 1).toLowerCase();\n }\n return buf.toLowerCase();\n }\n\n return null;\n }", "public String translateSentence(String sentence)\n {\n // store the punctuation in a variable.\n String punc = sentence.substring(sentence.length() - 1);\n // Use split to tokenize the sentence as per spec.\n String[] words = sentence.split(\" \");\n int lastIdx = words.length - 1;\n // Replace the punctuation in the last word with nothing, we'll add it later at the end.\n words[lastIdx] = words[lastIdx].replace(punc, \"\");\n\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < words.length; i++)\n {\n // for the first word, we want to lowercase it and capitalize only the first letter.\n if (i == 0)\n {\n sb.append(convertToLatin(words[i].toLowerCase()) + \" \");\n }\n else\n {\n sb.append(convertToLatin(words[i]) + \" \");\n }\n }\n // Trim off the last space and add the punctuation.\n String sent = sb.toString().substring(0, sb.toString().length() - 1) + punc;\n sent = sent.substring(0, 1).toUpperCase() + sent.substring(1);\n return sent;\n }", "public static void main (String [ ] args){//declaracion del programa principal \r\n\t\r\n \tScanner in=new Scanner(System.in); //se crea el objeto de la clase Scanner para poder capturar desde teclado\r\n\r\n\tSystem.out.println(\"Capture a phrase: \"); //se imprime en pantalla la instruccion\r\n\tString normal=in.nextLine();//almacenamos el numero capturado a normal, con el metodo nextLine() \r\n\r\n\tString back=new StringBuilder(normal).reverse().toString();\r\n\tSystem.out.println(\"The phrase backwards is: \"+back);//Impresion de la frase al reves\r\n}", "private String buildWordMatch(Matcher matcher, String word){\n return \"(\" + matcher.replaceAll(\"% \"+word+\" %\")\n + \" or \" + matcher.replaceAll(word+\" %\")\n + \" or \" + matcher.replaceAll(word)\n + \" or \" + matcher.replaceAll(\"% \"+word) + \")\" ;\n }", "private static String convertToLatin(String word)\n {\n return word.substring(1) + word.substring(0,1) + \"ay\";\n }" ]
[ "0.6203893", "0.5764212", "0.5746987", "0.56893903", "0.5586131", "0.557351", "0.5490504", "0.54545295", "0.53648114", "0.53584015", "0.53529614", "0.53379077", "0.5287768", "0.5262882", "0.5241785", "0.52150345", "0.5173905", "0.5158161", "0.5150458", "0.513219", "0.51149267", "0.5112617", "0.5111734", "0.5102769", "0.51024467", "0.50941753", "0.5068733", "0.506367", "0.503345", "0.50329024", "0.502172", "0.5021176", "0.5016214", "0.49896112", "0.4982354", "0.498099", "0.49752462", "0.49733296", "0.49677593", "0.4963947", "0.49626857", "0.49599448", "0.49517727", "0.49473736", "0.49389455", "0.49333465", "0.4925923", "0.49239218", "0.4918011", "0.4915691", "0.49084333", "0.4901808", "0.48930144", "0.48909742", "0.48813537", "0.4880858", "0.48545042", "0.48459932", "0.48392376", "0.48322028", "0.48302007", "0.48293158", "0.48165792", "0.48052305", "0.48027706", "0.48001543", "0.47883716", "0.47761863", "0.4771267", "0.47706917", "0.47654745", "0.4765032", "0.47637916", "0.47633678", "0.47627306", "0.47574914", "0.47571465", "0.47527933", "0.47519305", "0.47516075", "0.47477677", "0.4747062", "0.47470278", "0.47414297", "0.4730998", "0.4729058", "0.47236943", "0.47191066", "0.471428", "0.4707217", "0.4702314", "0.47014382", "0.47005457", "0.47003168", "0.4694164", "0.4691993", "0.46822652", "0.46820334", "0.46736833", "0.46604615", "0.4656623" ]
0.0
-1
Metodo che restituisce il numero degli alunni da un file
public static int ottieniNumeroRighe(File fileDaLeggere){ //Creo e inizializzo la variabile che contiene il numero degli alunni int numeroAlunni = 0; try { //Inizializzo i controlli FileInputStream lettoreIniziale = new FileInputStream(fileDaLeggere); BufferedReader lettoreFinale = new BufferedReader(new InputStreamReader(lettoreIniziale)); //Creo e inizializzo la variabile che controlla se la linea è piena o vuota String lineaPienaVuota; while(true){ lineaPienaVuota = lettoreFinale.readLine(); if (lineaPienaVuota != null){ numeroAlunni++; } else{ lettoreFinale.close(); break; } } } catch (IOException Errore) { JOptionPane.showMessageDialog(null, "Impossibile interagire con il file " + fileDaLeggere + ". Errore: \n" + Errore); } return numeroAlunni; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int getFileNum(File f)\r\n\t{\r\n\t\tString fileStr = f.toString().substring(2);\r\n\t\t\r\n\t\tint num = Integer.parseInt(fileStr.substring(13, fileStr.length()-5));\r\n\t\treturn num;\r\n\t}", "public int idNum(String fullFilePath){\n\n int lines = 0;\n\n try {\n BufferedReader reader = new BufferedReader(new FileReader(fullFilePath));\n while (reader.readLine() != null) {\n lines++;\n }\n reader.close();\n }\n catch(IOException ioe) {\n ioe.printStackTrace();\n }\n return lines;\n }", "public Integer getFileNo() {\n return fileNo;\n }", "public void setFileNo(Integer fileNo) {\n this.fileNo = fileNo;\n }", "public abstract long NewFileNumber();", "public static int getNumber(RandomAccessFile raf, int i) throws IOException {\n raf.seek(i*4);\n return raf.readInt();\n }", "private int read_int(RandomAccessFile file) throws IOException {\n int number = 0;\n for (int i = 0; i < 4; ++i) {\n number += (file.readByte() & 0xFF) << (8 * i);\n }\n return number;\n }", "private long getNumeroOrdem(File arquivo) throws IOException\n\t{\n\t\tFileReader \t\tfReader \t= new FileReader(arquivo);\n\t\tBufferedReader \tbuffReader \t= new BufferedReader(fReader);\n\t\tlong numeroOrdem=0;\n\t\tString linha=null;\n\t\t/* Faz a leitura das linhas ate encontrar a linha que contem o numero da ordem\n\t\t * Geralmente esta e a primeira linha do arquivo\n\t\t */\n\t\twhile ( (linha=buffReader.readLine()) != null )\n\t\t{\n\t\t\tString patternNumOrdem = getPropriedade(\"ordemVoucher.stringNumeroOrdem\"); \n\t\t\tif (linha.indexOf(patternNumOrdem) > -1)\n\t\t\t{\n\t\t\t\tnumeroOrdem = Long.parseLong( linha.substring(patternNumOrdem.length()).trim() );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tbuffReader.close();\n\t\tfReader.close();\n\t\treturn numeroOrdem;\n\t}", "@Override\n public int getFile() {\n return file;\n }", "public static void main(String[] args) {\n FileInputStream fis =null;\r\n int num; \r\n int contador=0;\r\n \r\n try {\r\n fis = new FileInputStream(\"EnterosGrabadosComoBytes.dat\");\r\n \r\n num= fis.read();\r\n while (num !=-1){\r\n contador++;\r\n System.out.print(num+\" \");\r\n System.out.flush();\r\n num= fis.read(); //leo el sgte num \r\n }\r\n System.out.println(\"\\nYa no hay mas numeros en el fichero\");\r\n System.out.println(\"El total de números es \"+contador);\r\n \r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"Error no encuentro el fichero\"); \r\n } catch (IOException ex) {\r\n System.out.println(\"Error en lectura\");}\r\n \r\n }", "public String getFileNumber() {\n\t\treturn fileNumber;\n\t}", "void setFile(String i) {\n file = i;\n }", "public byte getN_OF_FILE() throws CardException {\n\n if (!this.IC_ALREADY_SUBMIT) {\n this.SubmitIC();\n }\n\n //byte[] id = {(byte)0xFF, (byte)0x02};\n this.SelectFF02();\n\n byte n_of_file = this.__ReadRecord((byte)0, (byte)4)[2];\n System.out.println(\"Card contains \" + n_of_file + \" file.\");\n this.N_OF_FILE = n_of_file;\n return n_of_file;\n }", "public short getFileID() \r\n\t //@ requires [?f]valid_id(this);\r\n\t //@ ensures [f]valid_id(this);\r\n\t{\r\n\t\t////@ open [f]valid_id(this); // auto\r\n\t\tFile thiz = this;\r\n\t\treturn fileID;\r\n\t\t//@ close [f]valid_id(this); // todo\r\n\t}", "public short getFileID() \r\n\t //@ requires [?f]valid_id(this);\r\n\t //@ ensures [f]valid_id(this);\r\n\t{\r\n\t\t////@ open [f]valid_id(this); // auto\r\n\t\treturn fileID;\r\n\t\t//@ close [f]valid_id(this);\r\n\t}", "public short getFileID() \r\n\t //@ requires [?f]valid_id(this);\r\n\t //@ ensures [f]valid_id(this);\r\n\t{\r\n\t\t////@ open [f]valid_id(this); // auto\r\n\t\treturn fileID;\r\n\t\t//@ close [f]valid_id(this);\r\n\t}", "public void setFileId(int value) {\n this.fileId = value;\n }", "public Integer getFileid() {\n return fileid;\n }", "public synchronized int getiNumber(String fileName, boolean fCreate)\n {\n int iNumber = -1;\n int firstEmpty = -1;\n\n // Bad parameter\n if (fileName == null)\n {\n return -1;\n }\n\n // Return an error if the filename is too long\n if (fileName.length() > maxChars)\n {\n return -1;\n }\n\n // Must provide at least one character\n if (fileName.length() < 1)\n {\n return -1;\n }\n \n // Search the vector for the filename, \n // keeping track of the first empty element\n for (int i = 0; i < files.size(); i++)\n {\n if (files.get(i).equals(fileName))\n {\n iNumber = i;\n break;\n }\n else if (files.get(i).equals(\"\") && firstEmpty < 0)\n { \n // Confirm that the Inode is not being used.\n // (Inodes with count > 0 that aren't in the\n // directory are probably marked for deletion)\n Inode inode = new Inode(i);\n\n if (inode.getCount() < 1)\n {\n firstEmpty = i;\n }\n }\n }\n\n // If the file cannot be found, create a new one \n // at the first empty element.\n if (iNumber < 0 && fCreate)\n {\n // Out of directory space\n if (firstEmpty < 0)\n {\n return -1;\n }\n \n // Add the listing\n iNumber = firstEmpty;\n files.removeElementAt(iNumber);\n files.add(iNumber, fileName);\n flush();\n }\n\n return iNumber;\n }", "public void setNumFilhos(int numFilhos){ \n this.numFilhos = numFilhos;\n }", "public void setFileid(Integer fileid) {\n this.fileid = fileid;\n }", "void addFile(int numberLines);", "int getFileCount();", "public int get_ultimo_idUsuario() throws RemoteException {\n int idu=0;\n try {\n FileReader fr = new FileReader(datos);\n BufferedReader entrada = new BufferedReader(fr);\n String s, p=\"\";\n String texto[]=new String[11];\n while((s = entrada.readLine()) != null) p=s;\n\n if(p!=null && p.compareTo(\"\")!=0) {\n texto=p.split(\" \");\n if(texto[0].compareTo(\"\")!=0)\n idu=Integer.parseInt(texto[0]);\n else\n idu=0;\n }\n\n entrada.close();\n } catch (FileNotFoundException e) {\n System.err.println(\"FileStreamsTest: \" + e);\n } catch (IOException e) {\n System.err.println(\"FileStreamsTest: \" + e);\n }\n return idu;\n }", "public long getFileIndex(){\n \tString fileName=file.getName();\n// \tSystem.out.println(\"fileName:\"+fileName);\n \tfinal long start = Long.parseLong(fileName.substring(0,\n\t\t\t\tfileName.length() - FILE_SUFFIX.length()));\n// \tSystem.out.println(\"start:\"+start);\n \treturn start;\n }", "public void incFileCount(){\n\t\tthis.num_files++;\n\t}", "public FileCount(int numFiles){\n this.numFiles = numFiles;\n }", "public static int filaFinder (String fichero) throws IOException{\r\n\t\t\r\n\t\t//Inicialmente 0 filas leidas\r\n\t\tint filas = 0;\t\r\n\t\t\r\n\t\t//Leemos el fichero\r\n\t\tFileReader fr=new FileReader(fichero);\r\n\t\tBufferedReader bf=new BufferedReader(fr);\r\n\t\t\r\n\t\twhile(bf.readLine() != null){\r\n\t\t\t//Incrementamos numero de filas por linea leida en el fichero\r\n\t\t\tfilas++;\r\n\t\t}\r\n\t\t\r\n\t\treturn filas;\r\n\t}", "public static int getFileID() {\n\t\treturn StringArray.fileID;\n\t}", "private void aumentarPilha() {\n this.pilhaMovimentos++;\n }", "public static int nextId(String key) {\n //Setting the id to number of users created + 1 and clearing id file\n try {\n File file = FileHandler.loadFile(key + \".id\");\n InputStream input = new FileInputStream(file);\n Scanner scanner = new Scanner(input);\n int id = scanner.nextInt() + 1;\n scanner.close();\n input.close();\n FileHandler.ClearFile(file);\n //updating id file with new numbers\n PrintStream printStream = new PrintStream(new FileOutputStream(file));\n printStream.println(id);\n printStream.close();\n return id;\n } catch (FileNotFoundException fileNotFoundException) {\n fileNotFoundException.printStackTrace();\n logger.fatal(key + \"id file doesnt exist.\");\n } catch (IOException e) {\n e.printStackTrace();\n logger.error(\"couldn't read from \" + key + \" id file.\");\n }\n return -1;\n }", "public int Tipo() {\r\n File archivo = null;\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n \r\n try {\r\n String linea;\r\n for (a=0;a<5;a++){\r\n if (a==0){\r\n tipo=\"Embarazadas\";\r\n }\r\n if (a==1){\r\n tipo=\"Regulares\";\r\n }\r\n if (a==2){\r\n tipo=\"Discapacitados\";\r\n }\r\n if (a==3){\r\n tipo=\"Mayores\";\r\n }\r\n if (a==4){\r\n tipo=\"Corporativos\";\r\n }\r\n archivo = new File (System.getProperty(\"user.dir\")+\"/Clientes/\"+tipo+\".txt\");\r\n fr = new FileReader (archivo);\r\n br = new BufferedReader(fr);\r\n while((linea=br.readLine())!=null){\r\n if (leerTipo == contador){\r\n errorTipo =String.valueOf(String.valueOf(leerTipo).length());\r\n if (a==0){\r\n resultadoembarazadas+=1;\r\n }\r\n if (a==1){\r\n resultadoregulares+=1;\r\n }\r\n if (a==2){\r\n resultadodiscapacitados+=1;\r\n }\r\n if (a==3){\r\n resultadomayores+=1;\r\n }\r\n if (a==4){\r\n resultadocorporativos+=1;\r\n }\r\n contador +=1;\r\n leerTipo +=6;\r\n\r\n }\r\n else{\r\n contador += 1;\r\n }\r\n }\r\n }\r\n\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n // En el finally cerramos el fichero, para asegurarnos\r\n // que se cierra tanto si todo va bien como si salta \r\n // una excepcion.\r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n //return resultado;\r\n return 0;\r\n }", "public int getFileno() {\n return internalFileno;\n }", "void mo80454a(File file, long j);", "protected int leerArchivo(File f){\n try{\n fr = new FileReader(f);\n return parse();\n } catch(Exception e){\n System.out.println(\"Error: \" + e);\n }\n return -1;\n }", "public static int readID(String path) {\n int id = 0;\n\n try {\n File file = new File(sourcePath + path);\n BufferedReader br = new BufferedReader(new FileReader(file));\n\n String line = br.readLine();\n\n if (line != null)\n id = Integer.parseInt(line.trim());\n else\n System.out.println(\"Unable to convert to integer!\");\n\n br.close();\n } catch (IOException e) {\n System.out.println(\"File not found!\");\n e.printStackTrace();\n }\n\n return id;\n }", "public static int dataNum(File file) {\n int lineCount = 0; // Start line count at 0\n\n try { // Try catch\n Scanner scan = new Scanner(file); // Scans file that was specified\n while(scan.hasNextLine()) { // While loop runs until there are no more lines to read\n String line = scan.nextLine(); // Line read is stored as a string\n if (Character.isDigit(line.charAt(4))) { // Sees if the 4th character in the line is a integer\n lineCount++; // If it is an integer, it counts that line\n }\n }\n return lineCount; // Returns the line count\n } catch (FileNotFoundException e) { // If error occurs\n System.out.println(\"An error has occured\"); // Print that error has occured\n }\n return 0; // In case there is no lineCount return and to get rid of errors\n }", "public Integer getFileId() {\n\t\treturn fileId;\n\t}", "public int updateStudent_Number(){\n String num=\"0\";\n try{\n FileInputStream fileInputStream=context.openFileInput(Constant.STUDENT_NUMBER_FILE);\n Scanner scanner=new Scanner(fileInputStream);\n scanner.useDelimiter(\",\");\n while(scanner.hasNext())\n num=scanner.next();\n scanner.close();\n fileInputStream.close();\n }\n catch (FileNotFoundException e){\n Message.logMessages(\"ERROR: \",\"FILE NOT FOUND!\");\n }\n catch (Exception e){\n Message.logMessages(\"ERROR: \",e.toString());\n }\n return Integer.parseInt(num);\n }", "public static void setNumber(RandomAccessFile raf, int i, int value) throws IOException {\n raf.seek(4 * i);\n raf.writeInt(value);\n }", "public final int getFileId() {\n\t\treturn m_FID;\n\t}", "public long getFileIndex()\r\n {\r\n return fileIndex;\r\n }", "public static int Id(String key) {\n try {\n File file = FileHandler.loadFile(key + \".id\");\n InputStream input = new FileInputStream(Objects.requireNonNull(file));\n Scanner scanner = new Scanner(input);\n int id = scanner.nextInt();\n scanner.close();\n input.close();\n return id;\n } catch (FileNotFoundException fileNotFoundException) {\n fileNotFoundException.printStackTrace();\n logger.fatal(key + \"id file doesnt exist.\");\n } catch (IOException e) {\n e.printStackTrace();\n logger.error(\"couldn't read from \" + key + \" id file.\");\n }\n return 0;\n }", "public int read(ListaEnlazada<User> n){\n \n int rtn = 0;\n User readed;\n \n try (ObjectInputStream ois = new ObjectInputStream (new FileInputStream(file))){\n \n while (true){\n readed = (User) ois.readObject();\n n.add(readed);\n rtn ++; \n }\n }\n catch (FileNotFoundException e){\n rtn = -1;\n System.out.println(\"File not found\");\n }\n catch (ClassNotFoundException e){\n System.out.println(\"cacota gorda\");\n rtn = -1;\n }\n catch (EOFException e){\n System.out.println(\"file ends\");\n }\n catch(IOException e){\n rtn = -1;\n System.out.println(\"Another exception\");\n }\n \n return rtn;\n }", "public void salvaPartita(String file) {\n\r\n }", "public int getFile() {\n validify();\n return Client.INSTANCE.pieceGetFile(ptr);\n }", "int countFile(File file) {\n return readFile(file).length;\n }", "public static int createFileID(String fileName) {\n\n int fileID;\n\n fileID = 0;\n\n // checks to see if the curent fileID is in database. If yes, then it generates a random new one until a new one is found. \n while (containsFileID(fileID)) {\n fileID = (int) (Math.random() * 100000000);\n }\n // adds this id/name pairing to the database\n addOrUpdateFileName(fileID, fileName);\n System.out.println(\"CreateFileID: \" + fileID + \", \" + fileName);\n // returns the id so the TranslationFile object can store it.\n\n return fileID;\n }", "static int m61426a(Resources resources, C18846s sVar) throws FileNotFoundException {\n int i;\n if (sVar.f50795e != 0 || sVar.f50794d == null) {\n return sVar.f50795e;\n }\n String authority = sVar.f50794d.getAuthority();\n if (authority != null) {\n List pathSegments = sVar.f50794d.getPathSegments();\n if (pathSegments == null || pathSegments.isEmpty()) {\n StringBuilder sb = new StringBuilder(\"No path segments: \");\n sb.append(sVar.f50794d);\n throw new FileNotFoundException(sb.toString());\n }\n if (pathSegments.size() == 1) {\n try {\n i = Integer.parseInt((String) pathSegments.get(0));\n } catch (NumberFormatException unused) {\n StringBuilder sb2 = new StringBuilder(\"Last path segment is not a resource ID: \");\n sb2.append(sVar.f50794d);\n throw new FileNotFoundException(sb2.toString());\n }\n } else if (pathSegments.size() == 2) {\n i = resources.getIdentifier((String) pathSegments.get(1), (String) pathSegments.get(0), authority);\n } else {\n StringBuilder sb3 = new StringBuilder(\"More than two path segments: \");\n sb3.append(sVar.f50794d);\n throw new FileNotFoundException(sb3.toString());\n }\n return i;\n }\n StringBuilder sb4 = new StringBuilder(\"No package provided: \");\n sb4.append(sVar.f50794d);\n throw new FileNotFoundException(sb4.toString());\n }", "public static int readInt1(Context context, String fileName, String key) {\n if (context == null) return -1;\n SharedPreferences sharedPreferences = context.getSharedPreferences(fileName, Context.MODE_PRIVATE);\n return sharedPreferences.getInt(key, -1);\n }", "private long m20332a(File file) {\n if (!file.exists()) {\n return 0;\n }\n long length = file.length();\n if (file.delete()) {\n return length;\n }\n return -1;\n }", "private int getNumero() {\n\t\treturn numero;\n\t}", "int getFileInfoCount();", "public void mo210a(File file) {\n }", "public int readTrials() throws Exception\n {\n return fileHandler.readInt(file);\n }", "public Long getFileId() {\n/* 35:35 */ return this.fileId;\n/* 36: */ }", "public int getFileId() {\n return fileId;\n }", "private int inputFile(Integer parameterIndex) throws ExceptionMalformedInput\n {\n this.inputFile = parseParameter(args, parameterIndex+1);\n//TODO check that the file exists and is readable\n return parameterIndex + 1;\n }", "public int getNumFilhos() {\n return this.numFilhos;\n }", "public int getId() {\n // some code goes here\n \treturn m_f.getAbsoluteFile().hashCode();\n }", "public Vector<file> count()\n {\n Vector<Model.file> files = new Vector<>();\n try\n {\n pw.println(11);\n\n files = (Vector<Model.file>) ois.readObject();\n\n }\n catch (ClassNotFoundException | IOException e)\n {\n System.out.println(e.getMessage());\n }\n return files ;\n }", "void citire(FileReader f);", "public void Fecha() throws FileNotFoundException, IOException {\r\n File archivo = null;\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n \r\n try {\r\n // Apertura del fichero y creacion de BufferedReader para poder\r\n // hacer una lectura comoda (disponer del metodo readLine()).\r\n // Lectura del fichero\r\n String linea;\r\n \r\n for (b=0;b<5;b++){\r\n if (b==0){\r\n categoria=\"Embarazadas\";\r\n }\r\n if (b==1){\r\n categoria=\"Regulares\";\r\n }\r\n if (b==2){\r\n categoria=\"Discapacitados\";\r\n }\r\n if (b==3){\r\n categoria=\"Mayores\";\r\n }\r\n if (b==4){\r\n categoria=\"Corporativos\";\r\n }\r\n archivo = new File (System.getProperty(\"user.dir\")+\"/Clientes/\"+categoria+\".txt\");\r\n fr = new FileReader (archivo);\r\n br = new BufferedReader(fr);\r\n while((linea=br.readLine())!=null){\r\n if (leerFecha == contador){\r\n errorFecha = linea.substring(1,2);\r\n if (errorFecha.equals(\"/\")){\r\n comparar = linea.substring(0, 1);\r\n if (\"1\".equals(comparar)){\r\n d1++;\r\n }\r\n if (\"2\".equals(comparar)){\r\n d2++;\r\n }\r\n if (\"3\".equals(comparar)){\r\n d3++;\r\n }\r\n if (\"4\".equals(comparar)){\r\n d4++;\r\n }\r\n if (\"5\".equals(comparar)){\r\n d5++;\r\n }\r\n if (\"6\".equals(comparar)){\r\n d6++;\r\n }\r\n if (\"7\".equals(comparar)){\r\n d7++;\r\n }\r\n if (\"8\".equals(comparar)){\r\n d8++;\r\n }\r\n if (\"9\".equals(comparar)){\r\n d9++;\r\n }\r\n } \r\n else{\r\n comparar1=linea.substring(0, 2);\r\n if (\"10\".equals(comparar1)){\r\n d10++;\r\n }\r\n if (\"11\".equals(comparar1)){\r\n d11++;\r\n }\r\n if (\"12\".equals(comparar1)){\r\n d12++;\r\n }\r\n if (\"13\".equals(comparar1)){\r\n d13++;\r\n }\r\n if (\"14\".equals(comparar1)){\r\n d14++;\r\n }\r\n if (\"15\".equals(comparar1)){\r\n d15++;\r\n }\r\n if (\"16\".equals(comparar1)){\r\n d16++;\r\n }\r\n if (\"17\".equals(comparar1)){\r\n d17++;\r\n }\r\n if (\"18\".equals(comparar1)){\r\n d18++;\r\n }\r\n if (\"19\".equals(comparar1)){\r\n d19++;\r\n }\r\n if (\"20\".equals(comparar1)){\r\n d20++;\r\n }\r\n if (\"21\".equals(comparar1)){\r\n d21++;\r\n }\r\n if (\"22\".equals(comparar1)){\r\n d22++;\r\n }\r\n if (\"23\".equals(comparar1)){\r\n d23++;\r\n }\r\n if (\"24\".equals(comparar1)){\r\n d24++;\r\n }\r\n if (\"25\".equals(comparar1)){\r\n d25++;\r\n }\r\n if (\"26\".equals(comparar1)){\r\n d26++;\r\n }\r\n if (\"27\".equals(comparar1)){\r\n d27++;\r\n }\r\n if (\"28\".equals(comparar1)){\r\n d28++;\r\n }\r\n if (\"29\".equals(comparar1)){\r\n d29++;\r\n }\r\n if (\"30\".equals(comparar1)){\r\n d30++;\r\n }\r\n if (\"31\".equals(comparar1)){\r\n d31++;\r\n }\r\n \r\n }\r\n leerFecha+=6;\r\n contador += 1;\r\n }\r\n \r\n else{\r\n contador += 1;\r\n \r\n \r\n }\r\n } \r\n }\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n // En el finally cerramos el fichero, para asegurarnos\r\n // que se cierra tanto si todo va bien como si salta \r\n // una excepcion.\r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n }", "public static int getIntFromFile(String filename) {\n if (Logger.get().isDebug()) {\n Logger.debug(\"Reading file {}\", filename);\n }\n try {\n List<String> read = FileKit.readLines(filename);\n if (!read.isEmpty()) {\n if (Logger.get().isTrace()) {\n Logger.trace(\"Read {}\", read.get(0));\n }\n return Integer.parseInt(read.get(0));\n }\n } catch (NumberFormatException ex) {\n Logger.warn(\"Unable to read value from {}. {}\", filename, ex.getMessage());\n }\n return 0;\n }", "private static int m2538d(Context context) {\n try {\n File file = new File(Log.m2547a(context, Log.f1857e));\n if (file.exists()) {\n return file.list().length;\n }\n return 0;\n } catch (Throwable th) {\n BasicLogHandler.m2542a(th, \"StatisticsManager\", \"getFileNum\");\n return 0;\n }\n }", "public static int loadFile(File f, Data[] datas) throws IOException \n {\n Scanner scf = new Scanner(f);\n int n = 0; // number of lines read\n while (n < datas.length && scf.hasNextLine()) \n {\n String line = scf.nextLine();\n datas[n] = new Data(line);\n n++;\n }\n scf.close();\n return n;\n }", "public int getId() {\n // some code goes here\n int id = f.getAbsoluteFile().hashCode();\n //System.out.println(id);\n return id;\n }", "private void getArquivo()\n {\n /*** Obtem o conteudo do pacote através do diretorio ***/\n File file = new File(caminho_origem);\n if (file.isFile())\n {\n try\n {\n /*** Lê o pacote e põe em um array de bytes ***/\n DataInputStream diStream = new DataInputStream(new FileInputStream(file));\n long len = (int) file.length();\n if (len > Utils.tamanho_maximo_arquivo)\n {\n System.out.println(Utils.prefixo_cliente + Utils.arquivo_muito_grande);\n System.exit(0);\n }\n Float numero_pacotes_ = ((float)len / Utils.tamanho_util_pacote);\n int numero_pacotes = numero_pacotes_.intValue();\n int ultimo_pacote = (int) len - (Utils.tamanho_util_pacote * numero_pacotes);\n int read = 0;\n /***\n 1500\n fileBytes[1500]\n p[512]\n p[512]\n p[476]len - (512 * numero_pacotes.intValue())\n ***/\n byte[] fileBytes = new byte[(int)len];\n while (read < fileBytes.length)\n {\n fileBytes[read] = diStream.readByte();\n read++;\n }\n int i = 0;\n int pacotes_feitos = 0;\n while ( pacotes_feitos < numero_pacotes)\n {\n byte[] mini_pacote = new byte[Utils.tamanho_util_pacote];\n for (int k = 0; k < Utils.tamanho_util_pacote; k++)\n {\n mini_pacote[k] = fileBytes[i];\n i++;\n }\n Pacote pacote_ = new Pacote();\n pacote_.setConteudo(mini_pacote);\n this.pacotes.add(pacote_);\n pacotes_feitos++;\n }\n byte[] ultimo_mini_pacote = new byte[ultimo_pacote];\n int ultimo_indice = ultimo_mini_pacote.length;\n for (int j = 0; j < ultimo_mini_pacote.length; j++)\n {\n ultimo_mini_pacote[j] = fileBytes[i];\n i++;\n }\n byte[] ultimo_mini_pacote2 = new byte[512];\n System.arraycopy(ultimo_mini_pacote, 0, ultimo_mini_pacote2, 0, ultimo_mini_pacote.length);\n for(int h = ultimo_indice; h < 512; h++ ) ultimo_mini_pacote2[h] = \" \".getBytes()[0];\n Pacote pacote_ = new Pacote();\n pacote_.setConteudo(ultimo_mini_pacote2);\n this.pacotes.add(pacote_);\n this.janela = new HashMap<>();\n for (int iterator = 0; iterator < this.pacotes.size(); iterator++) janela.put(iterator, new Estado());\n } catch (Exception e)\n {\n System.out.println(Utils.prefixo_cliente + Utils.erro_na_leitura);\n System.exit(0);\n }\n } else\n {\n System.out.println(Utils.prefixo_cliente + Utils.arquivo_inexistente);\n System.exit(0);\n }\n }", "@Override\n\tpublic FileVO detailFile(int file_num) {\n\t\treturn workMapper.detailFile(file_num);\n\t}", "public static int readInt(Context context, String fileName, String key) {\n if (context == null) return 0;\n SharedPreferences sharedPreferences = context.getSharedPreferences(fileName, Context.MODE_PRIVATE);\n return sharedPreferences.getInt(key, 0);\n }", "private File getRotationFile(File file){\n System.out.println(\"Начата ротация: \");\n \n File parent = file.getParentFile();\n File ret;\n String withoutExtension = getWithoutExtension(file.getName());\n String extension = getExtension(file.getName());\n \n if (isContainsCountBrackets(withoutExtension)){\n int openBracket = withoutExtension.lastIndexOf(\"(\");\n int closeBracket = withoutExtension.lastIndexOf(\")\");\n String clearName = withoutExtension.substring(0, openBracket);\n String numbers = withoutExtension.substring(openBracket+1, closeBracket);\n //then it is getting his number\n try {\n int number = Integer.parseInt(numbers);\n int newlc = countRotation(clearName, extension, parent.toPath(), number);\n //check for append in old file\n if (existsRotationFile(clearName, newlc, extension, parent.toPath())\n && Files.size(getPathRotationFile(clearName, newlc, extension, parent.toPath()))>=maxSize)\n ret = createNewRotationFile(clearName, extension, parent.toPath());\n else {//size of file fits\n ret = getPathRotationFile(clearName, newlc, extension, parent.toPath()).toFile();\n }\n return ret;\n } catch (NumberFormatException ex){\n System.out.println(\"При парсинге number\"\n +numbers+\" ошибка: \"\n +ex.getMessage());\n //if it is the simply name\n int newlc = countRotation(withoutExtension, extension, parent.toPath(), 0);\n //check for append in old file\n try{\n if (existsRotationFile(withoutExtension, newlc, extension, parent.toPath())\n && Files.size(getPathRotationFile(withoutExtension, newlc, extension, parent.toPath()))>=maxSize)\n ret = createNewRotationFile(withoutExtension, extension, parent.toPath());\n else {//size of file fits\n ret = getPathRotationFile(withoutExtension, newlc, extension, parent.toPath()).toFile();\n }\n } catch (IOException e){\n ret = getPathRotationFile(withoutExtension, newlc, extension, parent.toPath()).toFile();\n System.out.println(\"Ошибка в получении пути файла: \"+e.getMessage());\n }\n return ret;\n } catch (IOException ex){\n ret = getPathRotationFile(withoutExtension, lastCountRotation, extension, parent.toPath()).toFile();\n System.out.println(\"Ошибка в получении пути файла: \"+ex.getMessage());\n return ret;\n }\n } else {//if it is the simply name\n int newlc = countRotation(withoutExtension, extension, parent.toPath(), 0);\n //check for append in old file\n try{\n if (existsRotationFile(withoutExtension, newlc, extension, parent.toPath())\n && Files.size(getPathRotationFile(withoutExtension, newlc, extension, parent.toPath()))>=maxSize)\n ret = createNewRotationFile(withoutExtension, extension, parent.toPath());\n else {//size of file fits\n ret = getPathRotationFile(withoutExtension, newlc, extension, parent.toPath()).toFile();\n }\n } catch (IOException e){\n ret = getPathRotationFile(withoutExtension, newlc, extension, parent.toPath()).toFile();\n System.out.println(\"Ошибка в получении пути файла: \"+e.getMessage());\n }\n return ret;\n }\n }", "public void numeros() {\r\n \tint[] lista= new int[3001];\r\n\r\n\t\tFile crear = new File (\"Numerosaleatorios.txt\");\r\n \r\n\t\tFileWriter escribir = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tescribir = new FileWriter (crear);\r\n\t\t\tBufferedWriter escribir1 = new BufferedWriter (escribir);\r\n\t\t\tint linea;\r\n\t\t\tRandom aleatorios = new Random();\r\n\t\t\tfor (int i =0; i<3000; i++) {\r\n\t\t\t\tlinea = aleatorios.nextInt(1000);\r\n\t\t\t\tlista[i]= aleatorios.nextInt(1000);\r\n\t\t\t\tescribir1.write(linea + \"\\n\");\r\n\t\t}\r\n\t\t\r\n\t\tescribir.close();\r\n\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(0);\r\n\t}\r\n\t}", "private long read_long(RandomAccessFile file) throws IOException {\n long number = 0;\n for (int i = 0; i < 8; ++i) {\n number += ((long) (file.readByte() & 0xFF)) << (8 * i);\n }\n return number;\n }", "public void iniciarValores(){\r\n //Numero de campos da linha, do arquivo de saida filtrado\r\n this.NUM_CAMPOS = 106;\r\n this.ID = 0; //numero da ficha\r\n this.NUM_ARQUIVOS = 2070;\r\n\r\n this.MIN_INDICE = 1; //indice do cadastro inicial\r\n this.MAX_INDICE = 90; //indice do cadastro final\r\n this.NUM_INDICES = 90; //quantidade de cadastros lidos em cada arquivo\r\n }", "public static void readNumbers(String filePath, int[] nums) {\n JSONParser parser = new JSONParser();\n try {\n JSONObject jsonObject = (JSONObject) parser.parse(new FileReader(filePath));\n nums[0] = Integer.parseInt((String) jsonObject.get(\"number of primary\"));\n nums[1] = Integer.parseInt((String) jsonObject.get(\"number of backup\"));\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n\n }", "public final static int get(String fileName) {\n\t\t\tString strValue = PROPERTIES.getProperty(fileName);\n\t\t\t//log.info(\"GET dataset id : \"+fileName);\n\t\t\ttry {\treturn strValue!=null? Integer.valueOf(strValue): -1;\t}catch(Exception e) {\treturn -1;\t}\n\t\t}", "private static void letturaFilePerRiga(File file) {\n\t\ttry(FileReader reader = new FileReader(file);\n\t\t\tBufferedReader buffReader = new BufferedReader(reader)) {\n\t\t\tString riga = null;\n\t\t\t\n\t\t\tdo {\n\t\t\t\triga = buffReader.readLine();\n\t\t\t\tSystem.out.println(riga);\n\n\t\t\t} while (riga != null);\n\t\t\twhile(riga != null);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO: handle exception\n\t\t} catch (IOException e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\n\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Dime que nombre quieres ponerle al fichero\");\n\t\tScanner scan = new Scanner(System.in);\n\t\tString nombre = scan.nextLine();\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\" Selecciona la opcion que quieres: 1 Crea el fichero 2 Muestra la info 3 muestra la longitud 4 comprueba si existe 5 borra el fichero 9 salir\"\n\t\t\t\t+ \"\");\n\t\tint numero = sc.nextInt();\n\t\t\n\t\t//while(numero <6) {\n\t\tswitch(numero) {\n\t\tcase 1:\n\t\t\t//System.out.println(\"Dime que nombre quieres ponerle al fichero\");\n\t\t\tFile fichero = new File(nombre +\".txt\");\n\t\t\ttry {\n\t\t\t\tif(fichero.createNewFile() == true)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"El fichero se ha creado\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"El fichero no se ha creado\");\n\t\t\t\t}\n\t\t\t} catch (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\tbreak;\n\t\tcase 2:\n\t\t\tfichero = new File(nombre +\".txt\");\n\t\t\tSystem.out.println(fichero.getName());\n\t\t\tSystem.out.println(fichero.getPath());\n\t\t\tSystem.out.println(fichero.getAbsolutePath());\n\t\t\tSystem.out.println(fichero.length());\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tfichero = new File(nombre +\".txt\");\n\t\t\tSystem.out.println(fichero.length());\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tfichero = new File(nombre +\".txt\");\n\t\t\ttry {\n\t\t\t\tif(fichero.createNewFile() == true)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"El fichero se ha creado\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"El fichero no se ha creado\");\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\tbreak;\n\t\tcase 5:\n\t\t\tfichero = new File(nombre +\".txt\");\n\t\t\tfichero.delete();\n\t\t\tbreak;\t\t\t\n\t\tcase 9:\n\t\t\tSystem.exit(0);\n\t\t\tbreak;\n\t\t}//}\n\t\t\t\n\t\t}", "public static final int getListFileFirstInt(final ListFile var) {\n if (var == null)\n return -1;\n return getListFileIntList(var)[0];\n }", "public int escreverVetorEmArquivo(int v[], \n\t\t\tString nomeArquivo) throws IOException{\n\t\tint resultado = -1; // sem sucesso\n\t\t\n\t\tFile f = new File(nomeArquivo);\n\t\t// se o arquivo nao existir -> criar\n\t\tif (!f.exists()) f.createNewFile();\n\t\t// 1) Criar um escritor de arquivo\n\t\tFileOutputStream fos = new FileOutputStream(f);\n\t\tDataOutputStream dos = new DataOutputStream(fos);\t\t\t\t\n\t\t// 2) Escrever o tamanho do vetor\n\t\tdos.writeInt(v.length);\n\t\t// 3) Para cada número no vetor\n\t\tfor (int i = 0; i < v.length; i++){\n\t\t// 3.1) escrever o número no arquivo\n\t\t\tdos.writeInt(v[i]);\n\t\t}\n\t\t// 4) Encerrar o escritor\n\t\tdos.close();\n\t\t// 5) Informar detalhes do arquivo (metadados)\n\t\tSystem.out.println(\"Arquivo escrito com sucesso: \" + \n\t\t\t\tf.length() + \" bytes.\");\n\t\tSystem.out.println(\"Caminho: \" + f.getAbsolutePath());\n\t\t// 6) Retornar a quantidade de números escrita\n\t\tresultado = v.length; \n\t\treturn resultado;\n\t}", "private synchronized int getNewLSN() throws IOException {\n File file = new File(LSN_FILE_NAME);\n int lsn = 0;\n\n if (file.exists()) {\n FileReader freader = new FileReader(file);\n BufferedReader breader = new BufferedReader(freader);\n\n String stringlsn = breader.readLine();\n lsn = Integer.parseInt(stringlsn);\n\n breader.close();\n } else {\n file.createNewFile();\n }\n\n FileWriter writer = new FileWriter(LSN_FILE_NAME);\n writer.write(Integer.toString(lsn + 1));\n writer.close();\n\n return lsn;\n }", "public final int getFileId() {\n\t\treturn m_fileId;\n\t}", "private int getPosition(){\n for (int i = 0; i < Integer.MAX_VALUE; i++){\n if (!new File(Environment.getExternalStorageDirectory().getPath() + \"/csv_\" + String.valueOf(i) + \".csv\").exists()){\n return i;\n }\n }\n return 0;\n }", "public void incrementFileProcess() {\n this.setCurrFileName(files.elementAt(\n this.currFileProgressValue).toString());\n this.currFileProgressValue++;\n this.pbarFileProcess.setValue(this.currFileProgressValue);\n this.lblFileProcessCaption.setText(processCaption+\" \"+currFileProgressValue+\" of \"+\n maxfiles); \n }", "public void setNumberOfInProcessFiles(int value) {\n this.numberOfInProcessFiles = value;\n }", "public Number getFileCount() {\r\n\t\treturn (this.fileCount);\r\n\t}", "private static void printNumbers(String f1) throws IOException {\n DataInputStream in = readFile(f1,f1,true);\n System.out.println(\"\\nThe numbers in \" + f1 + \" are :\");\n int i=0;\n while(i<20 && in.available()>=4){ //print first 20 numbers\n int val = in.readInt();\n System.out.print(val + \" \");\n\n i++;\n\n }\n }", "public static int readIntDefaultUsd(Context context, String fileName, String key) {\n if (context == null) return 1;\n SharedPreferences sharedPreferences = context.getSharedPreferences(fileName, Context.MODE_PRIVATE);\n return sharedPreferences.getInt(key, 1);\n }", "private static int lines(String file) {\n\t\tint lineCount = 0;\ntry{\n \t\tFileReader fr = new FileReader(file);\n \t\t LineNumberReader lnr = new LineNumberReader(fr);\n \t\t while (lnr.readLine() != null){\n \t\t \tlineCount++;\n \t }\n \t lnr.close(); \n \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}\nreturn lineCount;\n\n\t\t\n\t}", "void downloadNdvi(File file, int id) throws IOException, SQLException;", "public Long getInfile_()\n{\nreturn getInputDataItemId(\"infile_\");\n}", "public static int readIntFromIndex(File file, String index) {\n if(!file.exists()) return -1;\n String[] lines = getFileLines(file);\n for(String line : lines) {\n if(line.startsWith(index)) {\n line = line.replace(index,\"\");\n try{\n return Integer.parseInt(line);\n } catch (Exception e) { //continues looking for another index\n e.printStackTrace();\n ZmdbLogger.log(\"Unable to get integer from index \" + index + \" from file \" + file.getPath() + \". Continuing to look for another index.\");\n }\n }\n }\n //if nothing was found or Integer.parseInt failed\n return -1;\n }", "public static int getAmount()\n {\n Container v = new Container();\n\n //mal uso del try/catch con streams\n try\n {\n Stream<String> stream = Files.lines( Paths.get( PATHROOT,\"amount2.txt\" ) );\n stream.forEach( x -> v.v = Integer.parseInt( x ) );\n }\n catch ( Exception e )\n {\n }\n return v.v;\n }", "public static void main(String[] args) throws FileNotFoundException {\nint zbir=0;\n\n\t\tFileReader file=new FileReader(\"maraton.txt\");\n\nArrayList<Integer> lista = new ArrayList<>();\nScanner input=new Scanner(file);\n\nwhile (input.hasNext()) {\n\t\nString ime = input.next();\n\nlista.add(input.nextInt());\n}\nfor(int i=0; i<lista.size();i++) {\n\n\t zbir += lista.get(i);\n\t \n\t\n}\nSystem.out.println(\"Zbir je :\" +zbir);\n\t System.out.println(\"Prosjek je :\" + (zbir/lista.size()));\n\n}", "public void setFileID(Long fileID)\n/* */ {\n/* 100 */ this.fileID = fileID;\n/* */ }", "public void primera_parte(String path) {\r\n\t\tint aparece_dos_veces=0,aparece_tres_veces=0;\r\n\t\tint[] abecedario=new int[26];\r\n\t\tString linea;\r\n\t\tFile archivo=new File(path);\r\n\t\ttry {\r\n\t\t\tScanner sc=new Scanner(archivo);\r\n\t\t\twhile(sc.hasNextLine()) {\r\n\t\t\t\tinicializar_vector(abecedario);\r\n\t\t\t\tlinea=sc.nextLine();\r\n\t\t\t\tprocesar_linea(abecedario,linea);\r\n\t\t\t\tfor(int j=0;j<abecedario.length;j++) {\r\n\t\t\t\t\tif(abecedario[j]==2) {\r\n\t\t\t\t\t\taparece_dos_veces++;\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\tfor(int j=0;j<abecedario.length;j++) {\r\n\t\t\t\t\tif(abecedario[j]==3) {\r\n\t\t\t\t\t\taparece_tres_veces++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tsc.close();\r\n\t\t\tint resultado=(aparece_dos_veces*aparece_tres_veces);\r\n\t\t\tSystem.out.println(\"Our Checksum is: \"+resultado);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "double getFile(int index);", "public double getNumFiles(){\n\t\treturn (this.num_files);\n\t}", "public int leerDatosUsuarios() {\n\t\tMiObjectInputStream oi = null;\n\t\tboolean b = false;\n\t\ttry { // comprueba que el archivo FLIBROS existe antes de leerlo\n\t\t\toi = new MiObjectInputStream(new FileInputStream(Const.FUSUARIOS));\n\t\t\tb = true;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Archivo no encontrado - altaUsuario\" + e.toString());\n\t\t}\n\n\t\tint n = 0;\n\t\tif (b) { // si el archivo existe, leera los usuarios almacenados\n\t\t\ttry {\n\t\t\t\twhile (b) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tUsuario u = (Usuario) oi.readObject();\n\t\t\t\t\t\tn++;\n\t\t\t\t\t} catch (EOFException e) {\n\t\t\t\t\t\tb = false;\n\t\t\t\t\t}\n\t\t\t\t} // finaliza el while para la lectura\n\t\t\t\toi.close();\n\t\t\t} catch (Exception e) {// encaso de encontrar el archivo pero no puede leerlo\n\t\t\t\tSystem.out.println(\"Problemas al leer el archivo - altaUsuario\" + e.toString());\n\t\t\t}\n\t\t}\n\t\treturn n;\n\t}", "int retrieve(FileInputSplit fileInputSplit);" ]
[ "0.70844513", "0.70663995", "0.7044223", "0.70283055", "0.69995356", "0.6422472", "0.6364414", "0.6350384", "0.6321203", "0.63110316", "0.6305379", "0.62477386", "0.6160922", "0.6156703", "0.6141857", "0.6141857", "0.61413956", "0.6099902", "0.6097686", "0.60429096", "0.6040145", "0.60139877", "0.60101724", "0.60062426", "0.60034204", "0.5995057", "0.5963144", "0.5925911", "0.5903957", "0.58797467", "0.5877727", "0.58549166", "0.5829412", "0.5806578", "0.5800424", "0.5796359", "0.5785285", "0.5782685", "0.5762892", "0.5753645", "0.5738903", "0.5729048", "0.5727393", "0.57238424", "0.5718836", "0.57109565", "0.57010233", "0.5695827", "0.56923664", "0.56882036", "0.56757295", "0.5673407", "0.5672081", "0.56690156", "0.5663637", "0.5654844", "0.5635072", "0.56298226", "0.5625909", "0.56245744", "0.56223303", "0.56196386", "0.56035614", "0.56002146", "0.5589352", "0.55880034", "0.55854785", "0.55827266", "0.55825573", "0.55780214", "0.5570588", "0.55623555", "0.55463743", "0.5542681", "0.55374724", "0.55331707", "0.55302656", "0.55233413", "0.5519322", "0.5516433", "0.551221", "0.55066335", "0.54885846", "0.5471827", "0.5461916", "0.54616046", "0.5457657", "0.5446161", "0.54404277", "0.5432638", "0.5430885", "0.5428843", "0.5426997", "0.5425773", "0.54219085", "0.5419146", "0.54151326", "0.5414686", "0.5413476", "0.5405799" ]
0.6747223
5
Metodo che aggiunge elementi alla list per ogni riga del file
public static void aggiungiAlunni(List<String> listaNomi, File fileDaLeggere, BasicTextEncryptor ekrittik){ try { //Inizializzo i controlli FileInputStream lettoreIniziale = new FileInputStream(fileDaLeggere); BufferedReader lettoreFinale = new BufferedReader(new InputStreamReader(lettoreIniziale)); while(true){ String nomeAlunno = lettoreFinale.readLine(); if (nomeAlunno != null){ listaNomi.add(ekrittik.decrypt(nomeAlunno)); } else{ lettoreFinale.close(); break; } } } catch (IOException Errore) { JOptionPane.showMessageDialog(null, "Impossibile interagire con il file " + fileDaLeggere + ". Errore: \n" + Errore); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void remove() {\n ArrayList<String>Lines=new ArrayList<>();\r\n String Path = \"/home/yara/Documents/4year/OODP/Task.txt\";\r\n \r\n String RID=id.getText();\r\n String Taskname = name.getText();\r\n String startDate = date_start.getText();\r\n String EndDate = date_finish.getText();\r\n String LocalStatus = status.getText();\r\n String MemberID = MemberId.getText();\r\n \r\n Lines.add(RID);\r\n Lines.add(Taskname);\r\n Lines.add(startDate);\r\n Lines.add(EndDate);\r\n Lines.add(LocalStatus);\r\n Lines.add(MemberID);\r\n \r\n FileFacade facade = new FileFacade();\r\n facade.remove(Path, Lines);\r\n \r\n }", "private void deleteFile() {\r\n actionDelete(dataModelArrayList.get(position));\r\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n int indexDelFilm = listLesFilm.getSelectedIndex();\n System.out.println(\"Delete Film Index:\" + indexDelFilm);\n\n // Get delete film's name.\n String stringDelFilmNom = new String(listFilmInList.get(indexDelFilm).getNomdefilm());\n // Delete Last Space in String\n System.out.println(\"Delete Film Name: \" + stringDelFilmNom);\n\n // Get Film names from TXT file, search the movie which we want to delete and then delete it\n // Turn TXT to ArrayList\n File directory = new File(\"src/main/resources/film.csv\");\n String absoultePath = directory.getAbsolutePath();\n List<String> listFilmInTxt = new ArrayList<String>();\n List<String> listModeInTxt = new ArrayList<String>();\n List<Integer> listFilmIdInTxt = new ArrayList<Integer>();\n List<String> listYearInTxt = new ArrayList<String>();\n\n String line = \"\";\n try {\n FileInputStream fin = new FileInputStream(absoultePath);\n InputStreamReader reader = new InputStreamReader(fin);\n BufferedReader buffReader = new BufferedReader(reader);\n StringBuffer stringBuffer = new StringBuffer();\n while ((line = buffReader.readLine()) != null) {\n String[] stringFilm = line.split(\",\");\n listFilmInTxt.add(stringFilm[0]);\n listModeInTxt.add(stringFilm[1]);\n listFilmIdInTxt.add(Integer.valueOf(stringFilm[2]));\n listYearInTxt.add(stringFilm[3]);\n }\n System.out.println(listFilmInTxt);\n buffReader.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n\n // Check if the movie film is in array list, if yes then delete.\n for (int i = 0; i < listFilmInTxt.size(); i++) {\n// System.out.println(listFilmInTxt.get(i));\n if (listFilmInTxt.get(i).equals(stringDelFilmNom)) {\n System.out.println(i);\n System.out.println(listFilmInTxt.get(i));\n if (indexDelFilm != -1) {\n listFilmInList.remove(indexDelFilm);\n listModel.remove(indexDelFilm);\n System.out.println(\"yes\");\n try {\n\n // Empty txt file\n FileWriter fw = new FileWriter(absoultePath);\n fw.write(\"\");\n fw.flush();\n fw.close();\n } catch (IOException ioException) {\n ioException.printStackTrace();\n }\n\n listFilmInTxt.remove(i);\n listModeInTxt.remove(i);\n listFilmIdInTxt.remove(i);\n listYearInTxt.remove(i);\n\n // Rewrite the processed form into the TXT file.\n for (int j = 0; j < listFilmInTxt.size(); j++) {\n\n // Except for the last line, add \"\\n\" to wrap line.\n if (j < listFilmInTxt.size() - 1) {\n try {\n FileWriter fw = new FileWriter(absoultePath, true);\n fw.write(listFilmInTxt.get(j) + \",\" + listModeInTxt.get(j) + \",\" + listFilmIdInTxt.get(j) + \",\" + listYearInTxt.get(j) + \"\\n\");\n fw.close();\n } catch (IOException ioException) {\n ioException.printStackTrace();\n }\n // For the last line.\n } else {\n try {\n FileWriter fw = new FileWriter(absoultePath, true);\n fw.write(listFilmInTxt.get(j) + \",\" + listModeInTxt.get(j) + \",\" + listFilmIdInTxt.get(j) + \",\" + listYearInTxt.get(j));\n fw.close();\n } catch (IOException ioException) {\n ioException.printStackTrace();\n }\n }\n\n }\n }\n\n }\n }\n\n\n }", "public void domicilioElimina(){\r\n\t\tlog.info(\"DomicilioElimina()\");\r\n\t\tfor (int i = 0; i < DomicilioPersonaList.size(); i++) { \t\t\r\n\t \tlog.info(\"\"+DomicilioPersonaList.get(i).getItem()+\" ,idd \"+getIdd() +\" \"+DomicilioPersonaList.get(i).getDomicilio());\r\n\r\n\t\tif((DomicilioPersonaList.get(i).getIddomiciliopersona()== 0 || DomicilioPersonaList.get(i).getIddomiciliopersona()== null) && DomicilioPersonaList.get(i).getItem()==\"Por Agregar\"){\r\n\t\t\tlog.info(\"N2----> DomicilioPersonaList.get(i).getIddomiciliopersona()\" +\" \" +DomicilioPersonaList.get(i).getIddomiciliopersona());\r\n\t\t\tDomicilioPersonaSie domtemp = new DomicilioPersonaSie();\r\n\t\t\tdomtemp.setIddomiciliopersona(idd);\r\n\t\t\tDomicilioPersonaList.remove(domtemp);\r\n\t\tfor (int j = i; j < DomicilioPersonaList.size(); j++) {\r\n\t\t\tlog.info(\" i \" +i+\" j \"+ j);\r\n\t\t\ti=i+1;\r\n\t\t\tDomicilioPersonaList.set(j, DomicilioPersonaList.get(j));\r\n\t\t}break;\r\n\t\t}\r\n\t\telse if(DomicilioPersonaList.get(i).getIddomiciliopersona() ==(getIdd()) && DomicilioPersonaList.get(i).getItem()==\"Agregado\"){\r\n\t\t\tlog.info(\"ALERTA WDFFFF\");\r\n\t\t\tDomicilioPersonaSie obj = new DomicilioPersonaSie();\r\n\t\t\tobj.setIddomiciliopersona(idd);\r\n\t\t\tlog.info(\"DENTRO LISTA DESHABILITADO\");\r\n\t\t\tDomicilioPersonaDeshabilitado.add(obj);\t\r\n\t\t\tFaceMessage.FaceMessageError(\"ALERTA\", \"Los Cambios se realizaran despues de hacer clic en el boton Guardar\");\t\t\t\r\n//\t\t\tmsg = new FacesMessage(FacesMessage.SEVERITY_WARN,\r\n//\t\t\tConstants.MESSAGE_ERROR_TELEFONO_CLIENTE,mensaje);\r\n//\t\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void devolverArchivo(ArrayList<Alumno> lista) // Crea archivo de texto con la lista de datos ya ordenada\n {\n try\n {\n PrintWriter print = new PrintWriter(\"Registros Ordenados.txt\");\n for(int k=0; k<100; k++)\n {\n print.println(F0.get(k).getNombre() + \", \" + F0.get(k).getApellido() + \", \" + F0.get(k).getNoCnt());\n }\n print.close();\n }\n catch(Exception ex)\n {\n System.out.println(ex.getMessage());\n }\n }", "public void EliminarArchivos(){\n\t\ttry{\n\t\tFile Delete = new File(\"Cod.txt\");\n\t\tDelete.deleteOnExit();\n\t\tFile Borrar = new File(\"Maq.txt\");\n\t\tBorrar.deleteOnExit();\n\t\tFile eliminar = new File(\"WS.txt\");\n\t\teliminar.deleteOnExit();\n\t\tFile Bye = new File(\"RESPALDO.txt\");\n\t\tBye.deleteOnExit();\n\t\t\tBufferedReader numero= new BufferedReader(new FileReader(\"WS.txt\"));\n\t\t\tString valor = numero.readLine();\n\t\t\tint NumAreas= Integer.valueOf(valor);\n\t\t\tfor(int i=0; i< NumAreas;i++){\n\t\t\t\tvalor= numero.readLine();\n\t\t\t\tFile eliminas = new File(\"WS\"+valor+\".txt\");\n\t\t\t\teliminas.deleteOnExit();\n\t\t\t}\n\t\t\tnumero.close();\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(\"File not found\");\n\t\t}\n\t}", "public void eliminar(){\n inicio = null;\r\n // Reinicia el contador de tamaño de la lista a 0.\r\n tamanio = 0;\r\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 delete() {\r\n if (this.selectedTag != null) {\r\n for (int i = uploads.size() -1; i >= 0 ; i--) {\r\n if (this.selectedTag.equals(uploads.get(i).getTag())) {\r\n FileUtil.deleteFile(uploads.get(i).getFilepath());\r\n uploads.remove(i);\r\n break;\r\n }\r\n }\r\n }\r\n }", "private void deleteFilesFromDirectory(ArrayList<File> files)\n {\n for(File file:files) {\n Log.i(\"file\",\"indide\"+file.getPath());\n if (file.exists()) {\n Log.i(\"file\",\"exist\"+file.getPath());\n if (file.delete()) {\n Log.i(\"file\",\"delted successfully\"+file.getPath());\n } else {\n Log.i(\"file\",\"unable to delte file\"+file.getPath());\n }\n }\n }\n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\t\r\n\t\t\r\n\t\tDList list = new DList();\r\n\t\t\r\n\t\tFile input = new File(\"file.txt\");\r\n\t\t\r\n\t\tScanner read = new Scanner(input);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\twhile(read.hasNextLine() ) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString name = read.next();\r\n\t\t\t\r\n\t\t\tif(!name.contains(\"delete\") )\r\n\t\t\t\t\tlist.add(name);\r\n\t\t\t\r\n\t\t\tif(name.contains(\"delete\") ) { \r\n\t\t\t\tname = read.next();\t\t\t\t\r\n\t\t\t\tlist.delete(name);\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t}\r\n\t\t\r\n\t\tread.close();\r\n\t\t\r\n\t\tlist.traverse();\r\n\t\t\r\n\t\t//list.traverseBack();\r\n\r\n\t}", "@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 removeFileFromList(ChatFile file){\n\t\tfilelist.remove(file);\t\t\t\n\t}", "private void RemoverMapa(String nomeMapa){\n try{\n BufferedReader br = new BufferedReader(new FileReader(caminho.getPath()+\"/caminho.txt\"));\n File rm = new File(caminho.getPath()+\"/\"+nomeMapa+\".txt\");\n rm.delete();\n String linha = br.readLine();\n ArrayList<String> salvar = new ArrayList();\n String array[] = new String[3];\n while (linha != null){\n array = linha.split(\",\");\n if(!array[1].equals(nomeMapa)){\n salvar.add(linha);\n }\n linha = br.readLine();\n }\n br.close();\n FileWriter fw = new FileWriter(caminho.getPath()+\"/caminho.txt\", true);\n fw.close();\n BufferedWriter bw = new BufferedWriter(new FileWriter(caminho.getPath()+\"/caminho.txt\"));\n for (int i = 0; i < salvar.size();i++){\n bw.write(salvar.get(i));\n bw.newLine();\n }\n bw.close();\n\n }catch (IOException ioe){\n }\n }", "public void delete_from_list(String string)\n {\n String[] current_data = read();\n try\n {\n dir = new File(contextRef.getFilesDir(), filename);\n PrintWriter writer = new PrintWriter(dir);\n\n for (int i = 0; i < current_data.length; i++)\n {\n String line = current_data[i];\n if (line != null && !line.contains(string))\n {\n writer.println(line);\n }\n }\n writer.close();\n }catch (Exception ex)\n {\n //debug2(\"write_contact_list failure\");\n }\n }", "public static void deleteRefRecord(int referenceeState,String selectedItem) throws FileNotFoundException{\n String filePath=\"userData\\\\\";\n if(referenceeState==1){\n filePath = \"userData\\\\departments.txt\";\n }else if(referenceeState==2){\n filePath = \"userData\\\\specializedArea.txt\";\n \n }\n File file = new File(filePath);\n try {\n BufferedReader br = new BufferedReader(new FileReader(file));\n // get lines from txt file\n Object[] tableLines = br.lines().toArray();\n String[] stringArray = Arrays.copyOf(tableLines,tableLines.length, String[].class);\n ArrayList<String> list = new ArrayList<String>(Arrays.asList(stringArray));\n // extratct data from lines and add to the object array list\n for(int i = 0; i < stringArray.length; i++){\n String line = stringArray[i].toString().trim();\n if(line.equals(selectedItem)){\n list.remove(selectedItem);\n }\n }\n //deleting a all lines in the txt\n PrintWriter writer = new PrintWriter(file);\n writer.print(\"\");\n writer.close();\n //writing existing files to txt \n for(String loopObj: list){\n if(referenceeState==1){\n writingDepartment(loopObj);\n }else if(referenceeState==2){\n writingSpecializedArea(loopObj);\n } \n br.close();\n \n }\n \n }catch (Exception ex){\n Logger.getLogger(homeAdminGUI.class.getName()).log(Level.SEVERE, null, ex);\n \n }\n}", "public static void delete(String titulo) {\n\t\tif (pelisList.containsKey(titulo)) {\n\t\t\tSystem.out.println(\"Haz borrado \" + pelisList.remove(titulo) + \" de la cartelera\");\n\t\t} else {\n\t\t\tSystem.out.println(\"El título de esa película no está registrado\\nNo se ha realizado ninguna modificación\");\n\t\t}\n\t\twriteTxt(\"peliculas.txt\", pelisList);\n\t}", "public void processEliminar() {\n }", "public void supprimerLivres(View view) {\n /* recuperer les ids des livres selectionnes dans\n * la liste de livres\n */\n long[] ids = list.getCheckedItemIds();\n if (ids.length == 0)\n return;\n\n for (long id : ids) {\n Log.d(\"supprimer id =\", id + \"\");\n Uri.Builder builder = new Uri.Builder();\n builder.scheme(\"content\")\n .authority(authority)\n .appendPath(\"book_table\");\n /* id du livre a supprimer a la fin de uri */\n ContentUris.appendId(builder, id);\n Uri uri = builder.build();\n\n int res = getContentResolver().delete(uri, null, null);\n Log.d(\"result of delete=\", res + \"\");\n }\n /* apres la suppression de titres mettre a jour la liste\n de titres, id_author ne change pas */\n getLoaderManager().restartLoader(1, null, callbackTitres);\n }", "private void removeArquivos(File arquivoOrdem, String arquivosCaixa[]) throws IOException\n\t{\n\t\tfor (int i=0; i < arquivosCaixa.length; i++)\n\t\t{\n\t\t\t// Remove o arquivo concatenado que foi criptografado\n\t\t\tString extArqCriptografado \t= getPropriedade(\"ordemVoucher.extensaoArquivoCriptografado\");\n//\t\t\tString dirOrigem \t\t= getPropriedade(\"ordemVoucher.dirArquivos\");\n\t\t\tString nomArqCriptografado\t= arquivosCaixa[i]+extArqCriptografado;\n\t\t\tFile arquivoCriptografado\t= new File(nomArqCriptografado);\n\t\t\tSystem.out.println(\"Removendo arquivo \"+nomArqCriptografado);\n\t\t\tif (!arquivoCriptografado.delete())\n\t\t\t\tSystem.out.println(\"Nao foi possivel remover o arquivo \"+nomArqCriptografado);\n\n\t\t\t// Remove o arquivo concatenado original\n\t\t\tString nomArqOrigem\t\t\t= arquivosCaixa[i];\n\t\t\tFile arquivoOrigem\t\t= new File(nomArqOrigem);\n\t\t\tSystem.out.println(\"Removendo arquivo \"+nomArqOrigem);\n\t\t\tif (!arquivoOrigem.delete())\n\t\t\t\tSystem.out.println(\"Nao foi possivel remover o arquivo \"+nomArqOrigem);\n\t\t}\n\t\t\n\t\t/* Remove tambem o arquivo compactado que foi enviado para o GPP */\n\t\tFile arqCompactado = new File(getNomeArquivoCompactado(arquivoOrdem));\n\t\tSystem.out.println(\"Removendo arquivo \"+arqCompactado.getName());\n\t\tif (!arqCompactado.delete())\n\t\t\tSystem.out.println(\"Nao foi possivel remover o arquivo \"+arqCompactado.getName());\n\t}", "public void removerPorReferencia(int referencia){\n if (buscar(referencia)) {\n // Consulta si el nodo a eliminar es el pirmero\n if (inicio.getEmpleado().getId() == referencia) {\n // El primer nodo apunta al siguiente.\n inicio = inicio.getSiguiente();\n // Apuntamos con el ultimo nodo de la lista al inicio.\n ultimo.setSiguiente(inicio);\n } else{\n // Crea ua copia de la lista.\n NodoEmpleado aux = inicio;\n // Recorre la lista hasta llegar al nodo anterior\n // al de referencia.\n while(aux.getSiguiente().getEmpleado().getId() != referencia){\n aux = aux.getSiguiente();\n }\n if (aux.getSiguiente() == ultimo) {\n aux.setSiguiente(inicio);\n ultimo = aux;\n } else {\n // Guarda el nodo siguiente del nodo a eliminar.\n NodoEmpleado siguiente = aux.getSiguiente();\n // Enlaza el nodo anterior al de eliminar con el\n // sguiente despues de el.\n aux.setSiguiente(siguiente.getSiguiente());\n // Actualizamos el puntero del ultimo nodo\n }\n }\n // Disminuye el contador de tama�o de la lista.\n size--;\n }\n }", "void excluir(List<TabelaIRRFLegadoDTO> lstTabelaIRRF) throws BancoobException;", "public static void eliminaFile(long idSezione) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.parameters = new Object[] { idSezione };\n\t\trp.type = RequestType.DELETE_FILE;\n\t\tsend(rp);\n\t}", "public void unorderList() {\n\t\t\tIoFile io = new IoFile(); //created object of IoFile\n\t\t\tString str[]=io.readFromFile(\"/home/admin1/Documents/Data.txt\").split(\" \"); //read the file using readfromfile method\n\t\t\tUtility u = new Utility(); \n\t\t\tLinkedList list = new LinkedList(); //created object of linklist\n\t\t\tfor(int i=0; i<str.length; i++) { //check the length of string\n\t\t\t\tlist.sort(str[i]); //sorting the string\n\t\t\t}\n\t\t\tlist.display(); //display the list \n\t\t\tString st = u.getNext(\"\\nEnter word\"); //for user input\n\t\t\tif(list.search(st)) { //searched the word from the file\n\t\t\t\tlist.remove(st); //remove the word from the file\n\t\t\t}else list.sort(st); //otherwise again sort the word\n\t\t\tlist.display(); //again display\n\t\t\tio.writeToFile(list,\"/home/admin1/Documents/Data.txt\"); //write into the file\n\t\t}", "public void eliminarTodosLosElementos(){\n\t\tlistModel.removeAllElements();\n\t}", "public void removeDialog(ArrayList<Order> listOrder) {\n\t\tJLabel rmLabelOrder = new JLabel(\"Order's id\");\n\t\trmLabelOrder.setSize(80,40);\n\t\trmLabelOrder.setLocation(100, 50);\n\t\tJTextField rmTextOrder = new JTextField();\n\t\trmTextOrder.setSize(250,40);\n\t\trmTextOrder.setLocation(250, 50);\n\t\tadd(rmLabelOrder);\n\t\tadd(rmTextOrder);\n\t\t\n\t\t// setup field Item for remove dialog\n\t\tJLabel rmLabelItem = new JLabel(\"Item's id\");\n\t\trmLabelItem.setSize(80,40);\n\t\trmLabelItem.setLocation(100, 120);\n\t\tJTextField rmTextItem = new JTextField();\n\t\trmTextItem.setSize(250,40);\n\t\trmTextItem.setLocation(250, 120);\n\t\tadd(rmLabelItem);\n\t\tadd(rmTextItem);\n\t\t\n\t\tokJButton.setSize(100,30);\n\t\tokJButton.setLocation(250,330);\n\t\tokJButton.setFocusPainted(false);\n\t\tadd(okJButton);\n\t\tokJButton.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tsetVisible(false);\n\t\t\t\tif(rmLabelOrder.getText() == null || rmLabelItem == null) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Ban chua nhap thong tin\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tString strIdOrder = rmTextOrder.getText();\n\t\t\t\t\tString strIdItem = rmTextItem.getText();\n\t\t\t\t\tcheckTypeForRemove(strIdOrder, strIdItem);\n\t\t\t\t\t\n\t\t\t\t\tint idOrder = Integer.parseInt(rmTextOrder.getText());\n\t\t\t\t\tint idItem = Integer.parseInt(rmTextItem.getText());\n\t\t\t\t\t\n\t\t\t\t\tcheckIdOrderForRemove(idOrder, listOrder);\n\t\t\t\t\tcheckIdMediaForRemove(idItem, listOrder.get(idOrder -1));\n\t\t\t\t\t\n\t\t\t\t\tlistOrder.get(idOrder -1).removeMedia(idItem);\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Remove Item complete!\", \"Remove Item\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, e1.getMessage(), \"Warning\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tsetVisible(true);\n\t}", "void deleteTranslatedFiles(InformationResourceFile irFile);", "public void suppfichier(String chemin) {\n Path path = Paths.get(chemin);\n if (path.toFile().isDirectory()) { //si c'esst un dossier\n try (DirectoryStream<Path> listing = Files.newDirectoryStream(path)) {\n if (path != null) {\n for (Path nom : listing) { //parsourir les fichier et sou dossier\n if (!Files.isDirectory(nom)) {\n Files.delete(nom);\n } else {\n suppfichier(nom.toFile().getAbsolutePath());\n }\n }\n Files.delete(path);\n } else {\n Files.delete(path);\n }\n } catch (IOException e) {\n File file = new File(chemin);\n file.delete();\n }\n } else {\n File file = new File(chemin);\n file.delete();\n }\n }", "public void telefonoElimina(){\r\n \tlog.info(\"en eliminarTelefono()\");\t\r\n \tfor (int i = 0; i < TelefonoPersonaList.size(); i++) { \t\t\r\n \t\tlog.info(\"\"+TelefonoPersonaList.get(i).getItem()+\" ,idt \"+getIdt() +\" \"+TelefonoPersonaList.get(i).getTelefono());\r\n// \tlog.info(\"N1--->TelefonoPersonaList.get(i).getIdtelefonopersona()\"+\" --\" +TelefonoPersonaList.get(i).getIdtelefonopersona());\r\n\t\tif((TelefonoPersonaList.get(i).getIdtelefonopersona()== 0 || TelefonoPersonaList.get(i).getIdtelefonopersona()== null) && TelefonoPersonaList.get(i).getItem()==\"Por Agregar\"){\r\n\t\t\tlog.info(\"N2----> TelefonoPersonaList.get(i).getIdtelefonopersona()\" +\" \" +TelefonoPersonaList.get(i).getIdtelefonopersona());\r\n\t\t\tTelefonoPersonaSie teltemp = new TelefonoPersonaSie();\r\n\t\t\tteltemp.setIdtelefonopersona(idt);\r\n\t\t\tTelefonoPersonaList.remove(teltemp);\r\n\t\tfor (int j = i; j < TelefonoPersonaList.size(); j++) {\r\n\t\t\tlog.info(\" i \" +i+\" j \"+ j);\r\n\t\t\ti=i+1;\r\n\t\t\t//TelefonoPersonaList.get(j).setItem(i);\r\n\t\t\tTelefonoPersonaList.set(j, TelefonoPersonaList.get(j));\r\n\t\t}break;\r\n\t\t\t}\r\n\t\telse if(TelefonoPersonaList.get(i).getIdtelefonopersona() ==(getIdt()) && TelefonoPersonaList.get(i).getItem()==\"Agregado\"){\r\n\t\t\t\tlog.info(\"ALERTA WDFFFF\");\r\n\t\t\t\tTelefonoPersonaSie obj = new TelefonoPersonaSie(); \r\n\t\t\t\tobj.setIdtelefonopersona(idt);\r\n\t\t\t\tlog.info(\"DENTRO LISTA DESHABILITADO\");\t\t\t\t\r\n\t\t\t\tTelefonoDeshabilitado.add(obj);\r\n\t\t\r\n\t\t\t\tFaceMessage.FaceMessageError(\"ALERTA\", \"Los Cambios se realizaran despues de hacer clic en el boton Guardar\");\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t }", "public void deleteMenuItem() {\n\t\tviewMenu();\n\n\t\t//Clean arraylist so that you can neatly add data from saved file\n\t\tmm.clear();\n\t\t\n\t\tString delID;\n\n\t\tScanner delSC = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Menu ID to Delete : \");\n\t\tdelID = delSC.next();\n\t\t\n\t\ttry \n\t\t{\n\t\t\t// Get data contents from saved file\n\t\t\tFileInputStream fis = new FileInputStream(\"menuData\");\n ObjectInputStream ois = new ObjectInputStream(fis);\n \n mm = (ArrayList<AlacarteMenu>) ois.readObject();\n mm.removeIf(menuItem -> menuItem.getMenuName().equals(delID.toUpperCase()));\n \n ois.close();\n fis.close();\n \n try {\n \tFileOutputStream fos = new FileOutputStream(\"menuData\");\n\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t\t\toos.writeObject(mm);\n\t\t\t\toos.close();\n\t\t\t\tfos.close();\n }\n catch (IOException e) {\n \t\t\tSystem.out.println(\"Error deleting menu item!\");\n \t\t\treturn;\n \t\t}\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\t//System.out.println(\"No menu items found!\");\n\t\t\tSystem.out.format(\"+------------+---------------------------------------+-------+--------------+%n\");\n\t\t\tSystem.out.format(\"| Menu ID | Description | Price | Type |%n\");\n\t\t\tSystem.out.format(\"+------------+---------------------------------------+-------+--------------+%n\");\n\t\t\treturn;\n\t\t}\n\t\tcatch (ClassNotFoundException c) {\n\t\t\tc.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t}", "private void del_file() {\n\t\tFormatter f;\n\t\ttry{\n\t\t\tf = new Formatter(url2); //deleting file content\n\t\t\tf.format(\"%s\", \"\");\n\t\t\tf.close();\t\t\t\n\t\t}catch(Exception e){}\n\t}", "public void Lista(){\n\t\tcabeza = null;\n\t\ttamanio = 0;\n\t}", "public void removerInicio() {\n switch (totalElementos()) {\n case 0:\n System.out.println(\"lista esta vazia\");\n break;\n case 1:\n this.primeiro = this.ultimo = null;\n this.total--;\n break;\n default:\n this.primeiro = this.primeiro.irParaProximo();\n this.total--;\n break;\n }\n }", "public void sepulsaeliminar(View view) {\n\t\tif(posicionArrayList !=-1) {\n\t\t\tarrayList.get(posicionArrayList);\n\n\t\t\tfinal DatabaseReference referenciaUseraBorrar=FirebaseDatabase.getInstance().getReference(\"users\").child(arrayList.get(posicionArrayList));\n\n\t\t\treferenciaUseraBorrar.removeValue(); //Elimina el campo del User de la BD\n\t\t\tarrayList.remove(posicionArrayList); //Elimina la posición correspondiente del ArrayList\n\t\t\tarrayAdapter.notifyDataSetChanged(); //Función que actualiza el arrayAdapter y lo dibuja de nuevo.\n\t\t\tToast.makeText(getApplicationContext(),\"Usuario Cuidador eliminado\",Toast.LENGTH_LONG).show();\n\n\t\t}else{\n\t\t\tToast.makeText(getApplicationContext(),\"No se ha seleccionado ningún elemento\",Toast.LENGTH_LONG).show();\n\t\t}\n\t}", "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}", "public void delAll(List list);", "public void excluir(Filme f) {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Iniciar a transação\r\n gerenciador.getTransaction().begin();\r\n\r\n //Para excluir tem que dar o merge primeiro para \r\n //sincronizar o ator do BD com o ator que foi\r\n //selecionado na tela\r\n f = gerenciador.merge(f);\r\n\r\n //Mandar sincronizar as alterações \r\n gerenciador.remove(f);\r\n\r\n //Commit na transação\r\n gerenciador.getTransaction().commit();\r\n\r\n }", "public void removerPorReferencia(String referencia){\n if (buscar(referencia)) {\r\n // Consulta si el nodo a eliminar es el pirmero\r\n if (inicio.getValor() == referencia) {\r\n // El primer nodo apunta al siguiente.\r\n inicio = inicio.getSiguiente();\r\n } else{\r\n // Crea ua copia de la lista.\r\n Nodo aux = inicio;\r\n // Recorre la lista hasta llegar al nodo anterior \r\n // al de referencia.\r\n while(aux.getSiguiente().getValor() != referencia){\r\n aux = aux.getSiguiente();\r\n }\r\n // Guarda el nodo siguiente del nodo a eliminar.\r\n Nodo siguiente = aux.getSiguiente().getSiguiente();\r\n // Enlaza el nodo anterior al de eliminar con el \r\n // sguiente despues de el.\r\n aux.setSiguiente(siguiente); \r\n }\r\n // Disminuye el contador de tamaño de la lista.\r\n tamanio--;\r\n }\r\n }", "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 deleteFile() {\n\t\tif (JOptionPane.showConfirmDialog(desktopPane,\n\t\t\t\t\"Are you sure? this action is permanent!\") != JOptionPane.YES_OPTION)\n\t\t\treturn;\n\n\t\tEllowFile file = null;\n\t\tTreePath paths[] = getSelectionModel().getSelectionPaths();\n\t\tif (paths == null)\n\t\t\treturn;\n\t\tfor (TreePath path : paths) {\n\t\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) path\n\t\t\t\t\t.getLastPathComponent();\n\t\t\tfile = (EllowFile) node.getUserObject();\n\t\t\tEllowynProject project = file.parentProject;\n\t\t\tfile.deleteAll();\n\t\t\tif (!file.isProjectFile && project != null)\n\t\t\t\tproject.rebuild(); // don't rebuild the project if the project\n\t\t\t\t\t\t\t\t\t// itself is deleted\n\t\t\tdesktopPane.closeFrames(file);\n\t\t\tmodel.removeNodeFromParent(node);\n\t\t}\n\t}", "public void guardaLlista() throws IOException {\n ctrl_Persistencia.guardaLlista(\"@../../Dades/\"+list.getNomLlista()+\".llista\",list);\n }", "public void eliminarDatosEnEntidad(String entidad, ArrayList entidadencontrada)\r\n\t{\r\n\t\tif(entidad.equalsIgnoreCase(\"Rol\"))\r\n\t\t{\r\n\t\t\tRol encontrado = (Rol)entidadencontrada.get(0);\r\n\t\t\tint respuesta = JOptionPane.showConfirmDialog(this,\"Los datos seleccionados seran eliminados de forma permanente\"+\"\\n\"+\" ¿Desea eliminarlos definitivamente?\",\"Confirmacion para eliminar\",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t if (respuesta == JOptionPane.YES_OPTION){\r\n\t \ttry\r\n\t\t {\r\n\t\t Conector conector = new Conector();\r\n\t\t conector.iniciarConexionBaseDatos();\r\n\t\t RolBD.eliminar(encontrado.getIdrol(), conector);\r\n\t\t conector.terminarConexionBaseDatos();\r\n\t\t JOptionPane.showMessageDialog(this,\"Los datos seleccionados han sido eliminados.\",\"Elininar Datos\",JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t\t }\r\n\t\t catch (Exception e)\r\n\t\t\t\t{\r\n\t\t \tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t\t\t}\r\n\t }\r\n\t\t}\r\n\t\tif(entidad.equalsIgnoreCase(\"Prueba\"))\r\n\t\t{\r\n\t\t\tPrueba encontrado = (Prueba)entidadencontrada.get(0);\r\n\t\t\tint respuesta = JOptionPane.showConfirmDialog(this,\"Los datos seleccionados seran eliminados de forma permanente\"+\"\\n\"+\" ¿Desea eliminarlos definitivamente?\",\"Confirmacion para eliminar\",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t if (respuesta == JOptionPane.YES_OPTION){\r\n\t \tString nombrepru = encontrado.getNombre();\r\n\t \tif(nombrepru.equalsIgnoreCase(\"Vacante Exclusivo\") || nombrepru.equalsIgnoreCase(\"Vacante Multiple\") || nombrepru.equalsIgnoreCase(\"Prueba Libre\"))\r\n\t \t{\r\n\t \t\tJOptionPane.showMessageDialog(this,\"La prueba \"+nombrepru+\" no puede ser eliminada por ser parte importante de la base del conocimiento.\",\"Elininar Datos\",JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\ttry\r\n\t\t\t {\r\n\t\t\t Conector conector = new Conector();\r\n\t\t\t conector.iniciarConexionBaseDatos();\r\n\t\t\t PruebaBD.eliminar(encontrado.getIdprueba(), conector);\r\n\t\t\t conector.terminarConexionBaseDatos();\r\n\t\t\t JOptionPane.showMessageDialog(this,\"Los datos seleccionados han sido eliminados.\",\"Elininar Datos\",JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t\t\t }\r\n\t\t\t catch (Exception e)\r\n\t\t\t\t\t{\r\n\t\t\t \tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t\t\t\t}\r\n\t \t}\r\n\t }\r\n\t\t}\r\n\t\tif(entidad.equalsIgnoreCase(\"Pregunta\"))\r\n\t\t{\r\n\t\t\tPregunta encontrado = (Pregunta)entidadencontrada.get(0);\r\n\t\t\tint respuesta = JOptionPane.showConfirmDialog(this,\"Los datos seleccionados seran eliminados de forma permanente\"+\"\\n\"+\" ¿Desea eliminarlos definitivamente?\",\"Confirmacion para eliminar\",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t if (respuesta == JOptionPane.YES_OPTION){\r\n\t \ttry\r\n\t\t {\r\n\t\t Conector conector = new Conector();\r\n\t\t conector.iniciarConexionBaseDatos();\r\n\t\t PreguntaBD.eliminar(encontrado.getIdpregunta(), conector);\r\n\t\t conector.terminarConexionBaseDatos();\r\n\t\t JOptionPane.showMessageDialog(this,\"Los datos seleccionados han sido eliminados.\",\"Elininar Datos\",JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t\t }\r\n\t\t catch (Exception e)\r\n\t\t\t\t{\r\n\t\t \tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t\t\t}\r\n\t }\r\n\t\t}\r\n\t\tif(entidad.equalsIgnoreCase(\"Escala\"))\r\n\t\t{\r\n\t\t\tEscala encontrado = (Escala)entidadencontrada.get(0);\r\n\t\t\tint respuesta = JOptionPane.showConfirmDialog(this,\"Los datos seleccionados seran eliminados de forma permanente\"+\"\\n\"+\" ¿Desea eliminarlos definitivamente?\",\"Confirmacion para eliminar\",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t if (respuesta == JOptionPane.YES_OPTION){\r\n\t \ttry\r\n\t\t {\r\n\t\t Conector conector = new Conector();\r\n\t\t conector.iniciarConexionBaseDatos();\r\n\t\t EscalaBD.eliminar(encontrado.getIdescala(), conector);\r\n\t\t conector.terminarConexionBaseDatos();\r\n\t\t JOptionPane.showMessageDialog(this,\"Los datos seleccionados han sido eliminados.\",\"Elininar Datos\",JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t\t }\r\n\t\t catch (Exception e)\r\n\t\t\t\t{\r\n\t\t \tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t\t\t}\r\n\t }\r\n\t\t}\r\n\t\tif(entidad.equalsIgnoreCase(\"Competencia\"))\r\n\t\t{\r\n\t\t\tCompetencia encontrado = (Competencia)entidadencontrada.get(0);\r\n\t\t\tint respuesta = JOptionPane.showConfirmDialog(this,\"Los datos seleccionados seran eliminados de forma permanente\"+\"\\n\"+\" ¿Desea eliminarlos definitivamente?\",\"Confirmacion para eliminar\",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t if (respuesta == JOptionPane.YES_OPTION){\r\n\t \ttry\r\n\t\t {\r\n\t\t Conector conector = new Conector();\r\n\t\t conector.iniciarConexionBaseDatos();\r\n\t\t CompetenciaBD.eliminar(encontrado.getIdcompetencia(), conector);\r\n\t\t conector.terminarConexionBaseDatos();\r\n\t\t JOptionPane.showMessageDialog(this,\"Los datos seleccionados han sido eliminados.\",\"Elininar Datos\",JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/informacion.PNG\"));\r\n\t\t }\r\n\t\t catch (Exception e)\r\n\t\t\t\t{\r\n\t\t \tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/error.PNG\"));\r\n\t\t\t\t}\r\n\t }\r\n\t\t}\r\n\t\tif(entidad.equalsIgnoreCase(\"Caracteristica\"))\r\n\t\t{\r\n\t\t\tCaracteristica encontrado = (Caracteristica)entidadencontrada.get(0);\r\n\t\t\tint respuesta = JOptionPane.showConfirmDialog(this,\"Los datos seleccionados seran eliminados de forma permanente\"+\"\\n\"+\" ¿Desea eliminarlos definitivamente?\",\"Confirmacion para eliminar\",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t if (respuesta == JOptionPane.YES_OPTION){\r\n\t \ttry\r\n\t\t {\r\n\t\t Conector conector = new Conector();\r\n\t\t conector.iniciarConexionBaseDatos();\r\n\t\t CaracteristicaBD.eliminar(encontrado.getIdcaracteristica(), conector);\r\n\t\t conector.terminarConexionBaseDatos();\r\n\t\t JOptionPane.showMessageDialog(this,\"Los datos seleccionados han sido eliminados.\",\"Elininar Datos\",JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n\t\t }\r\n\t\t catch (Exception e)\r\n\t\t\t\t{\r\n\t\t \tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t\t\t}\r\n\t }\r\n\t\t}\r\n\t}", "public void rimuoveListaContatti(ListaContatti l) {\n\t\t\n\t\ttry {\n \t\n\t\t\tListaContattiDAO.deleteListaContatti(l);\n \n } catch (SQLException exception) {\n \t\n exception.printStackTrace();\n \n }\n\t}", "void fileDeleted(String path);", "public void eliminaDoppie(ArrayList<Sensore> listaSensori, ArrayList<Attuatore> listaAttuatori) {\n String lettura = readRuleFromFile();\n\n if (lettura.equals(\"\"))\n return;\n\n String[] regole = lettura.split(\"\\n\");\n\n\n ArrayList<String> regoleList = new ArrayList<>(Arrays.asList(regole));\n ArrayList<String> regoleSenzaAbil = new ArrayList<>();\n\n for (String reg : regoleList) {\n regoleSenzaAbil.add(reg.replace(\"ENABLED --> IF \",\"\").replace(\"DISABLED --> IF \",\"\"));\n }\n\n List<String> listWithoutDuplicates = regoleSenzaAbil.stream().distinct().collect(Collectors.toList());\n StringBuilder regoleModificate = new StringBuilder();\n\n for (int i = 0; i < listWithoutDuplicates.size() - 1; i++) {\n\n if (verificaAbilitazione(listWithoutDuplicates.get(i),listaSensori,listaAttuatori))\n regoleModificate.append(\"ENABLED --> IF \");\n else\n regoleModificate.append(\"DISABLED --> IF \");\n\n regoleModificate.append(listWithoutDuplicates.get(i)).append(\"\\n\");\n }\n\n if (verificaAbilitazione(listWithoutDuplicates.get(listWithoutDuplicates.size() - 1),listaSensori,listaAttuatori))\n regoleModificate.append(\"ENABLED --> IF \");\n else\n regoleModificate.append(\"DISABLED --> IF \");\n\n regoleModificate.append(listWithoutDuplicates.get(listWithoutDuplicates.size() - 1));\n writeRuleToFile(regoleModificate.toString(), false);\n }", "@Override\n public void onClick(View v) {\n DatabaseManager db = new DatabaseManager(getContext());\n int deletedrows = db.deleteData(filename.get(position));\n filename.remove(position);\n filesize.remove(position);\n historyAdapter.notifyDataSetChanged();\n if (deletedrows > 0) {\n Toast.makeText(getContext(), \"Data Deleted\", Toast.LENGTH_LONG).show();\n } else\n Toast.makeText(getContext(), \"Data Not Deleted\", Toast.LENGTH_LONG).show();\n }", "public void llenarListaArchivos(int op) {\n String[] archivosPermitidos = {\".HA\", \".HE\"};\n if (op == 1) {\n archivos_directorio.removeAllItems();\n } else {\n archivos_directorio2.removeAllItems();\n }\n File directorio = new File(\"./\");\n File[] archivos = null;\n if (directorio.exists()) {\n archivos = directorio.listFiles();\n }\n int i;\n\n for (i = 0; i < archivos.length; i++) {\n if (op == 1 && (\"\" + archivos[i]).contains(\".txt\")) {\n archivos_directorio.addItem(\"\" + archivos[i]);\n } else {\n int j;\n for (j = 0; j < archivosPermitidos.length; j++) {\n if ((\"\" + archivos[i]).contains(archivosPermitidos[j])) {\n archivos_directorio2.addItem(\"\" + archivos[i]);\n break;\n }\n }\n }\n }\n\n }", "public boolean DelVeh() {\n\t\ttry\n\t\t{\n\t\t\n\t\t\tString filename=\"src/FilesTXT/vehicule.txt\";\n\t\t\tFileInputStream is = new FileInputStream(filename);\n\t\t InputStreamReader isr = new InputStreamReader(is);\n\t\t BufferedReader buffer = new BufferedReader(isr);\n\t\t \n\t\t String line = buffer.readLine();\n\t \tString[] split;\n\t \tString Contenu=\"\";\n\n\t\t while(line != null){\n\t\t \tsplit = line.split(\" \");\n\t\t\t if(this.getId_vehi()!=Integer.parseInt(split[0])) {\n\t\t\t \tContenu+=line+\"\\n\";\n\t\t\t }\n\t\t \tline = buffer.readLine();\n\t\t }\n\t\t \n\t\t buffer.close();\n\t\t \n\t\t filename=\"src/FilesTXT/vehicule.txt\";\n\t\t\t FileWriter fw = new FileWriter(filename);\n\t\t\t fw.write(Contenu);\n\t\t\t fw.close();\n\t\t \n\t\t return true;\n\t\t}\n\t\tcatch(IOException ioe)\n\t\t{\n\t\t System.err.println(\"IOException: \"+ ioe.getMessage());\n\t\t}\n\t\treturn false;\n\t}", "public void KvtTartListFrissit( String sKonyvtar)\r\n {\n File cAktKvt = null ;\r\n Object aKvtTartalma[] = null ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit( \" + sKonyvtar + \")\") ;\r\n\r\n// cAktKvt = new File( \".\") ;\r\n// cAktKvt = new File( \"/home/tamas/java/Polar/hrmfiles\") ;\r\n cAktKvt = new File( sKonyvtar) ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit cAktKvt = new File() utan\") ;\r\n\r\n // Az aktualis konyvtar teljes utvonalanak beirasa\r\n// Itt nyeli le a vegerol a \\-t vagy /-t :\r\n// m_jKonyvtarTxtFld.setText( cAktKvt.getAbsolutePath()) ; // getAbsolutePath()\r\n m_jKonyvtarTxtFld.setText( sKonyvtar) ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit m_jKonyvtarTxtFld.setText( cAktKvt.getAbsolutePath()) utan\") ;\r\n if ( cAktKvt != null && cAktKvt.isDirectory() == true )\r\n {\r\n aKvtTartalma = HRMFileSzuro( cAktKvt) ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : HRMFileSzuro() utan\") ;\r\n\r\n if ( aKvtTartalma != null )\r\n {\r\n/*\r\nfor ( int i=0 ; i < aKvtTartalma.length ; i++ )\r\n{\r\nSystem.out.println( \"JFileValasztDlg.KvtTartListFrissit() : cKvtrkFileok[\" + i + \"]=\" + aKvtTartalma[i].toString()) ;\r\n}\r\n*/\r\n m_jKvtTartList.setListData( aKvtTartalma) ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : .setListData() utan\") ;\r\n\r\n // Itt mar valoszinu, hogy a ListBox a konyvtar file-jait tartalmazza +++\r\n SetAktKonyvtar( sKonyvtar) ;\r\n\r\n m_jKvtTartList.setSelectedIndex( 0) ;\r\n \r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : SetAktKonyvtar() utan\") ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : setListData\") ;\r\n/*\r\n for ( nIdx = 0 ; nIdx < aKvtTartalma.length ; nIdx++ )\r\n {\r\n m_jKvtTartList.setListData( aKvtTartalma) ;\r\n }\r\n*/\r\n }\r\n }\r\n }", "public void removerTodos() {\n\t\t\n\t}", "String batchRemoveAggr(List<String> datumList);", "public void getList() {\n\n\t\tFile opFile = new File(\"/home/bridgeit/Desktop/newfile.txt\");\n\t\ttry {\n\t\t\topFile.createNewFile();\n\t\t\tFileWriter fwriter = new FileWriter(opFile);\n\n\t\t\tfor (int i = 0; i < slist.size(); i++) {\n\n\t\t\t\tfwriter.append(slist.returnItem(i) + \" \");\n\n\t\t\t}\n\t\t\tfwriter.close();\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void addDeletedFiles(java.lang.String param){\r\n if (localDeletedFiles == null){\r\n localDeletedFiles = new java.lang.String[]{};\r\n }\r\n\r\n \r\n //update the setting tracker\r\n localDeletedFilesTracker = true;\r\n \r\n\r\n java.util.List list =\r\n org.apache.axis2.databinding.utils.ConverterUtil.toList(localDeletedFiles);\r\n list.add(param);\r\n this.localDeletedFiles =\r\n (java.lang.String[])list.toArray(\r\n new java.lang.String[list.size()]);\r\n\r\n }", "public void armarPreguntas(){\n preguntas = file.listaPreguntas(\"Preguntas.txt\");\n }", "public void eliminar(DetalleArmado detallearmado);", "public void remove() {\n\n\t\t\tsuprimirNodo(anterior);\n\n\t\t}", "private static void remover(String st){\n File f = new File(st);\n boolean isDeleted = f.delete();\n if(isDeleted == true) System.out.println(st + \"(removido com sucesso)\");\n }", "public void deleteFromID(String liste_del, int[] id_suppression) {\r\n for (int i = 0; i < id_suppression.length; i++) {\r\n this.executeUpdate(\"DELETE FROM \" + liste_del + \" WHERE id = \" + id_suppression[i]);\r\n }\r\n }", "private void deleteUploadFiles(List<File> listFiles) {\r\n\t\tif (listFiles != null && listFiles.size() > 0) {\r\n\t\t\tfor (File aFile : listFiles) {\r\n\t\t\t\taFile.delete();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void importaRegole(String file, ArrayList<Sensore> listaSensori, ArrayList<Attuatore> listaAttuatori) {\n ArrayList<String> nomiDispPres = new ArrayList<>();\n\n for (Sensore s : listaSensori) {\n nomiDispPres.add(s.getNome());\n }\n\n for (Attuatore att : listaAttuatori) {\n nomiDispPres.add(att.getNome());\n }\n\n String regoleImport = readFromFile(file);\n\n if (regoleImport.equals(\"\")) {\n System.out.println(\"XX Errore di lettura file. Non sono state inserite regole per l'unita immobiliare XX\\n\");\n return;\n }\n\n String[] regole = regoleImport.split(\"\\n\");\n\n for (String r : regole) {\n try {\n ArrayList<String> dispTrovati = verificaCompRegola(r);\n\n for (String nomeDis : dispTrovati) {\n if (nomeDis.contains(\".\")){\n String nomeS = nomeDis.split(\"\\\\.\")[0];\n\n if (!nomiDispPres.contains(nomeS)) {\n throw new Exception(\"XX Dispositivi Incompatibili all'interno della regola XX\\n\");\n }\n\n Sensore s = listaSensori.stream().filter(sensore -> sensore.getNome().equals(nomeS)).iterator().next();\n String nomeInfo = nomeDis.split(\"\\\\.\")[1];\n\n if (s.getInformazione(nomeInfo) == null)\n throw new Exception(\"XX Regola non compatibile XX\\n\");\n\n\n } else if (!nomiDispPres.contains(nomeDis)) {\n throw new Exception(\"XX Dispositivi Incompatibili all'interno della regola XX\\n\");\n\n }\n }\n System.out.println(\"*** Importazione della regola avvenuta con successo ***\\n\");\n writeRuleToFile(r, true);\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n\n }\n eliminaDoppie(listaSensori,listaAttuatori);\n }", "@Override\r\n\tpublic void deleteFileData(Long id) {\n\t\t\r\n\t}", "private void przygotujFolderWynikowy() {\r\n\t\tFile folder = new File(\"./wynik\");\r\n\t\tif (!(folder.mkdir())) {\r\n\t\t\tFile[] tablica = folder.listFiles();\r\n\t\t\tif(tablica != null)\r\n\t\t\tfor (File f : tablica) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tf.delete();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tTreePath[] paths = tree.getSelectionPaths();\n\t\t\t\tcurrentFile = new File(paths+\"\");\n\t\t\t\tint result = JOptionPane.showConfirmDialog(null, \"Bạn muốn xóa file này\",\"Xóa File\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\tif(result==JOptionPane.OK_OPTION)\n\t\t\t\t{\n\t\t\t\t\tcurrentFile.delete();\n\t\t\t\t}\n\t\t\t}", "public void delete(int posicao){\n /*\n *\n * Nega a existência da posição na Lista.\n * Uma pequena gambiarra para não aninhar expressões if e else\n *\n */\n if(!verificaPosicao(posicao))\n throw new IllegalArgumentException(\"Posição inválida\");\n\n for (int i = posicao; i < this.tamanho-1; ++i){\n this.lista[i] = this.lista[i+1];\n }\n this.tamanho--;\n }", "@Override\r\n\tpublic void eliminar(List l) {\n\t\tfor (Iterator i = l.iterator(); i.hasNext();) {\r\n\t\t\tEquipoCompetencia id = (EquipoCompetencia) i.next();\r\n\t\t\tid.setEstatus('E');\r\n\t\t\tdaoEquipoCompetencia.eliminar(id);\r\n\t\t}\r\n\r\n\t}", "@PostMapping(\"/remover1\")\r\nString remover1(@RequestParam(\"ava_0\") String ava_0,\r\n@RequestParam(\"ava_log\") String ava_log,\r\nModel model) {\n\r\n try (Connection connection = dataSource.getConnection()) {\r\n Statement stmt = connection.createStatement();\r\n ResultSet rs = stmt.executeQuery(\"SELECT * FROM avaliacao WHERE id=\"+ava_0);\r\n\r\n ArrayList<String> output = new ArrayList<String>();\r\n //Se achou a ficha\r\n if (rs.next()) {\r\n\r\n\r\n stmt.executeUpdate(\"DELETE FROM goniometria WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM preensao WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM composicao WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM goniometria WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM avaliacaodor WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM evolucaodor WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM gural WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM qualidade WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM forca WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM pressao WHERE id=\"+ava_0);\r\n stmt.executeUpdate(\"DELETE FROM avaliacao WHERE id=\"+ava_0);//chave primaria\r\n\r\n model.addAttribute(\"ava_log\", \"Ficha excluída com sucesso!\");\r\n } else\r\n model.addAttribute(\"ava_log\", \"Ficha não encontrada.\");\r\n return \"dashboard_ficha\";\r\n } catch (Exception e) {\r\n //model.put(\"message\", e.getMessage());\r\n model.addAttribute(\"ava_log\", e.getMessage());\r\n return \"dashboard_ficha\";\r\n }\r\n}", "public static void remove(int id_cancion, int id_lista){\n try{\n\t \t manager = Connection.connectToMysql();\n\t \t manager.getTransaction().begin();\n\t \t \n\t \t Lista l = manager.find(Lista.class, id_lista);\n\t \t Cancion c = manager.find(Cancion.class, id_cancion);\n\t\n\t \t List<Cancion> lista_canciones = l.getCanciones();\n\t \t lista_canciones.remove(c);\n\t \t l.setCanciones(lista_canciones);\n\t \n\t \t manager.getTransaction().commit();\n }catch (Exception ex) {\n System.out.println(ex);\n }\n }", "public Integer DeletarTodos(){\n\n //REMOVENDO OS REGISTROS CADASTRADOS\n return databaseUtil.GetConexaoDataBase().delete(\"tb_log\",\"log_ID = log_ID\",null);\n\n }", "public void FermerAgd() {\n //on essaye d'ouvrir un fichier dans lequel enregistrer le contenu de l'agenda\n try {\n Formatter agd_a_enreg = new Formatter(\"C:\\\\Projet_Agenda_ING3\\\\saved_agendas\");\n\n for (RdV el : this.getAgenda()) {\n //on enregistre 1 rdv par ligne\n //faire gaffe aux formats : %..\n agd_a_enreg.format(\"%s/%s/%s de %s a %s : %s , %s\\n\",\n el.getDate().getDayOfMonth(), el.getDate().getMonthValue(),\n el.getDate().getYear(), el.getHdebut(),\n el.getHfin(), el.getLibelle(), el.getRappel());\n //on supprime le rdv de l'arraylist d'agenda \n this.suppressionRdV(el);\n }\n //on ferme le fichier en ecriture\n agd_a_enreg.close();\n //on met l'attribut agenda à null une fois qu'il est \"vidé\"\n this.agd = null;\n } //en cas de probleme dans l'ouverture du fichier on affiche une erreur\n catch (Exception e) {\n System.out.print(\"Erreur d'ouverture du fichier en ecriture\\n\");\n }\n\n }", "public void borrarTodosTripulantes();", "public static void Delete() throws FileNotFoundException{\n System.out.println(\"[S]elected, [A]ll\");\n Scanner deleteEventScanner = new Scanner(System.in);\n String deleteOption = deleteEventScanner.next();\n if(deleteOption.equalsIgnoreCase(\"s\")){\n System.out.println(\"Enter the Date to delete all events scheduled on that date(MM/DD/YYYY\");\n String eventsToDelete = deleteEventScanner.next();\n int monthToDelete= Integer.parseInt(eventsToDelete.substring(0,2));\n int dateToDelete = Integer.parseInt(eventsToDelete.substring(3,5));\n int yearToDelete = Integer.parseInt(eventsToDelete.substring(6));\n delete.set(yearToDelete, monthToDelete-1, dateToDelete);\n for(int i=0;i<events.size();i++){\n if(events.get(i).getMonth()==delete.get(Calendar.MONTH)&&events.get(i).getDate()==delete.get(Calendar.DATE)&&events.get(i).getYear()==delete.get(Calendar.YEAR)){\n events.remove(i);\n }\n }\n \n \n }\n else if(deleteOption.equalsIgnoreCase(\"a\")){\n events.removeAll(events);\n }\n menu();\n }", "public void excluirContaImopostosDeduzidos(Integer idFaturamentoGrupo , Integer anoMesReferencia) throws ErroRepositorioException;", "protected void cmdRemove() throws Exception{\n\t\t//Determinamos los elementos a eliminar. De cada uno sacamos el id y el timestamp\n\t\tVector entities = new Vector();\n\t\tStringTokenizer claves = new StringTokenizer(conectorParametro(\"idSelection\"), \"|\");\n\t\tStringTokenizer timestamps = new StringTokenizer(conectorParametro(\"timestamp\"), \"|\");\n\t\ttraza(\"MMG::Se van a borrar \" + claves.countTokens() + \" y son \" + conectorParametro(\"idSelection\"));\n\t\twhile(claves.hasMoreTokens() && timestamps.hasMoreTokens()){\n\t\t\tCobGrupoUsuarCobraData cobGrupoUsuarCobra = new CobGrupoUsuarCobraData();\n\t\t\tcobGrupoUsuarCobra.setId(new Long(claves.nextToken()));\n\t\t\t//cobGrupoUsuarCobra.jdoSetTimeStamp(Long.parseLong(timestamps.nextToken()));\n\t\t\tentities.addElement(cobGrupoUsuarCobra);\n\t\t}\n\t\t\n\t\t//Construimos el DTO para realizar la llamada\n\t\tVector datos = new Vector();\n\t\tMareDTO dto = new MareDTO();\n\t\tdto.addProperty(\"entities\", entities);\n\t\tdatos.add(dto);\n\t\tdatos.add(new MareBusinessID(BUSINESSID_REMOVE));\n\t\t\n\t\t\n\t\t\n\t\t//Invocamos la lógica de negocio\n\t\ttraza(\"MMG:: Iniciada ejecución Remove de entidad CobGrupoUsuarCobra\");\n\t\tDruidaConector conectorCreate = conectar(CONECTOR_REMOVE, datos);\n\t\ttraza(\"MMG:: Finalizada ejecución Remove de entidad CobGrupoUsuarCobra\");\n\t\t\n\t\t\n\n\t\t//metemos en la sesión las query para realizar la requery\n\t\tconectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY, conectorParametro(VAR_LAST_QUERY_TO_SESSION));\n\t\t\n\t\t//Redirigimos a la LP de StartUp con la acción de StartUp y requery\n\t\tconectorAction(\"CobGrupoUsuarCobraLPStartUp\");\n\t\tconectorActionParametro(PARAMETRO_GENERICO_ORIGEN, \"menu\");\n\t\tconectorActionParametro(PARAMETRO_GENERICO_ACCION, ACCION_REMOVE);\n\t\tconectorActionParametro(VAR_PERFORM_REQUERY, \"true\");\n\t}", "@Test\n public void testUpdateDelete() {\n\n Fichier fichier = new Fichier(\"\", \"test.java\", new Date(), new Date());\n Raccourci raccourci = new Raccourci(fichier, \"shortcut vers test.java\", new Date(), new Date(), \"\");\n\n assertTrue(GestionnaireRaccourcis.getInstance().getRaccourcis().contains(raccourci));\n\n fichier.delete();\n\n assertFalse(GestionnaireRaccourcis.getInstance().getRaccourcis().contains(raccourci));\n }", "public void deleteAllArtisti() throws RecordCorrelatoException;", "public void llenDic(){\r\n ArrayList<String> wor= new ArrayList<String>();\r\n ArrayList<Association<String,String> >asociaciones= new ArrayList<Association<String,String>>();\r\n \r\n try {\r\n \r\n arch = new File (\"diccionario.txt\");\r\n fr = new FileReader (arch);\r\n br = new BufferedReader(fr);\r\n\r\n \r\n String lin;\r\n \r\n while((lin=br.readLine())!=null){\r\n wor.add(lin);\r\n }\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n \r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n \r\n //Ciclo para separar y obtener la palabra en ingles y español\r\n for(int i=0; i<wor.size()-1;i++){\r\n int lugar=wor.get(i).indexOf(',');\r\n String ing=wor.get(i).substring(0,lugar);\r\n String esp=wor.get(i).substring(lugar+1,wor.get(i).length());\r\n asociaciones.add(new Association(ing, esp));\r\n }\r\n \r\n rz.setValue(asociaciones.get(0));\r\n for (int i=1; i<asociaciones.size(); i++){\r\n insertarNodo(rz, asociaciones.get(i));\r\n }\r\n }", "public void deleteData(String filename, SaveType type);", "public int deleteReq() {\n String fileName = \"\";\n\n Log.v(\"File input stream\", fileName);\n String[] fileList = getContext().fileList();\n Log.v(\"File input stream\", Integer.toString(fileList.length));\n\n for (int i = 0; i < fileList.length; i++) {\n Log.v(\"File input stream\", fileList[i]);\n try {\n fileName = fileList[i];\n context.deleteFile(fileName);\n } catch (Exception e) {\n Log.e(\"Exception Thrown\", \"Exception Thrown\");\n }\n }\n return 0;\n }", "public void removeIngre(Button btn, RecipeTM tm, ObservableList<RecipeTM> obList) {\r\n btn.setOnAction((e) -> {\r\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION);\r\n alert.setTitle(\"Warning\");\r\n alert.setContentText(\"Are you sure ?\");\r\n Optional<ButtonType> result = alert.showAndWait();\r\n if (result.get() == ButtonType.OK) {\r\n try {\r\n deleteResIngre(tm.getIngreID(), cmbCakeID.getSelectionModel().getSelectedItem());\r\n } catch (SQLException | ClassNotFoundException throwables) {\r\n throwables.printStackTrace();\r\n }\r\n obList.remove(tm);\r\n tblRecipe.refresh();\r\n }\r\n });\r\n }", "@Override\n\tpublic void delete(Iterable<? extends Pessoa> arg0) {\n\t\t\n\t}", "public void eliminar(ListaConArreglo nodosMaquina){\n\t\tmodAdmin.eliminar( nodosMaquina);\n\t\tif(!ModAdmin.existe){\n\t\t\tSystem.err.println(\"El dominio indicado no existe en la base\");\n\t\t}\n\t\tModAdmin.existe=false;\n\t}", "public void doDeleteconfirm ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\t\tSet deleteIdSet = new TreeSet();\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\tString[] deleteIds = data.getParameters ().getStrings (\"selectedMembers\");\n\t\tif (deleteIds == null)\n\t\t{\n\t\t\t// there is no resource selected, show the alert message to the user\n\t\t\taddAlert(state, rb.getString(\"choosefile3\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdeleteIdSet.addAll(Arrays.asList(deleteIds));\n\t\t\tList deleteItems = new Vector();\n\t\t\tList notDeleteItems = new Vector();\n\t\t\tList nonEmptyFolders = new Vector();\n\t\t\tList roots = (List) state.getAttribute(STATE_COLLECTION_ROOTS);\n\t\t\tIterator rootIt = roots.iterator();\n\t\t\twhile(rootIt.hasNext())\n\t\t\t{\n\t\t\t\tBrowseItem root = (BrowseItem) rootIt.next();\n\n\t\t\t\tList members = root.getMembers();\n\t\t\t\tIterator memberIt = members.iterator();\n\t\t\t\twhile(memberIt.hasNext())\n\t\t\t\t{\n\t\t\t\t\tBrowseItem member = (BrowseItem) memberIt.next();\n\t\t\t\t\tif(deleteIdSet.contains(member.getId()))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(member.isFolder())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(ContentHostingService.allowRemoveCollection(member.getId()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdeleteItems.add(member);\n\t\t\t\t\t\t\t\tif(! member.isEmpty())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnonEmptyFolders.add(member);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnotDeleteItems.add(member);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(ContentHostingService.allowRemoveResource(member.getId()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdeleteItems.add(member);\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\tnotDeleteItems.add(member);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(! notDeleteItems.isEmpty())\n\t\t\t{\n\t\t\t\tString notDeleteNames = \"\";\n\t\t\t\tboolean first_item = true;\n\t\t\t\tIterator notIt = notDeleteItems.iterator();\n\t\t\t\twhile(notIt.hasNext())\n\t\t\t\t{\n\t\t\t\t\tBrowseItem item = (BrowseItem) notIt.next();\n\t\t\t\t\tif(first_item)\n\t\t\t\t\t{\n\t\t\t\t\t\tnotDeleteNames = item.getName();\n\t\t\t\t\t\tfirst_item = false;\n\t\t\t\t\t}\n\t\t\t\t\telse if(notIt.hasNext())\n\t\t\t\t\t{\n\t\t\t\t\t\tnotDeleteNames += \", \" + item.getName();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnotDeleteNames += \" and \" + item.getName();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\taddAlert(state, rb.getString(\"notpermis14\") + notDeleteNames);\n\t\t\t}\n\n\n\t\t\t/*\n\t\t\t\t\t//htripath-SAK-1712 - Set new collectionId as resources are not deleted under 'more' requirement.\n\t\t\t\t\tif(state.getAttribute(STATE_MESSAGE) == null){\n\t\t\t\t\t String newCollectionId=ContentHostingService.getContainingCollectionId(currentId);\n\t\t\t\t\t state.setAttribute(STATE_COLLECTION_ID, newCollectionId);\n\t\t\t\t\t}\n\t\t\t*/\n\n\t\t\t// delete item\n\t\t\tstate.setAttribute (STATE_DELETE_ITEMS, deleteItems);\n\t\t\tstate.setAttribute (STATE_DELETE_ITEMS_NOT_EMPTY, nonEmptyFolders);\n\t\t}\t// if-else\n\n\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t{\n\t\t\tstate.setAttribute (STATE_MODE, MODE_DELETE_CONFIRM);\n\t\t\tstate.setAttribute(STATE_LIST_SELECTIONS, deleteIdSet);\n\t\t}\n\n\n\t}", "private void deleteExec(){\r\n\t\tList<HashMap<String,String>> selectedDatas=ViewUtil.getSelectedData(jTable1);\r\n\t\tif(selectedDatas.size()<1){\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Please select at least 1 item to delete\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint options = 1;\r\n\t\tif(selectedDatas.size() ==1 ){\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete this Item ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}else{\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete these \"+selectedDatas.size()+\" Items ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}\r\n\t\tif(options==1){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor(HashMap<String,String> map:selectedDatas){\r\n\t\t\t\r\n\t\t\tdiscountService.deleteDiscountByMap(NameConverter.convertViewMap2PhysicMap(map, \"Discount\"));\r\n\t\t}\r\n\t\tthis.initDatas();\r\n\t}", "public void delete(View v){\n int index;\n index=(Integer)v.getTag();\n datos.remove(index);\n anadirarchivo();\n ad.notifyDataSetChanged();\n }", "private void deletion(String pids) {\n\t\tDeletions(pids);\n\t\t\n\t}", "public void deleteFile(File f);", "public void a(File file, List<WxAndQqScanPathInfo> list) {\n if (file != null && !this.p) {\n File[] listFiles = file.listFiles();\n if (listFiles != null) {\n int length = listFiles.length;\n int i2 = 0;\n while (i2 < length) {\n File file2 = listFiles[i2];\n if (!this.p) {\n if (file2 != null) {\n if (!file2.isDirectory()) {\n if (!\".nomedia\".equals(file2.getName()) && file2.length() >= 5 && file2 != null && file2.exists()) {\n CleanWxItemInfo cleanWxItemInfo = new CleanWxItemInfo();\n cleanWxItemInfo.setFileType(((WxAndQqScanPathInfo) list.get(0)).getType());\n cleanWxItemInfo.setFile(file2);\n cleanWxItemInfo.setDays(TimeUtil.changeTimeToDay(cleanWxItemInfo.getFile().lastModified()));\n cleanWxItemInfo.setFileSize(file2.length());\n switch (((WxAndQqScanPathInfo) list.get(0)).getType()) {\n case 1:\n o += cleanWxItemInfo.getFileSize();\n d.setTotalSize(d.getTotalSize() + cleanWxItemInfo.getFileSize());\n d.setTotalNum(d.getTotalNum() + 1);\n if (d.isChecked()) {\n cleanWxItemInfo.setChecked(true);\n d.setSelectSize(d.getSelectSize() + cleanWxItemInfo.getFileSize());\n d.setSelectNum(d.getSelectNum() + 1);\n }\n cleanWxItemInfo.setDays(TimeUtil.changeTimeToDay(0));\n a(d, cleanWxItemInfo);\n break;\n case 2:\n if (!file2.getAbsolutePath().endsWith(\"_cover\") && !new File(file2.getAbsolutePath() + \"_cover\").exists()) {\n if (!\"finishActivity\".equals(this.r) && !\"bigGarbageFragment\".equals(this.r)) {\n if (e.isFinished()) {\n j.setTotalNum(j.getTotalNum() + 1);\n j.setTotalSize(j.getTotalSize() + cleanWxItemInfo.getFileSize());\n a(j, cleanWxItemInfo);\n break;\n } else {\n o += cleanWxItemInfo.getFileSize();\n e.setTotalNum(e.getTotalNum() + 1);\n e.setTotalSize(e.getTotalSize() + cleanWxItemInfo.getFileSize());\n if (e.isChecked()) {\n cleanWxItemInfo.setChecked(true);\n e.setSelectNum(e.getSelectNum() + 1);\n e.setSelectSize(e.getSelectSize() + cleanWxItemInfo.getFileSize());\n }\n a(e, cleanWxItemInfo);\n break;\n }\n }\n } else {\n j.setTotalSize(j.getTotalSize() + cleanWxItemInfo.getFileSize());\n j.setTotalNum(j.getTotalNum() + 1);\n a(j, cleanWxItemInfo);\n break;\n }\n break;\n case 3:\n o += cleanWxItemInfo.getFileSize();\n f.setTotalSize(f.getTotalSize() + cleanWxItemInfo.getFileSize());\n f.setTotalNum(f.getTotalNum() + 1);\n if (f.isChecked()) {\n cleanWxItemInfo.setChecked(true);\n f.setSelectSize(f.getSelectSize() + cleanWxItemInfo.getFileSize());\n f.setSelectNum(f.getSelectNum() + 1);\n }\n a(f, cleanWxItemInfo);\n break;\n case 4:\n if (file2.getName().startsWith(\"snstblur_src_\")) {\n if (Constants.PRIVATE_LOG_CONTROLER) {\n break;\n } else {\n file2.delete();\n break;\n }\n } else {\n if (!file2.getName().startsWith(\"snst_\")) {\n if (file2.getName().startsWith(\"snsu_\") && new File(file2.getAbsolutePath().replace(\"snsu_\", \"snsb_\")).exists()) {\n break;\n }\n } else if (!new File(file2.getAbsolutePath().replace(\"snst_\", \"snsu_\")).exists()) {\n if (new File(file2.getAbsolutePath().replace(\"snst_\", \"snsb_\")).exists()) {\n break;\n }\n } else {\n break;\n }\n o += cleanWxItemInfo.getFileSize();\n g.setTotalSize(g.getTotalSize() + cleanWxItemInfo.getFileSize());\n g.setTotalNum(g.getTotalNum() + 1);\n if (g.isChecked()) {\n cleanWxItemInfo.setChecked(true);\n g.setSelectSize(g.getSelectSize() + cleanWxItemInfo.getFileSize());\n g.setSelectNum(g.getSelectNum() + 1);\n }\n a(g, cleanWxItemInfo);\n break;\n }\n case 5:\n if (file2.getName().endsWith(\".jpg_hevc\")) {\n if (Constants.PRIVATE_LOG_CONTROLER) {\n break;\n } else {\n file2.delete();\n break;\n }\n } else {\n if (file2.getName().startsWith(\"th_\")) {\n if (!file2.getName().endsWith(\"hd\")) {\n break;\n } else {\n break;\n }\n }\n h.setTotalSize(h.getTotalSize() + cleanWxItemInfo.getFileSize());\n h.setTotalNum(h.getTotalNum() + 1);\n a(h, cleanWxItemInfo);\n break;\n }\n case 6:\n if (!file2.getAbsolutePath().contains(\"download/appbrand\")) {\n if (file2.getName().endsWith(\".jpg\")) {\n if (!new File(file2.getAbsolutePath().replace(\".jpg\", \".mp4\")).exists() && !Constants.PRIVATE_LOG_CONTROLER) {\n file2.delete();\n break;\n }\n } else {\n i.setTotalSize(i.getTotalSize() + cleanWxItemInfo.getFileSize());\n i.setTotalNum(i.getTotalNum() + 1);\n a(i, cleanWxItemInfo);\n break;\n }\n } else {\n break;\n }\n case 8:\n k.setTotalSize(k.getTotalSize() + cleanWxItemInfo.getFileSize());\n k.setTotalNum(k.getTotalNum() + 1);\n a(k, cleanWxItemInfo);\n break;\n case 9:\n if (!file2.getName().endsWith(\".mp4\")) {\n l.setTotalSize(l.getTotalSize() + cleanWxItemInfo.getFileSize());\n l.setTotalNum(l.getTotalNum() + 1);\n l.getMineList().add(cleanWxItemInfo);\n a(l, cleanWxItemInfo);\n break;\n } else {\n m.setTotalSize(m.getTotalSize() + cleanWxItemInfo.getFileSize());\n m.setTotalNum(m.getTotalNum() + 1);\n m.getMineList().add(cleanWxItemInfo);\n a(m, cleanWxItemInfo);\n break;\n }\n case 10:\n n.setTotalSize(n.getTotalSize() + cleanWxItemInfo.getFileSize());\n n.setTotalNum(n.getTotalNum() + 1);\n a(n, cleanWxItemInfo);\n break;\n }\n }\n } else {\n try {\n if (file2.listFiles() == null || file2.listFiles().length == 0) {\n FileUtils.deleteFileAndFolder(file2);\n }\n } catch (Exception e2) {\n Logger.iCatch(Logger.TAG, Logger.ZYTAG, \"CleanWxClearNewActivity---wxFileScan ---- \", e2);\n }\n a(file2, list);\n }\n }\n i2++;\n } else {\n return;\n }\n }\n }\n }\n }", "private static void obtenirUneListe() throws FileNotFoundException {\n\t\tSystem.out.println(\"\\r\\nPour combien de jours : \");\n\t\tint nbJours = sc.nextInt();\n\n\t\tSystem.out.println(\"\\r\\nCombien de propositions : \");\n\t\tint nbPropositions = sc.nextInt();\n\n\t\tList<List<Recette>> listeProposition = genererListePropositions(nbJours, nbPropositions);\n\n\t\tSystem.out.println(\"\\r\\nChoix ? \");\n\t\tint choix = sc.nextInt();\n\n\t\tgenererFichier(listeProposition.get(choix - 1));\n\n\t\tsc.nextLine();\n\n\t\traz();\n\t}", "public void removerCarro() {\n\n if (carrosCadastrados.size() > 0) {//verifica se existem carros cadastrados\n listarCarros();\n System.out.println(\"Digite o id do carro que deseja excluir\");\n int idCarro = verifica();\n for (int i = 0; i < carrosCadastrados.size(); i++) {\n if (carrosCadastrados.get(i).getId() == idCarro) {\n if (carrosCadastrados.get(i).getEstado()) {//para verificar se o querto está sendo ocupado\n System.err.println(\"O carrp está sendo utilizado por um hospede nesse momento\");\n } else {\n carrosCadastrados.remove(i);\n System.err.println(\"cadastro removido\");\n }\n }\n\n }\n } else {\n System.err.println(\"Não existem carros cadastrados\");\n }\n }", "public int eliminardelInicio(){\n int elemento = inicio.dato;\n if(inicio == fin){\n inicio=fin=null;\n }else{\n inicio = inicio.sig;\n inicio.ant = null;\n }\n return elemento;\n \n \n }", "protected void cmdRemove() throws Exception{\n\t\t//Determinamos los elementos a eliminar. De cada uno sacamos el id y el timestamp\n\t\tVector entities = new Vector();\n\t\tStringTokenizer claves = new StringTokenizer(conectorParametro(\"idSelection\"), \"|\");\n\t\tStringTokenizer timestamps = new StringTokenizer(conectorParametro(\"timestamp\"), \"|\");\n\t\ttraza(\"MMG::Se van a borrar \" + claves.countTokens() + \" y son \" + conectorParametro(\"idSelection\"));\n\t\twhile(claves.hasMoreTokens() && timestamps.hasMoreTokens()){\n\t\t\tZonSecciData zonSecci = new ZonSecciData();\n\t\t\tzonSecci.setId(new Integer(claves.nextToken()));\n\t\t\t//zonSecci.jdoSetTimeStamp(Long.parseLong(timestamps.nextToken()));\n\t\t\tentities.addElement(zonSecci);\n\t\t}\n\t\t\n\t\t//Construimos el DTO para realizar la llamada\n\t\tVector datos = new Vector();\n\t\tMareDTO dto = new MareDTO();\n\t\tdto.addProperty(\"entities\", entities);\n\t\tdatos.add(dto);\n\t\tdatos.add(new MareBusinessID(BUSINESSID_REMOVE));\n\t\t\n\t\t\n\t\t\n\t\t//Invocamos la lógica de negocio\n\t\ttraza(\"MMG:: Iniciada ejecución Remove de entidad ZonSecci\");\n\t\tDruidaConector conectorCreate = conectar(CONECTOR_REMOVE, datos);\n\t\ttraza(\"MMG:: Finalizada ejecución Remove de entidad ZonSecci\");\n\t\t\n\t\t\n\n\t\t//metemos en la sesión las query para realizar la requery\n\t\tconectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY, conectorParametro(VAR_LAST_QUERY_TO_SESSION));\n\t\t\n\t\t//Redirigimos a la LP de StartUp con la acción de StartUp y requery\n\t\tconectorAction(\"ZonSecciLPStartUp\");\n\t\tconectorActionParametro(PARAMETRO_GENERICO_ORIGEN, \"menu\");\n\t\tconectorActionParametro(PARAMETRO_GENERICO_ACCION, ACCION_REMOVE);\n\t\tconectorActionParametro(VAR_PERFORM_REQUERY, \"true\");\n\t}", "@Override\n\t\tpublic void deleteItem(int index) {\n\t\t\tmFiles.remove(index);\n\t\t}", "public void eliminarLista(){\n //se define la lista seleccionada y se elimina\n ListaCompras listaSeleccionada = ListasComprasTabla.getSelectionModel().getSelectedItem();\n if (listaSeleccionada!=null) {\n ListasComprasTabla.getItems().remove(listaSeleccionada);\n }else {\n System.out.println(\"No hay lista seleccionada\");\n }\n }", "public void removerFinal() {\n switch (totalElementos()) {\n case 0:\n System.out.println(\"lista esta vazia\");\n break;\n case 1:\n this.primeiro = this.ultimo = null;\n this.total--;\n break;\n default:\n ElementoLista elementoTemporarioAnteriorAtual = this.primeiro;\n ElementoLista elementoTemporarioAtual = this.primeiro.irParaProximo();\n for (int i = 1; i < totalElementos(); i++) {\n elementoTemporarioAnteriorAtual = elementoTemporarioAtual;\n elementoTemporarioAtual = elementoTemporarioAtual.irParaProximo();\n }\n\n this.ultimo = elementoTemporarioAnteriorAtual;\n this.ultimo.definirProximo(null);\n this.total--;\n }\n //this.ultimo = this.ultimo.irParaAnterior();\n //this.ultimo.definirProximo(null);\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 }", "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 }", "public void deleteTDList(ActionEvent actionEvent) {\n // find the tdlist being referenced by the button,\n // removeList() from it's parenting group\n }", "private void deleteSelectedFile() {\r\n\t\tString sel = this.displayFileNames.getSelectedValue();\r\n\t\tif(sel != null) {\r\n\t\t\tFileModel model = FileData.getFileModel(sel);\r\n\t\t\tFileType type = model.getFileType();\r\n\t\t\tFileData.deleteFileModel(type);\r\n\t\t\tthis.setButtonEnabled(type);\r\n\t\t\tthis.loadFileNames();\r\n\t\t\tthis.updateColumnSelections(type);\r\n\t\t\tColumnData.clearMatchedCells(type);\r\n\t\t}\r\n\t}", "@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 }", "@Override\n public void actionPerformed(ActionEvent e) {\n String nama = String.valueOf(cbbNama.getSelectedItem());\n String pilihan2 = String.valueOf(cbbPilihan2.getSelectedItem());\n //dapetin nama nama table\n LinkedList<String> arrTable = DataAksesAdmin.listTable();\n //linked list buat nampung yg mau dihapus\n LinkedList<String> forDelete = new LinkedList<>();\n //pindahin ke array kalo ada namanya\n for(int i = 0; i < arrTable.size(); i++){\n for(int j = 1; j < 15; j++){\n if(arrTable.get(i).equals(nama+j)){\n forDelete.add(arrTable.get(i));\n }\n }\n }\n DataAksesAdmin.delUser(nama, pilihan2, forDelete);\n JOptionPane.showMessageDialog(null, \"Data Berhasil Dihapus!\");\n }" ]
[ "0.65464574", "0.65098345", "0.6351513", "0.6351304", "0.63276696", "0.6314919", "0.6249388", "0.6204501", "0.6200247", "0.6185403", "0.6180297", "0.61499447", "0.6143821", "0.61347973", "0.6048262", "0.6014513", "0.5964117", "0.5896817", "0.58904696", "0.5870395", "0.5868296", "0.5863718", "0.58617055", "0.5860493", "0.5851024", "0.58480215", "0.58317053", "0.58216697", "0.58193755", "0.5813795", "0.5811446", "0.5811406", "0.5809085", "0.5804819", "0.5801813", "0.5795327", "0.5787359", "0.57784027", "0.5776336", "0.577433", "0.57527375", "0.57505065", "0.5745755", "0.5742697", "0.57350063", "0.5725924", "0.57227075", "0.57003343", "0.5698459", "0.5696041", "0.5685064", "0.5675933", "0.5654105", "0.5649918", "0.56467366", "0.56443924", "0.5638355", "0.563672", "0.5635591", "0.56352335", "0.5632414", "0.56217784", "0.5621141", "0.56209105", "0.5602968", "0.5602561", "0.5601739", "0.5599549", "0.5598193", "0.5593545", "0.5590932", "0.5582252", "0.55742323", "0.55673194", "0.5562207", "0.55594784", "0.5557557", "0.55508405", "0.554026", "0.5538869", "0.5538804", "0.5537945", "0.55375004", "0.5535629", "0.5532086", "0.5531752", "0.55316335", "0.55239266", "0.5516273", "0.5504398", "0.55022645", "0.5500186", "0.54960465", "0.5493215", "0.54920465", "0.54907644", "0.5490748", "0.54904085", "0.5489618", "0.54892236" ]
0.6049476
14
... Initialize Firebase Auth
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActivitySignupBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); mRegisterBtn= findViewById(R.id.signup); mEmail = findViewById(R.id.username); mPassword = findViewById(R.id.password); getSupportActionBar().hide(); mAuth = FirebaseAuth.getInstance(); database = FirebaseDatabase.getInstance(); progressDialog = new ProgressDialog(SignupActivity.this); progressDialog.setTitle("creating your account"); progressDialog.setMessage("We're creating your account"); mRegisterBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final String email = binding.username.getText().toString().trim(); String password = binding.password.getText().toString().trim(); String confirm_password = binding.confirmPassword.getText().toString().trim(); if (TextUtils.isEmpty(email)) { mEmail.setError("Email is Required."); return; } if (TextUtils.isEmpty(password)) { mPassword.setError("Password is Required."); return; } if (password.length() < 6) { mPassword.setError("Password Must be greater than 6 Characters"); return; } if (TextUtils.isEmpty(confirm_password)) { mPassword.setError("Confirm Password"); return; } if(password.equals(confirm_password)) { progressDialog.show(); mAuth.createUserWithEmailAndPassword(email, password) .addOnCompleteListener(task -> { progressDialog.dismiss(); if (task.isSuccessful()) { Users user = new Users(email, password); String id = task.getResult().getUser().getUid(); database.getReference("Users").child(id).setValue(user); Toast.makeText(SignupActivity.this, "user created", Toast.LENGTH_LONG).show(); } else { Toast.makeText(SignupActivity.this, task.getException().getMessage(), Toast.LENGTH_LONG).show(); } }); } } }); binding.login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(SignupActivity.this,LoginActivity.class); startActivity(i); finish(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setupFirebaseAuth() {\n Log.d(TAG, \"setupFirebaseAuth: setting up firebase auth.\");\n mAuth = FirebaseAuth.getInstance();\n mAuthListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n //check if the user is logged in\n checkCurrentUser(user);\n\n if (user != null) {\n //User is signed in\n Log.d(TAG, \"onAuthStateChanged: signed_in:\" + user.getUid());\n }\n else {\n //User is signed out\n Log.d(TAG, \"onAuthStateChanged: signed out\");\n }\n }\n };\n }", "public void inicializarFirebaseAuth() {\n refAutenticacaofb = ConfiguracaoFirebase.metodoAutenticacaoFirebase();\n }", "private void setUpFirebaseAuthentication() {\n authentication = FirebaseAuth.getInstance();\n authStateListener = firebaseAuth -> {\n currentUser = firebaseAuth.getCurrentUser();\n if (currentUser != null) {\n Log.d(TAG, \"Success\");\n Intent intent = new Intent(SignInActivity.this, HomePageActivity.class);\n startActivity(intent);\n\n } else {\n Log.d(\"HIRHEFOIH\", \"signed out\");\n }\n };\n }", "private void setupFirebaseAuth(){\n Log.d(TAG, \"setupFirebaseAuth: setting up firebase auth.\");\n\n mAuth = FirebaseAuth.getInstance();\n mFirebaseDatabase = FirebaseDatabase.getInstance();\n myRef = mFirebaseDatabase.getReference();\n\n mAuthListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n if (user != null) {\n // User is signed in\n Log.d(TAG, \"onAuthStateChanged:signed_in:\" + user.getUid());\n } else {\n // User is signed out\n Log.d(TAG, \"onAuthStateChanged:signed_out\");\n }\n // ...\n }\n };\n\n\n }", "private void setFirebase() {\n auth = FirebaseAuth.getInstance();\n\n //get current user\n final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n\n authListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user == null) {\n // user auth state is changed - user is null\n // launch login activity\n startActivity(new Intent(MainActivity.this, LoginActivity.class));\n finish();\n }\n }\n };\n }", "private void initAuthListener() {\n\n mAuthStateListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n\n mExecutors.networkIO().execute(() -> {\n mFirebaseUser = firebaseAuth.getCurrentUser();\n mFirebaseUserLiveData.postValue(mFirebaseUser);\n if (mFirebaseUser != null) {\n initUserReference(mFirebaseUser);\n }\n });\n\n }\n };\n mFirebaseAuth.addAuthStateListener(mAuthStateListener);\n }", "public static void setupFirebase(Context context) {\n // initialised Firebase\n com.firebase.client.Firebase.setAndroidContext(context);\n }", "private void initGoogleClient() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n\n // [START initialize_auth]\n // Initialize Firebase Auth\n // [END initialize_auth]\n }", "private void initFirebase() {\n //инициализируем наше приложение для Firebase согласно параметрам в google-services.json\n // (google-services.json - файл, с настройками для firebase, кот. мы получили во время регистрации)\n FirebaseApp.initializeApp(this);\n //получаем точку входа для базы данных\n database = FirebaseDatabase.getInstance();\n myRef = database.getReference();\n\n }", "private void setupFirebaseAuth() {\n Log.d(TAG, \"setupFirebaseAuth: setting up firebase auth.\");\n\n mAuth = FirebaseAuth.getInstance();\n mFirebaseDatabse = FirebaseDatabase.getInstance();\n mRef = mFirebaseDatabse.getReference();\n\n mAuthStateListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n final FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user != null) {\n Log.d(TAG, \"onAuthStateChanged: signed in:\" + user.getUid());\n\n mRef.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n\n checkIfUsernameExists(username);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n //moving back to login screen after successful sign up.\n finish();\n\n } else\n Log.d(TAG, \"onAuthStateChanged: signed out\");\n }\n };\n\n\n }", "@Override\n protected void onStart() {\n super.onStart();\n if(ref.getAuth() == null){\n setEnabledAuthProvider(AuthProviderType.FACEBOOK);\n setEnabledAuthProvider(AuthProviderType.GOOGLE);\n showFirebaseLoginPrompt();\n\n }\n\n }", "@PostConstruct\r\n\tprivate void firebaseLogIn() {\n\t\ttry {\r\n\r\n\t\t\tInputStream serviceAccount = getClass()\r\n\t\t\t\t\t.getResourceAsStream(\"/avisosnick-firebase-adminsdk-ln9j6-55140aa5db.json\");\r\n\r\n//\t\t\t\t\tnew FileInputStream(\r\n//\t\t\t\t\t\"src/main/resources/avisosnick-firebase-adminsdk-ln9j6-55140aa5db.json\");\r\n\r\n\t\t\tFirebaseOptions options = FirebaseOptions.builder()\r\n\t\t\t\t\t.setCredentials(GoogleCredentials.fromStream(serviceAccount))\r\n\t\t\t\t\t.setDatabaseUrl(\"https://avisosnick.firebaseio.com\").build();\r\n\r\n\t\t\tFirebaseApp.initializeApp(options);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void initConnection() {\n try {\n FileInputStream serviceAccount = new FileInputStream(\"serviceAccountKey.json\");\n\n FirebaseOptions options = new FirebaseOptions.Builder()\n .setCredentials(GoogleCredentials.fromStream(serviceAccount))\n .setDatabaseUrl(\"https://yieldcomparisontool.firebaseio.com\")\n .build();\n try {\n if (FirebaseApp.getInstance(FirebaseApp.DEFAULT_APP_NAME) == null) {\n FirebaseApp.initializeApp(options);\n }\n } catch (IllegalStateException e) {\n FirebaseApp.initializeApp(options);\n }\n } catch (IOException e) {\n System.out.println(\"ERROR Invalid Firebase Service account credentials.\");\n System.out.println(e);\n System.exit(1);\n }\n }", "public DatabaseConnector() {\n\n try {\n firebaseAuth = FirebaseAuth.getInstance();\n //Firebase Instance..\n authStateListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if(user !=null) {\n Log.d(TAG, \"onAuthStateChanged: ***********\" + user.getUid());\n } else Log.d(TAG, \"onAuthStateChanged: ______________\");\n }\n };\n firebaseAuth.addAuthStateListener(authStateListener);\n } catch (Exception e) {\n Log.d(\"DatabaseConnector\", \"DatabaseConnector: Constructor | Error: \" + e.getMessage());\n }\n\n }", "private void initFirebase() {\n FirebaseApp.initializeApp(this);\n firebaseDatabase = FirebaseDatabase.getInstance();\n databaseReference = firebaseDatabase.getReference();\n storageReference = FirebaseStorage.getInstance().getReference();\n }", "private void initFirebase() {\n database = FirebaseDatabase.getInstance();\n user = FirebaseAuth.getInstance().getCurrentUser();\n dRef = database.getReference(\"Trails\");\n }", "private void setupFirebaseAuth(){\r\n Log.d(TAG, \"setupFirebaseAuth: setting up setupFirebaseAuth\");\r\n\r\n mAuth = FirebaseAuth.getInstance();\r\n mFirebaseDatabase = FirebaseDatabase.getInstance();\r\n myRef = mFirebaseDatabase.getReference();\r\n\r\n mAuthListener = new FirebaseAuth.AuthStateListener() {\r\n @Override\r\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\r\n FirebaseUser user = firebaseAuth.getCurrentUser();\r\n\r\n if (user != null) {\r\n // User is signed in\r\n Log.d(TAG, \"onAuthStateChanged:signed_in:\" + user.getUid());\r\n } else {\r\n // User is signed out\r\n Log.d(TAG, \"onAuthStateChanged:signed_out\");\r\n }\r\n // ...\r\n }\r\n };\r\n\r\n myRef.addValueEventListener(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n\r\n // retrieve user info from database\r\n// setProfileWidgets(mFirebaseMethods.getUserSettings(dataSnapshot));\r\n\r\n // retrieve job Post info from database\r\n// setJobPost(mFirebaseMethods.getUserSettings(dataSnapshot));\r\n// mFirebaseMethods.addNewJobPost(job_date,job_description, job_title,user_name );\r\n\r\n //retrieve bids from database\r\n\r\n\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n\r\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.i(\"lt\",\"auth failed\");\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n }", "private FirebaseUtil(){}", "@Override\n protected void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n //Firebase.setAndroidContext(this);\n MainActivity.firebaseRef = FirebaseDatabase.getInstance().getReferenceFromUrl(MainActivity.FIREBASEREF);\n //setContentView(R.layout.activity_login);\n callLoginDialog();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_login);\n\n if (getSupportActionBar() != null) {\n getSupportActionBar().hide();\n }\n\n mDepartmentField = (EditText) findViewById(R.id.login_input_department);\n mEmailField = (EditText) findViewById(R.id.login_input_email);\n mPasswordField = (EditText) findViewById(R.id.login_input_password);\n\n findViewById(R.id.button_login).setOnClickListener(this);\n findViewById(R.id.button_signup).setOnClickListener(this);\n\n mAuth = FirebaseAuth.getInstance();\n\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.d(TAG, \"Login attempt failed\");\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.d(TAG, \"Login attempt failed\");\n }", "private void configureGoogleClient() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n // for the requestIdToken, this is in the values.xml file that\n // is generated from your google-services.json\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n // Build a GoogleSignInClient with the options specified by gso.\n googleSignInClient = GoogleSignIn.getClient(this, gso);\n // Initialize Firebase Auth\n firebaseAuth = FirebaseAuth.getInstance();\n }", "private void setupFirebase(){\n FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();\n if (user!=null){\n databaseReference = firebaseDatabase.getReference(\"Users\").child(user.getUid()).child(\"teacher\");\n }\n }", "@Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_register);\r\n Email = findViewById(R.id.Email);\r\n Password = findViewById(R.id.Password);\r\n\r\n mAuth = FirebaseAuth.getInstance();\r\n\r\n findViewById(R.id.Signup).setOnClickListener(this);\r\n\r\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.d(\"LOGIN\", \"Error logging in after creating user\");\n }", "@Override\n public void onStart() {\n super.onStart();\n // Check if user is signed in (non-null) and update UI accordingly.\n currentUser = firebaseAuth.getCurrentUser();\n firebaseAuth.addAuthStateListener(authStateListener);\n\n\n }", "@Override\n public void onStart() {\n super.onStart();\n auth.addAuthStateListener(authListener);\n }", "private AppAuth() {\n }", "private void initVariables() {\n emailET = (EditText) findViewById(R.id.EmailET_Signup);\n passwordET = (EditText) findViewById(R.id.PasswordET_Signup);\n signupBTN = (Button) findViewById(R.id.SignupBTN_Signup);\n firebaseAuth = FirebaseAuth.getInstance();\n databaseRef = FirebaseDatabase.getInstance().getReference(\"users\");\n signupBTN.setOnClickListener(btnListener);\n }", "@Override\n protected void onStart(){\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n super.onStart();\n }", "private void firebaseAuthLogin() {\n startActivityForResult(AuthUI.getInstance()\n .createSignInIntentBuilder()\n .setAvailableProviders(getProvider())\n .setLogo(R.drawable.logo_login)\n .setTheme(R.style.LoginTheme)\n .setIsSmartLockEnabled(false)\n .setTosAndPrivacyPolicyUrls(\n \"https://www.freeprivacypolicy.com/privacy/view/3ccea0b97b785480095259db0c31569d\",\n \"https://www.freeprivacypolicy.com/privacy/view/3ccea0b97b785480095259db0c31569d\")\n .build(), REQUEST_CODE_LOGIN);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_sign_in);\n\n email_text = findViewById(R.id.email);\n password_text = findViewById(R.id.password);\n logIn = findViewById(R.id.log_in);\n mAuth = FirebaseAuth.getInstance();\n\n logIn.setOnClickListener(new View.OnClickListener(){\n public void onClick(View v){\n Intent intent = new Intent(getApplicationContext(), SignUp.class);\n startActivity(intent);\n }\n });\n }", "@Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n if(firebaseAuth.getCurrentUser() != null){\n // go to home screen via intent\n startActivity(\n new Intent(LoginActivity.this, NavigationActivity.class));\n }\n }", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_register);\n\n mFirebaseAuth=FirebaseAuth.getInstance(); //initializing authentication\n mUserLab=new UserLab(RegistrationActivity.this);\n getLayoutReference();\n\n addViewListeners();\n\n\n }", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_login);\n getSupportActionBar().hide();\n mAuth = FirebaseAuth.getInstance();\n emailET = findViewById(R.id.email_ET_login);\n passwordET = findViewById(R.id.password_ET_login);\n\n }", "@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(authListener);\n }", "private void initViews() {\n etEmail = (EditText) findViewById(R.id.etEmail);\n etPassword = (EditText) findViewById(R.id.etPassword);\n btnLogin = (Button) findViewById(R.id.btnLogin);\n mAuth = FirebaseAuth.getInstance();\n db = FirebaseFirestore.getInstance();\n user = mAuth.getCurrentUser();\n\n }", "private void setupFirebaseAuth(){\n Log.d(TAG, \"setupFirebaseAuth\");\n mAuth = FirebaseAuth.getInstance();\n fbaseDB = FirebaseDatabase.getInstance();\n dbRef = fbaseDB.getReference();\n\n mAuthListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n if(user != null){\n //somebody signed in\n Log.d(TAG, \"onAuthStateChanged:signed_in\" + user.getUid());\n dbRef.addListenerForSingleValueEvent(\n new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if(checkUsernamExists(username.getText().toString(), dataSnapshot)){\n Toast.makeText(SignUp.this,\"Signup SUCCESSFUL\",Toast.LENGTH_SHORT).show();\n } else{\n\n mAuth.signOut();\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n }\n );\n } else{\n //nobodys here\n Log.d(TAG, \"onAuthStateChanged:signed_out\");\n }\n }\n };\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_login);\n\n // ensure that the sign-in form is displayed first\n ConstraintLayout lytEmailVerification = findViewById(R.id.lytEmailVerification);\n lytEmailVerification.setVisibility(View.GONE);\n changeForm(R.id.btnSignInForm);\n\n // grab an instance of the firebase authentication\n mAuth = FirebaseAuth.getInstance();\n db = FirebaseFirestore.getInstance();\n user = mAuth.getCurrentUser();\n\n //find all the buttons\n Button btnSignIn = findViewById(R.id.btnSignIn);\n Button btnSignUp = findViewById(R.id.btnSignUp);\n Button btnSignUpForm = findViewById(R.id.btnSignUpForm);\n Button btnSignInForm = findViewById(R.id.btnSignInForm);\n Button btnResendEmail = findViewById(R.id.btnResend);\n Button btnVerifyDone = findViewById(R.id.btnVerifyDone);\n ImageButton btnResetPasswordForm = findViewById(R.id.btnResetPasswordForm);\n Button btnResetPassword = findViewById(R.id.btnResetPassword);\n\n //set the click listeners\n btnSignUpForm.setOnClickListener(this);\n btnSignInForm.setOnClickListener(this);\n btnSignUp.setOnClickListener(this);\n btnSignIn.setOnClickListener(this);\n btnResendEmail.setOnClickListener(this);\n btnVerifyDone.setOnClickListener(this);\n btnResetPasswordForm.setOnClickListener(this);\n btnResetPassword.setOnClickListener(this);\n }", "@Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser currentUser = firebaseAuth.getCurrentUser();\n if (currentUser != null) {\n Log.w(TAG, \"Usuario Logeado\" + currentUser.getEmail());\n } else {\n Log.w(TAG, \"Usuario NO Logeado\");\n }\n }", "@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }", "@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }", "public void onClick(View v) {\n EditText email = (EditText) findViewById(R.id.email);\n final String emailString = email.getText().toString();\n\n EditText pass = (EditText) findViewById(R.id.pass);\n final String passString = pass.getText().toString();\n Firebase ref = new Firebase(\"https://gymguy.firebaseio.com\");\n\n // Create a handler to handle the result of the authentication\n Firebase.AuthResultHandler authResultHandler = new Firebase.AuthResultHandler() {\n @Override\n public void onAuthenticated(AuthData authData) {\n // Authenticated successfully with payload authData\n\n Context context = getApplicationContext();\n CharSequence text = \"Logged in\";\n int duration = Toast.LENGTH_SHORT;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n //save uid\n //remove uid\n SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(\n getString(R.string.preference_file_key), Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"uid\", authData.getUid().toString());\n editor.commit();\n\n Intent goToNextActivity = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(goToNextActivity);\n }\n\n @Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n // Authenticated failed with error firebaseError\n Context context = getApplicationContext();\n// CharSequence text = firebaseError.getMessage() + \" : for \" + emailString + passString + firebaseError.getDetails();\n CharSequence text = firebaseError.getMessage() + \" : \" + firebaseError.getDetails();\n int duration = Toast.LENGTH_LONG;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n }\n };\n\n // Authenticate users with a custom Firebase token\n// ref.authWithCustomToken(\"<token>\", authResultHandler);\n // Or with an email/password combination\n ref.authWithPassword(emailString, passString, authResultHandler);\n }", "private void firebaseAuthWithGoogle(String idToken) {\n AuthCredential credential = GoogleAuthProvider.getCredential(idToken, null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n FirebaseUser user = mAuth.getCurrentUser();\n assert user != null;\n Toast.makeText(SignUpActivity.this, \"Signed in as: \" + user.getDisplayName(), Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n UpdateUI();\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n e.printStackTrace();\n Toast.makeText(SignUpActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }", "@Override\n protected void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }", "private void configureSignup() {\n\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(this.getResources().getString(R.string.web_client_id))\n .requestEmail().build();\n\n // Build a GoogleApiClient with access to GoogleSignIn.API and the options above.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n\n mGoogleApiClient.connect();\n }", "private void initFBGoogleSignIn() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(WEB_CLIENT_ID)\n .requestEmail()\n .build();\n\n Context context = getContext();\n mGoogleApiClient = new GoogleApiClient.Builder(context)\n .enableAutoManage(getActivity(), new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n mGoogleSignInTextView.setText(connectionResult.getErrorMessage());\n }\n }).addApi(Auth.GOOGLE_SIGN_IN_API, gso).build();\n }", "public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView((int) R.layout.activity_login);\n Log.d(TAG, \"onCreate: started\");\n this.register = (TextView) findViewById(R.id.link_signUp);\n this.context = this;\n this.progressBar = (ProgressBar) findViewById(R.id.loginProgressBar);\n this.wait = (TextView) findViewById(R.id.wait);\n this.email = (EditText) findViewById(R.id.input_email);\n this.password = (EditText) findViewById(R.id.input_password);\n this.loginButton = (Button) findViewById(R.id.login_button);\n this.progressBar.setVisibility(View.GONE);\n this.wait.setVisibility(View.GONE);\n setUpFirebaseAuth();\n init();\n }", "public void onStart() {\n super.onStart();\n // Check if user is signed in (non-null) and update UI accordingly.\n FirebaseUser currentUser = mAuth.getCurrentUser();\n if (currentUser!=null)\n this.logIn(currentUser);\n }", "@Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n user = firebaseAuth.getCurrentUser();\n if (user != null) {\n // User is signed in\n Log.d(\"LoginActivity\", \"onAuthStateChanged:signed_in:\" + user.getUid());\n jump_main();\n } else {\n // User is signed out\n Log.d(\"LoginActivity\", \"onAuthStateChanged:signed_out\");\n //signOut();\n tv_name.setText(\"\");\n tv_email.setText(\"\");\n boolean_google = false;\n }\n // [START_EXCLUDE]\n updateUI(user);\n // [END_EXCLUDE]\n }", "private void setupGoogleSignin() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n // Build a GoogleApiClient with access to the Google Sign-In API and the\n // options specified by gso.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n }", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_login);\n initViews();\n buttonRegister.setOnClickListener(this);\n buttonlog1.setOnClickListener(this);\n\n firebaseAuth = FirebaseAuth.getInstance();\n\n progressDialog = new ProgressDialog(this);\n\n users = FirebaseDatabase.getInstance().getReference(\"users\");\n\n //usuario = firebaseAuth.getCurrentUser().getEmail();\n\n String email = editTextEmail.getText().toString();\n String password= editTextPassword.getText().toString();\n }", "public FirebaseAuth getAuth() {\n return auth;\n }", "@Inject\n public UserRepositoryImpl() {\n database = FirebaseDatabase.getInstance();\n auth = FirebaseAuth.getInstance();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n email = (EditText) findViewById(R.id.etmail);\n password = (EditText) findViewById(R.id.etPassword);\n registr = (Button) findViewById(R.id.regsbtn);\n comment = (TextView) findViewById(R.id.textView);\n logbtn = (Button) findViewById(R.id.logbtn);\n\n Authinticate = FirebaseAuth.getInstance();\n registr.setOnClickListener(this);\n logbtn.setOnClickListener(this);\n // database = FirebaseDatabase.getInstance();\n //databaseReference = database.getReference();\n\n\n }", "public interface FirebaseService {\n public void init();\n}", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.d(TAG, \"Firebase authentication error with Google: \" + firebaseError);\n mFirebaseAuthCallback.onReceivedFirebaseAuth(null, firebaseError);\n }", "private void configureGoogleSignIn() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n googleApiClient = new GoogleApiClient.Builder(getApplicationContext()).enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n Toast.makeText(LoginActivity.this, \"Error\", Toast.LENGTH_LONG).show();\n }\n }).addApi(Auth.GOOGLE_SIGN_IN_API, gso).build();\n }", "private void initSome() {\n from_status=getIntent().getStringExtra(\"from\");\n Log.e(TAG, \"initSome: \"+from_status );\n\n progressBar.setVisibility(View.GONE);\n viewModel = ViewModelProviders.of(this).get(AuthViewModel.class);\n //initialize fb callbackmanger\n callbackManager = CallbackManager.Factory.create();\n //initialize firebase auth\n auth = FirebaseAuth.getInstance();\n\n prefs = Prefs.with(this);\n\n\n }", "@Override\n public void onAuthenticated(AuthData authData) {\n Log.d(TAG, \"Google user authenticated: \" + authData.getUid());\n mFirebaseAuthCallback.onReceivedFirebaseAuth(authData, null);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_registration);\n\n mAuth = FirebaseAuth.getInstance();\n\n //Initialise the variables\n registerUser = (Button) findViewById(R.id.btRegisterUser);\n registerUser.setOnClickListener(this);\n\n fullName = (EditText) findViewById(R.id.etFullName);\n age = (EditText) findViewById(R.id.etAge);\n email = (EditText) findViewById(R.id.etEmail);\n password = (EditText) findViewById(R.id.etPassword);\n\n progressBar = (ProgressBar) findViewById(R.id.progressBar);\n\n }", "private void initFBGithubLogIn() {\n AuthCredential credential = GithubAuthProvider.getCredential(GITHUB_TOKEN);\n mFirebaseAuth.signInWithCredential(credential)\n .addOnCompleteListener(AuthenticationFragment.this.getActivity(), new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n String message;\n if (task.isSuccessful()) {\n message = \"success firebaseAuthWithGithub\";\n } else {\n message = \"fail firebaseAuthWithGithub\";\n }\n mGithubLogInTextView.setText(message);\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n mGithubLogInTextView.setText(e.getMessage());\n e.printStackTrace();\n }\n });\n }", "private void setGoogleLoginSetting() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n mAuth = FirebaseAuth.getInstance();\n googleSignInClient = GoogleSignIn.getClient(this, gso);\n\n googleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n Log.d(Constant.TAG, \"Login fail\");\n }\n })\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n // auto login\n GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);\n if(account!=null)\n firebaseAuthWithGoogle(account);\n }", "synchronized public FirebaseAuth getDefaultFirebaseAuth() {\n if (mFirebaseAuth == null) {\n mFirebaseAuth = FirebaseAuth.getInstance();\n }\n\n return mFirebaseAuth;\n }", "private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n if(Constants.mAuth==null){\n Constants.mAuth= FirebaseAuth.getInstance();\n Log.d(Constants.TAG,\"mAuth new Instance\");\n }\n Constants.mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(Constants.TAG, \"signInResult:google success\");\n Constants.user=Constants.mAuth.getCurrentUser();\n SharedPreferences sharedPreferences=getSharedPreferences(Constants.LoginSharedPref.SHARED_PREF_NAME,MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n editor.putBoolean(Constants.LoginSharedPref.PREVIOUSLY_STARTED,true);\n editor.putBoolean(Constants.LoginSharedPref.LOGGED_IN,true);\n String email=Constants.user.getEmail();\n String name=Constants.user.getDisplayName();\n Uri photoUrl=Constants.user.getPhotoUrl();\n editor.putString(Constants.LoginSharedPref.LOGIN_EMAIL,email);\n editor.putString(Constants.LoginSharedPref.LOGIN_URENAME,name);\n if(photoUrl!=null) {\n Log.d(Constants.TAG,\" Photo Url Extract: \"+photoUrl.toString());\n editor.putString(Constants.LoginSharedPref.PROFILE_URL, photoUrl.toString());\n }\n editor.putBoolean(Constants.LoginSharedPref.IS_EMAIL_VERIFIED,true);\n editor.commit();\n progressBar.setVisibility(View.GONE);\n contentHome.setVisibility(View.VISIBLE);\n Intent intent=new Intent(HomeActivity.this,MainActivity.class);\n startActivity(intent);\n finish();\n } else {\n // If sign in fails, display a message to the user.\n progressBar.setVisibility(View.GONE);\n contentHome.setVisibility(View.VISIBLE);\n Log.d(Constants.TAG, \"signInResult:google with firebase failure\", task.getException());\n Toast.makeText(HomeActivity.this, \"An error occured while signing in. Check your network connection \",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }", "private void callRegisterByEmailToGoogleFirebase(){\n mFirebaseAuth = FirebaseAuth.getInstance();\n\n String userEmail = mEmailAddress.getText().toString();\n String userPassword = mPassword.getText().toString();\n\n // create the user with email and password\n mFirebaseAuth.createUserWithEmailAndPassword(userEmail,userPassword).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n showBottomSnackBar(\"Corresponding Firebase User Created\");\n }else{\n showBottomSnackBar(\"Firebase User Creation Fails\");\n }\n\n replaceActivity(MainActivity.class, null);\n }\n });\n\n }", "private void authUser(String email, String password){\n firebaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n Log.d(TAG, \"onComplete: user logged in successfully\");\n Snackbar.make(view, \"User has logged in\", Snackbar.LENGTH_LONG).show();\n goToMainActivity();\n }\n if(!task.isSuccessful()){\n Log.d(TAG, \"onComplete: user's credentials're incorrect\");\n Snackbar.make(view, \"Login or password is incorrect\", Snackbar.LENGTH_LONG).show();\n }\n }\n });\n }", "@Override\n public void onAuthenticated(AuthData authData) {\n Map<String, String> map = new HashMap<>();\n map.put(\"provider\", authData.getProvider());\n if(authData.getProviderData().containsKey(\"email\")) {\n map.put(\"email\", authData.getProviderData().get(\"email\").toString());\n }\n mRef.child(\"users\").child(authData.getUid()).setValue(map);\n final Intent startIntent = new Intent(getActivity(), HomeActivity.class);\n startIntent.putExtra(\"START_POS\", 0);\n startActivity(startIntent);\n }", "private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n //inicio de sesion exitoso\n //Recuperacion de los datos del usuario logueado\n FirebaseUser user = mAuth.getCurrentUser();\n //llamado a la vista inicial de usuario autenticado\n startActivity(new Intent(Login.this,Principal.class));\n finish();\n\n } else {\n // Fallo el inicio de sesion con firebase.\n Toast.makeText(Login.this, R.string.errorInicioSesion,\n Toast.LENGTH_SHORT).show();\n\n }\n\n }\n });\n }", "private void registerUserToFirebaseAuth() {\n Utils.showProgressDialog(this);\n Task<AuthResult> task = mAuth.createUserWithEmailAndPassword(etEmail.getText().toString().trim(), etPassword.getText().toString().trim());\n task.addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Utils.dismissProgressDialog();\n if (task.isSuccessful()) {\n String firebaseId = task.getResult().getUser().getUid();\n\n // Storage Image to Firebase Storage.\n addProfileImageToFirebaseStorage(firebaseId);\n\n } else {\n Utils.toast(context, \"Some Error Occurs\");\n }\n }\n });\n }", "private void init() {\n\t\tutils = new MmustUtils(Authenticate.this);\n\t\treceiver = new AuthReceiver();\n\t\t\n\t\tetRegno = (EditText)findViewById(R.id.authenticate_editText_reg_no);\n\t\tetPassword = (EditText)findViewById(R.id.authenticate_editText_password);\n\t\tetPassword.addTextChangedListener(this);\n\t\t\n\t\tbtAuth = (Button)findViewById(R.id.authenticate_button_auth);\n\t\tbtAuth.setOnClickListener(this);\n\t\t\n\t\tivPeek = (ImageView)findViewById(R.id.authenticate_imageView_view_password);\n\t\tivPeek.setVisibility(ImageView.GONE);\n\t\tivPeek.setOnClickListener(this);\n\t\t\n\t\t\n\t\tpbAuthenticating = (ProgressBar)findViewById(R.id.authenticate_progressBar_authenticating);\n\t\tpbAuthenticating.setVisibility(ProgressBar.GONE);\n\t\t\n\t\ttvLoginFail = (TextView)findViewById(R.id.authenticate_textView_login_fail);\n\t\ttvLoginFail.setVisibility(TextView.GONE);\n\t\t\n\t\tgetRegisteredEmails();\n\t\t\n\t}", "private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n fbAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n //Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = fbAuth.getCurrentUser();\n UserModel userModel=new UserModel();\n userModel.setEmail(user.getEmail());\n userModel.setDisplayName(user.getDisplayName());\n userModel.setPhotoUrl(user.getPhotoUrl().toString());\n userModel.setUid(user.getUid());\n UserFBDB userFBDB = new UserFBDB();\n userFBDB.save(userModel);\n updateUI(user);\n } else {\n // If sign in fails, display a message to the user.\n //Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Exception ex=task.getException();\n signupWithGoogleBtn.setVisibility(View.VISIBLE);\n mProgress.setVisibility(View.INVISIBLE);\n Toast.makeText(SignupActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n //updateUI(null);\n }\n\n // ...\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"singn\", e.getMessage());\n }\n });\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_video_call);\n mAuth = FirebaseAuth.getInstance();\n mUser = mAuth.getCurrentUser();\n mDatabase = FirebaseDatabase.getInstance().getReference();\n initUI();\n }", "@Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user != null) {\n // User is signed in\n // Log.d(TAG, \"onAuthStateChanged:signed_in:\" + user.getUid());\n // toastMessage(\"Successfully signed in with: \" + user.getEmail());\n } else {\n // User is signed out\n // Log.d(TAG, \"onAuthStateChanged:signed_out\");\n // toastMessage(\"Successfully signed out.\");\n }\n // ...\n }", "private void initializeCurrentUser() {\n if (enableLoginActivity && mAuth.getCurrentUser() != null) {\n try {\n initializeUser();\n refreshGoogleCalendarToken();\n } catch (PetRepeatException e) {\n Toast toast = Toast.makeText(this, getString(R.string.error_pet_already_existing),\n Toast.LENGTH_LONG);\n toast.show();\n }\n\n if (mAuth.getCurrentUser() != null) {\n mAuth.getCurrentUser().getIdToken(false).addOnCompleteListener(task -> {\n user.setToken(Objects.requireNonNull(task.getResult()).getToken());\n });\n }\n }\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_log_in);\n\n Toast.makeText(this, \"Login to your account\", Toast.LENGTH_SHORT).show();\n\n // Input for login information\n loginEmailField = findViewById(R.id.email_login_field);\n passwordField = findViewById(R.id.password_login_field);\n progressBar = findViewById(R.id.progress_bar2);\n // Click on the button to log in\n loginButton = findViewById(R.id.login_button);\n\n // Click on the text to reset password\n passwordReset = findViewById(R.id.password_reset);\n\n // Initiate Fire base\n firebaseAuth = FirebaseAuth.getInstance();\n\n loginButton.setOnClickListener(new View.OnClickListener() {\n /**\n * This checks for valid login in formation and allows the user to enter if validation is successful\n */\n @Override\n public void onClick(View view) {\n String email = loginEmailField.getText().toString();\n String password = passwordField.getText().toString();\n\n if (TextUtils.isEmpty(email)) {\n Toast.makeText(LogInActivity.this, \"Email is required\", Toast.LENGTH_SHORT).show();\n return;\n }\n if (TextUtils.isEmpty(password)) {\n Toast.makeText(LogInActivity.this, \"Password is required\", Toast.LENGTH_SHORT).show();\n return;\n }\n if (password.length()<8) {\n Toast.makeText(LogInActivity.this,\"Password is too short\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n progressBar.setVisibility(View.VISIBLE);\n loginButton.setEnabled(false);\n\n firebaseAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n /**\n * The onComplete method decides what to do once user clicks log in button\n * Depending on whether validation is successful or not, user is either redirected to selection page or is denied access\n */\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(LogInActivity.this, \"Login success\", Toast.LENGTH_SHORT).show();\n startActivity(new Intent(getApplicationContext(), SelectionActivity.class));\n finish();\n loginButton.setEnabled(true);\n progressBar.setVisibility(View.GONE);\n } else {\n Toast.makeText(LogInActivity.this, \"Your email or password is incorrect \"+task.getException(), Toast.LENGTH_SHORT).show();\n loginButton.setEnabled(true);\n progressBar.setVisibility(View.GONE);\n }\n }\n });\n }\n });\n\n passwordReset.setOnClickListener(new View.OnClickListener() {\n /**\n * Method is invoked when password reset is clicked on\n * @param view view clicked on\n */\n @Override\n public void onClick(View view) {\n final EditText emailField = new EditText(view.getContext());\n AlertDialog.Builder passwordResetDialog = new AlertDialog.Builder(view.getContext());\n passwordResetDialog.setIcon(android.R.drawable.ic_dialog_email)\n .setTitle(\"Reset password\")\n .setMessage(\"Enter your email to receive the reset link\")\n .setView(emailField)\n .setNegativeButton(\"NO\",null)\n .setPositiveButton(\"YES\", new DialogInterface.OnClickListener() {\n /**\n * Confirms password reset request\n * Sends an email to user to reset password\n * @param dialogInterface interface\n * @param i index\n */\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n // Extract email address\n String mail = emailField.getText().toString();\n if (mail.length()==0){\n Toast.makeText(LogInActivity.this, \"Enter a valid email\", Toast.LENGTH_SHORT).show();\n return;\n }\n firebaseAuth.sendPasswordResetEmail(mail).addOnSuccessListener(new OnSuccessListener<Void>() {\n /**\n * Displays toast when password reset email is successfully sent\n * @param aVoid VarArgs\n */\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(LogInActivity.this, \"Email is send\", Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n /**\n * Displays email when password reset email fails to send\n * @param e exception\n */\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(LogInActivity.this, \"Unable to send the email\"+e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }\n });\n passwordResetDialog.create().show();\n }\n });\n }", "public static FirebaseAuth getFirebaseAutenticacao() {\n if (referenciaAutenticacao == null) {\n referenciaAutenticacao = FirebaseAuth.getInstance();\n }\n\n return referenciaAutenticacao;\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_login);\n\n mEmailView = (EditText) findViewById(R.id.email);\n\n mPasswordView = (EditText) findViewById(R.id.password);\n\n mImageView = (ImageView) findViewById(R.id.image_view_login);\n\n mAuth = FirebaseAuth.getInstance();\n mDatabase = FirebaseDatabase.getInstance().getReference();\n\n registerButton = (Button) findViewById(R.id.email_register_button);\n loginButton = (Button) findViewById(R.id.email_sign_in_button);\n\n //Register button_sign_in listener will direct the user to the register page if they have not created an account\n registerButton.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View view) {\n String email = mEmailView.getText().toString();\n String password = mPasswordView.getText().toString();\n Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);\n intent.putExtra(\"email\", email);\n intent.putExtra(\"password\", password);\n\n startActivity(intent);\n }\n });\n\n //Will submit information entered by user to check if it matches server data\n loginButton.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View view) {\n signIn(mEmailView.getText().toString(), mPasswordView.getText().toString());\n }\n });\n }", "private FirebaseDAO() {}", "public void authenticateemail(final String email, final String pass){\n\n mAuth2.createUserWithEmailAndPassword(email, pass)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(\"MAIN\", \"createUserWithEmail:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n linking(email,pass);\n //Log.d(\"MAIN\", \"yupyup\"+user.getUid());\n\n } else {\n // If sign in fails, display a message to the user.\n Log.w(\"MAIN\", \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(otherinfoActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_login);\n\n dblogin = FirebaseDatabase.getInstance().getReference(\"users\");\n\n login = findViewById(R.id.buttonLogin);\n signUp = findViewById(R.id.buttonSignUp);\n email = findViewById(R.id.editTextEmail);\n password = findViewById(R.id.textPassword);\n\n //listener for login button press\n login.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n validDataCheck();\n }\n });\n //Listener for sign up button press\n signUp.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n checkUserExists();\n }\n });\n\n }", "public void createAccount (String email, String password) {\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (!task.isSuccessful()) {\n Toast.makeText(Login.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(Login.this, \"Registration Successful\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n //Sign in existing users\n mAuth.signInWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n //Log.d(TAG, \"signInWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n //Log.w(TAG, \"signInWithEmail\", task.getException());\n Toast.makeText(Login.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }", "@Override\n protected void onCreate(@NonNull Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(activity_signup);\n //Fetch resources\n etUsernameSignup = findViewById(R.id.etUsernameSignup);\n etPasswordSignup = findViewById(R.id.etPasswordSignup);\n etEmailSignup = findViewById(R.id.etEmailSignup);\n signupButton = findViewById(R.id.signupButton);\n authSpinner = findViewById(R.id.authSpinner);\n\n\n User newUser = new User();\n firebaseAuth = FirebaseAuth.getInstance();\n userWAPFirebase = new WAPFirebase<>(User.class,\"users\");\n ArrayAdapter<Authorization> arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Authorization.values());\n authSpinner.setAdapter(arrayAdapter);\n authSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n if(i==0){\n newUser.setAuth(Authorization.USER);\n }\n else{\n newUser.setAuth(Authorization.ADMIN);\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n newUser.setAuth(Authorization.USER);\n\n }\n });\n\n signupButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n\n boolean emailValid = AuthUtils.validateEmail(etEmailSignup.getText().toString());\n //TODO: check if there is any other validations required\n if (emailValid) {\n\n //Create a new User object\n newUser.setUsername(etUsernameSignup.getText().toString());\n newUser.setEmail(etEmailSignup.getText().toString());\n\n\n //Signing up the user to firebase auth and firebase firestore\n firebaseAuth.createUserWithEmailAndPassword(newUser.getEmail(), etPasswordSignup.getText().toString())\n\n //? If Firebase Auth creation succeeds\n .addOnSuccessListener(new OnSuccessListener<AuthResult>() {\n @Override\n public void onSuccess(AuthResult authResult) {\n //Create Firestore User object\n userWAPFirebase.create(newUser, firebaseAuth.getCurrentUser().getUid()).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(TAG, \"User \" + newUser.getUsername() + \" has been successfully created\");\n Toast.makeText(SignUpActivity.this, \"Sign up successful!\", Toast.LENGTH_SHORT).show();\n\n //Go back to Login Activity\n Intent loginIntent = new Intent(SignUpActivity.this, LoginActivity.class);\n loginIntent.putExtra(PASSWORD_KEY, etPasswordSignup.getText().toString());\n loginIntent.putExtra(EMAIL_KEY, newUser.getEmail());\n startActivity(loginIntent);\n }\n });\n }\n })\n //! If Firebase Auth User creation fails\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n if (e instanceof FirebaseAuthUserCollisionException) {\n if (((FirebaseAuthUserCollisionException) e).getErrorCode().equals(\"ERROR_EMAIL_ALREADY_IN_USE\")) {\n Log.w(TAG, \"Email is already in use.\");\n Toast.makeText(SignUpActivity.this, \"Email is already in use\", Toast.LENGTH_SHORT).show();\n }\n } else if (e instanceof FirebaseAuthWeakPasswordException) {\n Log.w(TAG, \"Weak password detected.\");\n Toast.makeText(SignUpActivity.this, \"Password must be at least 6 characters long\", Toast.LENGTH_SHORT).show();\n } else {\n Log.e(TAG, \"Error in creating Firebase Auth user: \" + e.toString(), e);\n Toast.makeText(SignUpActivity.this, \"Sign up failed\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n } else {\n Toast.makeText(SignUpActivity.this, \"Please enter a valid email\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "@Override\n public void onError(FirebaseError firebaseError) {\n Log.d(\"LOGIN\", \"Registration error\");\n }", "public void onStart() {\n super.onStart();\n this.mAuth.addAuthStateListener(this.mAuthStateListener);\n }", "public Authentification() {\n initComponents();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.auth_activity);\n connectVariablesToViews();\n listenToFields();\n WorkSpace.authorizationCompleted = false;\n }", "private void initializeInstanceVariables(){\n\n //Initialize Firebase variables\n firebaseAuth = FirebaseAuth.getInstance();\n currentUser = FirebaseAuth.getInstance().getCurrentUser();\n myDatabase = FirebaseDatabase.getInstance().getReference(firebaseAuth.getUid());\n\n //Initialize input variables\n newContactPhoneNumber = findViewById(R.id.addcontact_phonenumber);\n finishButton = findViewById(R.id.addcontact_finishbttn);\n backButton = findViewById(R.id.addContactScreenBackBttn);\n newContactFirstName = ((EditText) findViewById(R.id.addcontact_firstname));\n newContactLastName = ((EditText) findViewById(R.id.addcontact_lastname));\n newContactEmailAddress = ((EditText) findViewById(R.id.addcontact_email));\n }", "public void loginAsAdmin() {\n mAuth.signInWithEmailAndPassword(\"[email protected]\", \"password\")\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (! task.isSuccessful()) {\n alert(\"Firebase\", \"ERROR: Invalid username or password!\");\n return;\n }\n\n authenticationDone = true;\n if (splashTimeoutFinished) {\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(intent);\n }\n }\n });\n }", "@Override\n public void onStart(){\n super.onStart();\n //Check if user is signed in and update UI accordingly\n FirebaseUser currentUser = mAuth.getCurrentUser();\n\n if (currentUser != null){\n //User is signed in\n updateUI(\"User Signed In\");\n }\n else {\n // User is signed out\n updateUI(\"User Signed Out\");\n }\n\n // Check for existing Google Sign In account, if the user is already signed in\n // the GoogleSignInAccount will be non-null.\n GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);\n if(account != null) {\n accountEmail = account.getEmail();\n updateUI(account.toString());\n }\n }", "void initCognito() {\n Auth.Builder builder = new Auth.Builder().setAppClientId(getString(R.string.cognito_client_id))\n .setAppClientSecret(getString(R.string.cognito_client_secret))\n .setAppCognitoWebDomain(getString(R.string.cognito_web_domain))\n .setApplicationContext(getApplicationContext())\n .setAuthHandler(new callback())\n .setSignInRedirect(getString(R.string.app_redirect))\n .setSignOutRedirect(getString(R.string.app_redirect));\n this.auth = builder.build();\n appRedirect = Uri.parse(getString(R.string.app_redirect));\n }", "@Override\n public void onStart() {\n super.onStart();\n // Check if user is signed in (non-null) and update UI accordingly.\n FirebaseUser currentUser = mAuth.getCurrentUser();\n }", "private void firebaseAuthWithGoogle(AuthCredential credential) {\n\n\n try {\n// showProgressDialog();\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Utility.logData(\"signInWithCredential:onComplete:\" + task.isSuccessful());\n if (!task.isSuccessful()) {\n Utility.logData(\"signInWithCredential\" + task.getException().getMessage());\n task.getException().printStackTrace();\n Toast.makeText(LoginActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n } else {\n// createUserInFirebaseHelper(mUser);\n\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\n\n\n mDatabase.child(AppStringConstants.USER_ENTITY).\n child(Utility.encodeEmail(mUser.getEmail())).child(AppStringConstants.PROFILE_ENTITY).\n addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot snapshot) {\n try {\n if (snapshot.getValue() != null) {\n try {\n\n mUser = snapshot.getValue(UserModel.class);\n SessionManager.getInstance().createUser(mUser);\n SessionManager.getInstance().setCurrentuserRole(mUser.getRole());\n\n\n Utility.logData(\"logging user \\n\" + Objects.requireNonNull(mUser).toString());\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n UserModel model = new UserModel();\n model.setEmail(mUser.getEmail());\n model.setName(mUser.getName());\n model.setPhoto(mUser.getPhoto());\n model.setIdToken(mUser.getIdToken());\n model.setRole(UserRole.USER);\n model.setCity(mUser.getCity());\n model.setSpecialisation(mUser.getSpecialisation());\n mDatabase.child(AppStringConstants.USER_ENTITY).\n child(Utility.encodeEmail(model.getEmail())).child(AppStringConstants.PROFILE_ENTITY).\n setValue(model);\n SessionManager.getInstance().createUser(model);\n SessionManager.getInstance().setCurrentuserRole(model.getRole());\n\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n\n });\n\n\n startMainActivity();\n\n\n Utility.showLongToast(\"Login successful\");\n\n\n }\n// hideProgressDialog();\n }\n });\n }catch (Exception e){\n Utility.logExceptionData(e);\n Utility.hideLoader(this);\n }\n }", "private void checkFirebaseAuth(NavigationView view){\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n if (user != null) {\n // Name, email address, and profile photo Url\n String user_name = user.getDisplayName();\n String email = user.getEmail();\n photoUrl = user.getPhotoUrl();\n user_id = user.getUid();\n\n // Check if user's email is verified\n boolean emailVerified = user.isEmailVerified();\n\n // The user's ID, unique to the Firebase project. Do NOT use this value to\n // authenticate with your backend server, if you have one. Use\n // FirebaseUser.getToken() instead.\n View header = view.getHeaderView(0);\n TextView UserName = header.findViewById(R.id.user_name);\n TextView UserEmail = header.findViewById(R.id.user_email);\n ImageView ProfilePic = header.findViewById(R.id.profile_pic);\n UserName.setText(user_name);\n UserEmail.setText(email);\n if (photoUrl != null) {\n Picasso.with(this).load(photoUrl).into(ProfilePic);\n }\n }\n if (user == null){\n View header = view.getHeaderView(0);\n TextView UserName = header.findViewById(R.id.user_name);\n TextView UserEmail = header.findViewById(R.id.user_email);\n ImageView ProfilePic = header.findViewById(R.id.profile_pic);\n UserName.setText(getText(R.string.def_user));\n UserEmail.setText(getText(R.string.def_email));\n ProfilePic.setImageResource(R.drawable.def_icon);\n }\n\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n register = (TextView) findViewById(R.id.register);\n register.setOnClickListener(this);\n\n login = (Button) findViewById(R.id.login);\n login.setOnClickListener(this);\n\n editTextEmailAddress = (EditText) findViewById(R.id.emailAddress);\n editTextPassword = (EditText) findViewById(R.id.password);\n progressBar = (ProgressBar) findViewById(R.id.progressBar);\n mAuth = FirebaseAuth.getInstance();\n\n //Initialising the sensor text views to the layout file\n textView = findViewById(R.id.text_accelerometer);\n sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);\n sensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);\n sensorManager.registerListener(MainActivity.this, sensor, sensorManager.SENSOR_DELAY_NORMAL);\n\n\n\n\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n //Initialize Firebase Auth\n mAuth = FirebaseAuth.getInstance();\n\n textViewStatus = (TextView) findViewById(R.id.textViewStatus);\n editTextEmail = (EditText) findViewById(R.id.editTextEmail);\n editTextPassword = (EditText) findViewById(R.id.editTextPassword);\n buttonLogin = (Button) findViewById(R.id.buttonLogin);\n buttonGoogleLogin = (Button) findViewById(R.id.buttonGoogleLogin);\n buttonCreateLogin = (Button) findViewById(R.id.buttonCreateLogin);\n buttonSignOut = (Button) findViewById(R.id.buttonSignOut);\n buttonStartChat = findViewById(R.id.buttonStartChat);\n\n //Login Button\n buttonLogin.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n //Normal login\n if(fieldsFilled()){\n signIn(editTextEmail.getText().toString(), editTextPassword.getText().toString());\n }\n else {\n updateUI(\"You must enter an email and a password.\");\n }\n }\n });\n\n //Create Account Button\n buttonCreateLogin.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n //Create account\n if (fieldsFilled()) {\n createAccount(editTextEmail.getText().toString(), editTextPassword.getText().toString());\n }\n else {\n updateUI(\"You must enter an email and a password.\");\n }\n }\n });\n\n //Sign Into Google Button\n buttonGoogleLogin.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n //Google login\n googleSignIn();\n }\n });\n\n //Sign Out Button\n buttonSignOut.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n //Log out\n signOut();\n }\n });\n\n //Start Chat Button\n buttonStartChat.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n if(accountEmail != null && !accountEmail.isEmpty()) {\n //Starting chat\n Intent intent = new Intent(MainActivity.this, ChatActivity.class);\n intent.putExtra(\"email\", accountEmail);\n startActivity(intent);\n }\n else {\n updateUI((\"Please login\"));\n }\n }\n });\n\n // Configure sign-in to request the user's ID, email address, and basic\n // profile. ID and basic profile are included in DEFAULT_SIGN_IN.\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n\n }", "private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Toast.makeText(this, getResources().getString(R.string.autenticandoseGoogle) + \" \" + acct.getId(), Toast.LENGTH_SHORT).show();\n\n showProgressDialog();\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(getApplicationContext(), getResources().getString(R.string.autenticadoGoogle), Toast.LENGTH_SHORT).show();\n FirebaseUser user = mAuth.getCurrentUser();\n updateUI(user);\n finish();\n } else {\n Toast.makeText(getApplicationContext(), getResources().getString(R.string.autenticacionFallida), Toast.LENGTH_SHORT).show();\n updateUI(null);\n }\n hideProgressDialog();\n\n\n }\n });\n }", "@Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user != null) {\n Log.d(TAG, \"user.isEmailVerified():\" + user.isEmailVerified());\n Log.d(TAG, \"onAuthStateChanged:signed_in:\" + user.getUid());\n signInAlready(user);\n } else {\n // User is signed out//\n Log.d(TAG, \"onAuthStateChanged:signed_out\");\n signOut();\n }\n }" ]
[ "0.78499913", "0.7836418", "0.7767383", "0.7649103", "0.758813", "0.7556087", "0.7349044", "0.7242472", "0.71986413", "0.71980864", "0.7159526", "0.71383953", "0.6917937", "0.6882292", "0.68308437", "0.6789008", "0.6776534", "0.6748983", "0.66412127", "0.66227865", "0.66196245", "0.65909916", "0.65715003", "0.65715003", "0.65713173", "0.65671396", "0.65469563", "0.65401673", "0.6529151", "0.65216243", "0.6500803", "0.6457518", "0.6394738", "0.63926536", "0.638913", "0.63677526", "0.6353968", "0.6335961", "0.6334079", "0.63246226", "0.6300194", "0.6280428", "0.6280107", "0.6275357", "0.6275357", "0.6274833", "0.62670475", "0.62572145", "0.625634", "0.6249908", "0.62464494", "0.62432516", "0.61882645", "0.6178101", "0.6170303", "0.61626256", "0.6135969", "0.6131933", "0.6125434", "0.61247224", "0.61171716", "0.61108655", "0.6108681", "0.61065423", "0.6091477", "0.60870266", "0.6073807", "0.60704297", "0.6070397", "0.60699576", "0.6066048", "0.60659885", "0.6045322", "0.60425985", "0.60190105", "0.6008304", "0.60064375", "0.6003079", "0.59891534", "0.5977433", "0.59691405", "0.5967822", "0.59469444", "0.5943123", "0.5939754", "0.5934468", "0.59321654", "0.5925147", "0.5905545", "0.5903633", "0.5900317", "0.5886153", "0.5885224", "0.5865461", "0.5864392", "0.5856317", "0.5851423", "0.58486176", "0.58311564", "0.582641", "0.582029" ]
0.0
-1
TODO Autogenerated method stub
public T getValue() { return value; }
{ "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 check() throws ApiRuleException { }
{ "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 String getApiMethodName() { 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
Interface for the MatrixMultiplicator Component.
public interface IMatrixMultiplicator { /** * Multiplies two matrixes and returns the result in a new matrix * * @param matrixA first matrix * @param matrixB second matrix * @return result of the multiplication */ public long multiplyMatrix(final Matrix matrixA, final Matrix matrixB, final Matrix res); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface IMatrix {\n\n /**\n * Set coefficient\n * @param y row (0..height-1)\n * @param x column (0..width-1)\n * @param v value\n */\n public void set(int y, int x, double v);\n /**\n * Get coefficient from matrix, by returning coeff[y*width + x].\n * @param y row (0..height-1)\n * @param x column (0..width-1)\n * @return coefficient\n */\n public double get(int y, int x);\n\n /**\n * Clear matrix to zeros\n */\n public void clear();\n\n /**\n * Get array of coefficients.\n * They are indexed by [y*height + x].\n * Not all classes support this method.\n * @return array of coefficients\n */\n public double[] coeff();\n\n /**\n * Get width of matrix\n * @return width\n */\n public int width();\n\n /**\n * Get height of matrix\n * @return height\n */\n public int height();\n}", "public interface IMatrix {\n\n\tpublic int getRowsCount();\n\tpublic int getColsCount();\n\tpublic double get(int numberOne, int numberTwo);\n\tpublic IMatrix set(int numberOne, int numberTwo, double numberThree);\n\tpublic IMatrix copy();\n\tpublic IMatrix newInstance(int numberOne, int numberTwo);\n\tpublic IMatrix nTranspose(boolean trans);\n\tpublic IMatrix add(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nAdd(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix sub(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nSub(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nMultiply(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic double determinant() throws OperationNotSupportedException;\n\tpublic IMatrix subMatrix(int numberOne, int numberTwo, boolean subM);\n\tpublic IMatrix nInvert() throws OperationNotSupportedException;\n\tpublic double[][] toArray();\n\tpublic IVector toVector(boolean toVect) throws OperationNotSupportedException;\n\tpublic IMatrix scalarMultiply(double value);\n\tpublic IMatrix nScalarMultiply(double value);\n\t\n}", "private MatrixMultiplication() {\n throw new UnsupportedOperationException(\n \"Error @ new MatrixMultiplication() :: MatrixMultiplication is noninstantiable static class\");\n }", "@Override\n\tpublic IMatrix nMultiply(IMatrix other) {\n\n\t\tif (this.getColsCount() != other.getRowsCount()) {\n\t\t\tthrow new IncompatibleOperandException(\n\t\t\t\t\t\"For matrix multiplication first matrix must have same number of columns as number of rows of the other matrix!\");\n\t\t}\n\t\tint m = this.getRowsCount();\n\t\tint n = other.getColsCount();\n\t\tint innerDimension = this.getColsCount();\n\t\tdouble[][] p = new double[m][n];\n\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tdouble sum = 0;\n\t\t\t\tfor (int k = 0; k < innerDimension; k++) {\n\t\t\t\t\tsum += this.get(i, k) * other.get(k, j);\n\t\t\t\t}\n\t\t\t\tp[i][j] = sum;\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(m, n, p, true);\n\t}", "public interface VectorOperations extends MatrixOperations\n{\n /**\n * \n * Multiplies the vectors in a specific way, not sure of the term\n * \n * @param a\n * @param b\n * @return\n */\n public static Vector tensorProduct( final Vector a , final Vector b)\n {\n return a.tensorProduct(b);\n }\n \n /**\n * \n * Makes the tensor product of this and a\n * \n * @param a\n * @return\n */\n public Vector tensorProduct( final Vector a);\n \n /**\n * \n * Pretty much like List.sublist\n * \n * @param indexFrom\n * @param indexTo\n * @return\n */\n public Vector get( final int indexFrom, final int indexTo );\n \n /**\n * \n * @return size of the vector\n */\n public int size();\n}", "Multiply createMultiply();", "public static OperationMBean getMultiplyOperationMBean()\n {\n return new Operation(\"multiply\");\n }", "public interface IMatrix extends IArray<IMatrix>{\n\n IVector getRow(int index);\n\n IVector getColumn(int index);\n\n// IMatrix addi(IMatrix mat);\n\n// IMatrix subi(IMatrix mat);\n\n double[][] asDouble();\n\n float[][] asFloat();\n\n IMatrix subiColumn(int index, IVector vec);\n\n// IMatrix dup();\n\n IMatrix putiRow(int index, IVector vec);\n\n int rows();\n\n int columns();\n}", "@Override\npublic void mul(int a, int b) {\n\t\n}", "public Vector getReplicators() { return _replicatorQueue; }", "@Override\r\n\tpublic int mul() {\n\t\treturn 0;\r\n\t}", "public interface LinopTransform extends Transform {\r\n public double[][] getMat();\r\n}", "public void multiply() {\n\t\t\n\t}", "Matrix mul(Matrix m){\n if(m.cols != this.cols || m.rows != this.rows) throw new RuntimeException(String.format(\"Wrong dimensions\"));\n Matrix matrix_to_return = new Matrix(m.rows, m.cols);\n for(int i=0; i<m.rows * m.cols; i++){\n matrix_to_return.data[i] = this.data[i] * m.data[i];\n }\n return matrix_to_return;\n }", "public Matrix multiply(int i) {\n\t\treturn multiply(new Fraction(i));\n\t}", "Matrix mult(Matrix M){\n if(this.getSize() != M.getSize()){\n throw new RuntimeException(\"Matrix\");\n\n } \n int newMatrixSize = this.getSize();\n Matrix newM = M.transpose();\n Matrix resultMatrix = new Matrix(newMatrixSize);\n double resultMatrix_Entry = 0;\n for(int i = 1; i <= newMatrixSize; i++){\n for(int j = 1; j<= newMatrixSize; j++){\n List itRow_A = this.rows[i - 1];\n List itRow_B = newM.rows[j-1];\n itRow_A.moveFront();\n itRow_B.moveFront();\n while((itRow_A.index() != -1) && (itRow_B.index() != -1)){\n Entry c_A = (Entry)itRow_A.get();\n Entry c_B = (Entry) itRow_B.get();\n if(c_A.column == c_B.column){\n resultMatrix_Entry += (c_A.value)*(c_B.value);\n itRow_A.moveNext();\n itRow_B.moveNext();\n\n } else if(c_A.column > c_B.column){\n itRow_B.moveNext();\n\n }else{\n itRow_A.moveNext();\n }\n\n }\n resultMatrix.changeEntry(i, j, resultMatrix_Entry);\n resultMatrix_Entry = 0;\n }\n }\n return resultMatrix;\n\n }", "public double getMultiplier() {\r\n return multiplier;\r\n }", "@Override\n\tpublic void visit(Multiplication arg0) {\n\n\t}", "@Override\n\tpublic void visit(Multiplication arg0) {\n\t\t\n\t}", "public interface Matrix<T> {\n\n public void put(Integer x,Integer y,T element);\n public T get(Integer x, Integer y);\n}", "abstract void mulS();", "public interface ExprMatrix extends ExprCellIterator{\n public int getColumnsDimension();\n\n public int getRowsDimension();\n\n public Expr apply(int row, int column);\n\n public Expr get(int row, int column);\n\n public void set(Expr exp, int row, int col);\n\n\n /**\n * create a preloaded sequence (all element are pre evaluated)\n * @return\n */\n public ExprMatrix preload();\n\n /**\n * same as index, provided for scala compatibility\n *\n * @param index index\n * @return get(index)\n */\n /**\n * create a cached instance of this expression sequence\n * @return\n */\n public ExprMatrix withCache();\n\n /**\n * create a sequence of simplified elements\n * @return\n */\n public ExprMatrix simplify() ;\n}", "public interface IMul {\n Var mul(Var var);\n\n}", "public void matrixMultiply(Matrix m) {\n if (cols == m.getRows()) {\n ArrayList<double[]> result = newMatrix(rows, m.getCols());\n for (int i=0; i<rows; i++) {\n for (int k=0; k<m.getCols(); k++) {\n double sum = 0;\n for (int j=0; j<cols; j++) {\n sum += matrix.get(i)[j] * m.get(j, k);\n }\n result.get(i)[k] = sum;\n }\n }\n setMatrix(result, rows, m.getCols()); // Rows is that of original matrix, Columns is that of the multiplying matrix\n }\n else {\n throw new MatrixMultiplicationDimensionException();\n }\n }", "public interface aa {\n void m5433a(Matrix matrix);\n}", "@Override\n\tpublic float multiplicar(float op1, float op2) {\n\t\treturn op1 * op2;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"MULT\";\n\t}", "private void mul() {\n\n\t}", "public double getUIMultiplier() {\n\treturn multiplier;\n}", "public interface MatrixSummator {\n /**\n * Sums matrices\n * @param mtx1 first matrix\n * @param mtx2 second matrix\n * @throws ServiceException if matrices have different sizes\n */\n Matrix sum(Matrix mtx1, Matrix mtx2) throws ServiceException;\n}", "abstract int multiplication(int num1, int num2);", "public int getMultiplier() {\n return multiplier;\n }", "public interface Matrix extends Entity{\n\tboolean isNull(int row, int column);\n\tvoid setNull(int row, int column);\n\tScalar getRowLabel(int row);\n\tScalar getColumnLabel(int column);\n\tScalar get(int row, int column);\n\tVector getRowLabels();\n\tVector getColumnLabels();\n\tboolean hasRowLabel();\n\tboolean hasColumnLabel();\n\tClass<?> getElementClass();\n}", "public abstract <M extends AbstractMatrix> M elementwiseProduct(M b);", "@Override\r\n\tpublic void mul(int x, int y) {\n\t\t\r\n\t}", "public static void testMulRec() {\n\n try {\n\n Matrix m1 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m2 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m3 = Matrix.multiplyRec(m1, m2, 0);\n\n System.out.println(m3);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Test(expectedExceptions = IllegalArgumentException.class)\n\tpublic void testMultiplyWrongDimensions() {\n\t\tm1.multiply(m1);\n\t}", "Matrix scalarMult(double x){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n itRow.moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(i, c.column, (x*c.value));\n itRow.moveNext();\n }\n }\n\n return newM;\n }", "public void multiply(CubieCube multiplier) {\n multiplyTheCorners(multiplier);\n multiplyTheEdges(multiplier);\n }", "public Matrix multiply(Matrix other) {\n if (this.cols != other.rows)\n throw new RuntimeException(\"Illegal matrix dimensions\");\n\n Matrix result = new Matrix(this.rows, other.cols); //Matrix full of zeros\n for (int i = 0; i < this.rows; i++) {\n for (int j = 0; j < other.cols; j++) {\n for (int k = 0; k < this.cols; k++) {\n result.data[i][j] += (this.data[i][k] * other.data[k][j]);\n }\n }\n }\n\n return result;\n }", "public interface Matrix {\n\n void initZeroValues();\n\n void fillRandomValues();\n\n int getRows();\n\n int getColumns();\n\n Entity getEntity(int i, int j);\n\n String toString();\n}", "public abstract Vector4fc mul(IMatrix4f mat);", "LengthScalarMultiply createLengthScalarMultiply();", "public long[][] smultiply(int i){\n\t\tint sl = this.mat.length; //jumps to method sideLength to obtain the side length n of the matrix A\n\t\t//the global record contains an array of columns, where each column is an array of row elements. i.e.\n\t\t//the record contains the transpose of matrix A, where every row in the record is a column in A\n\t\t//a temporary 2D array tempMatA, and is made equal to the transpose of A\n\t\tlong[][] tempMatA = transpose(this.mat);\n\t\tlong[][] tempMat2 = new long[sl][sl]; //creates a temporary 2D matrix of the same size as tempMatA\n\t\tlong[][] outMat = new long[sl][sl];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"+\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\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\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//return matrix must be re-transposed to return a the proper format of 2D array for the global array\n\t\toutMat = transpose(outMat);\n\t\treturn outMat;\n\t}", "public MultiplierGenericModifierPanel(MultiplierGenericModifier genericModifier) {\n initComponents();\n setupIcons();\n\n setGenericModifier(genericModifier);\n \n valueText.setVisible(false);\n }", "public Composite multiply(Composite comp) {\n\t\tif(comp.isUnit()){\n\t\t\treturn this;\n\t\t}\n\t\tif(this.isUnit()){\n\t\t\treturn comp;\n\t\t}\n\t\tNode head = comp.head;\n\t\tNode current_node = this.head;\n\t\t//long product = 1;\n\t\tBigInteger product = BigInteger.ONE;\n\t\twhile (current_node != null){\n\t\t\tlong factor = (long) Math.pow(current_node.factor, current_node.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcurrent_node = current_node.next;\n\t\t}\n\t\twhile (comp.head != null){\n\t\t\tlong factor = (long)Math.pow(comp.head.factor, comp.head.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n\t\tComposite p = new Composite();\n\t\tNode n = new Node(product.longValue(), 1);\n\t\tp.head = n;\n\t\tcomp.head = head;\n\t\treturn p;\n\t}", "protected SimpleMatrix() {}", "public Matrix calculate();", "public Matrix P0 ();", "public abstract Vector4fc mul(IMatrix4x3f mat);", "public Object clone() throws CloneNotSupportedException {\r\n super.clone();\r\n return new JMSCacheReplicator(replicatePuts, replicateUpdates,\r\n replicateUpdatesViaCopy, replicateRemovals, replicateAsync, asynchronousReplicationInterval);\r\n }", "public void mul() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->mul() unimplemented!\\n\");\n }", "public T mult( T B ) {\n convertType.specify(this, B);\n\n // Look to see if there is a special function for handling this case\n if (this.mat.getType() != B.getType()) {\n Method m = findAlternative(\"mult\", mat, B.mat, convertType.commonType.getClassType());\n if (m != null) {\n T ret = wrapMatrix(convertType.commonType.create(1, 1));\n invoke(m, this.mat, B.mat, ret.mat);\n return ret;\n }\n }\n\n // Otherwise convert into a common matrix type if necessary\n T A = convertType.convert(this);\n B = convertType.convert(B);\n\n T ret = A.createMatrix(mat.getNumRows(), B.getMatrix().getNumCols(), A.getType());\n\n A.ops.mult(A.mat, B.mat, ret.mat);\n\n return ret;\n }", "private RealMatrix scalarMultiplication(RealMatrix matrix1, RealMatrix matrix2) {\n\t\tdouble a = matrix1.getEntry(0, 0);\n\t\tdouble b = matrix1.getEntry(1, 0);\n\t\tdouble c = matrix1.getEntry(2, 0);\n\t\tdouble d = matrix1.getEntry(3, 0);\n\t\t\n\t\tdouble[][] result = new double[matrix2.getRowDimension()][matrix2.getColumnDimension()];\n\t\t\n\t\tfor (int i=0; i < matrix2.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < matrix2.getColumnDimension(); j++) {\n\t\t\t\tif (i == 0) result[i][j] = a * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 1) result[i][j] = b * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 2) result[i][j] = c * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 3) result[i][j] = d * matrix2.getEntry(i, j);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn MatrixUtils.createRealMatrix(result);\n\t}", "public double componentProduct()\n {\n return this.x * this.y;\n }", "public double getMultiplier() {\n return genericModifier.getMultiplier();\n }", "@Override\n\tpublic MultiArrayDimension clone() {\n\t\treturn new MultiArrayDimension(this.label, this.size, this.stride);\n\t}", "public Calculation getMultiplicityFunction() {\n return multiplicityFunction;\n }", "@Override\n\tpublic IVector scalarMultiply(double number){\n\t\tfor(int i=this.getDimension()-1; i>=0; i--){\n\t\t\tthis.set(i, this.get(i)*number);\n\t\t}\n\t\treturn this;\n\t}", "public void MatrixChainMultiply(int[] p) {\n n = p.length - 1;\t// how many matrices are in the chain\n m = new int[n + 1][n + 1];\t// overallocate m, so that we don't use index 0\n s = new int[n + 1][n + 1];\t// same for s\n matrixChainOrder(p);\t// run the dynamic-programming algorithm\n }", "public Matrix3 multiplySelf(Matrix3 m)\n {\n Matrix3 temp = Matrix3.REUSABLE_STACK.pop().initZero();\n\n for (int r = 0; r < 3; r++)\n {\n for (int c = 0; c < 3; c++)\n {\n for (int k = 0; k < 3; k++)\n temp.set(c, r, temp.get(c, r) + this.m[k][r] * m.get(c, k));\n }\n }\n\n this.set(temp);\n Matrix3.REUSABLE_STACK.push(temp);\n\n return this;\n }", "interface ColorTransformation extends Mutator {\n\n }", "protected void sequence_Multiplication(ISerializationContext context, Multi semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, DslPackage.Literals.MULTI__LEFT) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DslPackage.Literals.MULTI__LEFT));\n\t\t\tif (transientValues.isValueTransient(semanticObject, DslPackage.Literals.MULTI__RIGHT) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DslPackage.Literals.MULTI__RIGHT));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getMultiplicationAccess().getMultiLeftAction_1_0_0_0(), semanticObject.getLeft());\n\t\tfeeder.accept(grammarAccess.getMultiplicationAccess().getRightPrimaryExpressionParserRuleCall_1_1_0(), semanticObject.getRight());\n\t\tfeeder.finish();\n\t}", "public Matrix multiply(ComplexNumber cn) {\n\t\tMatrix a = copy();\n\t\tfor (int row = 0; row < a.M; row++) {\n\t\t\tfor (int col = 0; col < a.N; col++) {\n\t\t\t\ta.ROWS[row][col] = a.ROWS[row][col].multiply(cn);\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}", "public abstract Vector4fc mulProject(IMatrix4f mat);", "@ZenCodeType.Operator(ZenCodeType.OperatorType.MUL)\n default IData mul(IData other) {\n \n return notSupportedOperator(OperatorType.MUL);\n }", "public AncientEgyptianMultiplication( ) {\r\n }", "abstract public Matrix4fc getViewMatrix();", "public ArrayList<ArrayList<T>> getMatrix() {\n\t\treturn matrix;\n\t}", "Matrix mul(double w){\n Matrix matrix_to_return = new Matrix(this.rows, this.cols);\n for(int i=0; i<this.rows * this.cols; i++){\n matrix_to_return.data[i] = this.data[i] * w;\n }\n return matrix_to_return;\n }", "Sum getMultiplier();", "public Row3 smultiply(int i){\n\t\tRow3 tempRec = this.mat; //creates a temporary duplicate of the global record\n\t\tlong[][] tempMatA = new long[3][3]; //creates the matrix A as a 2D array\n\t\ttempMatA[0][0] = tempRec.r1.col1;\n\t\ttempMatA[0][1] = tempRec.r1.col2;\n\t\ttempMatA[0][2] = tempRec.r1.col3;\n\t\ttempMatA[1][0] = tempRec.r2.col1;\n\t\ttempMatA[1][1] = tempRec.r2.col2;\n\t\ttempMatA[1][2] = tempRec.r2.col3;\n\t\ttempMatA[2][0] = tempRec.r3.col1;\n\t\ttempMatA[2][1] = tempRec.r3.col2;\n\t\ttempMatA[2][2] = tempRec.r3.col3;\n\t\t\n\t\tlong[][] tempMat2 = new long[3][3]; //creates a 2D array of the same size as A\n\t\tlong[][] outMat = new long[3][3];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\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\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//after matrix multiplication is performed, the respective elements of the 2D array tempMatA are stored in\n\t\t//the temporary register tempRec2, which is then returned\n\t\tcolRow3 a1 = new colRow3(outMat[0][0], outMat[0][1], outMat[0][2]);\n\t\tcolRow3 b1 = new colRow3(outMat[1][0], outMat[1][1], outMat[1][2]);\n\t\tcolRow3 c1 = new colRow3(outMat[2][0], outMat[2][1], outMat[2][2]);\n\t\tRow3 tempRec2 = new Row3(a1, b1, c1);\n\t\treturn tempRec2;\n\t}", "int getSize(){\n return this.matrixSize;\n }", "public interface ComponentInterface {\n\t\n\t/** \n\t * Execute component once and calculate metric values\n\t * \n\t * @param inputData Input data set\n\t * @return List of Objects containing component outputs\n\t */\n\t public java.util.List<Object> execute(java.util.List<Object> inputData);\n\t \n\t /** \n\t * Calculate metrics\n\t * \n\t * @param outputValues Output values of component execution\n\t * @param truthValues Component-generated truth values\n\t * @return List of Objects containing computed values of metrics\n\t */\n\t public java.util.List<Object> calculateMetrics(java.util.List<Object> outputValues, java.util.List<Object> truthValues);\n\t \n\t /**\n\t * Generate an input data set\n\t * @param genericProperties Generic parameters for data set generation (e.g., number of data points)\n\t * @return List of Objects containing generated input values\n\t */\n\t public java.util.List<Object> generateDataSet(java.util.List<Object> genericProperties);\n\t \n\t /**\n\t * Generate truth values \n\t * \n\t * @return List of Objects containing generated truth values\n\t */\n\t public java.util.List<Object> generateTruthValues();\n\t \n\t /**\n\t * Generate values for control variables\n\t * \n\t * @return List of Objects containing generated control variable values\n\t */\n\t public java.util.List<Object> generateControlVars();\n\t \n\t /**\n\t * Set control variable values to use in subsequent executions\n\t * \n\t * @param controlValues Values for control variables\n\t */\n\t public void setControlVars(java.util.List<Object> controlValues);\n\n}", "public double getXmultiplier()\n {\n return xmultiplier; \n }", "public LMUL() {\n super(InstructionOpCodes.LMUL, 1);\n }", "Double getMultiplier();", "public JComponent addModulation(Color color)\n {\n Category category = new Category(this, \"Modulation Matrix\", color);\n \n JComponent comp;\n String[] params;\n HBox hbox = new HBox();\n VBox outer = new VBox();\n \n for(int mod = 1; mod <= 16; mod++) // note <=\n {\n VBox vbox = new VBox();\n params = MOD_SOURCES;\n comp = new Chooser(\"Source \" + mod, this, \"mod\" + mod + \"source\", params);\n vbox.add(comp);\n\n params = (mod > 2 ? EXTENDED_MOD_DESTINATIONS : MOD_DESTINATIONS);\n comp = new Chooser(\"Destination \" + mod, this, \"mod\" + mod + \"destination\", params);\n vbox.add(comp);\n\n hbox.add(vbox);\n\n comp = new LabelledDial(\"Amount \" + mod, this, \"mod\" + mod + \"scaling\", color, 0, 127)\n {\n public boolean isSymmetric() { return true; }\n public String map(int value)\n {\n if (value <= 64) return \"\" + (((value - 64) * 100) / 64) + \"%\";\n else return \"\" + (((value - 64) * 100) / 63) + \"%\";\n }\n };\n hbox.add(comp);\n \n if (mod == 4 || mod == 8 || mod == 12 || mod == 16)\n {\n outer.add(hbox);\n if (mod == 4 || mod == 8 || mod == 12)\n outer.add(Strut.makeVerticalStrut(20));\n hbox = new HBox();\n }\n }\n \n category.add(outer, BorderLayout.CENTER);\n return category;\n }", "@Override\n public Matrix like() {\n return new PivotedMatrix(base.like());\n }", "@Override\n\tprotected void setMultiplier(DynamicMultiplier multiplier) {\n\t\tif (\"supportVectors\".equals(multiplier.getName())) {\n\t\t\tmultiplier.setFactor(numberOfSupportVectors);\n\t\t} else if (\"supportVectorsMinusOne\".equals(multiplier.getName())) {\n\t\t\tmultiplier.setFactor(numberOfSupportVectors - 1);\n\t\t} else if (\"supportVectorMachines\".equals(multiplier.getName())) {\n\t\t\tmultiplier.setFactor((numberOfClasses * (numberOfClasses - 1)) / 2);\n\t\t} else if (\"squareAndMultiplyDegree\".equals(multiplier.getName())) {\n\t\t\tmultiplier.setFactor((int) (2.0 * FastMath.floor(FastMath.log(2.0, ((Integer) kernelDegree.getValue())))));\n\t\t}\n\t}", "public final EObject ruleMultiplicationOperator() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4829:28: ( ( () otherlv_1= '*' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4830:1: ( () otherlv_1= '*' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4830:1: ( () otherlv_1= '*' )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4830:2: () otherlv_1= '*'\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4830:2: ()\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4831:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getMultiplicationOperatorAccess().getMultiplicationOperatorAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,46,FOLLOW_46_in_ruleMultiplicationOperator10841); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getMultiplicationOperatorAccess().getAsteriskKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "@Override\n\tpublic double multiply(double in1, double in2) {\n\t\treturn 0;\n\t}", "public abstract Matrix matrix(double s1, double s2, double s3, double c1, double c2, double c3);", "public Matrix multiplyTransposeSelf(Matrix m) {\n\t\tMatrix newMatrix = new Matrix(nbColumns, m.getNbColumns());\n\t\tmultiplyTransposeA(this, m, newMatrix);\n\n\t\treturn newMatrix;\n\t}", "public static Matrix product(Matrix m) {\n int rows_c = m.rows(), cols_c = m.cols();\n Matrix d;\n if (rows_c == 1) {\n return m;\n } else {\n d = MatrixFactory.getMatrix(1, cols_c, m);\n for (int col = 1; col <= cols_c; col++) {\n double prodCol = 1D;\n for (int row = 1; row <= rows_c; row++) {\n prodCol = prodCol * m.get(row, col);\n }\n d.set(1, col, prodCol);\n }\n }\n return d;\n }", "public Matrix xMatrix(){\n if(!this.pcaDone)this.pca();\n double denom = this.nItems;\n if(!super.nFactorOption)denom -= 1.0;\n Matrix mat = dataMinusMeans.times(1.0/Math.sqrt(denom));\n return mat;\n }", "public Matrix getMatrix() {\n\t\treturn matrix;\n\t}", "public Matrix4f GetMultipliedMatrix(Matrix4f m) {\n\n\t/*\n\tinputs--\n\t\n\tm :\n\t The input matrix m, instance of Matrix4f\n\t*/\n\t\n\t/*\n\toutputs--\n\t\n\tmul :\n\t The matrix this times m\n\t*/\n\t\n\t// Create new matrix to hold the results\n\tMatrix4f mul = new Matrix4f();\n\t\n\t// Double for loop based standard multiplication\n\tfor (int n_i = 0; n_i < 4; n_i ++) {\n\t \n\t for(int n_j = 0; n_j < 4 ; n_j ++) {\n\t\t\n\t\t// Set entry one by one\n\t\tfloat f_val = 0;\n\t\tfor (int n_k = 0; n_k < 4; n_k ++) {\n\t\t\n\t\t f_val += this.mat_f_m[n_i][n_k]*m.GetComponent(n_k, n_j);\n\t\t\n\t\t}\n\t\tmul.SetComponent(n_i, n_j, f_val);\n\t\t\n\t }\n\t\n\t}\n\t\n\t// Return the multiplied matrix\n\treturn mul;\n \n }", "public interface IMutationOperator extends IDescriptable, Opcodes {\n\t/**\n\t * Gets all possible points in given class (bytecode) where different\n\t * mutants can be produced.\n\t *\n\t * @param bytecode bytecode to be analyzed\n\t * @return list of mutation points witihn given class (bytecode)\n\t */\n\tList<IMutationPoint> getMutationPoints(byte[] bytecode);\n\n\t/**\n\t * Mutate given bytecode to create mutants with given mutation points.\n\t *\n\t * @param bytecode bytecode to be mutated\n\t * @param mutationPoint mutation point in given class (bytecode)\n\t * @return list of mutants created within given point\n\t */\n\tList<IMutantBytecode> mutate(byte[] bytecode, IMutationPoint mutationPoint);\n\n\t/**\n\t * @param bytecode bytecode to be mutated\n\t * @param mutationPointIndex mutation point in given class (bytecode)\n\t * @param mutantIndex specific mutant index within given point\n\t * @return mutated bytecode - mutant\n\t */\n\tIMutantBytecode mutate(byte[] bytecode, int mutationPointIndex, int mutantIndex);\n}", "public int[][] getMat() {\n // Note: java has no return read-only so we won't return matrix;\n // b\\c that would expose internal representation. Instead we will\n // copy each row into a new matrix, and return that.\n return Helper.cloneMatrix(matrix);\n }", "protected MatrixToken _multiplyElement(Token rightArgument)\n\t\t\tthrows IllegalActionException {\n\t\tlong scalar;\n\t\tif (rightArgument instanceof LongMatrixToken) {\n\t\t\tif (((LongMatrixToken) rightArgument).getRowCount() != 1\n\t\t\t\t\t|| ((LongMatrixToken) rightArgument).getColumnCount() != 1) {\n\t\t\t\t// Throw an exception.\n\t\t\t\treturn super._moduloElement(rightArgument);\n\t\t\t}\n\t\t\tscalar = ((LongMatrixToken) rightArgument).getElementAt(0, 0);\n\t\t} else {\n\t\t\tscalar = ((LongToken) rightArgument).longValue();\n\t\t}\n\t\tlong[] result = LongArrayMath.multiply(_value, scalar);\n\t\treturn new LongMatrixToken(result, _rowCount, _columnCount, DO_NOT_COPY);\n\t}", "public Matrix multiply(Matrix b) {\n MultMatrix multCommand = new MultMatrix();\n Matrix result = multCommand.multiply(this, b);\n\n return result;\n }", "public void multiplyCoords(double multiplier) {\n\t\tposition.setX(position.getX() * multiplier);\n\t\tposition.setY(position.getY() * multiplier);\n\t\tsetX(getX() * multiplier);\n\t\tsetY(getY() * multiplier);\n\t}", "public Matrix multiply(double scalar) {\n Matrix result = new Matrix(this.rows, this.cols);\n for (int i = 0; i < this.rows; i++) {\n for (int j = 0; j < this.cols; j++) {\n result.data[i][j] = this.data[i][j] * scalar;\n }\n }\n\n return result;\n }", "public R3Mult(int rdIndex, int rsIndex, int id) {\n\n }", "public String multiply()\r\n {\r\n\r\n return First.multiply(Second).stripTrailingZeros().toString();\r\n }", "public <I extends Image<?, I>> I multiply(I in1, float[] amt) {\n\t\tCLQueue queue = context.createDefaultQueue();\n\t\t\n\t\tCLImage2D clin1 = CLImageConversion.convert(context, in1);\n\t\tCLImage2D clout = context.createImage2D(CLMem.Usage.Output, clin1.getFormat(), clin1.getWidth(), clin1.getHeight());\n\t\t\n\t\tCLEvent evt = process(multiplyImage, queue, clin1, amt, clout);\n\t\t\n\t\tI out = CLImageConversion.convert(queue, evt, clout, in1.newInstance(in1.getWidth(), in1.getHeight()));\n\t\t\n\t\tclin1.release();\n\t\tclout.release();\n\t\tqueue.release();\n\t\t\n\t\treturn out;\n\t}", "public void multiply(double multiplier) {\n x *= multiplier;\n y *= multiplier;\n }", "MatrixElement(int edgesQuantity) {\r\n\t\tthis.edgesQuantity = edgesQuantity;\r\n\t}", "public <I extends Image<?, I>> I multiply(I in1, I in2) {\n\t\tCLQueue queue = context.createDefaultQueue();\n\t\t\n\t\tCLImage2D clin1 = CLImageConversion.convert(context, in1);\n\t\tCLImage2D clin2 = CLImageConversion.convert(context, in2);\n\t\tCLImage2D clout = context.createImage2D(CLMem.Usage.Output, clin1.getFormat(), clin1.getWidth(), clin1.getHeight());\n\t\t\n\t\tCLEvent evt = process(multiplyImage, queue, clin1, clin2, clout);\n\t\t\n\t\tI out = CLImageConversion.convert(queue, evt, clout, in1.newInstance(in1.getWidth(), in1.getHeight()));\n\t\t\n\t\tclin1.release();\n\t\tclin2.release();\n\t\tclout.release();\n\t\tqueue.release();\n\t\t\n\t\treturn out;\n\t}" ]
[ "0.6128349", "0.60526466", "0.6017523", "0.5872967", "0.5776593", "0.57399374", "0.57043505", "0.5657673", "0.556408", "0.5540668", "0.5533117", "0.5526284", "0.5512023", "0.5498189", "0.5464114", "0.5429971", "0.5358993", "0.5354682", "0.5351928", "0.5313288", "0.5313243", "0.5307297", "0.5296257", "0.5289235", "0.52105016", "0.52096874", "0.5203286", "0.5189801", "0.5177535", "0.51487744", "0.5147448", "0.51455605", "0.5145178", "0.5140668", "0.5122576", "0.5089602", "0.5088523", "0.5088293", "0.50838", "0.5076729", "0.50605047", "0.5048138", "0.503261", "0.50207204", "0.5011956", "0.5011681", "0.5011006", "0.49947459", "0.4981526", "0.49805146", "0.4978393", "0.49727488", "0.49683097", "0.49681675", "0.49598154", "0.49589807", "0.49537587", "0.49430478", "0.49397328", "0.4935782", "0.493554", "0.49290374", "0.49019483", "0.48833957", "0.48647994", "0.4858304", "0.48486152", "0.4847043", "0.48410162", "0.48374185", "0.483062", "0.48229942", "0.48197058", "0.48171812", "0.4816434", "0.48134148", "0.48013023", "0.47994906", "0.4799231", "0.47923303", "0.4790796", "0.4779947", "0.4766753", "0.4764689", "0.47573143", "0.47493413", "0.47489306", "0.47465366", "0.47447196", "0.47431156", "0.47392324", "0.47378528", "0.47359782", "0.47350475", "0.47334072", "0.47261783", "0.47163984", "0.47095135", "0.47047293", "0.47013846" ]
0.7701014
0
Multiplies two matrixes and returns the result in a new matrix
public long multiplyMatrix(final Matrix matrixA, final Matrix matrixB, final Matrix res);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Matrix multiply(Matrix first, Matrix second) {\n \n Matrix result = new Matrix(first.getRows(), first.getClumns());\n \n for (int row = 0; row < first.getRows(); row++) {\n for (int col = 0; col < first.getClumns(); col++) {\n result.matrix[row][col] = first.matrix[row][col] * second.matrix[row][col];\n }\n }\n \n return result;\n }", "public Matrix multiply(Matrix other) {\n if (this.cols != other.rows)\n throw new RuntimeException(\"Illegal matrix dimensions\");\n\n Matrix result = new Matrix(this.rows, other.cols); //Matrix full of zeros\n for (int i = 0; i < this.rows; i++) {\n for (int j = 0; j < other.cols; j++) {\n for (int k = 0; k < this.cols; k++) {\n result.data[i][j] += (this.data[i][k] * other.data[k][j]);\n }\n }\n }\n\n return result;\n }", "public static void multiply(int[][] matrix1, int[][] matrix2) {\n\t\t int matrix1row = matrix1.length;\r\n\t\t int matrix1column = matrix1[0].length;//same as rows in B\r\n\t\t int matrix2column = matrix2[0].length;\r\n\t\t int[][] matrix3 = new int[matrix1row][matrix2column];\r\n\t\t for (int i = 0; i < matrix1row; i++) {//outer loop refers to row position\r\n\t\t for (int j = 0; j < matrix2column; j++) {//refers to column position\r\n\t\t for (int k = 0; k < matrix1column; k++) {\r\n\t\t \t //adds the products of row*column elements until the row/column is complete\r\n\t\t \t //updates to next row/column\r\n\t\t matrix3[i][j] = matrix3[i][j] + matrix1[i][k] * matrix2[k][j];\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t print(matrix3);\r\n\t\t }", "@Override\n\tpublic IMatrix nMultiply(IMatrix other) {\n\n\t\tif (this.getColsCount() != other.getRowsCount()) {\n\t\t\tthrow new IncompatibleOperandException(\n\t\t\t\t\t\"For matrix multiplication first matrix must have same number of columns as number of rows of the other matrix!\");\n\t\t}\n\t\tint m = this.getRowsCount();\n\t\tint n = other.getColsCount();\n\t\tint innerDimension = this.getColsCount();\n\t\tdouble[][] p = new double[m][n];\n\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tdouble sum = 0;\n\t\t\t\tfor (int k = 0; k < innerDimension; k++) {\n\t\t\t\t\tsum += this.get(i, k) * other.get(k, j);\n\t\t\t\t}\n\t\t\t\tp[i][j] = sum;\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(m, n, p, true);\n\t}", "public static double[][] multiplyMatrices(double[][] firstMatrix, double[][] secondMatrix, int r1, int c1, int c2) {\r\n\t double[][] product = new double[r1][c2];\r\n\t for(int i = 0; i < r1; i++) {\r\n\t for (int j = 0; j < c2; j++) {\r\n\t for (int k = 0; k < c1; k++) {\r\n\t product[i][j] += firstMatrix[i][k] * secondMatrix[k][j];\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t return product;\r\n\t }", "private RealMatrix scalarMultiplication(RealMatrix matrix1, RealMatrix matrix2) {\n\t\tdouble a = matrix1.getEntry(0, 0);\n\t\tdouble b = matrix1.getEntry(1, 0);\n\t\tdouble c = matrix1.getEntry(2, 0);\n\t\tdouble d = matrix1.getEntry(3, 0);\n\t\t\n\t\tdouble[][] result = new double[matrix2.getRowDimension()][matrix2.getColumnDimension()];\n\t\t\n\t\tfor (int i=0; i < matrix2.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < matrix2.getColumnDimension(); j++) {\n\t\t\t\tif (i == 0) result[i][j] = a * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 1) result[i][j] = b * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 2) result[i][j] = c * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 3) result[i][j] = d * matrix2.getEntry(i, j);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn MatrixUtils.createRealMatrix(result);\n\t}", "public static Matrix multiply(Matrix mat1, Matrix mat2) throws Exception {\n double[][] temp = new double[mat1.rows][mat2.cols];\n try {\n if(mat1.cols == mat2.rows){\n for(int col = 0; col < mat2.cols; col++) {\n for (int row = 0; row < mat1.rows; row++) {\n for (int rowin = 0; rowin < mat2.rows; rowin++) {\n for (int colin = 0; colin < mat1.cols; colin++) {\n temp[row][col] += mat1.arr[row][colin] * mat2.arr[rowin][col];\n }\n }\n }\n }\n }\n\n }catch (Exception e){\n e.printStackTrace();\n throw new Exception(\"Matrices are the wrong size: \" +\n mat1 +\n \" and \" +\n mat2 +\n \" and temp \" +\n Arrays.toString(temp));\n }\n return new Matrix(mat1.rows, mat2.cols, temp);\n }", "public static BigDecimal[][] multiplyMatrices(BigDecimal[][] m1, BigDecimal[][] m2){\n\t\t\n\t\tint size = m1.length;\n\t\t\n\t\tBigDecimal[][] next = new BigDecimal[size][size];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tfor(int j = 0; j < size; j++){\n\t\t\t\tBigDecimal current = new BigDecimal(0);\n\t\t\t\tfor(int k = 0; k < size; k++)\n\t\t\t\t\tcurrent = current.add(m1[i][k].multiply(m2[k][j]));\n\n\t\t\t\tnext[i][j] = current;\n\t\t\t}\n\t\t}\n\t\treturn next;\n\t}", "public static void multiplyMatrixes( double[][] m1, double[][] m2, double[][] result) {\n result[0][0] = m1[0][0]*m2[0][0] + m1[0][1]*m2[1][0] + m1[0][2]*m2[2][0];\n result[0][1] = m1[0][0]*m2[0][1] + m1[0][1]*m2[1][1] + m1[0][2]*m2[2][1];\n result[0][2] = m1[0][0]*m2[0][2] + m1[0][1]*m2[1][2] + m1[0][2]*m2[2][2];\n\n result[1][0] = m1[1][0]*m2[0][0] + m1[1][1]*m2[1][0] + m1[1][2]*m2[2][0];\n result[1][1] = m1[1][0]*m2[0][1] + m1[1][1]*m2[1][1] + m1[1][2]*m2[2][1];\n result[1][2] = m1[1][0]*m2[0][2] + m1[1][1]*m2[1][2] + m1[1][2]*m2[2][2];\n\n result[2][0] = m1[2][0]*m2[0][0] + m1[2][1]*m2[1][0] + +m1[2][2]*m2[2][0];\n result[2][1] = m1[2][0]*m2[0][1] + m1[2][1]*m2[1][1] + +m1[2][2]*m2[2][1];\n result[2][2] = m1[2][0]*m2[0][2] + m1[2][1]*m2[1][2] + +m1[2][2]*m2[2][2];\n }", "@Test\n\tpublic void testMultiply() {\n\t\tdouble epsilon = 0.0000000001;\n\n\t\tdouble[][] values2 = {{1.1, 1.2, 1.3}, {2.1, 2.2, 2.3}};\n\t\tMatrix m2 = new Matrix(values2);\n\n\t\tdouble[][] expectedValues = {{3.73, 3.96, 4.19}, {9.67, 10.24, 10.81}, {-2.07, -2.24, -2.41}};\n\t\tMatrix expected = new Matrix(expectedValues);\n\n\t\tMatrix product = m1.multiply(m2);\n\n\t\tassertEquals(3, product.getRowCount(), \"Product have unexpected number of rows.\");\n\t\tassertEquals(3, product.getColCount(), \"Product have unexpected number of columns.\");\n\n\t\tfor (int i = 0; i < product.getRowCount(); i++) {\n\t\t\tfor (int j = 0; j < product.getColCount(); j++) {\n\t\t\t\tassertTrue(Math.abs(product.get(i, j) - expected.get(i, j)) < epsilon,\n\t\t\t\t\t\"Unexpected value on row \" + i + \" column \" + j + \".\");\n\t\t\t}\n\t\t}\n\t}", "public static void testMulRec() {\n\n try {\n\n Matrix m1 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m2 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m3 = Matrix.multiplyRec(m1, m2, 0);\n\n System.out.println(m3);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public Matrix multiply(Matrix m2)\n\t{\n\t\tMatrix result = new Matrix(new double[matrix.length][matrix[0].length]);\n\t\tfor(int i = 0; i < matrix.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < matrix.length; j++)\n\t\t\t{\n\t\t\t\tfor (int k = 0; k < matrix.length; k++)\n\t\t\t\t{\n\t\t\t\t\tresult.matrix[i][j] = result.matrix[i][j] + matrix[i][k] * m2.matrix[k][j];\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\treturn result;\n\t}", "public static int[][] matrixMultiply(int[][] matA, int[][] matB)\n {\n if(isRect(matA)== false || isRect(matB)== false || matA[0].length != matB.length)\n {\n System.out.println(\"You cant not multiply these matrices\");\n int[][] matC = {{}};\n return matC;\n }\n else\n {\n int[][] matC = new int[matA.length][matB[0].length];\n for(int i = 0; i < matA.length; i++)\n for(int j = 0; j < matB[0].length; j++)\n for(int k = 0; k < matA[0].length; k++)\n {\n matC[i][j] += matA[i][k] * matB[k][j];\n }\n return matC;\n }\n }", "public static TransformMatrix multiplyMatrix(TransformMatrix a, TransformMatrix b) {\n\t\treturn new TransformMatrix(\n\t\t\t\ta.a * b.a,\n\t\t\t\ta.b * b.b,\n\t\t\t\ta.a * b.c + a.c,\n\t\t\t\ta.b * b.d + a.d\n\t\t\t\t);\n\t}", "public Matrix times(Matrix B) {\n Matrix A = this;\n if (A.columnCount != B.rowCount) throw new RuntimeException(\"Illegal matrix dimensions.\");\n Matrix C = new Matrix(A.rowCount, B.columnCount);\n for (int i = 0; i < C.rowCount; i++)\n for (int j = 0; j < C.columnCount; j++)\n for (int k = 0; k < A.columnCount; k++)\n C.data[i][j] += (A.data[i][k] * B.data[k][j]);\n return C;\n }", "public static double[][] multiply(double[][] a, double[][] b) {\n int m1 = a.length;\n int n1 = a[0].length;\n int m2 = b.length;\n int n2 = b[0].length;\n if (n1 != m2) throw new RuntimeException(\"Illegal matrix dimensions.\");\n double[][] c = new double[m1][n2];\n for (int i = 0; i < m1; i++)\n for (int j = 0; j < n2; j++)\n for (int k = 0; k < n1; k++)\n c[i][j] += a[i][k] * b[k][j];\n return c;\n }", "Matrix mult(Matrix M){\n if(this.getSize() != M.getSize()){\n throw new RuntimeException(\"Matrix\");\n\n } \n int newMatrixSize = this.getSize();\n Matrix newM = M.transpose();\n Matrix resultMatrix = new Matrix(newMatrixSize);\n double resultMatrix_Entry = 0;\n for(int i = 1; i <= newMatrixSize; i++){\n for(int j = 1; j<= newMatrixSize; j++){\n List itRow_A = this.rows[i - 1];\n List itRow_B = newM.rows[j-1];\n itRow_A.moveFront();\n itRow_B.moveFront();\n while((itRow_A.index() != -1) && (itRow_B.index() != -1)){\n Entry c_A = (Entry)itRow_A.get();\n Entry c_B = (Entry) itRow_B.get();\n if(c_A.column == c_B.column){\n resultMatrix_Entry += (c_A.value)*(c_B.value);\n itRow_A.moveNext();\n itRow_B.moveNext();\n\n } else if(c_A.column > c_B.column){\n itRow_B.moveNext();\n\n }else{\n itRow_A.moveNext();\n }\n\n }\n resultMatrix.changeEntry(i, j, resultMatrix_Entry);\n resultMatrix_Entry = 0;\n }\n }\n return resultMatrix;\n\n }", "Matrix(Matrix first, Matrix second) {\n if (first.getColumns() == second.getRows()) {\n this.rows = first.getRows();\n this.columns = second.getColumns();\n matrix = new int[first.getRows()][second.getColumns()];\n for (int col = 0; col < this.getColumns(); col++) {\n int sum;\n int commonality = first.getColumns(); // number to handle summation loop\n for (int rw = 0; rw < this.getRows(); rw++) {\n sum = 0;\n // summation loop\n for (int x = 0; x < commonality; x++) {\n sum += first.getValue(rw, x) * second.getValue(x, col);\n }\n matrix[rw][col] = sum;\n }\n\n }\n } else {\n System.out.println(\"Matrices cannot be multiplied\");\n }\n }", "public void multiplyOtherMatrixToEnd(Matrix other){\n Matrix output = Matrix(other.rows, columns);\n for (int a = 0; a < other.rows; a++)\n {\n for (int b = 0; b < columns; b++)\n {\n for (int k = 0; k < other.columns; k++)\n {\n output[a][b] = output[a][b] + output[a][k] * other.output[k][b];\n }\n }\n }\n return output;\n }", "private static void multiply(float[] a, float[] b, float[] destination) {\r\n\t\tfor(int i = 0; i < 4; i++){\r\n\t\t\tfor(int j = 0; j < 4; j++){\r\n\t\t\t\tfor(int k = 0; k < 4; k++){\r\n\t\t\t\t\tset(destination, i, j, get(destination, i, j) + get(a, i, k) * get(b, k, j));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Matrix multiplyOtherMatrixToFront(Matrix other) {\n Matrix output = Matrix(rows, other.columns);\n for (int a = 0; a < rows; a++)\n {\n for (int b = 0; b < other.columns; b++)\n {\n for (int k = 0; k < columns; k++)\n {\n output[a][b] = output[a][b] + output[a][k] * other.output[k][b];\n }\n }\n }\n return output;\n }", "public Matrix times(Matrix B) {\n Matrix A = this;\n if (A.n != B.m) throw new RuntimeException(\"Illegal matrix dimensions.\");\n Matrix C = new Matrix(A.m, B.n);\n for (int i = 0; i < C.m; i++)\n for (int j = 0; j < C.n; j++)\n for (int k = 0; k < A.n; k++)\n C.data[i][j] += (A.data[i][k] * B.data[k][j]);\n return C;\n }", "public Matrix times(Matrix B) {\n Matrix A = this;\n if (A.N != B.M) throw new RuntimeException(\"Illegal matrix dimensions.\");\n Matrix C = new Matrix(A.M, B.N);\n for (int i = 0; i < C.M; i++)\n for (int j = 0; j < C.N; j++)\n for (int k = 0; k < A.N; k++)\n C.data[i][j] += (A.data[i][k] * B.data[k][j]);\n return C;\n }", "Matrix mul(Matrix m){\n if(m.cols != this.cols || m.rows != this.rows) throw new RuntimeException(String.format(\"Wrong dimensions\"));\n Matrix matrix_to_return = new Matrix(m.rows, m.cols);\n for(int i=0; i<m.rows * m.cols; i++){\n matrix_to_return.data[i] = this.data[i] * m.data[i];\n }\n return matrix_to_return;\n }", "public Matrix mult (Matrix otherMatrix) {\n Matrix resultMatrix = new Matrix(nRows, otherMatrix.nColumns);\n\n ExecutorService executor = Executors.newFixedThreadPool(16);\n\n IntStream.range(0, nRows).forEach(rowIndex -> {\n executor.execute(() -> {\n IntStream.range(0, otherMatrix.nColumns).forEach(otherMatrixColIndex -> {\n double sum = IntStream.range(0, this.nColumns)\n .mapToDouble(colIndex -> this.data[rowIndex][colIndex] * otherMatrix.data[colIndex][otherMatrixColIndex])\n .sum();\n\n resultMatrix.setValue(rowIndex, otherMatrixColIndex, sum);\n });\n });\n });\n\n executor.shutdown();\n\n try {\n if (executor.awaitTermination(60, TimeUnit.MINUTES)){\n return resultMatrix;\n } else {\n System.out.println(\"Could not finish matrix multiplication\");\n }\n } catch (InterruptedException e) {\n System.out.println(\"Could not finish matrix multiplication, thread interrupted.\");\n }\n\n return null;\n }", "private static BigInteger[][] multiply (BigInteger a[][], BigInteger b[][])\n {\n BigInteger x = (a[0][0].multiply(b[0][0])).add(a[0][1].multiply(b[1][0]));\n BigInteger y = (a[0][0].multiply(b[0][1])).add(a[0][1].multiply(b[1][1]));\n BigInteger z = (a[1][0].multiply(b[0][0])).add(a[1][1].multiply(b[1][0]));\n BigInteger w = (a[1][0].multiply(b[0][1])).add(a[1][1].multiply(b[1][1]));\n \n return new BigInteger[][]{{x, y},{z, w}};\n }", "static public double[][] MatrixMult( double [][] A , double [][] B) {\n\t// A [NxK] * B[KxZ] = M[NxZ]\n\tif ( A.length == 0 || B.length == 0 || A[0].length != B.length ) {\n\t System.out.println( \"Matrix Mult Error, Invalid Input Matricies\" );\n\t return new double[1][1];\n\t}\n\tint Rows = A.length , Cols = B[0].length;\n\tdouble [][] M = new double[Rows][Cols];\n\tfor( int i = 0; i < Rows ; i++ ) {\n\t for( int j = 0; j < Cols ; j++ ) {\n\t\tM[i][j] = multRowByCol( A , B , i , j );\n\t }\n\t}\n\treturn M;\n }", "public static int[][] multiply(int[][] x,int[][] y){\n int[][] result = new int[x.length][x.length];\n int[] tempRow = new int[x.length];\n int[] tempCol = new int[x.length];\n for (int i = 0; i < x.length; i++) {\n for (int j = 0; j < x.length; j++) {\n //make 2 array then multiple respective number and add them up\n for (int k = 0; k < x.length; k++) {\n tempRow[k] = x[i][k];\n }\n for (int k = 0; k < x.length; k++) {\n tempCol[k] = y[k][j];\n }\n for (int k = 0; k < x.length; k++) {\n result[i][j] += tempRow[k]*tempCol[k];\n }\n }\n }\n return result;\n }", "public void rightMultiply(Matrix other){\n \tdouble[][] temp = new double[4][4];\n\n //record copy of this matrix \n\tfor (int i = 0; i < 4; i++) {\n\t for (int j = 0; j < 4; j++) {\n\t\ttemp[i][j] = array[i][j];\n\t }\n\t}\n\t//user copy of matrix to left multiply while writing dot products into matrix values\n\tfor (int i = 0; i < 4; i++) {\n\t for (int j = 0; j < 4; j++) {\n\t\tarray[i][j] = 0;\n\t\tfor (int k = 0 ; k < 4 ; k++) {\n \t\t array[i][j] += other.array[i][k] * temp[k][j];\n\t\t}\n\t }\n\t}\n }", "public static @NotNull Matrix mult(@NotNull Matrix matrA, @NotNull Matrix matrB) {\n final int compatibleValue = matrA.getColumnCount();\n if (compatibleValue != matrB.getRowCount()) {\n throw new IllegalArgumentException(\n \"Error @ MatrixMultiplication.mult() :: incompatible matrix matrA.columns != matrB.rows\");\n }\n\n final int rowCount = matrA.getRowCount();\n final int colCount = matrB.getColumnCount();\n final Matrix.Builder result = new Matrix.Builder(rowCount, colCount);\n for (int i = 0; i < rowCount; i++) {\n for (int j = 0; j < colCount; j++) {\n int val = 0;\n for (int k = 0; k < compatibleValue; k++) {\n val += matrA.get(i, k) * matrB.get(k, j);\n }\n result.set(i, j, val);\n }\n }\n\n return result.build();\n }", "public static double[][] multiplicacaoMatriz(double[][] a, double[][] b) {\n\t\t// linha por coluna\n\n\t\tif (a == null || b == null)\n\t\t\tthrow new NullPointerException(\"Argumentos nulos\");\n\n\t\tif (a[0].length != b.length)\n\t\t\tthrow new IllegalArgumentException(\"Numero de linhas de \\\"A\\\" � diferente de colunas de \\\"B\\\"\");\n\n\t\tfinal double[][] resultado = new double[a.length][b[0].length];\n\n\t\tfor (int x = 0; x < resultado.length; x++)\n\t\t\tfor (int y = 0; y < resultado[0].length; y++) {\n\n\t\t\t\tdouble acomulador = 0;\n\t\t\t\tfor (int i = 0; i < a[0].length; i++)\n\t\t\t\t\tacomulador += a[x][i] * b[i][y];\n\n\t\t\t\tresultado[x][y] = acomulador;\n\t\t\t}\n\n\t\treturn resultado;\n\t}", "public static Matrix3D times(Matrix3D A, Matrix3D B) {\n Matrix3D C = new Matrix3D();\n for (int i=0 ; i<=2 ; i++) { // loop over each row of A\n for (int j=0 ; j<=2 ; j++) { // loop over each column of B\n // Calculate the dot product of the ith row of A with the jth column of B:\n double v = 0;\n for (int k=0 ; k<=2 ; k++) { // loop over each item in the row/column\n v += A.d[i][k] * B.d[k][j];\n }\n C.set(i,j,v);\n }\n }\n return C;\n }", "Matrix mul(double w){\n Matrix matrix_to_return = new Matrix(this.rows, this.cols);\n for(int i=0; i<this.rows * this.cols; i++){\n matrix_to_return.data[i] = this.data[i] * w;\n }\n return matrix_to_return;\n }", "public static double[][] multiplyMatrixes( double[][] m1, double[][] m2 ) {\n double[][] result = new double[3][3];\n multiplyMatrixes( m1, m2, result );\n return result;\n }", "public Matrix multiply(ComplexNumber cn) {\n\t\tMatrix a = copy();\n\t\tfor (int row = 0; row < a.M; row++) {\n\t\t\tfor (int col = 0; col < a.N; col++) {\n\t\t\t\ta.ROWS[row][col] = a.ROWS[row][col].multiply(cn);\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}", "public interface IMatrixMultiplicator {\n\n\t/**\n\t * Multiplies two matrixes and returns the result in a new matrix \n\t * \n\t * @param matrixA first matrix\n\t * @param matrixB second matrix \n\t * @return result of the multiplication\n\t */\n\tpublic long multiplyMatrix(final Matrix matrixA, final Matrix matrixB, final Matrix res);\n\t \n\t\n}", "private static void multiplyArray(double [][] matrixA, double [][] matrixB, double [][] matrixC) {\n\t\t\n\t\tmatrixC[0][0] = ((matrixA[0][0] * matrixB[0][0]) + (matrixA[0][1] * matrixB[1][0]));\n\t\tmatrixC[0][1] = ((matrixA[0][0] * matrixB[0][1]) + (matrixA[0][1] * matrixB[1][1]));\n\t\tmatrixC[1][0] = ((matrixA[1][0] * matrixB[0][0]) + (matrixA[1][1] * matrixB[1][0]));\n\t\tmatrixC[1][1] = ((matrixA[1][0] * matrixB[0][1]) + (matrixA[1][1] * matrixB[1][1]));\n\t}", "public T mul(T first, T second);", "public static double[][] matrixMultiplier(double[][] A, double[][] B) {\n\n if (A[0].length != B.length) {\n System.out.println(\"ERROR MATRIX DIMENSIONS INCORRECT! A: \" + Integer.toString(A[0].length) + \" B: \" + Integer.toString(B.length) + \"\\nSHUTTING DOWN PROGRAM\");\n System.exit(0);\n }\n\n double[][] C = new double[A.length][B[0].length];\n for (int i = 0; i < A.length; i++) {\n for (int j = 0; j < B[0].length; j++) {\n C[i][j] = 0;\n }\n }\n\n for (int i = 0; i < A.length; i++) {\n for (int j = 0; j < B[0].length; j++) {\n for (int k = 0; k < A[0].length; k++) {\n C[i][j] += A[i][k] * B[k][j];\n }\n }\n }\n return C;\n }", "public Matrix times(Matrix B) throws JPARSECException {\n if (B.m != n) {\n throw new JPARSECException(\"Matrix inner dimensions must agree.\");\n }\n Matrix X = new Matrix(m,B.n);\n double[][] C = X.getArray();\n double[] Bcolj = new double[n];\n for (int j = 0; j < B.n; j++) {\n for (int k = 0; k < n; k++) {\n Bcolj[k] = B.data[k][j];\n }\n for (int i = 0; i < m; i++) {\n double[] Arowi = data[i];\n double s = 0;\n for (int k = 0; k < n; k++) {\n s += Arowi[k]*Bcolj[k];\n }\n C[i][j] = s;\n }\n }\n return X;\n }", "public Matrix mult(Matrix MatrixB) {\n\t\tDouble[][] newValue = new Double[row][MatrixB.col()];\r\n\t\tVector[] MatBcol = MatrixB.getCol();\r\n\t\t\r\n\r\n\t\tfor (int x = 0; x < row; x++) {\r\n\t\t\tfor (int y = 0; y < MatrixB.col(); y++) {\r\n\t\t\t\tVector rowVecI = rowVec[x];\r\n\t\t\t\tVector colVecI = MatBcol[y];\r\n\t\t\t\tnewValue[x][y] = rowVecI.DotP(colVecI);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Matrix(newValue);\r\n\t}", "public void multiply() {\n\t\t\n\t}", "private static int[][] sparseMatrixMultiplyBruteForce (int[][] A, int[][] B) {\n int[][] result = new int[A.length][B[0].length];\n\n for(int i = 0; i < result.length; i++) {\n for(int j = 0; j < result[0].length; j++) {\n int sum = 0;\n for(int k = 0; k < A[0].length; k++) {\n sum += A[i][k] * B[k][j];\n }\n result[i][j] = sum;\n }\n }\n return result;\n }", "public Matrix multiply(Matrix b) {\n MultMatrix multCommand = new MultMatrix();\n Matrix result = multCommand.multiply(this, b);\n\n return result;\n }", "public static void testMulRecStrassen() {\n\n try {\n\n Matrix m1 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m2 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m3 = Matrix.strassen(m1, m2);\n\n System.out.println(m3);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public String multiply()\r\n {\r\n\r\n return First.multiply(Second).stripTrailingZeros().toString();\r\n }", "public void matrixMultiply(Matrix m) {\n if (cols == m.getRows()) {\n ArrayList<double[]> result = newMatrix(rows, m.getCols());\n for (int i=0; i<rows; i++) {\n for (int k=0; k<m.getCols(); k++) {\n double sum = 0;\n for (int j=0; j<cols; j++) {\n sum += matrix.get(i)[j] * m.get(j, k);\n }\n result.get(i)[k] = sum;\n }\n }\n setMatrix(result, rows, m.getCols()); // Rows is that of original matrix, Columns is that of the multiplying matrix\n }\n else {\n throw new MatrixMultiplicationDimensionException();\n }\n }", "public void leftMultiply(Matrix other){\n \t double[][] temp = new double[4][4];\n //record copy of this matrix \n\tfor (int i = 0; i < 4; i++) {\n\t for (int j = 0; j < 4; j++) {\n\t\ttemp[i][j] = array[i][j];\n\t }\n\t}\n\t//user copy of matrix to left multiply while writing dot products into matrix values\n\tfor (int i = 0; i < 4; i++) {\n\t for (int j = 0; j < 4; j++) {\n\t\tarray[i][j] = 0;\n\t\tfor (int k = 0 ; k < 4 ; k++) {\n\t\t array[i][j] += temp[i][k] * other.array[k][j];\n\t\t}\n\t }\n\t}\n }", "public static <T extends Vector> T Multiply(T a, T b,T result){\n if(Match(a,b)) {\n for (int i = 0; i < result.axis.length; i++) {\n result.axis[i] = a.axis[i] * b.axis[i];\n }\n return result;\n }\n return result;\n }", "private static void directProd(DMatrixRMaj a, DMatrixRMaj b, DMatrixRMaj c) {\n for (int i=0; i<5; ++i) {\n for (int j=0; j<5; ++j) {\n c.unsafe_set(i, j, a.unsafe_get(i, 0)*b.unsafe_get(j, 0));\n }\n }\n }", "static float[] mulMM(float[] m1, float[] m2){\n \t\n \t\tif(m1.length != 16 || m2.length != 16){\n \t\t\tthrow new IllegalArgumentException();\n \t\t}\n \t\n float[] result = new float[16];\n for(int i = 0; i < 4; i++){ \n for(int j = 0; j < 4; j++){ \n float rij = 0;\n for(int k = 0; k < 4; k++){\n rij += m1[j*4+k] * m2[i+4*k];\n }\n// result[i*4+j] = rij;\n result[i+j*4] = rij;\n }\n }\n return result;\n }", "public byte[][] multiplyMatricesFiniteField(byte[][] m1, byte[][] m2) {\n\n byte[][] result = new byte[m1.length][m2[0].length];\n\n int rows = m1.length;\n int cols = m2[0].length;\n\n for(int i = 0; i < rows; i++) {\n int sum = 0;\n for(int j = 0; j < cols; j++) {\n for(int k = 0; k < 4; k++) {\n sum ^= multiplyPolynomialsMod(m1[i][k],m2[k][j], reductionPolynomial);\n }\n result[i][j] = (byte)sum;\n }\n }\n\n return result;\n }", "public void multiply()\r\n {\r\n resultDoubles = Operations.multiply(leftOperand, rightOperand);\r\n resultResetHelper();\r\n }", "public static ArrayList<Float> mathematicalMultiply(ArrayList<Float> firstWave, ArrayList<Float> secondWave) {\r\n ArrayList<Float> newWave = new ArrayList<>();\r\n int size = getSize(firstWave,secondWave);\r\n for (int i = 0; i < size; i++) {\r\n newWave.add(i, firstWave.get(i) * secondWave.get(i));\r\n }\r\n return newWave;\r\n }", "public Matrix times(Matrix bmat){\r\n \tif(this.ncol!=bmat.nrow)throw new IllegalArgumentException(\"Nonconformable matrices\");\r\n\r\n \tMatrix cmat = new Matrix(this.nrow, bmat.ncol);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n \tdouble sum = 0.0D;\r\n\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<bmat.ncol; j++){\r\n \t\tsum=0.0D;\r\n \t\tfor(int k=0; k<this.ncol; k++){\r\n \t\t\tsum += this.matrix[i][k]*bmat.matrix[k][j];\r\n \t\t}\r\n \t\tcarray[i][j]=sum;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}", "public T mult( T B ) {\n convertType.specify(this, B);\n\n // Look to see if there is a special function for handling this case\n if (this.mat.getType() != B.getType()) {\n Method m = findAlternative(\"mult\", mat, B.mat, convertType.commonType.getClassType());\n if (m != null) {\n T ret = wrapMatrix(convertType.commonType.create(1, 1));\n invoke(m, this.mat, B.mat, ret.mat);\n return ret;\n }\n }\n\n // Otherwise convert into a common matrix type if necessary\n T A = convertType.convert(this);\n B = convertType.convert(B);\n\n T ret = A.createMatrix(mat.getNumRows(), B.getMatrix().getNumCols(), A.getType());\n\n A.ops.mult(A.mat, B.mat, ret.mat);\n\n return ret;\n }", "public void testMultiply() {\r\n System.out.println(\"Multiply\");\r\n Double [][] n = new Double[][]{{-3., -2.5, -1., 0., 1., 2., 3.4, 3.5, 1.1E100, -1.1E100}, \r\n {-3., 2.5, 0., 0., 1., -2., 3., 3.7, 1.1E100, 1.1E100}, \r\n {9., -6.25, 0., 0., 1., -4., 10.2, 12.95, 1.21E200, -1.21E200}};\r\n for(int i = 0; i < 10; i++){\r\n Double x = n[0][i];\r\n Double y = n[1][i];\r\n double expResult = n[2][i];\r\n double result = MathOp.Multiply(x, y);\r\n assertEquals(expResult, result, 0.001);\r\n }\r\n }", "private void mul() {\n\n\t}", "abstract int multiplication(int num1, int num2);", "public void multiply(double skalar) {\r\n for (int i = 0; i < matrix.length; i++) {\r\n for (int j = 0; j < matrix[0].length; j++) {\r\n matrix[i][j] *= skalar;\r\n }\r\n }\r\n }", "@SuppressWarnings(\"UnnecessaryLocalVariable\")//Readability\n public Matrix multiply(Matrix b, BigInteger modulo) {\n if (nrOfCols != b.nrOfRows) {\n throw new MalformedMatrixException(\"Matrix with dimensions \" + nrOfRows + \"x\" + nrOfCols +\n \" cannot be multiplied with matrix with dimensions \" + b.nrOfRows + \"x\" + b.nrOfCols);\n }\n Matrix a = this;\n\n int m = a.nrOfRows;\n int p = b.nrOfCols;\n\n final BigInteger[][] result = new BigInteger[m][p];\n\n //Compute the resulting row, using a parallel stream to properly utilize multi-core CPU\n IntStream range = IntStream.range(0, m);\n if (concurrent) {\n range = range.parallel();\n }\n range.forEach(computeRowMultiplication(result, a, b, modulo));\n\n return new Matrix(result);\n }", "Matrix( Vector a, Vector b )\n {\n x = b.times(a.x);\n y = b.times(a.y);\n z = b.times(a.z);\n }", "int multiply (int a, int b) {\n\t\t//let me do it in one step\n\t\treturn a * b; \n\t\t\n\t\t\n\t}", "public double multiply(Coordinate other) {\n return _coord * other._coord;\n }", "public static Transform mult(Transform t1, Transform t2) {\n\t\treturn transpose(t1.a * t2.a + t1.c * t2.b, t1.a * t2.c + t1.c * t2.d, t1.a * t2.tx + t1.c * t2.ty + t1.tx,\n\t\t\t\t\t\t t1.b * t2.a + t1.d * t2.b, t1.b * t2.c + t1.d * t2.d, t1.b * t2.tx + t1.d * t2.ty + t1.ty);\n\t}", "public Matrix times(double[][] bmat){\r\n \t int nr=bmat.length;\r\n \tint nc=bmat[0].length;\r\n\r\n \tif(this.ncol!=nr)throw new IllegalArgumentException(\"Nonconformable matrices\");\r\n\r\n \tMatrix cmat = new Matrix(this.nrow, nc);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n \tdouble sum = 0.0D;\r\n\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tsum=0.0D;\r\n \t\tfor(int k=0; k<this.ncol; k++){\r\n \t\t\tsum += this.matrix[i][k]*bmat[k][j];\r\n \t\t}\r\n \t\tcarray[i][j]=sum;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}", "Matrix scalarMult(double x){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n itRow.moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(i, c.column, (x*c.value));\n itRow.moveNext();\n }\n }\n\n return newM;\n }", "public Matriz punto(Matriz B) {\n\t\tMatriz A = this;\n\t\tif (A.getColumnas() != B.getFilas()) { throw new RuntimeException(\"Dimensiones no compatibles.\"); }\n\t\t\n\t\tMatriz C = new Matriz(A.getFilas(), B.getColumnas());\n\t\tfor (int i = 0 ; i < C.getFilas() ; i++) {\n\t\t\tfor (int j = 0 ; j < C.getColumnas() ; j++) {\n\t\t\t\tfor (int k = 0 ; k < A.getColumnas() ; k++) {\n\t\t\t\t\tC.setValor(i, j, C.getValor(i, j) + (A.getValor(i, k) * B.getValor(k, j)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn C;\n\t}", "public long[][] smultiply(int i){\n\t\tint sl = this.mat.length; //jumps to method sideLength to obtain the side length n of the matrix A\n\t\t//the global record contains an array of columns, where each column is an array of row elements. i.e.\n\t\t//the record contains the transpose of matrix A, where every row in the record is a column in A\n\t\t//a temporary 2D array tempMatA, and is made equal to the transpose of A\n\t\tlong[][] tempMatA = transpose(this.mat);\n\t\tlong[][] tempMat2 = new long[sl][sl]; //creates a temporary 2D matrix of the same size as tempMatA\n\t\tlong[][] outMat = new long[sl][sl];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"+\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\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\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//return matrix must be re-transposed to return a the proper format of 2D array for the global array\n\t\toutMat = transpose(outMat);\n\t\treturn outMat;\n\t}", "public Matrix multiply(BigInteger c, BigInteger modulo) {\n Stream<BigInteger[]> stream = Arrays.stream(inner);\n if (concurrent) {\n stream = stream.parallel();\n }\n\n BigInteger[][] res = stream.map(r -> rowMultiplyConstant(r, c, modulo)).toArray(BigInteger[][]::new);\n\n return new Matrix(res);\n }", "public int multiplication(int a, int b) {\n return a * b;\n }", "@Override\n\tpublic double multiply(double in1, double in2) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic double multiply(double a, double b) {\n\t\treturn (a*b);\n\t}", "public static float[] multiply(float[] a, float[] b) {\n float[] tmp = new float[16];\n glMultMatrixf(FloatBuffer.wrap(a), FloatBuffer.wrap(b), FloatBuffer.wrap(tmp));\n return tmp;\n }", "public static void main(String[] args) {\n\r\n\t\tMatrices1 matrix = new Matrices1(10, 3);\r\n\t\tMatrices1 matrix2 = new Matrices1(3, 1);\r\n\t\t\r\n\r\n\t\tmatrix.initialize(matrix.array);\r\n\t\tmatrix2.initialize(matrix2.array);\r\n\t\t\r\n\t\tdouble [][]output=Matrices1.matrixProduct(matrix.array, matrix2.array, matrix.row1, matrix2.column1, matrix.column1);\r\n\t\tfor (int i = 0; i < matrix.row1; i++) {\r\n\t\t\tfor (int j = 0; j < matrix2.column1; j++) {\r\n\t\t\t\tSystem.out.println(output[i][j]);\r\n\t\t\t}//end of forloop\r\n\t\t}//end of forloop\r\n\t}", "public double multiplica(double a, double b) {\n\t\treturn a*b;\n\t}", "public CLImage2D multiply(CLImage2D in1, CLImage2D in2) {\n\t\treturn process(multiplyImage, in1, in2);\n\t}", "@Override\r\n\tpublic int mul(int a,int b) {\n\t\treturn a*b;\r\n\t}", "public static BigFraction[][] multiply(BigFraction[][] A, BigFraction[][] B) {\n int mA = A.length;\n int nA = A[0].length;\n int mB = B.length;\n int nB = B[0].length;\n if (nA != mB) throw new RuntimeException(\"Illegal matrix dimensions.\");\n BigFraction[][] C = new BigFraction[mA][nB];\n for (int i = 0; i < mA; i++)\n for (int j = 0; j < nB; j++)\n for (int k = 0; k < nA; k++)\n C[i][j] = (A[i][k].multiply(B[k][j]));\n return C;\n }", "public int multiply(int x, int y) {\n int n1 = x; //n1 = c_n * 2^n + c_n-1 * 2^n-1 + ... + c_1 * 2 + c_0 * 1 where c_i = {0, 1} \n int n2 = y; //n2 = c_m * 2^m + c_m-1 * 2^m-1 + ... + c_1 * 2 + c_0 * 1 where c_i ] {0, 1}\n int sum = 0; //named sum b/c represent the product of n1 and n2 as the sum of their constituent parts\n /*\n let n1 be rep as in its binary form (***...***) a bit string\n n1*n2 = (***...***)(c_m * 2^m + ... + c_0 * 1)\n = (***...***)(c_0 * 1) + (***...***)(c_1 * 2) + ... + (***...***)(c_m * 2^m)\n since << has the effect of multiplying a number by 2, can rep as\n = (***...***)(c_0 * 1) + (***...***)(c_1 * 1) << 1 + (***...***)(c_2 * 1) << 2 + ... + (***...***)(c_m * 1) << m\n so for each loop through a loop left shift n1 by one to simulate multiplying the next term by 2\n also right shift n2 to find c_i, the value of the bit in the bit string n2\n */\n while (n2 != 0) { // if n2 == 0 run through the length of n2 and nothing left to do\n if ((n2 & 1) == 0) { //find the last bit of n2; if it is 0 then do nothing because the n1 term will be multiplied by 0\n } else {//else it is 1 so add n1 to the sum\n sum = add(sum, n1); //bitwise addition has already been defined (implemented)\n }\n n1 = n1 << 1; //leftshift n1 to mult by 2; see above comments\n n2 = n2 >>> 1; //rightshift n2 to find value of next bit in bit string\n }\n return sum;\n }", "public synchronized void matrixMultiplication(cl_mem matrixA, cl_mem matrixB, cl_mem matrixC, \r\n int widthA, int heightA, int widthB) {\r\n confirmActiveState();\r\n \r\n clSetKernelArg(kernelMatrixMultiplication, 1, Sizeof.cl_mem, Pointer.to(matrixB));\r\n clSetKernelArg(kernelMatrixMultiplication, 0, Sizeof.cl_mem, Pointer.to(matrixA));\r\n clSetKernelArg(kernelMatrixMultiplication, 2, Sizeof.cl_mem, Pointer.to(matrixC));\r\n clSetKernelArg(kernelMatrixMultiplication, 3, Sizeof.cl_int, Pointer.to(new int[] {widthA}));\r\n clSetKernelArg(kernelMatrixMultiplication, 4, Sizeof.cl_int, Pointer.to(new int[] {widthB}));\r\n\r\n long globalThreads[] = new long[] {widthB, heightA};\r\n clEnqueueNDRangeKernel(commandQueue, kernelMatrixMultiplication, \r\n 2, null, globalThreads, null, 0, null, null);\r\n }", "@Override\n\tpublic float multiplicar(float op1, float op2) {\n\t\treturn op1 * op2;\n\t}", "public <I extends Image<?, I>> I multiply(I in1, I in2) {\n\t\tCLQueue queue = context.createDefaultQueue();\n\t\t\n\t\tCLImage2D clin1 = CLImageConversion.convert(context, in1);\n\t\tCLImage2D clin2 = CLImageConversion.convert(context, in2);\n\t\tCLImage2D clout = context.createImage2D(CLMem.Usage.Output, clin1.getFormat(), clin1.getWidth(), clin1.getHeight());\n\t\t\n\t\tCLEvent evt = process(multiplyImage, queue, clin1, clin2, clout);\n\t\t\n\t\tI out = CLImageConversion.convert(queue, evt, clout, in1.newInstance(in1.getWidth(), in1.getHeight()));\n\t\t\n\t\tclin1.release();\n\t\tclin2.release();\n\t\tclout.release();\n\t\tqueue.release();\n\t\t\n\t\treturn out;\n\t}", "public void MatrixChainMultiply(int[] p) {\n n = p.length - 1;\t// how many matrices are in the chain\n m = new int[n + 1][n + 1];\t// overallocate m, so that we don't use index 0\n s = new int[n + 1][n + 1];\t// same for s\n matrixChainOrder(p);\t// run the dynamic-programming algorithm\n }", "private static AffineTransform3D MatrixMult(AffineTransform3D matLeft,\r\n\t\t\tAffineTransform3D matRight) {\r\n\r\n\t\tAffineTransform3D m = new AffineTransform3D();\r\n\t\tm.M11 = (matRight.M11 * matLeft.M11) + (matRight.M21 * matLeft.M12)\r\n\t\t\t\t+ (matRight.M31 * matLeft.M13) + (matRight.M41 * matLeft.M14);\r\n\t\tm.M12 = (matRight.M12 * matLeft.M11) + (matRight.M22 * matLeft.M12)\r\n\t\t\t\t+ (matRight.M32 * matLeft.M13) + (matRight.M42 * matLeft.M14);\r\n\t\tm.M13 = (matRight.M13 * matLeft.M11) + (matRight.M23 * matLeft.M12)\r\n\t\t\t\t+ (matRight.M33 * matLeft.M13) + (matRight.M43 * matLeft.M14);\r\n\t\tm.M14 = (matRight.M14 * matLeft.M11) + (matRight.M24 * matLeft.M12)\r\n\t\t\t\t+ (matRight.M34 * matLeft.M13) + (matRight.M44 * matLeft.M14);\r\n\t\tm.M21 = (matRight.M11 * matLeft.M21) + (matRight.M21 * matLeft.M22)\r\n\t\t\t\t+ (matRight.M31 * matLeft.M23) + (matRight.M41 * matLeft.M24);\r\n\t\tm.M22 = (matRight.M12 * matLeft.M21) + (matRight.M22 * matLeft.M22)\r\n\t\t\t\t+ (matRight.M32 * matLeft.M23) + (matRight.M42 * matLeft.M24);\r\n\t\tm.M23 = (matRight.M13 * matLeft.M21) + (matRight.M23 * matLeft.M22)\r\n\t\t\t\t+ (matRight.M33 * matLeft.M23) + (matRight.M43 * matLeft.M24);\r\n\t\tm.M24 = (matRight.M14 * matLeft.M21) + (matRight.M24 * matLeft.M22)\r\n\t\t\t\t+ (matRight.M34 * matLeft.M23) + (matRight.M44 * matLeft.M24);\r\n\t\tm.M31 = (matRight.M11 * matLeft.M31) + (matRight.M21 * matLeft.M32)\r\n\t\t\t\t+ (matRight.M31 * matLeft.M33) + (matRight.M41 * matLeft.M34);\r\n\t\tm.M32 = (matRight.M12 * matLeft.M31) + (matRight.M22 * matLeft.M32)\r\n\t\t\t\t+ (matRight.M32 * matLeft.M33) + (matRight.M42 * matLeft.M34);\r\n\t\tm.M33 = (matRight.M13 * matLeft.M31) + (matRight.M23 * matLeft.M32)\r\n\t\t\t\t+ (matRight.M33 * matLeft.M33) + (matRight.M43 * matLeft.M34);\r\n\t\tm.M34 = (matRight.M14 * matLeft.M31) + (matRight.M24 * matLeft.M32)\r\n\t\t\t\t+ (matRight.M34 * matLeft.M33) + (matRight.M44 * matLeft.M34);\r\n\t\tm.M41 = (matRight.M11 * matLeft.M41) + (matRight.M21 * matLeft.M42)\r\n\t\t\t\t+ (matRight.M31 * matLeft.M43) + (matRight.M41 * matLeft.M44);\r\n\t\tm.M42 = (matRight.M12 * matLeft.M41) + (matRight.M22 * matLeft.M42)\r\n\t\t\t\t+ (matRight.M32 * matLeft.M43) + (matRight.M42 * matLeft.M44);\r\n\t\tm.M43 = (matRight.M13 * matLeft.M41) + (matRight.M23 * matLeft.M42)\r\n\t\t\t\t+ (matRight.M33 * matLeft.M43) + (matRight.M43 * matLeft.M44);\r\n\t\tm.M44 = (matRight.M14 * matLeft.M41) + (matRight.M24 * matLeft.M42)\r\n\t\t\t\t+ (matRight.M34 * matLeft.M43) + (matRight.M44 * matLeft.M44);\r\n\r\n\t\treturn m;\r\n\t}", "public static Rational multiply(Rational num1, Rational num2){\r\n Rational product = new Rational();\r\n \r\n // multiply throughout\r\n product.denominator = num1.getDenominator() * num2.getDenominator();\r\n product.numerator = num1.getNumerator() * num2.getNumerator();\r\n \r\n product.reduce();\r\n return product;\r\n }", "public void multiplyTwoNumbers(int num1, int num2) {\n\t\t\n\t\tint product = num1*num2; //A\n\t\tSystem.out.println(\"**************************************************************\");\n\t\tSystem.out.println(\"Product of these 2 numbers is: \"+product);\n\t\tint remainder = getRemainder(num1, num2); //C\n\t\tint finalResult = product+remainder; //B\n\t\tSystem.out.println(\"Final Result of these 2 numbers is: \"+ finalResult);\n\t\n\t\t\n\t}", "public final void mul() {\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tpush(secondTopMostValue * topMostValue);\n\t\t}\n\t}", "private static void multMatVect(double[] v, double[][] A, double m1,\n double[][] B, double m2) {\n double[] vv = new double[3];\n for(int i = 0; i < 3; i++)\n vv[i] = v[i];\n ArithmeticMod.matVecModM(A, vv, vv, m1);\n for(int i = 0; i < 3; i++)\n v[i] = vv[i];\n\n for(int i = 0; i < 3; i++)\n vv[i] = v[i + 3];\n ArithmeticMod.matVecModM(B, vv, vv, m2);\n for(int i = 0; i < 3; i++)\n v[i + 3] = vv[i];\n }", "public static void main(String[] args) {\n int mat1[][]=new int[3][3];\n int mat2[][]=new int[3][3];\n int ans[][]=new int[3][3];\n Scanner sc=new Scanner(System.in);\n \n //input values\n for(int i=0;i<3;i++) {\n \t for(int j=0;j<3;j++) {\n \t\t System.out.println(\"Enter mat1[\"+i+\"][\"+j+\"] : \");\n \t\t mat1[i][j]= sc.nextInt();\n \t }\n }\n for(int i=0;i<3;i++) {\n \t for(int j=0;j<3;j++) {\n \t\t System.out.println(\"Enter mat2[\"+i+\"][\"+j+\"] : \");\n \t\t mat2[i][j]= sc.nextInt();\n \t }\n }\n \n System.out.println(\"Matrix 1 is :\");\n for(int i=0;i<3;i++) {\n \t for(int j=0;j<3;j++) {\n \t\t System.out.print(mat1[i][j]+\" \");\n \t }\n \t System.out.println(\"\\n\");\n }\n \n System.out.println(\"\\nMatrix 2 is :\");\n for(int i=0;i<3;i++) {\n \t for(int j=0;j<3;j++) {\n \t\t System.out.print(mat2[i][j]+\" \");\n \t }\n \t System.out.println(\"\\n\");\n }\n \n //Multiplication\n for(int i=0;i<3;i++) {\n \t for(int j=0;j<3;j++) {\n \t\tans[i][j]=0;\n \t\tfor(int k=0;k<3;k++) {\n \t\t\tans[i][j]+=mat1[i][k]*mat2[k][j];\n \t\t}\n \t }\n }\n \n System.out.println(\"\\nMatrix Multiplication is :\");\n for(int i=0;i<3;i++) {\n \t for(int j=0;j<3;j++) {\n \t\t System.out.print(ans[i][j]+\" \");\n \t }\n \t System.out.println(\"\\n\");\n }\n sc.close();\n\t}", "private static int[][] sparseMatrixMultiplyBestCase(int[][] A, int[][] B) {\n int[][] result = new int[A.length][B[0].length];\n\n for(int i = 0; i < result.length; i++) {\n for(int k = 0; k < A[0].length; k++) {\n if(A[i][k] != 0) {\n for(int j = 0; j < result[0].length; j++) {\n result[i][j] += A[i][k] * B[k][j];\n }\n }\n }\n }\n return result;\n }", "public int multiplicationFunction(int a, int b) {\n return a*b;\n }", "@Override\r\n\tpublic void mul(int x, int y) {\n\t\t\r\n\t}", "public int multiply(int a,int b) throws RemoteException;", "public final void mul(Matrix3f m1, Matrix3f m2) {\n\t// alias-safe way.\n\tset(\n\t m1.m00*m2.m00 + m1.m01*m2.m10 + m1.m02*m2.m20,\n\t m1.m00*m2.m01 + m1.m01*m2.m11 + m1.m02*m2.m21,\n\t m1.m00*m2.m02 + m1.m01*m2.m12 + m1.m02*m2.m22,\n\n\t m1.m10*m2.m00 + m1.m11*m2.m10 + m1.m12*m2.m20,\n\t m1.m10*m2.m01 + m1.m11*m2.m11 + m1.m12*m2.m21,\n\t m1.m10*m2.m02 + m1.m11*m2.m12 + m1.m12*m2.m22,\n\n\t m1.m20*m2.m00 + m1.m21*m2.m10 + m1.m22*m2.m20,\n\t m1.m20*m2.m01 + m1.m21*m2.m11 + m1.m22*m2.m21,\n\t m1.m20*m2.m02 + m1.m21*m2.m12 + m1.m22*m2.m22\n\t );\n }", "public static NumberP Multiplication(NumberP first, NumberP second)\n {\n return OperationsManaged.PerformArithmeticOperation\n (\n first, second, ExistingOperations.Multiplication\n ); \t\n }", "public static double multiply(int left, int right){\n return left * right;\n }", "@Override\r\n\tpublic int mul() {\n\t\treturn 0;\r\n\t}", "public int[][] denseMatrixMult(int[][] A, int[][] B, int size)\n {\n\t int[][] matrix = initMatrix(size);\n\t \n\t // base case\n\t // Just multiply the two numbers in the matrix.\n\t if (size==1) {\n\t\t matrix[0][0] = A[0][0]*B[0][0];\n\t\t return matrix;\n\t }\n\t \n\t // If the base case is not satisfied, we must do strassens. \n\t // Get M0-M6\n\t //a00: x1 = 0, y1 = 0\n\t //a01: x1 = 0; y1 = size/2\n\t //a10: x1 = size/2, y1 = 0\n\t //a11: x1 = size/2,. y1 = size/2\n\t \n\t // (a00+a11)*(b00+b11)\n\t int[][] m0 = denseMatrixMult(sum(A,A,0,0,size/2,size/2,size/2), sum(B,B, 0,0,size/2,size/2,size/2), size/2);\n\t // (a10+a11)*(B00)\n\t int[][] m1 = denseMatrixMult(sum(A,A,size/2,0,size/2,size/2,size/2), sum(B, initMatrix(size/2), 0,0,0,0,size/2), size/2);\n\t //a00*(b01-b11)\n\t int[][] m2 = denseMatrixMult(sum(A, initMatrix(size/2), 0,0,0,0,size/2), sub(B, B, 0, size/2, size/2, size/2, size/2), size/2);\n\t //a11*(b10-b00)\n\t int[][] m3 = denseMatrixMult(sum(A,initMatrix(size/2), size/2, size/2, 0,0,size/2), sub(B,B,size/2,0,0,0,size/2), size/2);\n\t //(a00+a01)*b11\n\t int[][] m4 = denseMatrixMult(sum(A,A,0,0,0,size/2,size/2), sum(B, initMatrix(size/2), size/2, size/2,0,0,size/2), size/2);\n\t //(a10-a00)*(b00+b01)\n\t int[][] m5 = denseMatrixMult(sub(A,A,size/2,0,0,0,size/2), sum(B,B,0,0,0,size/2,size/2), size/2);\n\t //(a01-a11)*(b10-b11)\n\t int[][] m6 = denseMatrixMult(sub(A,A,0,size/2,size/2,size/2,size/2), sum(B,B,size/2,0,size/2,size/2,size/2), size/2);\n\t \n\t // Now that we have these, we can get C00 to C11\n\t // m0+m3 + (m6-m4)\n\t int[][] c00 = sum(sum(m0,m3,0,0,0,0,size/2), sub(m6,m4,0,0,0,0,size/2), 0,0,0,0, size/2);\n\t // m2 + m4\n\t int[][] c01 = sum(m2,m4,0,0,0,0,size/2);\n\t // m1 + m3\n\t int[][] c10 = sum(m1,m3,0,0,0,0,size/2);\n\t // m0-m1 + m2 + m5\n\t int[][] c11 = sum(sub(m0,m1,0,0,0,0,size/2), sum(m2,m5,0,0,0,0,size/2), 0,0,0,0,size/2);\n\t \n\t // Load the results into the return array.\n\t // We are \"stitching\" the four subarrays together. \n\t for (int i = 0; i< size; i++) {\n\t\t for (int j = 0; j<size; j++) {\n\t\t\t if (i<size/2) {\n\t\t\t\t if (j<size/2) {\n\t\t\t\t\t matrix[i][j] = c00[i][j];\n\t\t\t\t } else {\n\t\t\t\t\t matrix[i][j] = c01[i][j-size/2];\n\t\t\t\t }\n\t\t\t } else {\n\t\t\t\t if (j<size/2) {\n\t\t\t\t\t matrix[i][j] = c10[i-size/2][j];\n\t\t\t\t } else {\n\t\t\t\t\t matrix[i][j] = c11[i-size/2][j-size/2];\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n\t \n\t // return the matrix we made.\n\t return matrix;\n }", "public static UnitP Multiplication(UnitP first, UnitP second)\n {\n return OperationsPublic.PerformUnitOperation\n (\n first, second, Operations.Multiplication,\n OperationsOther.GetOperationString(first, second, Operations.Multiplication) \n );\n }" ]
[ "0.77890205", "0.7500587", "0.7454777", "0.7447289", "0.7378319", "0.7291569", "0.7285535", "0.72698116", "0.7244799", "0.7212367", "0.7169227", "0.7134624", "0.7118809", "0.7058964", "0.7047968", "0.7036611", "0.70020866", "0.70020175", "0.69796306", "0.6944863", "0.69391423", "0.69128835", "0.6885802", "0.6885504", "0.6885313", "0.6847846", "0.6801454", "0.6742374", "0.6688275", "0.66810703", "0.6680977", "0.6644722", "0.6635568", "0.660699", "0.66006136", "0.65518075", "0.65403044", "0.6526781", "0.65216935", "0.6521534", "0.6505914", "0.6484194", "0.6474321", "0.6455619", "0.6413572", "0.6380359", "0.6366619", "0.6354311", "0.6348906", "0.63437164", "0.6342804", "0.63156974", "0.6301132", "0.62955695", "0.6292819", "0.62812006", "0.62459695", "0.6242374", "0.62408835", "0.62208486", "0.6216692", "0.6215274", "0.62127817", "0.62031543", "0.6183578", "0.61662054", "0.6162691", "0.6159631", "0.6153733", "0.61522126", "0.6146992", "0.61365235", "0.6127238", "0.6125641", "0.6114132", "0.61120456", "0.6109895", "0.6094813", "0.60820276", "0.60709643", "0.60600054", "0.60548574", "0.60385644", "0.60366106", "0.60132563", "0.6001595", "0.59955764", "0.5976425", "0.59761494", "0.59619", "0.59498924", "0.5949371", "0.5944034", "0.5943471", "0.59331137", "0.5928446", "0.5908695", "0.58860385", "0.58831805", "0.5878194" ]
0.74046063
4
TODO Autogenerated method stub
@Override public void onActionCallback(boolean result, Object object) { if (result) { msgList = (List<XmppMessage>) object; RefreshAdapter(); } }
{ "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 onStart() { super.onStart(); }
{ "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 onUpdate() { super.onUpdate(); }
{ "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
Pointbypoint Gaussian filter application
public void applyFilterAtPoint(int x, int y, BufferedImage imgIn, BufferedImage imgOut) { double dltX = 0; double dltY = 0; for(int i_x = -getMargin(); i_x <= getMargin(); i_x++) { for(int i_y = -getMargin(); i_y <= getMargin(); i_y++) { int rgb = imgIn.getRGB(x + i_x, y + i_y); int blue = (rgb) & 0x000000FF; double V_ = blue * Math.exp(-0.25 * (Math.pow(i_x, 2) + Math.pow(i_y, 2))); dltX += Integer.signum(i_x) * V_; dltY += Integer.signum(i_y) * V_; } } double N_ = Math.sqrt(Math.pow(dltX, 2) + Math.pow(dltY, 2)); double V_ = 255.0 - 0.5 * N_; int V_grey = (int) Math.round(Math.max(0.0d, V_)); imgOut.setRGB(x - this.getMargin() , y - this.getMargin(), new Color(V_grey, V_grey, V_grey).getRGB()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void gaussianSmooth(double[] img, int width, int height, double sigma) {\n\t\tint radius = (int)Math.sqrt((6.908)*(2*sigma*sigma));\n\t\t// compute coefficients of the gaussian filter\n\t\tdouble[] filter = new double[2*radius+1];\n\t\tdouble filtersum = 0;\n\n\t\tfor(int i=-radius;i<=radius;i++) {\n\t\t\tdouble g = gaussian(i,sigma);\n\t\t\tfilter[i+radius]=g;\n\t\t\tfiltersum+=g;\n\t\t}\n\n\t\tfor(int i=-radius;i<=radius;i++) {\n\t\t\tfilter[i+radius]=filter[i+radius]/(2*filtersum);//2 since 1D-filter will be used in x and y directions\n\t\t}\n\n\t\tconvolveInX(img, width, height, filter, radius);\n\t\tconvolveInY(img, width, height, filter, radius);\n\n\t}", "public void gaussianSmooth(Img i, double sigma) {\n int half = (int) (sigma * Math.sqrt(6 * Math.log(10)));\n int size = 1 + 2 * half;\n System.out.printf(\"Size: %d\\n\", size);\n double[] mask = new double[size];\n double mask_sum = 0;\n for (int k = 0; k <= half; k++) {\n double value = Math.exp(-k * k / (2 * sigma * sigma)) / (sigma * Math.sqrt(2 * Math.PI));\n mask_sum += (k == 0) ? value : value * 2;\n mask[half + k] = value;\n mask[half - k] = value;\n }\n // normalize the mask\n for (int k = 0; k < size; k++) {\n mask[k] = mask[k] / mask_sum;\n }\n System.out.printf(\"Mask: %s\\n\", Arrays.toString(mask));\n\n // 2D convolution using 1D mask in x\n double[] i_temp = new double[i.img.length];\n for (int x = 0; x < i.img.length; x++) {\n i_temp[x] = (double) (i.img[x] & 0xFF);\n }\n for (int x = half; x < i.height - half; x++) {\n for (int y = half; y < i.width - half; y++) {\n i_temp[x * i.width + y] = 0;\n for (int s = -half; s <= half; s++) {\n i_temp[x * i.width + y] += (double) (i.img[(x + s) * i.width + y] & 0xFF) * mask[half - s];\n }\n }\n }\n\n // 2D convolution using 1D mask in y\n for (int x = half; x < i.height - half; x++) {\n for (int y = half; y < i.width - half; y++) {\n double f = 0;\n for (int s = -half; s <= half; s++) {\n f += i_temp[x * i.width + y + s] * mask[half - s];\n }\n i.img[x * i.width + y] = (byte) f;\n }\n }\n }", "public static Picture gaussian(Picture picture) {\n double[][] weights = { { 1 / 16.0, 2 / 16.0, 1 / 16.0 }, { 2 / 16.0, 4 / 16.0, 2 / 16.0 },\n { 1 / 16.0, 2 / 16.0, 1 / 16.0 }, };\n return kernel(picture, weights);\n }", "public static Picture gaussian(Picture picture) {\r\n double[][] gaussina = {\r\n {1.0/16, 2.0/16, 1.0/16},\r\n {2.0/16, 4.0/16, 2.0/16},\r\n {1.0/16, 2.0/16, 1.0/16}\r\n };\r\n return transform(picture, gaussina);\r\n }", "public Position sampleRandomGaussianPosition();", "public void useGaussianDeviates(){\n this.gaussianDeviates = true;\n }", "public static List<Double> gaussianFilter(List<Double> listToFilter, double parameter) {\r\n int windowSize = 7;\r\n List<Double> filteredList = new ArrayList<Double>();\r\n \r\n // double firstFactor = Math.pow(parameter/Math.PI, 0.5) *\r\n // Math.pow(Math.E, -1 * parameter);\r\n \r\n for (int j = 0; j < windowSize / 2; j++) {\r\n filteredList.add(0.0);\r\n }\r\n \r\n for (int i = windowSize / 2; i < listToFilter.size() - windowSize / 2; i++) {\r\n double sumValues = 0;\r\n double sumWeight = 0;\r\n for (int j = 0; j < windowSize; j++) {\r\n double weight = Math.pow(Math.E, -1 * (j - windowSize / 2) * (j - windowSize / 2) / 2\r\n * parameter);\r\n \r\n sumWeight += weight;\r\n sumValues += weight * listToFilter.get(i);\r\n }\r\n double newValue = 1.0 / sumWeight * sumValues / sumWeight;\r\n \r\n filteredList.add(newValue);\r\n }\r\n \r\n for (int j = 0; j < windowSize / 2; j++) {\r\n filteredList.add(0.0);\r\n }\r\n \r\n return filteredList;\r\n }", "private final void probabilityFromRecursiveRidgeFilter( float[] filter, float[] shape) {\n\t\tint nb = 0;\n\t\tdouble min = 1e9;\n\t\tdouble max = 0.0;\n\t\tfor (int x=2;x<nx-2;x++) for (int y=2;y<ny-2;y++) for (int z=2;z<nz-2;z++) {\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\t\t// keep only the proper sign\n\t\t\t\tif (filter[xyz]<=0) filter[xyz] = 0.0f;\n\t\t\t\telse {\n\t\t\t\t\t// fit exp only to non-zero data\n\t\t\t\t\tnb++;\n\t\t\t\t\tmin = Numerics.min(filter[xyz], min);\n\t\t\t\t\tmax = Numerics.max(filter[xyz], max);\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t// robust measures? pb is the exponential is not steep enough\n\t\tdouble[] response = new double[nb];\n\t\tint n=0;\n\t\tfor (int x=2;x<nx-2;x++) for (int y=2;y<ny-2;y++) for (int z=2;z<nz-2;z++) {\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\t\tif (filter[xyz]>0) {\n\t\t\t\t\tresponse[n] = filter[xyz];\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t}\n\t\tPercentile measure = new Percentile();\n\t\tdouble median = measure.evaluate(response, 50.0);\n\t\tdouble beta = median/FastMath.log(2.0);\n\t\t\n\t\tBasicInfo.displayMessage(\"exponential parameter estimates: median \"+median+\", beta \"+beta+\",\\n\");\n\t\t\n\t\t// model the filter response as something more interesting, e.g. log-normal (removing the bg samples)\n\t\tdouble[] weights = new double[nb];\n\t\tfor (int b=0;b<nb;b++) { \n\t\t\tweights[b] = (1.0-FastMath.exp( -response[b]/beta));\n\t\t\tresponse[b] = FastMath.log(response[b]);\n\t\t}\n\t\t\n\t\tdouble fmean = ImageStatistics.weightedPercentile(response,weights,50.0,nb);\n\t\t\n\t\t// stdev: 50% +/- 1/2*erf(1/sqrt(2)) (~0.341344746..)\n\t\tdouble dev = 100.0*0.5*Erf.erf(1.0/FastMath.sqrt(2.0));\n\t\tdouble fdev = 0.5*(ImageStatistics.weightedPercentile(response,weights,50.0+dev,nb) - ImageStatistics.weightedPercentile(response,weights,50.0-dev,nb));\n\t\t\n\t\tBasicInfo.displayMessage(\"Log-normal parameter estimates: mean = \"+FastMath.exp(fmean)+\", stdev = \"+FastMath.exp(fdev)+\",\\n\");\n\t\t\n\t\tfor (int x=0;x<nx;x++) for (int y=0;y<ny;y++) for (int z=0;z<nz;z++){\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\tif (filter[xyz]>0) {\n\t\t\t\tdouble pe = FastMath.exp( -filter[xyz]/beta)/beta;\n\t\t\t\tdouble plg = FastMath.exp(-Numerics.square(FastMath.log(filter[xyz])-fmean)/(2.0*fdev*fdev))/FastMath.sqrt(2.0*FastMath.PI*fdev*fdev);\n\t\t\t\tshape[xyz] = (float)(plg/(plg+pe));\n\t\t\t\t//shape[xyz] = (float)(1.0-pe);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "public static double[]getDataForVoxelGaussian(ImagePlus imgIn,int xCor,int yCor,int curT,int totalT,int curZ,int totalZ,int nEchoesExpected,int crossWidth,int crossThick,boolean gaussianWeighting){\n\t\tif(gaussianWeighting) {IJ.showMessage(\"Not applicable : gaussian weighting. Abort\");gaussianWeighting=false;}\n\t\tint xMax=imgIn.getWidth();\n\t\tint yMax=imgIn.getHeight();\n\t\tint zMax=imgIn.getNSlices();\n\t\tint zCor=curZ;\n\t\tint xm,ym,xM,yM,zm,zM;\n\t\txm=xCor-crossWidth;\n\t\txM=xCor+crossWidth;\n\t\tym=yCor-crossWidth;\n\t\tyM=yCor+crossWidth;\n\t\tzm=curZ-crossThick;\n\t\tzM=curZ+crossThick;\n\t\txm=Math.max(xm, 0);\n\t\txM=Math.min(xMax-1, xM);\n\t\tym=Math.max(ym, 0);\n\t\tyM=Math.min(yMax-1, yM);\n\t\tzm=Math.max(zm, 0);\n\t\tzM=Math.min(zMax-1, zM);\n\t\tdouble[]data= new double[nEchoesExpected];\n\t\tint nHits=(xM-xm+1)*(yM-ym+1)*(zM-zm+1);\n\t\tif( (xCor>xMax-1) || (yCor>yMax-1)) {IJ.log(\"Bad coordinates. Data set to 0\"); return data;}\n\t\tdouble[][][]weights=new double[xM-xm+1][yM-ym+1][zM-zm+1];\n\t\tdouble sigmaX=crossWidth;\n\t\tdouble sigmaY=crossWidth;\n\t\tdouble sigmaZ=crossThick;\n\t\t\n\t\t\n\t\tdouble sum=0;\n\t\tfor(int x=xm;x<=xM;x++) {\n\t\t\tfor(int y=ym;y<=yM;y++) {\n\t\t\t\tfor(int z=zm;z<=zM;z++) {\t\n\t\t\t\t\tif(!gaussianWeighting)weights[x-xm][y-ym][z-zm]=1.0/nHits;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(sigmaX<=0 && sigmaZ<=0) {//One point\n\t\t\t\t\t\t\tweights[x-xm][y-ym][z-zm]=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(sigmaX<=0 && sigmaZ>0) {//Mono dimensional along z\n\t\t\t\t\t\t\tweights[x-xm][y-ym][z-zm]=1/(Math.pow(2*Math.PI,0.5)*sigmaZ) * Math.exp(- (z-zCor)*(z-zCor)/(sigmaZ*sigmaZ));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(sigmaX>0 && sigmaZ<=0) {//Two dimensional along x and y\n\t\t\t\t\t\t\tweights[x-xm][y-ym][z-zm]=1/(Math.pow(2*Math.PI,1)*sigmaX*sigmaY) * Math.exp(- (x-xCor)*(x-xCor)/(sigmaX*sigmaX) - (y-yCor)*(y-yCor)/(sigmaY*sigmaY));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {//Three dimensional gaussian\n\t\t\t\t\t\t\tweights[x-xm][y-ym][z-zm]=1/(Math.pow(2*Math.PI,1.5)*sigmaX*sigmaY*sigmaZ) * Math.exp(- (x-xCor)*(x-xCor)/(sigmaX*sigmaX) - (y-yCor)*(y-yCor)/(sigmaY*sigmaY) - (z-zCor)*(z-zCor)/(sigmaZ*sigmaZ));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsum+=weights[x-xm][y-ym][z-zm];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(gaussianWeighting) {\n\t\t\tfor(int x=xm;x<=xM;x++) {\n\t\t\t\tfor(int y=ym;y<=yM;y++) {\n\t\t\t\t\tfor(int z=zm;z<=zM;z++) {\t\n\t\t\t\t\t\tweights[x-xm][y-ym][z-zm]/=sum;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int ec=0;ec<nEchoesExpected;ec++) {\t\t\t\n\t\t\tfor(int z=zm;z<=zM;z++) {\n\t\t\t\tint indexZ=nEchoesExpected*totalZ*curT+nEchoesExpected*z+1+ec;\n\t\t\t\tfor(int x=xm;x<=xM;x++) {\n\t\t\t\t\tfor(int y=ym;y<=yM;y++) {\n\t\t\t\t\t\tdata[ec]+=weights[x-xm][y-ym][z-zm]*(double)((float[])(imgIn.getStack().getProcessor(indexZ).getPixels()))[x + xMax * y];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn data;\n\t\t\n\t}", "public void gaussianSmooth(final byte[] f, int width, int height, double sigma) {\n\t\tdouble[] img = new double[width * height];\n\t\tbyteToDouble(f, img);\n\t\tgaussianSmooth(img, width, height, sigma);\n\t\tdoubleToByte(f, img);\n\t\t//System.out.println(\"finish\");\n\t}", "private float gauss (int whatMask, int size) {\n int mu = 0;\n double sigma = 1/(size*Math.sqrt(2*Math.PI));\n return (float) (1/(sigma*Math.sqrt(2*Math.PI))*Math.exp(-(whatMask-mu)*(whatMask-mu)/(2*sigma*sigma)));\n }", "void nextGaussianStep(){\n \n \n int stepx=nextGaussian(2,1)*(r.nextInt(3)-1);\n int stepy=nextGaussian(2,1)*(r.nextInt(3)-1);\n \n StdDraw.line(x,y,x+stepx,y+stepy);\n x += stepx;\n y += stepy;\n }", "private void gaussianBlur() {\n targetImage = new Mat();\n Utils.bitmapToMat(lena, targetImage);\n Imgproc.cvtColor(targetImage, targetImage, Imgproc.COLOR_BGR2RGB);\n\n gaussianBlur(targetImage.getNativeObjAddr());\n\n // create a bitMap\n Bitmap bitMap = Bitmap.createBitmap(targetImage.cols(),\n targetImage.rows(), Bitmap.Config.RGB_565);\n // convert Mat to Android's bitmap:\n Imgproc.cvtColor(targetImage, targetImage, Imgproc.COLOR_RGB2BGR);\n Utils.matToBitmap(targetImage, bitMap);\n\n\n ImageView iv = (ImageView) findViewById(R.id.imageView);\n iv.setImageBitmap(bitMap);\n }", "public static double[][] gaussianFunction(int size_x, int size_y, double sigma) {\n double[][] kernel;\n int center_x = size_x/2;\n int center_y = size_y/2;\n\n kernel = new double[size_y][size_x];\n for (int y=0; y<size_y; y++) {\n for (int x=0; x<size_x; x++) {\n double tmp_x = (double)((x - center_x) * (x - center_x)) / (2 * sigma * sigma);\n double tmp_y = (double)((y - center_y) * (y - center_y)) / (2 * sigma * sigma);\n kernel[y][x] = 1.0 / (2 * Math.PI * sigma * sigma) * Math.exp(-(tmp_x + tmp_y));\n }\n }\n\n return kernel;\n }", "public static List<Double> gaussianFilter(List<Double> listToFilter) {\r\n DescriptiveStatistics stats = new DescriptiveStatistics();\r\n // Add the data from the array\r\n for (Double value : listToFilter) {\r\n stats.addValue(value);\r\n }\r\n double std = stats.getStandardDeviation();\r\n double parameter = 1.0 / (std * std * 2);\r\n return gaussianFilter(listToFilter, parameter);\r\n }", "public Gaussian() {\r\n this(1, 0, 1);\r\n }", "private static native long createAMFilter_0(double sigma_s, double sigma_r, boolean adjust_outliers);", "public static float[] getBinomialKernelSigmaZeroPointFive() {\n //1 -1 norm=0.5\n return new float[]{0.5f, 0.0f, -0.5f};\n }", "public BufferedImage LoG(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n BufferedImage timg3 = GreayscaleImg(timg);\n\n int [][][] ImageArray1 = convertToArray(timg3);\n int [][][] ImageArray2 = convertToArray(timg);\n int [][][] ImageArray3 = convertToArray(timg);\n\n // Mask for convolution = [0 0 -1 0 0; 0 -1 -2 -1 0; -1 -2 16 -2 -1; 0 -1 -2 -1 0; 0 0 -1 0 0]\n int[][] mask = {\n {0, 0, -1, 0, 0},\n {0, -1, -2, -1, 0},\n {-1, -2, 16, -2, -1},\n {0, -1, -2, -1, 0},\n {0, 0, -1, 0, 0},\n };\n System.out.println();\n System.out.println(\"Laplacian of Gaussian mask of 5*5 array\");\n for (int i = 0; i < mask.length; ++i) {\n for (int j = 0; j < mask[i].length; ++j) {\n System.out.print(mask[i][j] + \" \");\n }\n System.out.println();\n }\n\n //for Mask of size 5x5\n for(int y=2; y<height-2; y++){\n for(int x=2; x<width-2; x++){\n // //r = 0; g = 0; b = 0;\n // // int r = ImageArray1[x][y][1]; //r\n // int g = ImageArray1[x][y][2]; //g\n // int b = ImageArray1[x][y][3]; //b\n\n int r = 0; int g = 0; int b = 0;\n for(int s=0; s<=4; s++){\n for(int t=0; t<=4; t++){\n r = r + mask[s][t]*ImageArray1[x-s+2][y-t+2][1];\n g = g + mask[s][t]*ImageArray1[x-s+2][y-t+2][2];\n b = b + mask[s][t]*ImageArray1[x-s+2][y-t+2][3];\n }\n }\n ImageArray2[x][y][1] = r; //r\n ImageArray2[x][y][2] = g; //g\n ImageArray2[x][y][3] = b; //b\n }\n }\n for(int y=1; y<height-1; y++){\n for(int x=1; x<width-1; x++){\n ImageArray3[x][y][1] = Math.max(ImageArray2[x][y][1],0);\n ImageArray3[x][y][2] = Math.max(ImageArray2[x][y][2],0);\n ImageArray3[x][y][3] = Math.max(ImageArray2[x][y][3],0);\n }\n }\n return convertToBimage(ImageArray3);\n }", "private static native void amFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, double sigma_s, double sigma_r, boolean adjust_outliers);", "private static native long createFastGlobalSmootherFilter_0(long guide_nativeObj, double lambda, double sigma_color, double lambda_attenuation, int num_iter);", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "private static native void fastGlobalSmootherFilter_0(long guide_nativeObj, long src_nativeObj, long dst_nativeObj, double lambda, double sigma_color, double lambda_attenuation, int num_iter);", "public void setGaussian(double ragam, double x, double rataan) {\n g1 = 1 / Math.sqrt(2 * 22 / 7 * ragam * ragam);\n g3 = -((x - rataan) * (x - rataan)) / (2 * ragam * ragam);\n g2 = Math.pow(2.718, g3);\n gauss = g1 * g2;\n }", "private Matrix gaussianEliminate(){\r\n\t\t//Start from the 0, 0 (top left)\r\n\t\tint rowPoint = 0;\r\n\t\tint colPoint = 0;\r\n\t\t// instantiate the array storing values for new Matrix\r\n\t\tDouble[][] newVal = deepCopy(AllVal);\r\n\t\twhile (rowPoint < row && colPoint < col) {\r\n\t\t\t// find the index with max number (absolute value) from rowPoint to row\r\n\t\t\tDouble max = Math.abs(newVal[rowPoint][colPoint]);\r\n\t\t\tint index = rowPoint;\r\n\t\t\tint maxindex = rowPoint;\r\n\t\t\twhile (index < row) {\r\n\t\t\t\tif (max < Math.abs(newVal[index][colPoint])) {\r\n\t\t\t\t\tmax = newVal[index][colPoint];\r\n\t\t\t\t\tmaxindex = index;\r\n\t\t\t\t}\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t\t// if max is 0 then that must mean there are no pivots\r\n\t\t\tif (max == 0) {\r\n\t\t\t\tcolPoint++;\r\n\t\t\t}else {\r\n\t\t\t\t//TODO: refactor into method\r\n\t\t\t\tDouble[] Temp = newVal[rowPoint];\r\n\t\t\t\tnewVal[rowPoint] = newVal[maxindex];\r\n\t\t\t\tnewVal[maxindex] = Temp;\r\n\t\t\t\t// Fill 0 lower part of pivot\r\n\t\t\t\tfor(int lower = rowPoint + 1; lower < row; lower++) {\r\n\t\t\t\t\tDouble ratio = newVal[lower][colPoint]/newVal[rowPoint][colPoint];\r\n\t\t\t\t\tnewVal[lower][colPoint] = (Double) 0.0;\r\n\t\t\t\t\t// adjust for the remaining element\r\n\t\t\t\t\tfor (int remain = colPoint + 1; remain < col; remain++) {\r\n\t\t\t\t\t\tnewVal[lower][remain] = newVal[lower][remain] - newVal[lower][remain]*ratio;\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\trowPoint++;\r\n\t\t\t\tcolPoint++;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Matrix(newVal);\r\n\t}", "public static void fastGlobalSmootherFilter(Mat guide, Mat src, Mat dst, double lambda, double sigma_color, double lambda_attenuation, int num_iter)\r\n {\r\n \r\n fastGlobalSmootherFilter_0(guide.nativeObj, src.nativeObj, dst.nativeObj, lambda, sigma_color, lambda_attenuation, num_iter);\r\n \r\n return;\r\n }", "public void useUniformDeviates(){\n this.gaussianDeviates = false;\n }", "public Point3d sampleHemisphere();", "public static void fastGlobalSmootherFilter(Mat guide, Mat src, Mat dst, double lambda, double sigma_color)\r\n {\r\n \r\n fastGlobalSmootherFilter_1(guide.nativeObj, src.nativeObj, dst.nativeObj, lambda, sigma_color);\r\n \r\n return;\r\n }", "public double nextGaussian() {\n\n /*\n * This implementation uses the polar method to generate two gaussian\n * values at a time. One is returned, and the other is stored to be returned\n * next time.\n */\n\n if (haveStoredGaussian) {\n haveStoredGaussian = false;\n return storedGaussian;\n }\n\n double v1;\n double v2;\n double s;\n do {\n v1 = 2 * nextDouble() - 1;\n v2 = 2 * nextDouble() - 1;\n s = v1 * v1 + v2 * v2;\n } while (s >= 1 || s == 0);\n\n double m = StrictMath.sqrt(-2 * StrictMath.log(s) / s);\n storedGaussian = v2 * m;\n haveStoredGaussian = true;\n\n return v1 * m;\n }", "private static native long createGuidedFilter_0(long guide_nativeObj, int radius, double eps);", "public static double gaussian() {\n // use the polar form of the Box-Muller transform\n double r, x, y;\n do {\n x = uniform( -1.0, 1.0 );\n y = uniform( -1.0, 1.0 );\n r = x*x + y*y;\n } while ( r >= 1 || r == 0 );\n \n return x * Math.sqrt(-2 * Math.log(r) / r);\n\n // Remark: y * Math.sqrt(-2 * Math.log(r) / r)\n // is an independent random gaussian\n }", "public void filterImage()\r\n {\r\n\t if (!isInverted && !isBlured )\r\n {\r\n cropedEdited = cropedPart;\r\n }\r\n\t float[] elements = {0.0f, 1.0f, 0.0f, -1.0f,brightnessLevel,1.0f,0.0f,0.0f,0.0f}; \r\n\t Kernel kernel = new Kernel(3, 3, elements); \r\n\t BufferedImageOp change = new ConvolveOp(kernel); \r\n\t cropedEdited = change.filter(cropedEdited, null);\r\n repaint();\r\n }", "private double gaussValue(double entfernung) {\n\t\tdouble x = entfernung * inputFaktor;\n\t\tdouble res = 1.0 / (sigma * Math.sqrt(2 * Math.PI));\n\t\tdouble xMySigma = -Math.pow((x - my / sigma), 2.0) / 2.0;\n\t\tdouble resExpo = Math.exp(xMySigma);\n\t\tdouble result = res * resExpo;\n\n\t\tif (result < epsilon) {\n\t\t\treturn 0.0;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t\t// return 1.0 / (sigma * Math.sqrt(2.0 * Math.PI)) *\n\t\t// Math.exp(-Math.pow(x-my / sigma, 2.0) / 2.0);\n\t}", "public void filter(double[] X, int offset, int count) {\r\n\t\tint m, i;\r\n\t\t\r\n\t\tz[BUTTERWORTH4_NUM_COEFFICIENTS - 1] = 0;\r\n\t\tfor (m = offset; m < offset + count; m++) {\r\n\t\t\tdouble oldXm = X[m];\r\n\t\t\tdouble newXm = B[0] * oldXm + z[0];\r\n\t\t\tfor (i = 1; i < BUTTERWORTH4_NUM_COEFFICIENTS; i++) {\r\n\t\t\t\tz[i - 1] = B[i] * oldXm + z[i] - A[i] * newXm;\r\n\t\t\t}\r\n\t\t\tX[m] = newXm;\r\n\t\t}\r\n\t}", "protected static float[] getBinomialKernelSigmaOneSQRT2() {\n float a = 1.f/256.f;\n return new float[]{a*3, a*12, a*27, a*28,\n 0, -28*a, -27*a, -12*a, -3*a};\n }", "public static Picture sharpen(Picture picture) {\n double[][] weights = { { 0.0, -1.0, 0.0 }, { -1.0, 5.0, -1.0 }, { 0.0, -1.0, 0.0 }, };\n return kernel(picture, weights);\n }", "public BufferedImage transform(BufferedImage image) {\n\t\tpoint.setFuzziness(10);\r\n\t\treturn point.filter(image, null);\r\n\t}", "private static float[] GetAppropriateSeparableGauss(int kernelSize){\n final double epsilon = 2e-2f / kernelSize;\n double searchStep = 1.0;\n double sigma = 1.0;\n while( true )\n {\n\n double[] kernelAttempt = GenerateSeparableGaussKernel( sigma, kernelSize );\n if( kernelAttempt[0] > epsilon )\n {\n if( searchStep > 0.02 )\n {\n sigma -= searchStep;\n searchStep *= 0.1;\n sigma += searchStep;\n continue;\n }\n\n float[] retVal = new float[kernelSize];\n for (int i = 0; i < kernelSize; i++)\n retVal[i] = (float)kernelAttempt[i];\n return retVal;\n }\n\n sigma += searchStep;\n\n if( sigma > 1000.0 )\n {\n assert( false ); // not tested, preventing infinite loop\n break;\n }\n }\n\n return null;\n }", "public static void gaussian(double a[][], int index[])\r\n {\r\n int n = index.length;\r\n double c[] = new double[n];\r\n\r\n for (int i=0; i<n; ++i)\r\n index[i] = i;\r\n\r\n for (int i=0; i<n; ++i)\r\n {\r\n double c1 = 0;\r\n for (int j=0; j<n; ++j)\r\n {\r\n double c0 = Math.abs(a[i][j]);\r\n if (c0 > c1) c1 = c0;\r\n }\r\n c[i] = c1;\r\n }\r\n\r\n int k = 0;\r\n for (int j=0; j<n-1; ++j)\r\n {\r\n double pi1 = 0;\r\n for (int i=j; i<n; ++i)\r\n {\r\n double pi0 = Math.abs(a[index[i]][j]);\r\n pi0 /= c[index[i]];\r\n if (pi0 > pi1)\r\n {\r\n pi1 = pi0;\r\n k = i;\r\n }\r\n }\r\n\r\n int itmp = index[j];\r\n index[j] = index[k];\r\n index[k] = itmp;\r\n for (int i=j+1; i<n; ++i)\r\n {\r\n double pj = a[index[i]][j]/a[index[j]][j];\r\n\r\n a[index[i]][j] = pj;\r\n\r\n for (int l=j+1; l<n; ++l)\r\n a[index[i]][l] -= pj*a[index[j]][l];\r\n }\r\n }\r\n }", "private void doGaussainBlurRGB(BufferedImage img, int minBlurX, int maxBlurX, int minBlurY, int maxBlurY, int x, int y,\n\t\t\tint blurWidth, int blurHeight, int srcRgb) {\n\t\timg.setRGB(x, y, srcRgb); // Nothing blur\n\n\t\t// int[] inPixels = new int[blurWidth * blurHeight];\n\t\t// int[] outPixels = new int[blurWidth * blurHeight];\n\t\t// java.awt.image.Kernel kernel = GaussianFilter.makeKernel(0.667f);\n\t\t// GaussianFilter.convolveAndTranspose(kernel, inPixels, outPixels,\n\t\t// blurWidth, blurHeight, true, GaussianFilter.CLAMP_EDGES);\n\t\t// GaussianFilter.convolveAndTranspose(kernel, outPixels, inPixels,\n\t\t// blurHeight, blurWidth, true, GaussianFilter.CLAMP_EDGES);\n\t\t// img.setRGB(x, y, blurWidth, blurHeight, inPixels, 0, blurWidth);\n\n\t\t// int v = 0;\n\t\t// if ((maxBlurY - minBlurY) > (maxBlurX - minBlurX)) { // Left/Right?\n\t\t// v = (int) (Math.abs(240 - Math.abs(x - minBlurX) * 20));\n\t\t// } else {\n\t\t// v = (int) (Math.abs(240 - Math.abs(y - minBlurY) * 20));\n\t\t// }\n\t\t// img.setRGB(x, y, new Color(v, v, v).getRGB());\n\n\t\t// NormalDistribution nd = new NormalDistribution(0, 1.44);\n\n\t\t// int r = (0xff & srcRgb);\n\t\t// int g = (0xff & (srcRgb >> 8));\n\t\t// int b = (0xff & (srcRgb >> 16));\n\t\t// srcRgb = r + (g << 8) + (b << 4) + (100 << 24);\n\t\t// img.setRGB(x, y, Color.white.getRGB());\n\t\t// img.setRGB(x, y, new Color(220, 220, 220).getRGB());\n\t}", "private float noise(Vector2 point) {\n\t\tVector2 bottomLeft = randomGrid[(int) point.x][(int) point.y];\n\t\tVector2 topLeft = randomGrid[(int) point.x][(int) point.y + 1];\n\t\tVector2 bottomRight = randomGrid[(int) point.x + 1][(int) point.y];\n\t\tVector2 topRight = randomGrid[(int) point.x + 1][(int) point.y + 1];\n\n\t\tfloat bottomLeftValue = bottomLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y));\n\t\tfloat topLeftValue = topLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y + 1));\n\t\tfloat bottomRightValue = bottomRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y));\n\t\tfloat topRightValue = topRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y + 1));\n\n\t\tfloat bottomValue = bottomLeftValue * (1 - point.x % 1) + bottomRightValue * (point.x % 1);\n\t\tfloat topValue = topLeftValue * (1 - point.x % 1) + topRightValue * (point.x % 1);\n\t\tfloat value = bottomValue * (1 - point.y % 1) + topValue * (point.y % 1);\n\n\t\treturn value;\n\t}", "public double filter(double x) {\n y = b0 * x + b1 * x1 + b2 * x2 - a1 * y1 - a2 * y2;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n return (y);\n }", "public static int[] LoGFilter(int[] data, int w, int h) {\n int[] newData = new int[w * h];\n\n // apply filter\n int kernel_size = 3; // kernel size\n double s = 1.1; // sigma value\n double i2ss = 0.5 / s / s, issss = 1d / s / s / s / s;\n\n double[][] kernel = new double[kernel_size * 2 + 1][kernel_size * 2 + 1];\n for (int i = -kernel_size; i <= kernel_size; i++) {\n for (int j = -kernel_size; j <= kernel_size; j++) {\n double ss = (i * i + j * j) * i2ss;\n kernel[i + kernel_size][j + kernel_size] = (ss - 1d) * Math.exp(-ss) * issss / Math.PI;\n }\n }\n\n for (int x = 0; x < w; x++) {\n for (int y = 0; y < h; y++) {\n double sum = 0d;\n for (int i = -kernel_size; i <= kernel_size; i++) {\n for (int j = -kernel_size; j <= kernel_size; j++) {\n int xx = x + i, yy = y + j;\n if (xx >= 0 && xx < w && yy >= 0 && yy < h) {\n sum += kernel[i + kernel_size][j + kernel_size] * RGB.luminance(data[yy * w + xx]);\n }\n }\n }\n\n newData[y * w + x] = (int) sum;\n }\n }\n\n return newData;\n }", "private double gaussprob(int k, double r)\n\t{\n\t\treturn \tMath.exp( -0.5*Math.pow( ((double)k-r)/data_bg_std , 2 ) ) * \n\t\t\t\tMath.pow( 2*Math.PI, -0.5 ) / data_bg_std;\n\t}", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "@Override\n\tpublic void run() {\n\t\tspacing = checkDimensions(spacingString, input.numDimensions(), \"Spacings\");\n\t\tscales = Arrays.stream(scaleString.split(regex)).mapToInt(Integer::parseInt)\n\t\t\t.toArray();\n\t\tDimensions resultDims = Views.addDimension(input, 0, scales.length - 1);\n\t\t// create output image, potentially-filtered input\n\t\tresult = opService.create().img(resultDims, new FloatType());\n\n\t\tfor (int s = 0; s < scales.length; s++) {\n\t\t\t// Determine whether or not the user would like to apply the gaussian\n\t\t\t// beforehand and do it.\n\t\t\tRandomAccessibleInterval<T> vesselnessInput = doGauss ? opService.filter()\n\t\t\t\t.gauss(input, scales[s]) : input;\n\t\t\tIntervalView<FloatType> scaleResult = Views.hyperSlice(result, result\n\t\t\t\t.numDimensions() - 1, s);\n\t\t\topService.filter().frangiVesselness(scaleResult, vesselnessInput, spacing,\n\t\t\t\tscales[s]);\n\t\t}\n\t}", "public void transform(double[] x) {\r\n int i,j;\r\n double sumWindow=nn*nn;\r\n\r\n System.arraycopy(x,0,data,1,n);\r\n if(winNum>0) {\r\n for(i=0,j=1;i<nn;i++) {\r\n data[j]=data[j]*winMult[i];\r\n j++;\r\n data[j]=data[j]*winMult[i];\r\n j++;\r\n sumWindow=sumWindow+winMult[i]*winMult[i];\r\n }\r\n }\r\n/* Test to plot windowed function\r\n nSpectrum++;\r\n for(i=0,j=0;i<nn;i++) {\r\n x[j]=i;\r\n j++;\r\n x[j]=data[j];\r\n j++;\r\n }\r\n if(ncurve>=0) ncurve = graph.deleteAllCurves();\r\n ncurve = graph.addCurve(x,nn,Color.blue);\r\n graph.paintAll=true;\r\n graph.repaint();\r\n*/\r\n four1(data,nn,1);\r\n nSpectrum++;\r\n x[0]=0;\r\n spectrum[0]+=(data[0]*data[0]+data[1]*data[1])/sumWindow;\r\n for(i=1,j=2;i<nn/2;i++) {\r\n x[j]=i*scale;\r\n j++;\r\n spectrum[i]+=2.*(data[j]*data[j]+data[j+1]*data[j+1])/sumWindow;\r\n j++;\r\n }\r\n x[j]=(nn/2)*scale;\r\n j++;\r\n spectrum[nn/2]+=(data[j]*data[j]+data[j+1]*data[j+1])/sumWindow;\r\n for(i=0,j=1;i<=nn/2;i++) {\r\n x[j]=0.434*Math.log(floor+spectrum[i]/nSpectrum);\r\n j+=2;\r\n }\r\n }", "private static WeightsAndOffsets GenerateGaussShaderKernelWeightsAndOffsets(int kernelSize){\n float[] inputKernel = GetAppropriateSeparableGauss(kernelSize);\n\n float[] oneSideInputs = new float[kernelSize/2 + 1];\n for( int i = (kernelSize/2); i >= 0; i-- )\n {\n if( i == (kernelSize/2) )\n oneSideInputs[i] = ( (float)inputKernel[i] * 0.5f );\n else\n oneSideInputs[i] = ( (float)inputKernel[i] );\n }\n\n assert( (oneSideInputs.length % 2) == 0 );\n int numSamples = oneSideInputs.length/2;\n\n float[] weights = new float[numSamples];\n\n for( int i = 0; i < numSamples; i++ )\n {\n float sum = oneSideInputs[i*2+0] + oneSideInputs[i*2+1];\n weights[i] = sum;\n }\n\n float[] offsets = new float[numSamples];\n\n for( int i = 0; i < numSamples; i++ )\n {\n offsets[i] = ( i*2.0f + oneSideInputs[i*2+1] / weights[i] );\n }\n\n return new WeightsAndOffsets(weights, offsets);\n }", "public int noise(int xin, int yin, int zin);", "@Override\r\n\tpublic void makeTransform() {\n\r\n\t\tImgproc.GaussianBlur(src, dst, new Size(size, size),\r\n\t\t\t\tTransConstants.GAUSSIAN_SIGMA);\r\n\r\n\t}", "public static FastGlobalSmootherFilter createFastGlobalSmootherFilter(Mat guide, double lambda, double sigma_color, double lambda_attenuation, int num_iter)\r\n {\r\n \r\n FastGlobalSmootherFilter retVal = FastGlobalSmootherFilter.__fromPtr__(createFastGlobalSmootherFilter_0(guide.nativeObj, lambda, sigma_color, lambda_attenuation, num_iter));\r\n \r\n return retVal;\r\n }", "public static FastGlobalSmootherFilter createFastGlobalSmootherFilter(Mat guide, double lambda, double sigma_color)\r\n {\r\n \r\n FastGlobalSmootherFilter retVal = FastGlobalSmootherFilter.__fromPtr__(createFastGlobalSmootherFilter_1(guide.nativeObj, lambda, sigma_color));\r\n \r\n return retVal;\r\n }", "private void doBlur(int times){\n \n int pixel, x,y;\n long s,r,g,b;\n //times the image will be blurred with the kernel\n for (int t = 0; t < times; t++) {\n //march pixels\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < size; j++) {\n //reset colors\n r = g = b = s = 0;\n //march pixels inside kernel\n for (int k = 0; k < kernelSize; k++) {\n for (int l = 0; l < kernelSize; l++) {\n //get rgb color from pixel\n x = j + l - kernelCenter; \n y = i + k - kernelCenter;\n try{\n if( x>=0 && x<512 && y>=0 && y<512 ){\n pixel = imageKerneled.getRGB(x,y);\n //multiply the rgb by the number in kernel\n r += ((pixel >> 16) & 0xff) * kernel[k][l];\n g += ((pixel >> 8) & 0xff) * kernel[k][l];\n b += ((pixel) & 0xff) * kernel[k][l];\n s += kernel[k][l];\n }\n }catch(ArrayIndexOutOfBoundsException e){\n System.out.println(\"Error en \"+x+\",\"+y);\n }\n }\n }\n //averages\n r = Math.round(r/s);\n if(r>255) {System.out.println(r+\" entro r > 255 en \"+j+\",\"+i); r=255; }\n else if(r<0) {System.out.println(r+\" entro r < 255 en \"+j+\",\"+i); r=0; }\n g = Math.round(g/s);\n if(g>255) {System.out.println(g+\" entro g > 255 en \"+j+\",\"+i); g=255; }\n else if(g<0) {System.out.println(g+\" entro g < 255 en \"+j+\",\"+i); g=0; }\n b = Math.round(b/s);\n if(b>255) {System.out.println(b+\" entro b > 255 en \"+j+\",\"+i); b=255; }\n else if(b<0) {System.out.println(b+\" entro b < 255 en \"+j+\",\"+i); b=0; }\n //set the new rgb\n imageKerneled2.setRGB(j,i,new Color((int)r,(int)g,(int)b).getRGB());\n }\n }\n copyKerneled2ToKerneled();\n System.out.println(\"Finished blur: \"+(t+1));\n }\n }", "public native MagickImage gaussianBlurImage(double raduis, double sigma)\n\t\t\tthrows MagickException;", "protected static float[] getBinomialKernelSigmaZeroPointSevenOne() {\n float a = 1.f/200.f;\n return new float[]{9*a, 83*a, 0, -83*a, -9*a};\n }", "private static native void bilateralTextureFilter_0(long src_nativeObj, long dst_nativeObj, int fr, int numIter, double sigmaAlpha, double sigmaAvg);", "public static double nextGaussian(final RandomEventSource source) {\r\n double v1, v2, s;\r\n do {\r\n // Generates two independent random variables U1, U2\r\n v1 = 2 * source.nextDouble() - 1;\r\n v2 = 2 * source.nextDouble() - 1;\r\n s = v1 * v1 + v2 * v2;\r\n } while (s >= 1 || s == 0);\r\n final double norm = Math.sqrt(-2 * Math.log(s) / s);\r\n final double result = v1 * norm;\r\n // On 1,000,000 calls, this would usually yield about -5 minimum value,\r\n // and +5 maximum value. So we pretend the range is [-5.5,5.5] and normalize\r\n // it to [0,1], clamping if needed.\r\n final double normalized = (result + 5.5) / 11.0;\r\n return (normalized < 0) ? 0 : (normalized > BEFORE_ONE ? BEFORE_ONE\r\n : normalized);\r\n }", "private static native void jointBilateralFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, int d, double sigmaColor, double sigmaSpace, int borderType);", "static void set_bnd ( int N, int b, double[] x )\r\n{\nint i;\r\nfor ( i=1 ; i<=N ; i++ ) {\r\nx[getIndex(0 ,i)] = b==1 ? -x[getIndex(1,i)] : x[getIndex(1,i)];\r\nx[getIndex(N+1,i)] = b==1 ? -x[getIndex(N,i)] : x[getIndex(N,i)];\r\nx[getIndex(i,0 )] = b==2 ? -x[getIndex(i,1)] : x[getIndex(i,1)];\r\nx[getIndex(i,N+1)] = b==2 ? -x[getIndex(i,N)] : x[getIndex(i,N)];\r\n}\r\nx[getIndex(0 ,0 )] = 0.5f*(x[getIndex(1,0 )]+x[getIndex(0 ,1)]);\r\nx[getIndex(0 ,N+1)] = 0.5f*(x[getIndex(1,N+1)]+x[getIndex(0 ,N )]);\r\nx[getIndex(N+1,0 )] = 0.5f*(x[getIndex(N,0 )]+x[getIndex(N+1,1)]);\r\nx[getIndex(N+1,N+1)] = 0.5f*(x[getIndex(N,N+1)]+x[getIndex(N+1,N )]);\r\n\r\n//System.out.println(\"dopo\");\r\n//draw_dens ( N, x );\r\n}", "private ArrayList<Point> extractCC(Point r, Image img)\r\n/* 55: */ {\r\n/* 56: 58 */ this.s.clear();\r\n/* 57: 59 */ this.s.add(r);\r\n/* 58: 60 */ this.temp.setXYBoolean(r.x, r.y, true);\r\n/* 59: 61 */ this.list2.add(r);\r\n/* 60: */ \r\n/* 61: 63 */ Point[] N = { new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1), \r\n/* 62: 64 */ new Point(1, 1), new Point(-1, -1), new Point(-1, 1), new Point(1, -1) };\r\n/* 63: */ \r\n/* 64: 66 */ ArrayList<Point> pixels = new ArrayList();\r\n/* 65: */ int x;\r\n/* 66: */ int i;\r\n/* 67: 68 */ for (; !this.s.isEmpty(); i < N.length)\r\n/* 68: */ {\r\n/* 69: 70 */ Point tmp = (Point)this.s.pop();\r\n/* 70: */ \r\n/* 71: 72 */ x = tmp.x;\r\n/* 72: 73 */ int y = tmp.y;\r\n/* 73: 74 */ pixels.add(tmp);\r\n/* 74: */ \r\n/* 75: 76 */ this.temp2.setXYBoolean(x, y, true);\r\n/* 76: */ \r\n/* 77: 78 */ i = 0; continue;\r\n/* 78: 79 */ int _x = x + N[i].x;\r\n/* 79: 80 */ int _y = y + N[i].y;\r\n/* 80: 82 */ if ((_x >= 0) && (_x < this.xdim) && (_y >= 0) && (_y < this.ydim)) {\r\n/* 81: 84 */ if (!this.temp.getXYBoolean(_x, _y))\r\n/* 82: */ {\r\n/* 83: 86 */ boolean q = img.getXYBoolean(_x, _y);\r\n/* 84: 88 */ if (q)\r\n/* 85: */ {\r\n/* 86: 90 */ Point t = new Point(_x, _y);\r\n/* 87: 91 */ this.s.add(t);\r\n/* 88: */ \r\n/* 89: 93 */ this.temp.setXYBoolean(t.x, t.y, true);\r\n/* 90: 94 */ this.list2.add(t);\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94: 78 */ i++;\r\n/* 95: */ }\r\n/* 96: 99 */ for (Point t : this.list2) {\r\n/* 97:100 */ this.temp.setXYBoolean(t.x, t.y, false);\r\n/* 98: */ }\r\n/* 99:101 */ this.list2.clear();\r\n/* 100: */ \r\n/* 101:103 */ return pixels;\r\n/* 102: */ }", "public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);", "public static double gamma(double x) {\n double sgngam, q, z, y, p1, q1;\n int ip, p;\n double[] pp = {1.60119522476751861407E-4, 1.19135147006586384913E-3, 1.04213797561761569935E-2, 4.76367800457137231464E-2, 2.07448227648435975150E-1, 4.94214826801497100753E-1, 9.99999999999999996796E-1};\n double[] qq = {-2.31581873324120129819E-5, 5.39605580493303397842E-4, -4.45641913851797240494E-3, 1.18139785222060435552E-2, 3.58236398605498653373E-2, -2.34591795718243348568E-1, 7.14304917030273074085E-2, 1.00000000000000000320};\n sgngam = 1;\n q = Math.abs(x);\n if(q>33.0) {\n if(x<0.0) {\n p = (int) Math.floor(q);\n ip = Math.round(p);\n if(ip%2==0) {\n sgngam = -1;\n }\n z = q-p;\n if(z>0.5) {\n p = p+1;\n z = q-p;\n }\n z = q*Math.sin(Math.PI*z);\n z = Math.abs(z);\n z = Math.PI/(z*gammastirf(q));\n } else {\n z = gammastirf(x);\n }\n y = sgngam*z;\n return y;\n }\n z = 1;\n while(x>=3) {\n x = x-1;\n z = z*x;\n }\n while(x<0) {\n if(x>-0.000000001) {\n y = z/((1+0.5772156649015329*x)*x);\n return y;\n }\n z = z/x;\n x = x+1;\n }\n while(x<2) {\n if(x<0.000000001) {\n y = z/((1+0.5772156649015329*x)*x);\n return y;\n }\n z = z/x;\n x = x+1.0;\n }\n if(x==2) {\n y = z;\n return y;\n }\n x = x-2.0;\n p1 = pp[0];\n for(int i = 1; i<7; i++) {\n p1 = pp[i]+p1*x;\n }\n q1 = qq[0];\n for(int i = 1; i<8; i++) {\n q1 = qq[i]+q1*x;\n }\n return z*p1/q1;\n }", "public static void main(String args[]) {\n\n\tint nx = 200;\n int ny = 300;\n\n\tColorSurfaceData data = new SmoothData3D(nx,ny);\n\n double minX = -2;\n double minY = -3;\n double maxX = 2;\n double maxY = 3; \n\tdouble stepX = (maxX - minX)/(nx-1);\n double stepY = (maxY - minY)/(ny-1); \n\n\tdata.setMinMaxX(minX,maxX);\n\tdata.setMinMaxY(minY,maxY);\n\n\tdouble x,y,v;\n\n\tfor(int i = 0; i < nx; i++){\n\tfor(int j = 0; j < ny; j++){\n\t x = minX + i*stepX;\n\t y = minY + j*stepY;\n v = Math.exp(-(x*x+y*y));\n data.setValue(i,j,v);\n //data.addValue(x,y,v);\n\t}}\n\n\tdouble max_dev = 0;\n\tint i_max = 0, j_max = 0;\n\n\tfor(int i = 6; i < nx-6; i++){\n\tfor(int j = 6; j < ny-6; j++){\n\t x = i*stepX + minX + 0.5*stepX;\n\t y = j*stepY + minY + 0.5*stepY;\n v = Math.abs(Math.exp(-(x*x+y*y)) - data.getValue(x,y))/Math.exp(-(x*x+y*y));\n if(max_dev < v) {\n max_dev = v;\n\t i_max = i;\n\t j_max = j;\n\t }\n\t}} \n\n\tSystem.out.println(\"max dev [%] = \"+max_dev*100);\n\n\tdouble v_calc = 0;\n\tx = i_max*stepX + minX + 0.5*stepX;\n\ty = j_max*stepY + minY + 0.5*stepY; \n\tv = Math.exp(-(x*x+y*y));\n\tv_calc = data.getValue(x,y);\n \tSystem.out.println(\"stepX = \"+stepX);\n \tSystem.out.println(\"stepY = \"+stepY);\n \tSystem.out.println(\"i_max = \"+i_max);\n \tSystem.out.println(\"j_max = \"+j_max);\n \tSystem.out.println(\"x = \"+x);\n \tSystem.out.println(\"y = \"+y);\n \tSystem.out.println(\"v = \"+v);\n \tSystem.out.println(\"v_calc = \"+v_calc); \n\n }", "public void sample()\n\t{\n\t\tint nd = interval.numDimensions();\n\n\t\t// the order in which mpicbg expects\n\t\tp = new double[ nd ][ (int) N ];\n\t\tq = new double[ nd ][ (int) N ];\n\n\t\tdouble[] src = new double[ nd ];\n\t\tdouble[] tgt = new double[ nd ];\n\n\t\tint i = 0;\n\t\tIntervalIterator it = new IntervalIterator( interval );\n\t\twhile ( it.hasNext() )\n\t\t{\n\t\t\tit.fwd();\n\t\t\tit.localize( src );\n\t\t\txfm.apply( src, tgt );\n\n\t\t\tfor ( int d = 0; d < nd; d++ )\n\t\t\t{\n\t\t\t\tp[ d ][ i ] = src[ d ];\n\t\t\t\tq[ d ][ i ] = tgt[ d ];\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}", "M generateNoise();", "public MultivariateGaussianDM(DMatrixRMaj x, DMatrixRMaj P) {\n\t\tthis.x = new DMatrixRMaj(x);\n\t\tthis.P = new DMatrixRMaj(P);\n\t}", "@SuppressWarnings(\"unused\")\r\n private double[] getSeedPoint(double[] center) {\r\n double lowIntensity = -50;\r\n double highIntensity = 50;\r\n \r\n int originalX = (int)center[0], currentX = (int)center[0];\r\n int originalY = (int)center[1], currentY = (int)center[1];\r\n \r\n boolean pointFound = false;\r\n \r\n while(!pointFound && currentX < xDim) {\r\n if(srcImage.get(currentX, currentY, (int)center[2]).doubleValue() < highIntensity &&\r\n srcImage.get(currentX, currentY, (int)center[2]).doubleValue() > lowIntensity) {\r\n pointFound = true;\r\n break;\r\n }\r\n if(currentX - originalX > currentY - originalY)\r\n currentY++;\r\n else\r\n currentX++;\r\n }\r\n \r\n if(pointFound) {\r\n center[0] = currentX;\r\n center[1] = currentY;\r\n }\r\n \r\n return center;\r\n \r\n }", "public static double gaussian(double[] parameters) {\r\n double mean, stddev;\r\n mean = parameters[0];\r\n stddev = parameters[1];\r\n return mean + stddev * gaussian();\r\n }", "private static native void guidedFilter_0(long guide_nativeObj, long src_nativeObj, long dst_nativeObj, int radius, double eps, int dDepth);", "public static Picture emboss(Picture picture) {\n double[][] weights = { { -2.0, -1.0, 0.0 }, { -1.0, 1.0, 1.0 }, { 0.0, 1.0, 2.0 }, };\n return kernel(picture, weights);\n }", "public ArrayList<Point> getPoints(BufferedImage image_dest) {\n\n int x = 0;\n int y = 0;\n int x_sum = 0;\n int y_sum = 0;\n int count = 0;\n\n int x_sumL = 0;\n int y_sumL = 0;\n int countL = 0;\n\n int x_sumR = 0;\n int y_sumR = 0;\n int countR = 0;\n\n Point pointA = null; //rigth \t-A\n Point pointB = null; //left\t\t-B\n Point pointC = null; //centroid\t-C\n\n\n ArrayList<Point> points = new ArrayList<Point>();\n\n /*\n * centroid of image - point[2]\n *\n */\n for (y = 0; y < h; y++) {\n for (x = 0; x < w; x++) {\n if (image_dest.getRGB(x, y) != -1) {\n x_sum += x;\n y_sum += y;\n count++;\n\n //\tSystem.out.print(\"0\");\n }\n //else\n //\tSystem.out.print(\"1\");\n\n }\n //System.out.println(\"\");\n }\n //System.out.println(\"count lg : \"+count);\n double mycount = new Double(count).doubleValue();\n //JOptionPane.showMessageDialog(null, new Double(count).toString());\n //int y3 =0;\n double d_y3 = 0;\n double d_x3 = 0;\n if (mycount != 0) {\n d_y3 = Double.valueOf(df.format(new Double(y_sum).doubleValue() / mycount));\n d_x3 = Double.valueOf(df.format(new Double(x_sum).doubleValue() / mycount));\n }\n int y3 = (int) Math.round(new Double(d_y3));\n int x3 = (int) Math.round(new Double(d_x3));\n\n /*\n * x3 and y3 are assigned to point[3] (centroid of image)\n */\n\n pointC = new Point(x3, y3);\n //System.out.println( \"Point C :::::\"+pointC);\n tri_main.setPointC(pointC);\n tri_main.setCount_main(count);\n //\t\tSystem.out.println(\"ysum : \"+y_sum);\n //\t\tSystem.out.println(\"xsum : \"+x_sum);\n //\t\tSystem.out.println(\"count :\"+count);\n for (y = 0; y < h; y++) {\n for (x = 0; x <= x3; x++) {\n //correct\n if (image_dest.getRGB(x, y) != -1) {\n //\t\tSystem.out.print(\"A\");\n x_sumL += x;\n y_sumL += y;\n countL++;\n//\t\t\t\t\t System.out.print(\"0\");\n }\n//\t\t\t\tSystem.out.print(\"1\");\n }\n\n }\n//\t\tSystem.out.println(\"\");\n int y2 = 0;\n int x2 = 0;\n//\t\tSystem.out.println(\"countL : \"+countL);\n//\t\tSystem.out.println(\"x_sumL : \"+x_sumL);\n//\t\tSystem.out.println(\"y_sumL :\"+y_sumL);\n try {\n double d_y2 = 0;\n double d_x2 = 0;\n double mycountL = new Double(countL).doubleValue();\n if (mycountL != 0) {\n d_y2 = Double.valueOf(df.format(new Double(y_sumL).doubleValue() / mycountL));\n d_x2 = Double.valueOf(df.format(new Double(x_sumL).doubleValue() / mycountL));\n }\n y2 = (int) Math.round(new Double(d_y2));\n x2 = (int) Math.round(new Double(d_x2));\n\n\n //\tSystem.out.println(\" Kiri X2, Y2 :\"+\"(\"+x2+\" , \"+y2+\")\");\n } catch (java.lang.ArithmeticException asd) {\n //\tSystem.out.println(\"Hello\");\n }\n\n pointB = new Point(x2, y2);\n tri_main.setPointB(pointB);\n tri_main.setCount_left(countL);\n\n countR = 0;\n for (y = 0; y < h; y++) {\n for (x = x3; x < w; x++) {\n\n if (image_dest.getRGB(x, y) != -1) {\n x_sumR += x;\n y_sumR += y;\n countR++;\n//\t\t\t\t\tSystem.out.print(\"0\");\n }\n//\t\t\t\tSystem.out.print(\"1\");\n }\n//\t\t\tSystem.out.println(\"\");\n }\n//\t\tSystem.out.println(\"ysumR: \"+y_sumR);\n//\t\tSystem.out.println(\"xsumR: \"+x_sumR);\n//\t\tSystem.out.println(\"countR: \"+countR);\n double d_y1 = 0;\n double d_x1 = 0;\n double mycountR = new Double(countR).doubleValue();\n if (mycountR != 0) {\n d_y1 = Double.valueOf(df.format(new Double(y_sumR).doubleValue() / mycountR));\n d_x1 = Double.valueOf(df.format(new Double(x_sumR).doubleValue() / mycountR));\n }\n int y1 = (int) Math.round(new Double(d_y1));\n int x1 = (int) Math.round(new Double(d_x1));\n\n\n //System.out.println(\"Point1 : x : \"+x1+\" y : \"+y1);\n pointA = new Point(x1, y1);\n tri_main.setPointA(pointA);\n tri_main.setCount_left(countR);\n\n //System.out.println(\"Centroid C_Main: x : \"+x3+\" y : \"+y3+\" : \"+pointC);\n //System.out.println(\"Point A: x : \"+x1+\" y : \"+y1+\" : \"+pointA);\n points.add(pointA);//on right\n points.add(pointB);//on left\n points.add(pointC);//centroid\n\n status = \"reset\";\n return points;\n }", "public void homogenize() {\n\t\tif (DoubleComparison.eq(w, 0)){\n\t\t\tthrow new RuntimeException(\"Can't homogenize points at infinity (last component zero)\");\n\t\t}\n\n\t\tthis.x = x / w;\n\t\tthis.y = y / w;\n\t\tthis.z = z / w;\n\t\tthis.w = 1;\n\t}", "private static void filterNoise(BufferedImage image) {\n\t\tfor (int x=0; x<image.getWidth(); x++) {\r\n\t\t\tfor (int y=0; y<image.getHeight(); y++) {\r\n\t\t\t\t\r\n\t\t\t\tint pixelVal = image.getRGB(x, y);\r\n\r\n\t\t\t\t// check how many pixels in a 2 x 2 rectangle with this point \r\n\t\t\t\t// in the center have the same color as this point; if not \r\n\t\t\t\t// many, flip this pixel's color\r\n\t\t\t\tint startX = Math.max(x-2, 0);\r\n\t\t\t\tint startY = Math.max(y-2, 0);\r\n\t\t\t\tint endX = Math.min(x+2, image.getWidth()-1);\r\n\t\t\t\tint endY = Math.min(y+2, image.getHeight()-1);\r\n\r\n\t\t\t\tint matchCount = 0;\r\n\t\t\t\tint totalCount = 0;\r\n\t\t\t\tfor (int i=startX; i<=endX; i++) {\r\n\t\t\t\t\tfor (int j=startY; j<=endY; j++) {\r\n\t\t\t\t\t\tif (image.getRGB(i,j) == pixelVal) {\r\n\t\t\t\t\t\t\tmatchCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttotalCount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ((matchCount / (double) totalCount) < .2) {\r\n\t\t\t\t\tif (pixelVal == Color.YELLOW.getRGB()) {\r\n\t\t\t\t\t\timage.setRGB(x, y, Color.BLACK.getRGB());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\timage.setRGB(x, y, Color.YELLOW.getRGB());\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\tif (debug) {\r\n\t\t\ttry {\r\n\t\t\t\tImageIO.write(image, \"gif\", new File(\"noiseFiltered.gif\"));\r\n\t\t\t} catch (Exception e) {e.printStackTrace();}\r\n\t\t}\r\n\t}", "public static int[] bilateralFilter(int[] data, int w, int h) {\n int[] newData = new int[w * h];\n\n // apply filter\n int kernel = 3; // kernel size\n double s1 = 100, s2 = 10; // sigma values\n double i2ss1 = 0.5 / s1 / s1, i2ss2 = 0.5 / s2 / s2;\n\n for (int x = 0; x < w; x++) {\n for (int y = 0; y < h; y++) {\n double deno_sum = 0d;\n double nume_sum_l = 0d, nume_sum_a = 0d, nume_sum_b = 0d;\n\n for (int i = -kernel; i <= kernel; i++) {\n for (int j = -kernel; j <= kernel; j++) {\n int xx = x + i, yy = y + j;\n if (xx >= 0 && xx < w && yy >= 0 && yy < h) {\n int c = data[yy * w + xx];\n double ii = i * i, jj = j * j;\n double S = Math.exp(-(ii + jj) * i2ss1) * Math.exp(-Lab.distance_not_sqrt(data[y * w + x], c) * i2ss2);\n deno_sum += S;\n nume_sum_l += Lab.l(c) * S;\n nume_sum_a += Lab.a(c) * S;\n nume_sum_b += Lab.b(c) * S;\n }\n }\n }\n\n newData[y * w + x] = Lab.lab(\n (int) (nume_sum_l / deno_sum),\n (int) (nume_sum_a / deno_sum),\n (int) (nume_sum_b / deno_sum));\n }\n }\n\n return newData;\n }", "private void runFilters() {\n \tif (currentPoint * itp < time1) {\r\n \t\t//Accelerating filter 1\r\n \t\tfilterSum1 = currentPoint / filterLength1;\r\n \t}\r\n \telse if (currentPoint >= totalPoints - filterLength2) {\r\n \t\tfilterSum1 = 0;\r\n \t}\r\n \telse if (currentPoint * itp >= timeToDeccel) {\r\n \t\t//Deccelerating filter 1\r\n \t\tfilterSum1 = (totalPoints - filterLength2 - currentPoint) / filterLength1;\r\n \t}\r\n \telse {\r\n \t\tfilterSum1 = 1;\r\n \t}\r\n \t\r\n \t//Creating filterSum2 from the sum of the last filterLength2 values of filterSum1(Boxcar filter)\r\n \tfilterSums1[currentPoint] = filterSum1;\r\n \tint filter2Start = (int) ((currentPoint > filterLength2) ? currentPoint - filterLength2 + 1 : 0);\r\n \tfilterSum2 = 0;\r\n \tfor(int i = filter2Start; i <= currentPoint; i++) {\r\n \t\tfilterSum2 += filterSums1[i];\r\n \t}\r\n \t\r\n\t}", "private void compute() {\r\n int i, j, k;\r\n float gx, gy, gz;\r\n for (int q = 0; q < data.length; q++) {\r\n data[q] = new VoxelGradient();\r\n }\r\n\r\n\r\n // gradient at extremes, 0 and dim-1\r\n i = 0;\r\n j = 0;\r\n k = 0;\r\n gx = (volume.data[(i + 1) + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n gy = (volume.data[i + (dimX * ((j + 1) + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n gz = (volume.data[i + (dimX * (j + (dimY * (k + 1))))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n i = dimX - 1;\r\n j = dimY - 1;\r\n k = dimZ - 1;\r\n gx = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[(i - 1) + (dimX * (j + (dimY * k)))]) / 1;\r\n gy = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * ((j - 1) + (dimY * k)))]) / 1;\r\n gz = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * (k - 1))))]) / 1;\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n\r\n\r\n //gradient in non-extreme points\r\n for (i = 1; i < dimX - 1; i++) {\r\n for (j = 1; j < dimY - 1; j++) {\r\n for (k = 1; k < dimZ - 1; k++) {\r\n\r\n gx = (volume.data[(i + 1) + (dimX * (j + (dimY * k)))] - volume.data[(i - 1) + (dimX * (j + (dimY * k)))]) / 2;\r\n\r\n gy = (volume.data[i + (dimX * ((j + 1) + (dimY * k)))] - volume.data[i + (dimX * ((j - 1) + (dimY * k)))]) / 2;\r\n\r\n gz = (volume.data[i + (dimX * (j + (dimY * (k + 1))))] - volume.data[i + (dimX * (j + (dimY * (k - 1))))]) / 2;\r\n\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n\r\n\r\n }\r\n }\r\n }\r\n }", "public KeyProbability(double segmentTime) { \n filters.add(new SingleKeyProbabilityFilter(true, \"ionian\", \t\t\t\tnew double[] { 0.2, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.16, 0.0, 0.12, 0.0, 0.12 } ));\n filters.add(new SingleKeyProbabilityFilter(true, \"lydian\",\t\t\t\tnew double[] { 0.2, 0.0, 0.12, 0.0, 0.16, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.12 } ));\n filters.add(new SingleKeyProbabilityFilter(true, \"mixolydian\",\t\t\tnew double[] { 0.2, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.16, 0.0, 0.12, 0.12, 0.0 } ));\n filters.add(new MultiKeyProbabilityFilter(false, \"aeolian\",\t\t\t\tnew double[][] {\n new double[] { 0.2, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.12, 0.0 },\n new double[] { 0.2, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.0, 0.12 } // harmonic\n } )); \n filters.add(new MultiKeyProbabilityFilter(false, \"dorian\",\t\t\t\tnew double[][] {\n new double[] { 0.2, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.16, 0.0, 0.12, 0.12, 0.0 },\n new double[] { 0.2, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.16, 0.0, 0.12, 0.0, 0.12 } // augmented\n } )); \n filters.add(new SingleKeyProbabilityFilter(false, \"phrygian\",\t\t\tnew double[] { 0.2, 0.12, 0.0, 0.16, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.12, 0.0 } ));\n }", "public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }", "@Override\r\n\tpublic Pixel withPixel(int x, int y, Pixel[][] matrix) {\n\t\tint m = matrix.length;\r\n\t\tint n = matrix[0].length;\r\n\t\tPixel pix = new Pixel(0, 0, 0);\r\n\t\tfloat[][] kernel = { { 1 / 16f, 1 / 8f, 1 / 16f },\r\n\t\t\t\t{ 1 / 8f, 1 / 4f, 1 / 8f }, { 1 / 16f, 1 / 8f, 1 / 16f } };\r\n\t\tint sumR = 0;\r\n\t\tint sumG = 0;\r\n\t\tint sumB = 0;\r\n\t\tint kernCenterX = (int) Math.floor(kernel.length / 2);\r\n\t\tint kernCenterY = (int) Math.floor(kernel[0].length / 2);\r\n\t\tint coordX = x + (m - kernCenterX);\r\n\t\tint coordY = y + (n - kernCenterX);\r\n\t\tfor (int i = 0; i < kernel.length; i++) {\r\n\t\t\tint mm = kernel.length - 1 - i;\r\n\t\t\tfor (int j = 0; j < kernel[0].length; j++) {\r\n\t\t\t\tint nn = kernel[0].length - 1 - n;\r\n\t\t\t\tsumR += matrix[coordX][coordY].getR() * kernel[mm][nn];\r\n\t\t\t\tsumG += matrix[coordX][coordY].getG() * kernel[mm][nn];\r\n\t\t\t\tsumB += matrix[coordX][coordY].getB() * kernel[mm][nn];\r\n\t\t\t}\r\n\t\t}\r\n\t\tpix = new Pixel(sumR, sumG, sumB);\r\n\t\treturn pix;\r\n\t}", "@Override\r\n\tpublic Point2D.Double transform(Point2D.Double p) {\r\n\t\tRealVector s = new ArrayRealVector(new double[] { p.x, p.y, 1 }, false);\r\n\t\tRealVector t = H.operate(s);\r\n\t\tp.x = t.getEntry(0) / t.getEntry(2);\r\n\t\tp.y = t.getEntry(1) / t.getEntry(2);\r\n\t\treturn p;\r\n\t}", "private static native void dtFilter_0(long guide_nativeObj, long src_nativeObj, long dst_nativeObj, double sigmaSpatial, double sigmaColor, int mode, int numIters);", "@Test\r\n\tpublic void testPositiveGenerateSignedGaussians_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String, Object> o = roc.generateSignedGaussians(10, 3.41d, 2.1d, 4, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, double[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Override\n public void filter(BoundingBox3d bounds) {\n filter = new boolean[points.size()];\n for (int i = 0; i < filter.length; i++)\n filter[i] = bounds.contains(points.get(i).xyz);\n }", "private static double G1(double x, double M) {\n double G1Val = 0.0;\n if (x >= 0 && x <= 1) {\n double denom = ((Math.PI / M) * Math.cos((Math.PI / M))) - Math.sin((Math.PI / M));\n double num = (0.5 * (((2.0 * Math.PI / M) * Math.cos((Math.PI / M))) - Math.sin((Math.PI / M))))\n - ((Math.PI / M) * Math.cos((Math.PI / M)) * x) - (0.5 * Math.sin((Math.PI / M) - ((2.0 * Math.PI / M) * x)));\n G1Val = num / denom;\n }\n return G1Val;\n }", "float DetGauss(Matrix m){\r\n Matrix mtemp = new Matrix(m.M);\r\n float hasil=1;\r\n int count = 0;\r\n int swap = -1;\r\n for(int i=0;i<mtemp.rows-1;i++){\r\n for(int j=i+1; j<mtemp.rows; j++){\r\n if(mtemp.M[i][i]<mtemp.M[j][i]){\r\n count++;\r\n swapRow(mtemp,i,j);\r\n\r\n }\r\n }\r\n for(int k=i+1; k<mtemp.rows; k++){\r\n double ratio = mtemp.M[k][i]/mtemp.M[i][i];\r\n for(int j=0;j<mtemp.cols;j++){\r\n mtemp.M[k][j] -= ratio*mtemp.M[i][j];\r\n }\r\n\r\n }\r\n\r\n }\r\n for(int i=0; i<mtemp.rows; i++){\r\n hasil *= mtemp.M[i][i];\r\n }\r\n if(count==0){\r\n swap = 1;\r\n }else{\r\n for(int i=1; i<count; i++){\r\n swap = swap * (-1);\r\n }\r\n }\r\n return hasil*swap;\r\n }", "private double processImg() {\n\n\t\ttry {\n\t\t\timgPreview.setVisibility(View.VISIBLE);\n\n\t\t\t// bitmap factory\n\t\t\tBitmapFactory.Options options = new BitmapFactory.Options();\n\n\t\t\t// downsizing image as it throws OutOfMemory Exception for larger\n\t\t\t// images\n\t\t\toptions.inSampleSize = 8;\n\n\t\t\tbitmap_ref = BitmapFactory.decodeFile(fileUriSafe.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\tbitmap_sample = BitmapFactory.decodeFile(fileUriMole.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\t//convert from bitmap to Mat\n\t\t\tMat ref = new Mat(bitmap_ref.getHeight(), bitmap_ref.getWidth(), CvType.CV_8UC4);\n\t\t\tMat sample = new Mat(bitmap_sample.getHeight(), bitmap_sample.getWidth(), CvType.CV_8UC4);\n\t\t\tMat mask = new Mat(bitmap_sample.getHeight(),bitmap_sample.getWidth(),CvType.CV_8UC4);\n\t\t\tMat sample2calcgrad = new Mat(bitmap_sample.getHeight(), bitmap_sample.getWidth(), CvType.CV_8UC4);\n\n\t\t\tUtils.bitmapToMat(bitmap_ref, ref);\n\t\t\tUtils.bitmapToMat(bitmap_sample, sample);\n\t\t\tUtils.bitmapToMat(bitmap_sample,sample2calcgrad);\n\n\t\t\t//normalize image based on reference\t\t\t\n\t\t\t//sample = normalizeImg(sample, ref);\n\n\t\t\t//Using Sobel filter to calculate gradient\n\t\t\tMat grad_x = new Mat();\n\t\t\tMat grad_y = new Mat();\n\t\t\tMat abs_grad_x = new Mat();\n\t\t\tMat abs_grad_y = new Mat();\n\t\t\tMat gradVals = new Mat();\n\t\t\tMat sample_gray = new Mat(bitmap_sample.getHeight(),bitmap_sample.getWidth(),CvType.CV_8UC1);\n\t\t\tImgproc.cvtColor(sample2calcgrad, sample_gray, Imgproc.COLOR_BGRA2GRAY);\n\t\t\tImgproc.GaussianBlur(sample_gray, sample_gray, new Size(5,5), 0);\n\n\t\t\t//Gradient X\n\t\t\tImgproc.Sobel(sample_gray, grad_x, CvType.CV_8UC1, 1, 0);\n\t\t\tCore.convertScaleAbs(grad_x, abs_grad_x,10,0);\n\n\t\t\t//Gradient Y\n\t\t\tImgproc.Sobel(sample_gray, grad_y, CvType.CV_8UC1, 0, 1);\n\t\t\tCore.convertScaleAbs(grad_y,abs_grad_y, 10, 0);\n\n\t\t\t//combine with grad = sqrt(gx^2 + gy^2)\n\t\t\tCore.addWeighted(abs_grad_x, .5, abs_grad_y, .5, 0, gradVals);\n\n\n\t\t\t//Using CANNY to further smooth Gaussian blurred image; extract contours\n\t\t\tImgproc.Canny(sample_gray, mIntermediateMat, 80, 90);\n\n\t\t\t//find contours of filtered image\n\t\t\tList <MatOfPoint> contours = new ArrayList<MatOfPoint>();\n\t\t\tImgproc.findContours(mIntermediateMat, contours, mHierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);\n\n\t\t\t// Find max contour area\n\t\t\tdouble maxArea = 0;\n\t\t\tIterator<MatOfPoint> each = contours.iterator();\n\t\t\twhile (each.hasNext()) {\n\t\t\t\tMatOfPoint wrapper = each.next();\n\t\t\t\tdouble area = Imgproc.contourArea(wrapper);\n\t\t\t\tif (area > maxArea)\n\t\t\t\t\tmaxArea = area;\n\t\t\t}\n\n\t\t\t// Filter contours by area and only keep those above thresh value\n\t\t\tmContours.clear();\n\t\t\teach = contours.iterator();\n\t\t\twhile (each.hasNext()) {\n\t\t\t\tMatOfPoint contour = each.next();\n\t\t\t\tif (Imgproc.contourArea(contour) > mMinContourArea*maxArea) {\n\t\t\t\t\tmContours.add(contour);\n\t\t\t\t\tborder.addAll(contour.toList());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//segment border into 8 parts \n\t\t\t//calc gradient along contour segment & normalize based on number of points in border\n\t\t\t//upto 7 points at end of border list ignored\n\t\t\tdouble [] seg_val = new double [8];\n\t\t\tint seg_len = border.size()/8;\n\t\t\tfor(int i = 0; i<8; i++){\n\t\t\t\tdouble contourGradientSum = 0;\n\t\t\t\tfor(int j=i*seg_len; j<(i+1)*seg_len;j++){\n\t\t\t\t\tPoint pt = border.get(j);\n\t\t\t\t\tint x = (int) pt.x;\n\t\t\t\t\tint y = (int) pt.y;\t\t\t\n\t\t\t\t\tcontourGradientSum += Core.mean(gradVals.submat(y-1, y+1, x-1, x+1)).val[0];\n\t\t\t\t}\n\t\t\t\tseg_val[i]=contourGradientSum/seg_len;\n\t\t\t}\n\n\n\t\t\tLog.v(TAG, \"grad vals: [\" + seg_val[0] + \",\" + seg_val[1] + \",\" \n\t\t\t\t\t+ seg_val[2] + \",\"+ seg_val[3] + \",\"\n\t\t\t\t\t+ seg_val[4] + \",\"+ seg_val[5] + \",\"\n\t\t\t\t\t+ seg_val[6] + \",\"+ seg_val[7] + \"]\");\n\t\t\t\n\t\t\tdouble thresh = 140;\n\t\t\tdouble score = 0;\n\n\t\t\tfor(double val:seg_val){\n\t\t\t\tif (val<=thresh){\n\t\t\t\t\tscore++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(score<8){\n\t\t\t\tscore += mContours.size()/7;\n\t\t\t\tscore = Math.min(8,score);\n\t\t\t}\n\n\n\n\t\t\tLog.v(TAG, \"score: \" +score);\n\t\t\tLog.v(TAG, \"Contours count: \" + mContours.size());\n\t\t\tLog.v(TAG, \"Border size: \" + border.size());\n\t\t\tImgproc.drawContours(sample, mContours, -1, CONTOUR_COLOR);\n\t\t\tImgproc.drawContours(mask, mContours, -1, COLOR_WHITE, -1);\n\t\t\tborders = mask;\n\n\t\t\t//display image with contours\n\t\t\tUtils.matToBitmap(sample, bitmap_sample);\n\t\t\timgPreview.setImageBitmap(bitmap_sample);\n\t\t\timgPreview.setFocusable(true);\n\n\t\t\treturn score;\n\n\t\t\t//\t\t\t\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn -1;\n\t}", "public ArrayList<Point> getUpperPoints(BufferedImage image_dest, int y_center, int width) {\n\n int w = image_dest.getWidth();\n\n //\tSystem.out.println(\"lebar x :\" +w);\n //\tSystem.out.println(\"tinggi y :\"+image_dest.getHeight());\n //int h = image_dest.getHeight();\n\n int xUpperCentroid = 0;\n int yUpperCentroid = 0;\n\n int xUpperLeft = 0;\n int yUpperLeft = 0;\n\n int xUpperRight = 0;\n int yUpperRight = 0;\n\n int x_sum = 0;\n int y_sum = 0;\n\n int x_sum_left = 0;\n int y_sum_left = 0;\n\n int x_sum_right = 0;\n int y_sum_right = 0;\n\n\n int count = 0;\n\n Point point1 = null;\n Point point2 = null;\n Point point3 = null;\n\n ArrayList<Point> points = new ArrayList<Point>();\n\n for (int y = 0; y <= y_center; y++) {\n if (width == 0) {\n\n }\n\n for (int x = 0; x < w; x++) {\n //System.out.println(\"test \"+image_dest.getRGB(x, y));\n if (image_dest.getRGB(x, y) != -1) {\n //System.out.print(image_dest.getRGB(x, y));\n x_sum += x;\n y_sum += y;\n count++;\n\n //\t\t\t\tSystem.out.print(\"0\");\n } else {\n //System.err.print(\"X\"+x+\" Y : \"+y);\n //return;\n //System.out.print(image_dest.getRGB(x, y));\n //\t\t\t\tSystem.out.print(\"1\");\n }\n }\n //\t\tSystem.out.println(\"\");\n\n\n }\n\n //\tSystem.out.println(\"\\n\\n\");\n //\tSystem.out.println(\"KIRI\");\n double d_yUpperCentroid = Double.valueOf(df.format(new Double(y_sum).doubleValue() / new Double(count).doubleValue()));\n double d_xUpperCentroid = Double.valueOf(df.format(new Double(x_sum).doubleValue() / new Double(count).doubleValue()));\n yUpperCentroid = (int) Math.round(new Double(d_yUpperCentroid));\n xUpperCentroid = (int) Math.round(new Double(d_xUpperCentroid));\n\n//\t\txUpperCentroid = (int)Math.round(new Double(x_sum)/new Double(count));\n//\t\tyUpperCentroid = (int)Math.round(new Double(y_sum)/new Double(count)); //point 3\n\n count = 0;\n for (int y = 0; y <= y_center; y++) {\n for (int x = 0; x <= xUpperCentroid; x++) {\n\n if (image_dest.getRGB(x, y) != -1) {\n //System.out.print(\"A\");\n x_sum_left += x;\n y_sum_left += y;\n count++;\n //\t\t\t System.out.print(\"0\");\n } else {\n //\t\t\t\tSystem.out.print(\"1\");\n }\n }\n //\tSystem.out.println(\"\");\n\n }\n\n double d_yUpperLeft = Double.valueOf(df.format(new Double(y_sum_left).doubleValue() / new Double(count).doubleValue()));\n double d_xUpperLeft = Double.valueOf(df.format(new Double(x_sum_left).doubleValue() / new Double(count).doubleValue()));\n yUpperLeft = (int) Math.round(new Double(d_yUpperLeft));\n xUpperLeft = (int) Math.round(new Double(d_xUpperLeft));\n\n//\t\txUpperLeft = (int)Math.round(new Double(x_sum_left)/new Double(count));\n//\t\tyUpperLeft = (int)Math.round(new Double(y_sum_left)/new Double(count));\n\n count = 0;\n\n\n for (int y = 0; y <= y_center; y++) {\n for (int x = xUpperCentroid; x < w; x++) {\n //System.out.println(\"x3 : \"+x3);\n //System.out.println(\"y3 : \"+x3);\n if (image_dest.getRGB(x, y) != -1) {\n x_sum_right += x;\n y_sum_right += y;\n count++;\n //\t\t\tSystem.out.print(\"0\");\n } else {\n //\t\t\tSystem.out.print(\"1\");\n }\n }\n //\tSystem.out.println(\"\");\n }\n\n double d_yUpperRight = Double.valueOf(df.format(new Double(y_sum_right).doubleValue() / new Double(count).doubleValue()));\n double d_xUpperRight = Double.valueOf(df.format(new Double(x_sum_right).doubleValue() / new Double(count).doubleValue()));\n yUpperLeft = (int) Math.round(new Double(d_yUpperRight));\n xUpperLeft = (int) Math.round(new Double(d_xUpperRight));\n\n//\t\txUpperRight= (int)Math.round(new Double(x_sum_right)/new Double(count));\n//\t\tyUpperRight =(int)Math.round(new Double(y_sum_right)/new Double(count));\n count = 0;\n\n point1 = new Point(xUpperRight, yUpperRight);\n point2 = new Point(xUpperLeft, yUpperLeft);\n point3 = new Point(xUpperCentroid, yUpperCentroid);\n\n\n points.add(point1);\n points.add(point2);\n points.add(point3);\n//\n return points;\n }", "public static void main(String args[]) {\n\t\t\n\t\tString dataPath = args[0];\n\t\tint iniIter = Integer.parseInt(args[1]);\n\t\tboolean isCov1 = Boolean.parseBoolean(args[2]);\n\t\tint maxIter = Integer.parseInt(args[3]);\n\t\t\n\t\tgaussianEM gem = new gaussianEM(dataPath, iniIter, isCov1, maxIter);\n\t\tSystem.out.println(\"log likelihood/10000:\");\n\t\tSystem.out.println(gem.loglike/10000);\n\t\tSystem.out.println(\"centers:\");\n\t\tSystem.out.println(gem.mu_k[0]);\n\t\tSystem.out.println(gem.mu_k[1]);\n\t\tSystem.out.println(gem.mu_k[2]);\n\t\tSystem.out.println(\"variance:\");\n\t\tSystem.out.println(gem.cov_k[0]);\n\t\tSystem.out.println(gem.cov_k[1]);\n\t\tSystem.out.println(gem.cov_k[2]);\n\t\tSystem.out.println(\"assiginment ration of each clusters:\");\n\t\tSystem.out.println(gem.pi_k[0]);\n\t\tSystem.out.println(gem.pi_k[1]);\n\t\tSystem.out.println(gem.pi_k[2]);\n\t}", "@Override\n public Bitmap filterImage(Bitmap inputImage){\n Mat cvMat = new Mat(inputImage.getWidth(), inputImage.getHeight(), CvType.CV_8UC4);\n Utils.bitmapToMat(inputImage, cvMat);\n // Convert Image to grayscale\n Mat cvMatGray = new Mat(inputImage.getWidth(), inputImage.getHeight(), CvType.CV_8UC1);\n Imgproc.cvtColor(cvMat, cvMatGray, Imgproc.COLOR_BGRA2GRAY);\n cvMatGray.convertTo(cvMatGray, CvType.CV_64FC1);\n Mat cvMatGrayInvert = cvMatGray.clone();\n // Then apply a gaussian blur\n Mat cvMatGrayBlurred = new Mat(inputImage.getWidth(),\n inputImage.getHeight(),\n CvType.CV_64FC1);\n Size kernelSize = new Size(25, 25);\n Imgproc.GaussianBlur(\n cvMatGrayInvert,\n cvMatGrayBlurred,\n kernelSize,\n 0,\n 0,\n Core.BORDER_CONSTANT\n );\n // Finally Blend the grayscale image with the blurred negative\n Mat cvMatGrayBlend = cvMatGray.clone();\n Core.divide(cvMatGrayBlend, cvMatGrayBlurred, cvMatGrayBlend, 256);\n cvMatGrayBlend.convertTo(cvMatGrayBlend, CvType.CV_8UC3);\n Bitmap filteredImage = Bitmap.createBitmap(\n cvMat.cols(),\n cvMat.rows(),\n Bitmap.Config.ARGB_8888\n );\n Utils.matToBitmap(cvMatGrayBlend, filteredImage);\n return filteredImage;\n }", "List<List<Pixel>> filter(Image img, int multiplier, String operation);", "public static double[] Gauss(Matriks M) {\r\n \tdouble[][] a = new double[M.BrsEff][M.KolEff-1];\r\n \tdouble[] b = new double[M.BrsEff];\r\n \tfor (int i = 0; i < M.BrsEff; i++){\r\n \t\tfor (int j = 0; j < M.KolEff-1; j++){\r\n \t\t\ta[i][j] = M.Elmt[i][j];\r\n \t\t}\r\n \t}\r\n \tfor (int i = 0; i < M.BrsEff; i++){\r\n \t\tb[i] = M.Elmt[i][M.KolEff-1];\r\n \t}\r\n int n = b.length;\r\n\r\n for (int p = 0; p < n; p++) {\r\n\r\n int max = p;\r\n for (int i = p + 1; i < n; i++) {\r\n if (Math.abs(a[i][p]) > Math.abs(a[max][p])) {\r\n max = i;\r\n }\r\n }\r\n double[] temp = a[p];\r\n a[p] = a[max];\r\n a[max] = temp;\r\n double t = b[p];\r\n b[p] = b[max];\r\n b[max] = t;\r\n\r\n for (int i = p + 1; i < n; i++) {\r\n double ratio = a[i][p] / a[p][p];\r\n b[i] -= ratio * b[p];\r\n for (int j = p; j < n; j++) {\r\n a[i][j] -= ratio * a[p][j];\r\n }\r\n }\r\n }\r\n\r\n double[] x = new double[n];\r\n for (int i = n - 1; i >= 0; i--) {\r\n double sum = 0;\r\n for (int j = i + 1; j < n; j++) {\r\n sum += a[i][j] * x[j];\r\n }\r\n x[i] = (b[i] - sum) / a[i][i];\r\n }\r\n return x;\r\n }", "public static double nextGaussian() {\n return randGen.nextGaussian();\n }", "private void run2D(int numImages) {\r\n\r\n this.buildProgressBar();\r\n int totalComputation = numImages * numIterations;\r\n int computationCount = 0;\r\n\r\n // OK, here is where the meat of the algorithm goes\r\n\r\n int length;\r\n int extents[] = new int[2];\r\n extents[0] = srcImage.getExtents()[0];\r\n extents[1] = srcImage.getExtents()[1];\r\n xDim = extents[0];\r\n yDim = extents[1];\r\n length = xDim * yDim;\r\n\r\n // buffers for the image data\r\n float sourceBuffer[];\r\n float resultBuffer[];\r\n float gaussianBuffer[];\r\n float gradientBuffer[];\r\n\r\n // copy the image data into the sourceBuffer so we can access it\r\n try {\r\n sourceBuffer = new float[length];\r\n resultBuffer = new float[length];\r\n gaussianBuffer = new float[length];\r\n gradientBuffer = new float[length];\r\n } catch (OutOfMemoryError e){\r\n sourceBuffer = resultBuffer = gaussianBuffer = gradientBuffer = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: Out of memory when creating image buffer\", true);\r\n return;\r\n } // catch{}\r\n\r\n // Gaussian blur the input image as a 2.5D image set\r\n sigmas = new float[2];\r\n sigmas[0] = sigmas[1] = stdDev;\r\n\r\n makeKernels1D(false);\r\n\r\n // source image is in sourceBuffer, gaussian smoothed image is in gaussianBuffer\r\n\r\n\r\n\r\n int startIndex;\r\n for (int imgNumber = 0; imgNumber < numImages; imgNumber++) {\r\n startIndex = imgNumber * length;\r\n try {\r\n srcImage.exportData(startIndex, length, sourceBuffer);\r\n } catch (IOException error) {\r\n sourceBuffer = resultBuffer = gaussianBuffer = gradientBuffer = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: could NOT export source image\", true);\r\n return;\r\n } // catch()\r\n // make the magnitude of the gradient image of the gaussian smoothed source image\r\n algoSepConvolver = new AlgorithmSeparableConvolver(gaussianBuffer, sourceBuffer,\r\n extents, xDataRound, yDataRound, srcImage.isColorImage());\r\n\r\n for(int iterNum = 0; iterNum < numIterations; iterNum++) {\r\n if (isProgressBarVisible()) {\r\n progressBar.updateValue(Math.round( ( (float) (computationCount) /\r\n (totalComputation - 1) * 100)),\r\n activeImage);\r\n }\r\n\r\n algoSepConvolver.run();\r\n gradientMagnitude(gaussianBuffer, gradientBuffer);\r\n upDateImage(resultBuffer, sourceBuffer, gradientBuffer);\r\n\r\n // copy resultBuffer to sourceBuffer for the next iteration\r\n if (iterNum < (numIterations - 1)) {\r\n for (int i = 0; i < length; i++) { sourceBuffer[i] = resultBuffer[i]; }\r\n }\r\n\r\n computationCount++;\r\n } // end for (int iterNum = 0; ...)\r\n\r\n algoSepConvolver.finalize();\r\n algoSepConvolver = null;\r\n\r\n // OK, the resultBuffer is filled with the results of the algorithm,\r\n // put this data into the destination image so it will be displayed in\r\n // in the ViewJFrameWizard\r\n try {\r\n destImage.importData(startIndex, resultBuffer, true);\r\n } catch (IOException error) {\r\n sourceBuffer = resultBuffer = gaussianBuffer = gradientBuffer = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: Could NOT import resultBuffer to the image\", true);\r\n return;\r\n } // end try{}-catch{}\r\n\r\n } // end for (imgNumber = 0; ...)\r\n\r\n disposeProgressBar();\r\n if (threadStopped) { finalize(); return; }\r\n\r\n setCompleted(true);\r\n }", "private void obtainRefiningPoints(ArrayList<double[]> points2d_in, Matrix P, double gridSize_in, int gridCount_in[], ArrayList<double[]> points2d_out, ArrayList<double[]> points3d_out) {\n\t\tdouble fuzziness = 25;\n\t\tfor (int x = (gridCount_in[0] > 1 ? 1 : 0); x < gridCount_in[0]; x += 2) {\n\t\t\tfor (int y = (gridCount_in[1] > 1 ? 1 : 0); y < gridCount_in[1]; y += 2) {\n\t\t\t\tfor (int z = 1; z < gridCount_in[2]; z += 2) {\n\t\t\t\t\tMatrix x3D = new Matrix(4, 1);\n\t\t\t\t\tx3D.set(0, 0, x * gridSize_in);\n\t\t\t\t\tx3D.set(1, 0, y * gridSize_in);\n\t\t\t\t\tx3D.set(2, 0, z * gridSize_in);\n\t\t\t\t\tx3D.set(3, 0, 1.0);\n\t\t\t\t\tMatrix x2D = P.mul(x3D);\n\t\t\t\t\tx2D = x2D.div(x2D.get(2));\n\t\t\t\t\tdouble minDistance = 100000;\n\t\t\t\t\tint minDistanceIndex = 0;\n\t\t\t\t\tfor (int j=0;j<points2d_in.size();j++) {\n\t\t\t\t\t\tdouble distance = Math.pow(x2D.get(0) - points2d_in.get(j)[0], 2) + Math.pow(x2D.get(1) - points2d_in.get(j)[1], 2);\n\t\t\t\t\t\tif (distance < minDistance) {\n\t\t\t\t\t\t\tminDistance = distance;\n\t\t\t\t\t\t\tminDistanceIndex = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (minDistance < fuzziness) {\n\t\t\t\t\t\tpoints2d_out.add(points2d_in.get(minDistanceIndex));\n\t\t\t\t\t\tpoints3d_out.add(new Matrix(x3D).data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public final EObject ruleGaussianTypeSpecifier() throws RecognitionException {\n EObject current = null;\n\n EObject lv_unit_3_0 = null;\n\n EObject lv_dimensions_6_0 = null;\n\n EObject lv_dimensions_8_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1989:6: ( ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:1: ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:1: ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:2: () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:2: ()\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1991:5: \n {\n \n temp=factory.create(grammarAccess.getGaussianTypeSpecifierAccess().getGaussianTypeSpecifierAction_0().getType().getClassifier());\n current = temp; \n temp = null;\n CompositeNode newNode = createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getGaussianTypeSpecifierAction_0(), currentNode.getParent());\n newNode.getChildren().add(currentNode);\n moveLookaheadInfo(currentNode, newNode);\n currentNode = newNode; \n associateNodeWithAstElement(currentNode, current); \n \n\n }\n\n match(input,37,FOLLOW_37_in_ruleGaussianTypeSpecifier3490); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getGaussKeyword_1(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2005:1: ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )?\n int alt29=2;\n int LA29_0 = input.LA(1);\n\n if ( (LA29_0==25) ) {\n alt29=1;\n }\n switch (alt29) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2005:3: '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')'\n {\n match(input,25,FOLLOW_25_in_ruleGaussianTypeSpecifier3501); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getLeftParenthesisKeyword_2_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2009:1: ( (lv_unit_3_0= ruleUnitExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2010:1: (lv_unit_3_0= ruleUnitExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2010:1: (lv_unit_3_0= ruleUnitExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2011:3: lv_unit_3_0= ruleUnitExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getUnitUnitExpressionParserRuleCall_2_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleUnitExpression_in_ruleGaussianTypeSpecifier3522);\n lv_unit_3_0=ruleUnitExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"unit\",\n \t \t\tlv_unit_3_0, \n \t \t\t\"UnitExpression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n match(input,26,FOLLOW_26_in_ruleGaussianTypeSpecifier3532); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getRightParenthesisKeyword_2_2(), null); \n \n\n }\n break;\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2037:3: ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n int alt31=2;\n int LA31_0 = input.LA(1);\n\n if ( (LA31_0==33) ) {\n alt31=1;\n }\n switch (alt31) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2037:5: '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']'\n {\n match(input,33,FOLLOW_33_in_ruleGaussianTypeSpecifier3545); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getLeftSquareBracketKeyword_3_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2041:1: ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2042:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2042:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2043:3: lv_dimensions_6_0= ruleArrayDimensionSpecification\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleGaussianTypeSpecifier3566);\n lv_dimensions_6_0=ruleArrayDimensionSpecification();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"dimensions\",\n \t \t\tlv_dimensions_6_0, \n \t \t\t\"ArrayDimensionSpecification\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2065:2: ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )*\n loop30:\n do {\n int alt30=2;\n int LA30_0 = input.LA(1);\n\n if ( (LA30_0==14) ) {\n alt30=1;\n }\n\n\n switch (alt30) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2065:4: ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t {\n \t match(input,14,FOLLOW_14_in_ruleGaussianTypeSpecifier3577); \n\n \t createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getCommaKeyword_3_2_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2069:1: ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2070:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2070:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2071:3: lv_dimensions_8_0= ruleArrayDimensionSpecification\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_2_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleGaussianTypeSpecifier3598);\n \t lv_dimensions_8_0=ruleArrayDimensionSpecification();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().getType().getClassifier());\n \t \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t \t }\n \t \t try {\n \t \t \t\tadd(\n \t \t \t\t\tcurrent, \n \t \t \t\t\t\"dimensions\",\n \t \t \t\tlv_dimensions_8_0, \n \t \t \t\t\"ArrayDimensionSpecification\", \n \t \t \t\tcurrentNode);\n \t \t } catch (ValueConverterException vce) {\n \t \t\t\t\thandleValueConverterException(vce);\n \t \t }\n \t \t currentNode = currentNode.getParent();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop30;\n }\n } while (true);\n\n match(input,34,FOLLOW_34_in_ruleGaussianTypeSpecifier3610); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getRightSquareBracketKeyword_3_3(), null); \n \n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "private double sigmoidPrime(double x) {\n return x * (1 - x);\n }", "private static native void rollingGuidanceFilter_0(long src_nativeObj, long dst_nativeObj, int d, double sigmaColor, double sigmaSpace, int numOfIter, int borderType);", "private static native long createDTFilter_0(long guide_nativeObj, double sigmaSpatial, double sigmaColor, int mode, int numIters);", "public void setGhostPoint(double[] point, boolean connected);" ]
[ "0.63382727", "0.6230982", "0.61350286", "0.6015929", "0.59254706", "0.5796465", "0.5666851", "0.5620814", "0.55068654", "0.549492", "0.5480227", "0.5453791", "0.54337656", "0.53027356", "0.5297538", "0.52581155", "0.52315944", "0.5227258", "0.51564145", "0.51554805", "0.5152008", "0.5140594", "0.51169133", "0.50309545", "0.4987799", "0.497193", "0.49402767", "0.49139667", "0.4909877", "0.48713022", "0.48516163", "0.48483747", "0.48128873", "0.48084328", "0.48049465", "0.4779084", "0.47782362", "0.47735634", "0.47676578", "0.47667465", "0.47637352", "0.4758607", "0.4752101", "0.47435197", "0.47368148", "0.47342056", "0.47339228", "0.47094187", "0.46912718", "0.4689918", "0.46874532", "0.46645156", "0.4656876", "0.46411473", "0.46213704", "0.46080726", "0.46004063", "0.4600096", "0.459892", "0.45932183", "0.4590101", "0.45846808", "0.45814368", "0.45812064", "0.45652816", "0.45457536", "0.45400995", "0.4516075", "0.45126906", "0.4496297", "0.44882143", "0.44801214", "0.44730964", "0.4469301", "0.446679", "0.44559783", "0.4455543", "0.4453645", "0.4443365", "0.44398576", "0.44380873", "0.4436175", "0.4434671", "0.44226918", "0.44222587", "0.44174758", "0.44041216", "0.43944392", "0.43944207", "0.43884405", "0.43875116", "0.4386229", "0.43804488", "0.4377844", "0.4372784", "0.43706185", "0.4366277", "0.43624464", "0.43588147", "0.43576857" ]
0.5942078
4
called when user has put in all of the input successfully.
public void newRound(){ clearRandomDirections(); this.currentAmountToPutIn++; initializeNewRound(); //reset timer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkUserInput() {\n }", "private void takeInUserInput(){\n\t\t// only take in input when it is in the ANSWERING phase\n\t\tif(spellList.status == QuizState.Answering){\n\t\t\tspellList.setAnswer(getAndClrInput());\n\t\t\tspellList.status = QuizState.Answered;\n\t\t\tansChecker=spellList.getAnswerChecker();\n\t\t\tansChecker.execute();\n\t\t}\t\n\n\t}", "public void takeUserInput() {\n\t\t\r\n\t}", "@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isAcceptingInput() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isAcceptingInput() {\n\t\treturn true;\n\t}", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "protected abstract boolean checkInput();", "public void processInput() {\n\n\t}", "private void validateInputParameters(){\n\n }", "@Override\n\tprotected void processInput() {\n\t}", "@FXML\n private void handleUserInput() {\n String input = userInput.getText();\n String response = getResponse(input);\n if (response.equals(ExitCommand.COMMAND_WORD)) {\n handleExit();\n }\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userImage),\n DialogBox.getDukeDialog(response, dukeImage)\n );\n userInput.clear();\n }", "public boolean checkInput();", "private boolean isInputValid() {\n return true;\n }", "@FXML\n private void handleUserInput() {\n String input = inputTextField.getText();\n storeUserInputHistory(input);\n try {\n Command command = ParserFactory.parse(input);\n command.execute(tasks, storage, history);\n } catch (ChronologerException e) {\n e.printStackTrace();\n }\n printUserMessage(\" \" + input);\n printChronologerMessage(UiMessageHandler.getOutputForGui());\n inputTextField.clear();\n }", "@FXML\n private void handleUserInput() {\n String input = userInput.getText();\n CommandResult dukeResponse;\n try {\n dukeResponse = duke.getResponse(input);\n runDialogContainer(input, dukeResponse);\n if (dukeResponse.isExit()) {\n runExitDialogContainer();\n }\n } catch (DukeException e) {\n runDialogContainer(input, e.getMessage());\n }\n userInput.clear();\n }", "private void handleInput() {\n\n // Get the input string and check if its not empty\n String text = textInput.getText().toString();\n if (text.equals(\"\\n\")) {\n textInput.setText(\"\");\n return;\n }\n // remove empty line\n if (text.length() >= 2 && text.endsWith(\"\\n\")) text = text.substring(0, text.length() - 1);\n\n if (TextUtils.isEmpty(text)) return;\n textInput.setText(\"\");\n\n myGame.onInputString(text);\n }", "@FXML\n private void handleUserInput() {\n String input = userInput.getText();\n String response = duke.getResponse(input);\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userIcon),\n DialogBox.getDukeDialog(response, mrRobotIcon)\n );\n userInput.clear();\n if (response.equals(\"Goodbye friend.\")) {\n Platform.exit();\n }\n }", "public static void processInputNames() {\r\n\t\tif (!IniSetup.enterNames.getText().equals(\"\")) {\r\n\t\t\tnames.add((String) IniSetup.enterNames.getText());\r\n\t\t}\r\n\t}", "@Override\r\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\tcheckInput();\r\n\t\t\t}", "@And(\"^user enters any \\\"([^\\\"]*)\\\"$\")\n public void userEntersAny(String arg0) throws Throwable {\n }", "@FXML\n private void handleUserInput() {\n String input = userInput.getText();\n if (input.toLowerCase().equals(\"bye\")) {\n String response = cait.getResponse(input);\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userImage),\n DialogBox.getCaitDialog(response, caitImage)\n );\n userInput.clear();\n Platform.exit();\n }\n String response = cait.getResponse(input);\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userImage),\n DialogBox.getCaitDialog(response, caitImage)\n );\n userInput.clear();\n }", "public abstract boolean supportsMultipleInputs();", "@FXML\n private void handleUserInput() {\n Parser parser = new Parser();\n String input = userInput.getText();\n String response;\n if (input.equals(\"bye\")) {\n response = ui.ending();\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userImage),\n DialogBox.getDukeDialog(response, dukeImage)\n );\n userInput.clear();\n\n } else {\n response = parser.getResponse(input);\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userImage),\n DialogBox.getDukeDialog(response, dukeImage)\n );\n\n }\n userInput.clear();\n\n\n }", "public abstract boolean listenerUserInput();", "public abstract boolean verifyInput();", "private boolean validateUserInputs() {\n ArrayList<String> errors = new ArrayList();\n \n if (this.view.getContent().equals(\"\")) {\n errors.add(\"\\t - Enter a comment\");\n }\n \n if (errors.size() > 0) {\n String errorMsg = \"Unable to save new Asset.\\nDetails:\";\n for (String error : errors) {\n errorMsg += \"\\n\" + error;\n }\n JOptionPane.showMessageDialog(this.view, errorMsg, \"Unable to Save\", JOptionPane.INFORMATION_MESSAGE);\n return false;\n }\n return true;\n }", "public boolean checkInput(){\n if(spelerIDField.getText().equals(\"\") || typeField.getText().equals(\"\") || codeField.getText().equals(\"\") || heeftBetaaldField.getText().equals(\"\")){\n return true;\n } else { return false; }\n }", "public void execute() {\n String input;\n boolean isInputValid;\n\n do {\n isInputValid = true;\n\n System.out.print(\"Please send me the numbers using space between them like \\\"1 2 3\\\": \");\n input = sc.nextLine();\n\n try {\n validateData(input);\n } catch (NumberFormatException e) {\n System.err.println(\"NumberFormatException \" + e.getMessage());\n isInputValid = false;\n }\n\n } while (!isInputValid);\n\n System.out.println(\"Result: \" + find(input));\n }", "@Override\n\tpublic void inputEnded() {\n\n\t}", "protected void processInputs() {\n\t\twhile (InputInfo.size() > 0) {\n\t\t\tInputInfo info = InputInfo.get();\n\n\t\t\tif (info.kind == 'k' && (info.action == GLFW_PRESS\n\t\t\t\t\t|| info.action == GLFW_REPEAT)) {\n\t\t\t\tint code = info.code;\n\n\t\t\t}// input event is a key\n\t\t\telse if (info.kind == 'm') {// mouse moved\n\t\t\t\t// System.out.println( info );\n\t\t\t} else if (info.kind == 'b') {// button action\n\t\t\t\t// System.out.println( info );\n\t\t\t}\n\n\t\t}// loop to process all input events\n\n\t}", "private boolean isInputOkay() {\n // checks the text fields\n if (mBinding.date.getText() == null || mBinding.date.getText().toString().equals(\"\")) {\n snackBar(\"Please select the date.\");\n return false;\n }\n\n if (mBinding.time.getText() == null || mBinding.time.getText().toString().equals(\"\")) {\n snackBar(\"Please select the time.\");\n return false;\n }\n\n if (mBinding.stress.getText() == null || mBinding.stress.getText().toString().equals(\"\")) {\n snackBar(\"Please select the stress level.\");\n return false;\n }\n\n if (mBinding.tired.getText() == null || mBinding.tired.getText().toString().equals(\"\")) {\n snackBar(\"Please select the tiredness level.\");\n return false;\n }\n\n if (mBinding.mv0.getText() == null || mBinding.mv0.getText().toString().equals(\"\")) {\n snackBar(\"Please select at least the start glucose value.\");\n return false;\n }\n\n return true;\n }", "@Override\n\tpublic void inputEnded() {\n\t\t\n\t}", "private void getUserInput() {\n getUserTextInput();\n getUserPhotoChoice();\n getUserRoomChoice();\n getUserBedroomsChoice();\n getUserBathroomsChoice();\n getUserCoownerChoice();\n getUserIsSoldChoice();\n getUserTypeChoice();\n mAmenitiesInput = Utils.getUserAmenitiesChoice(mBinding.chipGroupAmenities.chipSchool,\n mBinding.chipGroupAmenities.chipShop, mBinding.chipGroupAmenities.chipTransport,\n mBinding.chipGroupAmenities.chipGarden);\n }", "public void input_entered() {\n\t\t_last_column = 0;\n\t\t_last_line = 0;\n\t\t_last_printed = '\\n';\n\t}", "public void approveAll() {\r\n\t\tif (readDocument != null) {\r\n\t\t\tif (incorrectWords.size() > 0) {\r\n\t\t\t\tScanner sc = new Scanner(System.in);\r\n\t\t\t\tObject[] incorrectWordsArray = incorrectWords.toArray();\r\n\t\t\t\tSystem.out.println(\"Would you like to add the following misspelled words to the dictionary?\");\r\n\t\t\t\tfor (int i = 0; i < incorrectWordsArray.length; i++) {\r\n\t\t\t\t\tSystem.out.println(incorrectWordsArray[i]);\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.print(\"(Y/N): \");\r\n\t\t\t\tString response = sc.next();\r\n\t\t\t\tif (response.equalsIgnoreCase(\"Y\")) {\r\n\t\t\t\t\tfor (int i = 0; i < incorrectWordsArray.length; i++) {\r\n\t\t\t\t\t\tdictionary.add((String)incorrectWordsArray[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tincorrectWords.clear();\r\n\t\t\t\t\tSystem.out.println(\"Your changes were made to the dictionary.\");\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\"There were no misspelled words.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"You have not read in a document to be spell checked. Please indicate file name\"\r\n\t\t\t\t\t+ \" before using this feature.\");\r\n\t\t}\r\n\t}", "public void listenUserInput(){\n boolean quit = false;\n while(!quit) {\n String head = scanner.next();\n switch (head) {\n case \"get\": {\n String key = scanner.next();\n if (key == null) {\n System.out.println(\"[User] No key specified\");\n continue;\n }\n this.get(key);\n continue;\n }\n case \"put\": {\n String key = scanner.next();\n String value = scanner.next();\n if (key == null || value == null) {\n System.out.println(\"[User] No key or value specified\");\n continue;\n }\n Object obj = parseValueType(value);\n if (obj != null) {\n this.put(key, parseValueType(value));\n }\n else {\n System.out.println(\"[User] Unknown data type\");\n }\n continue;\n }\n case \"delete\": {\n String key = scanner.next();\n if (key == null) {\n System.out.println(\"[User] No key specified\");\n continue;\n }\n this.delete(key);\n continue;\n }\n case \"getall\":{\n this.getAll();\n continue;\n }\n case \"quit\":{\n System.out.println(\"[User] Goodbye\");\n quit = true;\n break;\n }\n default:{\n System.out.println(\"[User] Invalid command\");\n }\n }\n }\n }", "@Override\r\n\tpublic void acceptInput(String input) {\n\t\t\r\n\t}", "private void verifyInput(){\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n\n mNameFieldsFilled = !TextUtils.isEmpty(firstName) && !TextUtils.isEmpty(lastName);\n\n }", "public void getInput() {\r\n System.out.print(\"Is the car silent when you turn the key? \");\r\n setAnswer1(in.nextLine());\r\n if(getAnswer1().equals(YES)) {\r\n System.out.print(\"Are the battery terminals corroded? \");\r\n setAnswer2(in.nextLine());\r\n if(getAnswer2().equals(YES)){\r\n printString(\"Clean the terminals and try again\");\r\n }\r\n else {\r\n printString(\"The battery may be damaged.\\nReplace the cables and try again\");\r\n }\r\n\r\n }\r\n else {\r\n System.out.print(\"Does the car make a slicking noise? \");\r\n setAnswer3(in.nextLine());\r\n if(getAnswer3().equals(YES)) {\r\n printString(\"Replace the battery\");\r\n }\r\n else {\r\n System.out.print(\"Does the car crank up but fail to start? \");\r\n setAnswer4(in.nextLine());\r\n if(getAnswer4().equals(YES)) {\r\n printString(\"Check spark plug connections.\");\r\n }\r\n else{\r\n System.out.print(\"Does the engine start and then die? \");\r\n setAnswer5(in.nextLine());\r\n if(getAnswer5().equals(YES)){\r\n System.out.print(\"Does your care have fuel injection? \");\r\n setAnswer6(in.nextLine());\r\n if(getAnswer6().equals(YES)){\r\n printString(\"Get it in for service\");\r\n }\r\n else{\r\n printString(\"Check to insure the chock is opening and closing\");\r\n }\r\n }\r\n else {\r\n printString(\"This should be impossible\");\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n }", "public void input(){\n\t\tboolean[] inputKeyArray = inputHandler.processKeys();\n\t\tint[] inputMouseArray = inputHandler.processMouse();\n\t\tcurrentLevel.userInput(inputKeyArray, inputMouseArray);\n\t}", "@Override\n\tpublic void handleInput() {\n\t\t\n\t}", "private boolean checkingAllArguments() {\n\t\t\n\t\t// test if the four player types have been selected\n\t\tfor(int i=0;i<allButtons.size();i++) {\n\t\t\tif(allButtons.get(i)==null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// test if the seed is in the correct format\n\t\tif(!(seed.textProperty().get().isEmpty())){\n\t\t\ttry {\n\t\t\t\tgameSeed = Long.parseLong(seed.getText());\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\tmenuMessage.setText(\"Given seed is not a valid number\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t// test if for each of the players the given arguments are correct\n\t\tfor(int i = 0; i < allButtons.size(); ++i) {\n\t\t\tchar playerType = allButtons.get(i).getText().charAt(0);\n\t\t\tString argument = texts.get(2 * i + 1).getText();\n\t\t\t\n\t\t\tif(!argument.isEmpty()) {\n\t\t\t\tswitch(playerType) {\n\t\t\t\t\n\t\t\t\tcase 'S' : \n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlong l = Long.parseLong(texts.get(2 * i + 1).getText());\n\t\t\t\t\t\tif(l < 9) {\n\t\t\t\t\t\t\tmenuMessage.setText(\"The iteration value must be at least 9\");\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\tmenuMessage.setText(\"One of the iteration number is not a valid number\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'R' :\n\t\t\t\t\t\n\t\t\t\t\tString[] parts = StringSerializer.split(\"\\\\.\", argument); \n\t\t\t\t\t\n\t\t\t\t\tif (parts.length != 4) { \n\t\t\t\t\t\tmenuMessage.setText(\"One of the IP Address is not a valid address\");\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\tfor (String str : parts) { \n\t\t\t\t\t\tint j = Integer.parseInt(str); \n\t\t\t\t\t\tif ((j < 0) || (j > 255)) { \n\t\t\t\t\t\t\tmenuMessage.setText(\"One of the IP Address is not a valid address\");\n\t\t\t\t\t\t\treturn false; \n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\treturn true;\n\t}", "@FXML\n private void handleUserInput() {\n if (userInput.getText().trim().length() != 0) {\n String input = userInput.getText();\n String response = ailurus.getResponse(input);\n assert response.length() != 0 : \"response should not be empty\";\n assert userImage != null : \"userImage should not be null\";\n assert ailurusImage != null : \"ailurusImage should not be null\";\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userImage),\n DialogBox.getAilurusDialog(response, ailurusImage)\n );\n userInput.clear();\n if (Ailurus.isExit()) {\n userInput.setDisable(true);\n new Timer().schedule(new TimerTask() {\n @Override\n public void run() {\n Platform.exit();\n System.exit(0);\n }\n }, 1000);\n }\n } else {\n userInput.clear();\n }\n }", "private void processInputs() {\n if (controller.escape) { parent.changeScreen(parent.PAUSE, parent.GAME_PLAY); }\r\n\r\n // Ask the controller if the left paddle has been told to do anything\r\n if (controller.leftUp) { leftPaddle.moveUp(); }\r\n else if (controller.leftDown) { leftPaddle.moveDown(); }\r\n else { leftPaddle.stayPut(); }\r\n // same for the right\r\n if (controller.rightUp) { rightPaddle.moveUp(); }\r\n else if (controller.rightDown) { rightPaddle.moveDown(); }\r\n else { rightPaddle.stayPut(); }\r\n\r\n }", "public void acceptInput(int keyPressed){\r\n\t\tif (!done){\r\n\t\t\tif (keyPressed == Constants.KEY_UP){\r\n\t\t\t\tif (thisDialog.get(dialogToDisplay).isOption()){\r\n\t\t\t\t\tOption yada = (Option)thisDialog.get(dialogToDisplay);\r\n\t\t\t\t\tyada.moveSelectRect(true);\r\n\t\t\t\t}\r\n\t\t\t}else if (keyPressed == Constants.KEY_DOWN){\r\n\t\t\t\tif (thisDialog.get(dialogToDisplay).isOption()){\r\n\t\t\t\t\tOption yada = (Option)thisDialog.get(dialogToDisplay);\r\n\t\t\t\t\tyada.moveSelectRect(false);\r\n\t\t\t\t}\r\n\t\t\t}else if (keyPressed == Constants.KEY_ACCEPT){\r\n\t\t\t\tif (thisDialog.get(dialogToDisplay).isOption()){\r\n\t\t\t\t\tOption yada = (Option)thisDialog.get(dialogToDisplay);\r\n\t\t\t\t\toptionSelection = yada.getValue();\r\n\t\t\t\t\tLog.info(\"Value:\"+optionSelection);\r\n\t\t\t\t\tfor (int i=0; i< thisDialog.size();i++){\r\n\t\t\t\t\t\tif (thisDialog.get(i).getName().equals(optionSelection)){\r\n\t\t\t\t\t\t\tqueuedDialog = 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}else{\r\n\t\t\t\t\t//thisDialog.get(dialogToDisplay).switchBoxState();\r\n\t\t\t\t\tif (thisDialog.get(dialogToDisplay).getProceed().equals(Text.PROCEED_NEXT)){\r\n\t\t\t\t\t\t// if there are any values left in the arrayList, then increment the \r\n\t\t\t\t\t\t// queuedDialog\r\n\t\t\t\t\t\tif ((dialogToDisplay + 1) < thisDialog.size()){\r\n\t\t\t\t\t\t\tqueuedDialog=dialogToDisplay +1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else if (thisDialog.get(dialogToDisplay).getProceed().equals(Text.PROCEED_LAST)){\r\n\t\t\t\t\t\tif ((dialogToDisplay - 1) > 0){\r\n\t\t\t\t\t\t\tqueuedDialog=dialogToDisplay -1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else if (thisDialog.get(dialogToDisplay).getProceed().equals(Text.PROCEED_END)){\r\n\t\t\t\t\t\tthis.done = true;\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tfor (int i=0; i<thisDialog.size();i++){\r\n\t\t\t\t\t\t\tif (thisDialog.get(i).getName().equals(thisDialog.get(dialogToDisplay).getProceed())){\r\n\t\t\t\t\t\t\t\tqueuedDialog = i;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// check to see if we've done something to change the queue\r\n\t\t\t\tconsiderQueue();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void readInput()\n\t{\n\t\tString userInput;\n\t\tChoices choice;\n\t\t\n\t\tdo {\n\t\t\tlog.log(Level.INFO, \"Please give the inputs as:\\n\"\n\t\t\t\t\t+ \"ADDACCOUNT to add the account\\n\" \n\t\t\t\t\t+ \"DISPLAYALL to display all accounts\\n\"\n\t\t\t\t\t+ \"SEARCHBYACCOUNT to search by account\\n\"\n\t\t\t\t\t+ \"DEPOSIT to deposit into account\\n\"\n\t\t\t\t\t+ \"WITHDRAW to withdraw from the account\\n\"\n\t\t\t\t\t+ \"EXIT to end the application\"\n\t\t\t\t\t);\n userInput = scan.next();\n choice = Choices.valueOf(userInput);\n\n switch (choice) {\n case ADDACCOUNT : \taddAccount();\n \t\t\t\t\t\tbreak;\n \n case DISPLAYALL :\t\tdisplayAll();\n \t\t\t\t\t\tbreak;\n\n case SEARCHBYACCOUNT :\tsearchByAccount();\n \t\t\t\t\t\tbreak;\n \n case DEPOSIT :\t\t\tdepositAmount();\n \t\t\t\t\t\tbreak;\n \n case WITHDRAW :\t\t\twithDrawAmount();\n \t\t\t\t\t\tbreak;\n \n case EXIT:\t\t\t\tlog.log(Level.INFO, \"Application has ended successfully\");\n \t\t\t\t\t\tbreak;\n \n default: break;\n }\n } while(choice != Choices.EXIT);\n\t\t\n\t\tscan.close();\n\t}", "private boolean checkInput() {\n if (trackWindowSize.isSelected()) {\n inputSize = new int[] { 0, 0 };\n return true;\n }\n inputSize = null;\n int width, height;\n try {\n width = Integer.parseInt(widthInput.getText());\n }\n catch (NumberFormatException e) {\n error(I18n.tr(\"imagesizedialog.error.widthnotanumber\", widthInput.getText()));\n widthInput.selectAll();\n widthInput.requestFocus();\n return false;\n }\n try {\n height = Integer.parseInt(heightInput.getText());\n }\n catch (NumberFormatException e) {\n error(I18n.tr(\"imagesizedialog.error.heightnotanumber\", heightInput.getText())); \n heightInput.selectAll();\n heightInput.requestFocus();\n return false;\n }\n if (width < 10 || width > 5000) {\n error(I18n.tr(\"imagesizedialog.error.badwidth\", \"\"+width)); \n widthInput.selectAll();\n widthInput.requestFocus();\n return false;\n }\n else if (height < 10 || height > 5000) {\n error(I18n.tr(\"imagesizedialog.error.badheight\", \"\"+width)); \n heightInput.selectAll();\n heightInput.requestFocus();\n return false;\n }\n inputSize = new int[] { width, height };\n return true;\n }", "@FXML\n private void handleUserInput() {\n String input = userInput.getText();\n String response = duke.getResponse(input);\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userImage),\n DialogBox.getDukeDialog(response, dukeImage)\n );\n userInput.clear();\n }", "private boolean checkInputFields(){\r\n\t\tString allertMsg = \"Invalid input: \" + System.getProperty(\"line.separator\");\r\n\t\t\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MCSTf.getText());\r\n\t\t\tif(testValue < 0 || testValue > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a MCS score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for relevance score weight and coherence score weight text fields\r\n\t\ttry{\r\n\t\t\tFloat relScoreW = Float.parseFloat(m_RelScoreTf.getText());\r\n\t\t\tFloat cohScoreW = Float.parseFloat(m_CohScoreTf.getText());\r\n\t\t\tif(relScoreW < 0 || relScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif(cohScoreW < 0 || cohScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif((relScoreW + cohScoreW) != 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a weight for relevance and coherence score.\" + System.getProperty(\"line.separator\");\r\n\t\t\tallertMsg += \"Sum of the weights for relevance and coherence score must be 1.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_KeyTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as multiplier for keyword concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for category confidence weight\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_CatConfTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for the weight of the category confidence of concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for weight of repeated concepts\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_RepeatTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for repeated concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for number of output categories\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MaxCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the maximum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MinCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the minimum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MinCatScoreTf.getText());\r\n\t\t\tif(testValue < 0.0f || testValue > 1.0f)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number between 0 and 1 as minimum category score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\tif(allertMsg.length() > 18){\r\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\talert.setContentText(allertMsg);\r\n\t\t\talert.showAndWait();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@FXML\n\tprivate void handleOk() {\n\t\tif (isValidInput()) {\n\t\t\tsaveCurrentAcknowledgment();\n\t\t\t\n\t\t\tif (isNew) {\n\t\t\t\tmain.getDbHelper().insertAcknowledgment(acknowledgment);\n\t\t\t\tmain.getAcknowledgmentData().clear();\n\t\t\t\tmain.getAcknowledgmentData().addAll(main.getDbHelper().retrieveAcknowledgmentList());\n\t\t\t} else {\n\t\t\t\tmain.getDbHelper().updateAcknowledgment(acknowledgment);\n\t\t\t\tmain.getAcknowledgmentData().clear();\n\t\t\t\tmain.getAcknowledgmentData().addAll(main.getDbHelper().retrieveAcknowledgmentList());\t\n\t\t\t}\n\t\t\t\n\t\t\tokClicked = true;\n\t\t\tdialogStage.close();\n\t\t}\n\t}", "@Override\n\tpublic void input() {\n\t\t\n\t}", "@Override\n\tprotected void checkNumberOfInputs(int length) {\n\n\t}", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tboolean allOK = true;//boolean allOk is set to true\n\t\t\t\t\tString order = orderTextField.getText();//get text within the textfield\n\t\t\t\t\tif (order.equals(\"\")) {//if the textfield is blank nothing happens...\n\t\t\t\t\t\tallOK=false;\n\t\t\t\t\t}\n\t\t\t\t\tif (allOK==true) {//if allOk is set to true then....\n\t\t\t\t\t\t//Order orders = new Order(order);//\n\t\t\t\t\t\tRestaurant.runMyRestaurant(order);//Restaurant class is called\n\t\t\t\t\t}\n\t\t\t\t\t}", "private boolean User_Input() {\r\n \r\n if ( Get_Now_Token_Tpye() == VOID\r\n || Get_Now_Token_Tpye() == INT\r\n || Get_Now_Token_Tpye() == FLOAT\r\n || Get_Now_Token_Tpye() == CHAR\r\n || Get_Now_Token_Tpye() == STRING\r\n || Get_Now_Token_Tpye() == BOOL ) { \r\n // 先不要拿\r\n if ( Definition() ) { // 如果是 Definition()\r\n System.out.print( \"> \" ) ;\r\n Print_Definition() ;\r\n return true ;\r\n } // if()\r\n else { // 不是 Definition()\r\n Print_Error( Get_Error_Token(), Get_Error_Type(), Get_Error_Token_No_Id() ) ;\r\n return false ;\r\n } // else()\r\n } // if()\r\n else if ( Statement() ) { // 如果是 Statement()\r\n \r\n System.out.print( \"> \" ) ;\r\n \r\n if ( Return_ListAllVariables() ) { // 印出所有全域變數 // 由小到大\r\n Print_ListAllVariables() ;\r\n } // if()\r\n else if ( Return_ListAllFunctions() ) { // 印出所有 Function 名稱 // 由小到大\r\n Print_ListAllFunctions() ;\r\n } // else if()\r\n else if ( Return_ListVariable() ) { // 印出一個 已定義的變數 以及型別\r\n Print_ListVariable() ;\r\n } // else if()\r\n else if ( Return_ListFunction() ) { // 印出一個 已定義的 Function\r\n Print_ListFunction() ;\r\n } // else if()\r\n \r\n if ( !Return_Done() ) { // 如果不是 Done();\r\n Print_Statement() ;\r\n } // if()\r\n \r\n return true ;\r\n } // else if()\r\n else { // 都不是\r\n Print_Error( Get_Error_Token(), Get_Error_Type(), Get_Error_Token_No_Id() ) ;\r\n return false ;\r\n } // else()\r\n \r\n }", "private static void promptUserForMoreItems()\r\n\t{\r\n\t\tboolean check = false;\r\n\t\tSystem.out.println(\"Any more items to add? (Y/N)\");\r\n\t\twhile(check==false)\r\n\t\t{\r\n\t\t\tString userInput = scan.nextLine();\r\n\t\t\tif(userInput.equalsIgnoreCase(\"N\"))\r\n\t\t\t{\r\n\t\t\t\tcheck = true;\r\n\t\t\t}\r\n\t\t\telse if(userInput.equalsIgnoreCase(\"Y\"))\r\n\t\t\t{\r\n\t\t\t\torderItems();\r\n\t\t\t\tSystem.out.println(\"Any more items to add? (Y/N)\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Please enter a valid input (Y/N)\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "@FXML\n private void handleUserInput() {\n String input = userInput.getText().strip();\n String response = \" \";\n\n DialogBox userDb = null;\n DialogBox dukeDb = null;\n\n try {\n response = this.getResponse(input);\n userDb = DialogBox.getUserDialog(input, userImage);\n dukeDb = DialogBox.getDukeDialog(response, dukeImage);\n } catch (DukeException e) {\n userDb = DialogBox.getUserDialog(input, userImage);\n dukeDb = DialogBox.getDukeDialog(GUI.sendErrorMessage(e), dukeImage);\n dukeDb.modifyColorForError();\n }\n\n dialogContainer.getChildren().addAll(\n userDb,\n dukeDb\n );\n\n userInput.clear();\n\n // Exit window once duke chatbot is closed\n if (isClosed(response)) {\n System.exit(0);\n }\n }", "@FXML\n private void handleUserInput() {\n String input = userInput.getText();\n String response = mug.getResponse(input);\n dialogContainer.getChildren().addAll(\n DialogBox.getUserDialog(input, userImage),\n DialogBox.getMugDialog(response, mugImage)\n );\n userInput.clear();\n if (input.toUpperCase().equals(\"BYE\")) {\n PauseTransition delay = new PauseTransition(Duration.seconds(1));\n delay.setOnFinished(event -> {\n Platform.exit();\n System.exit(0);\n });\n delay.play();\n }\n }", "private void processInputUntilRoomChange() {\n while (true) {\n // Get the user input\n System.out.print(\"> \");\n String input = scan.nextLine();\n\n // Determine which command they used and act accordingly\n if (input.startsWith(\"help\")) {\n this.displayCommands();\n } else if (input.startsWith(\"look\")) {\n this.displayDescription(input.substring(input.indexOf(\" \") + 1));\n } else if (input.startsWith(\"get\")) {\n this.acquireItem(input.substring(input.indexOf(\" \") + 1));\n } else if (input.startsWith(\"go\")) {\n if (this.movePlayer(input.substring(input.indexOf(\" \") + 1))) {\n break;\n }\n } else if (input.startsWith(\"use\")) {\n this.useItem(input.substring(input.indexOf(\" \") + 1));\n } else if (input.startsWith(\"inventory\")) {\n System.out.print(player.listInventory());\n } // The player did not enter a valid command.\n else {\n System.out.println(\"I don't know how to \" + input);\n }\n }\n }", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(parent_frame.getFestival().isLocked()){\n\t\t\t\t\tfeedback_display.append(\"\\tPlease submit after voice prompt has finished.\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tprocessAttempt(input_from_user.getText());\n\t\t\t\t}\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t}", "@Override\r\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tList<User> l=new ArrayList<User>();\r\n\t\t\t\t\t\t\t\ttv.setInput(l);\r\n\t\t\t\t\t\t\t\tMessageDialog.openWarning(Display.getDefault().getActiveShell(), \"wain\", \"you already has this friend\");\r\n\t\t\t\t\t\t\t}", "private boolean validateInputs() {\n question = txtQuestion.getText().trim();\n option1 = txtOption1.getText().trim();\n option2 = txtOption2.getText().trim();\n option3 = txtOption3.getText().trim();\n option4 = txtOption4.getText().trim();\n correctOption = jcCorrectAns.getSelectedItem().toString();\n //System.out.println(correctOption);\n if(question.isEmpty() || option1.isEmpty() || option2.isEmpty() || \n option3.isEmpty() || option4.isEmpty() || correctOption.isEmpty()){\n return false;\n }\n return true;\n }", "private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }", "@Override\n\tprotected void okCallback() {\n\t\tif (checkInput()) {\n\t\t\tclose();\n\t\t}\n\t}", "private void handleCommandEntered(String input) {\n try {\n commandExecutor.execute(input);\n commandTextField.commitAndFlush();\n } catch (CommandException | ParseException | UnmappedPanelException e) {\n setStyleToIndicateCommandFailure();\n }\n }", "private void checkAndSave(){\n if (haveEmptyField()){\n JOptionPane.showMessageDialog(dialog,\n \"Some field are empty!\",\n \"Not valid\",\n JOptionPane.ERROR_MESSAGE);\n } else {\n saveStudent();\n }\n }", "@Override\n\tpublic boolean performOk() {\n\t\t// Get the preference store\n\t\tfinal IPreferenceStore preferenceStore = getPreferenceStore();\n\n\t\t// Set the values from the fields\n\t\tpreferenceStore.setValue(DEFAULT_PASSWORD_LENGTH, spiLength.getSelection());\n\t\tpreferenceStore.setValue(USE_LOWERCASE_LETTERS, btnUseLowercase.getSelection());\n\t\tpreferenceStore.setValue(USE_UPPERCASE_LETTERS, btnUserUppercase.getSelection());\n\t\tpreferenceStore.setValue(USE_DIGITS, btnUseDigits.getSelection());\n\t\tpreferenceStore.setValue(USE_SYMBOLS, btnUseSymbols.getSelection());\n\t\tpreferenceStore.setValue(USE_EASY_TO_READ, btnUseEaseToRead.getSelection());\n\t\tpreferenceStore.setValue(USE_HEX_ONLY, btnUseHexOnly.getSelection());\n\n\t\t// Return true to allow dialog to close\n\t\treturn true;\n\t}", "public static void checkFromUser() {\n\t\tif (askUser(\"Please type y to execute program and any other key to stop\").contentEquals(\"y\")) {\n\t\t\tSystem.out.println(\"Continuing\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Terminating program\");\n\t\t\tSystem.exit(0); \n\t\t}\n\t\tSystem.out.println(\"Calculating the greatest house income, the greatest income after expenditure and greatest savings from the given 3 families\");\n\t}", "public void processUser() {\r\n Scanner sc = new Scanner(System.in);\r\n model.setAllparameters(inputIntValueWithScanner(sc, View.INPUT_INT_HOUR_DATA, GlobalConstants.PRIMARY_HOUR_MAX_BARRIER),// the correct input (hour,minute,second) is sent to the model\r\n inputIntValueWithScanner(sc, View.INPUT_INT_MINUTE_DATA, GlobalConstants.PRIMARY_MINUTE_MAX_BARRIER),\r\n inputIntValueWithScanner(sc, View.INPUT_INT_SECOND_DATA, GlobalConstants.PRIMARY_SECOND_MAX_BARRIER));\r\n int k = 0;\r\n do { //at least once the menu option is chosen (for option number 6 (break) for example)\r\n k = inputIntValueWithScanner(sc, View.CHOOSE_OPERATION, GlobalConstants.MENU_OPTION_MAX_VALUE);\r\n chooseOperation(k);\r\n } while (k != GlobalConstants.MENU_OPTION_MAX_VALUE); //menu loop until break option isn't chosen\r\n\r\n }", "public static boolean checkInputAll(String saInput) {\r\n\t\treturn checkGenericPatternAll(saInput) && checkGenericPatternAll(unalter(saInput));\r\n\t}", "private void updateState() {\n \t\tfor (Map.Entry<FunctionParameter, Pair<Text, Button>> entry : inputFields.entries())\n \t\t\tif (entry.getKey().getValidator() != null\n \t\t\t\t\t&& entry.getKey().getValidator().validate(entry.getValue().getFirst().getText()) != null) {\n \t\t\t\tsetPageComplete(false);\n \t\t\t\treturn;\n \t\t\t}\n \t\tsetPageComplete(true);\n \t}", "@FXML\n private void handleUserInput() {\n String input = userInput.getText();\n dialogContainer.getChildren().add(DialogBox.getUserDialog(input, userImage));\n if (duke.getResponse(input)) {\n CompletableFuture<Void> completableFuture = CompletableFuture.runAsync(() -> {\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n });\n completableFuture.thenRun(() -> Platform.exit());\n }\n userInput.clear();\n }", "private boolean validateInput() {\n String username = editUsername.getText().toString().trim();\n String email = editEmail.getText().toString().trim();\n String password = editPassword.getText().toString().trim();\n String repeatPassword = editRepeatPassword.getText().toString().trim();\n if (!password.equals(repeatPassword)) {\n ShowMessageUtil.tosatSlow(\"Enter passwords differ\", EmailRegisterActivity.this);\n return false;\n } else if (username.equals(\"\") || email.equals(\"\") || password.equals(\"\")) {\n ShowMessageUtil.tosatSlow(\"every item can not be empty!\", EmailRegisterActivity.this);\n return false;\n }\n if (username.length()>10){\n ShowMessageUtil.tosatSlow(\"the character length of the username can't be over than 10\", EmailRegisterActivity.this);\n return false;\n }\n return true;\n }", "private static boolean validateInput1(String[] input) {\n\t\tif (input.length != 1) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public void getNames() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter a name: \");\n\t\twhile (sc.hasNextLine()) {\n\t\t\tString name = sc.nextLine();\n\t\t\tif (name.equals(\"\")) {\n\t\t\t\t//User is finished.\n\t\t\t\tSystem.out.println(\"Exiting the program\");\n\t\t\t\tSystem.exit(1);\n\t\t\t} else {\n\t\t\t\tgetSimilarNames(name);\n\t\t\t\tSystem.out.println(\"Please enter a name: \");\n\t\t\t}\n\t\t}\n\t}", "private void processAttempt(String attempt){\n\t\tinput_from_user.setText(\"\");//clear input field\t\n\n\t\tif(!attempt.matches(\".*[a-zA-Z]+.*\")){ \n\t\t\t//user doesn't enters any alphabetical characters\n\t\t\tfeedback_display.append(\"Feedback: Word includes alphabet characters, try again\\n\\n\");\n\t\t} else if(!attempt.equals(words_to_spell.get(current_word_number))&&(attempt.toLowerCase()).equals(words_to_spell.get(current_word_number).toLowerCase())){ \n\t\t\t//differs only by capitalisation\n\t\t\tfeedback_display.append(\"Feedback: \\\"\"+attempt+\"\\\" is spelt correctly but incorrect capitalisation, try again\\n\\n\");\n\t\t} else{\n\t\t\tfeedback_display.append(\"Feedback: \\\"\"+attempt+\"\\\" is \");//updates progress area with user guess\n\n\t\t\tif(attempt.equals(words_to_spell.get(current_word_number))){\n\t\t\t\tcorrectSpelling();\n\t\t\t} else{\n\t\t\t\tincorrectSpelling();\n\t\t\t}\n\t\t}\n\n\t\t//When words to spell array exhausted, asks DataHandler to process results\n\t\tif (current_word_number == words_to_spell.size()){\n\t\t\t//no point speaking any more things if quiz has already completed\n\t\t\tparent_frame.getFestival().emptyWorkerQueue();\n\t\t\tparent_frame.getPostQuizHandler().processQuizResults(words_mastered,words_faulted,words_failed,quiz_type,words_to_spell.size());\n\t\t\t\n\t\t\t//after processing results, so if got word correct after clicking Add To Review, word is still added\n\t\t\tparent_frame.getPostQuizHandler().addToReviewList(words_to_add_to_review);\n\t\t\tparent_frame.changePanel(PanelID.QuizComplete);\n\t\t} else{ \n\t\t\t//Otherwise keep going with quiz\n\t\t\tstartQuiz();\n\t\t}\n\t}", "@Ignore @Test\n public void doCompletion() {\n controller.getCompletionList(INPUT,ONTOLOGY,FIELD,bean);\n List<CompletionTerm> compList = bean.getCompletionTermList();\n Assert.assertNotNull(compList);\n Assert.assertTrue(\"Should have >0 comp terms\",compList.size()>0);\n boolean containsInput = false;\n for (CompletionTerm t : compList)\n containsInput |= t.toString().contains(INPUT);\n Assert.assertTrue(\"Should contain \"+INPUT,containsInput);\n }", "public void clientRunning() {\n\t\twhile (this.running) {\n\t\t\tString userInputString = textUI.getString(\"Please input (or type 'help'):\");\n\t\t\tthis.processUserInput(userInputString);\n\t\t}\n\t}", "protected void handleInput(String input) {}", "public void complete() {\r\n\t\tcomplete(suggestBox.getText());\r\n\t}", "@When(\"^user enters \\\"([^\\\"]*)\\\"$\")\n public void userEnters(String arg0) throws Throwable {\n }", "protected abstract boolean isInputValid();", "private void processInput() {\r\n\t\ttry {\r\n\t\t\thandleInput(readLine());\r\n\t\t} catch (WrongFormatException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "protected boolean okData() {\n \t\tString name2 = name.getText().trim();\n \t\tString phone2 = phone.getText().trim();\n \t\tString adress2 = adress.getText().trim();\n \t\tboolean enterpriseButton = enterpriseCustomer.isSelected();\n \t\tboolean privateButton = privateCustomer.isSelected();\n \t if (name2.equals(\"\") || phone2.equals(\"\") || adress2.equals(\"\") || (!enterpriseButton && !privateButton)) {\n \t \tif (name2.equals(\"\")) {\n \t \t\tshowMessageDialog(CustomerRegistration.this, \"You have to input a customer name!\");\n \t \t\tname.requestFocusInWindow();\n \t \t} else if(phone2.equals(\"\")) {\n \t \t\tshowMessageDialog(CustomerRegistration.this, \"You have to input a phone number!\");\n \t \t\tphone.requestFocusInWindow();\n \t \t} else if(adress2.equals(\"\")) {\n \t \t\tshowMessageDialog(CustomerRegistration.this, \"You have to input an adress!\");\n \t \t\tadress.requestFocusInWindow();\n \t \t} else if(!enterpriseButton && !privateButton) {\n \t \t\tshowMessageDialog(CustomerRegistration.this, \"You have to choose a customer type!\");\n \t \t\tprivateCustomer.requestFocusInWindow();\n \t \t}\n \t \treturn false;\n \t } else {\n \t \treturn true;\n \t }\n \t}", "public void userInterface() {\r\n\r\n boolean proceed = true;\r\n\r\n while (proceed == true) {\r\n\r\n System.out.println(\"Enter a name to find phone number: \");\r\n Scanner user = new Scanner(System.in);\r\n String input = table.lookUp(user.nextLine());\r\n System.out.println(input);\r\n\r\n System.out.println(\"Look up another number? <Y/N>\");\r\n Scanner answer = new Scanner(System.in);\r\n String ans = answer.nextLine();\r\n\r\n if (ans.equals(\"y\") || ans.equals(\"Y\")) {\r\n proceed = true;\r\n } else {\r\n proceed = false;\r\n }\r\n }\r\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tList<User> l=new ArrayList<User>();\r\n\t\t\t\t\t\t\ttv.setInput(l);\r\n\t\t\t\t\t\t\tMessageDialog.openWarning(Display.getDefault().getActiveShell(), \"wain\", \"Without this user \");\r\n\t\t\t\t\t\t}", "public boolean endOfInput() {\n \tif((tmpPosition<totalLength)&&(IsOk)){\n \t//\tSystem.out.println(\"Am returnat ok\");\n \t\treturn false;\n\t\t\t\n \t}\n\t\telse\n\t\t\treturn true;\n \t\n }", "public void beforeInput() {\n }", "public void beforeInput() {\n }", "@Override\r\n public void afterTextChanged(Editable editable) {\n checkFieldsForEmptyValues();\r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(parent_frame.getFestival().isLocked()){\n\t\t\t\t\tfeedback_display.append(\"\\tPlease submit after voice prompt has finished.\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tprocessAttempt(input_from_user.getText());\n\t\t\t\t\tinput_from_user.requestFocusInWindow(); //gets focus back on the field\n\t\t\t\t}\n\t\t\t}", "private boolean validateInputs() {\n if (KEY_EMPTY.equals(tenchuxe)) {\n etTenChuXe.setError(\"Vui lòng điền Tên chủ xe\");\n etTenChuXe.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(sdt)) {\n etSDT.setError(\"Vui lòng điền Số điện thoại\");\n etSDT.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(mota)) {\n edMoTa.setError(\"Vui lòng điền Mô tả xe\");\n edMoTa.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(biensoxe)) {\n etBienSoXe.setError(\"Vui lòng điền Biển số xe\");\n etBienSoXe.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(passwordtx)) {\n etPasswordtx.setError(\"Vui lòng điền Mật khẩu\");\n etPasswordtx.requestFocus();\n return false;\n }\n\n if (KEY_EMPTY.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Vui lòng điền Xác nhận mật khẩu\");\n etConfirmPassword.requestFocus();\n return false;\n }\n if (!passwordtx.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Xác nhận mật khẩu sai !\");\n etConfirmPassword.requestFocus();\n return false;\n }\n\n return true;\n }", "@Override\n\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t// Check if input fields are filled in\n\t\t\ttoggleSearchButton();\n\t\t}", "@Override public void onFinishInput() {\n super.onFinishInput();\n \n // Clear current composing text and candidates.\n mComposing.clear();\n mCandidatesAdapter.clear();\n updateCandidatesView(EMPTYLIST);\n setCandidatesViewShown(false);\n\n mCurKeyboard = mQwertyKeyboard;\n\n }", "public boolean handleUserInput(String userInput) {\n return this.duke.processOneCommand(userInput);\n }", "@Override\npublic void userInputUpdated(boolean newVal) {\n\t\n}", "static public void woundedSurvivor() {\n System.out.println(\"Maybe you could bring me some food and something to defend myself now that i cant move\");\n System.out.println(\"Do you want to accept his mission: Yes or no\");\n Scanner scan = new Scanner(System.in); //Creates a new scanner\n String input = scan.nextLine(); //Waits for input\n if (input.equalsIgnoreCase(\"yes\")) {\n System.out.println(\"You got a mission, please use the show command for more information\");\n allMissions.addMission(jungle, \"Helping the injured survivor\");\n } else if (input.equalsIgnoreCase(\"no\")) {\n System.out.println(\"Come back again if you change your mind\");\n } else {\n System.out.println(\"Come back again if you change your mind\");\n }\n }", "private void submitBtnClicked() {\n\n clearIncomplete(locationComboBox);\n clearIncomplete(avTypeComboBox);\n clearIncomplete(avDate);\n clearIncomplete(avDesc);\n clearIncomplete(avEmployeeComboBox);\n\n if (locationComboBox.getValue() == null\n || !locationComboBox.getItems().contains(locationComboBox.getValue())\n || avTypeComboBox.getValue() == null\n || avDesc.getText().equals(\"\")\n || avDate.getValue() == null\n || (Settings.getSettings().getCurrentPermissions() == 3\n && ((avEmployeeComboBox.getValue() == null)\n || !avEmployeeComboBox.getItems().contains(avEmployeeComboBox.getValue())))) {\n if (locationComboBox.getValue() == null\n || !locationComboBox.getItems().contains(locationComboBox.getValue())) {\n incomplete(locationComboBox);\n }\n if (avTypeComboBox.getValue() == null) {\n incomplete(avTypeComboBox);\n }\n if (avDesc.getText().equals(\"\")) {\n incomplete(avDesc);\n }\n if (avDate.getValue() == null) {\n incomplete(avDate);\n incomplete(avDate);\n }\n if (avEmployeeComboBox.getValue() == null\n || !avEmployeeComboBox.getItems().contains(avEmployeeComboBox.getValue())) {\n incomplete(avEmployeeComboBox);\n }\n nonCompleteForm(stackPane);\n } else {\n Service service = new Service(DataOperations.generateUniqueID(\"AV\"), \"Audio Visual\");\n\n service.setCategory((String) avTypeComboBox.getValue());\n service.setLocation(locationComboBox.getValue().toString());\n service.setDate(avDate.getValue().toString());\n service.setDescription(avDesc.getText());\n service.setRequester(settings.getCurrentUsername());\n if (settings.getCurrentPermissions() == 3) {\n service.setEmployee((String) avEmployeeComboBox.getValue());\n } else {\n service.setEmployee(\"admin\");\n }\n\n try {\n DataOperations.saveService(service);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n submittedPopUp(stackPane);\n parent.loadCenterSubPage(\"ServiceRequestNavigator.fxml\");\n clearButton();\n }\n }", "@Override\n\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t// Check if input fields are filled in\n\t\t\ttoggleSearchButton();\n\n\t\t}", "@FXML\n private void handleOk() {\n if (isInputValid()) {\n gem.setGemName(gemNameField.getText());\n gem.setGemValue(Integer.parseInt(gemValueField.getText()));\n gem.setDescription(gemDescripField.getText());\n\n okClicked = true;\n dialogStage.close();\n }\n }" ]
[ "0.6824957", "0.6409321", "0.631002", "0.62492704", "0.6189683", "0.6189683", "0.61003", "0.6018371", "0.600304", "0.59176403", "0.5915002", "0.5888544", "0.5877879", "0.58631134", "0.5840691", "0.57922745", "0.5766833", "0.5731702", "0.5703262", "0.5681225", "0.5666084", "0.5619532", "0.56104004", "0.5606998", "0.5603266", "0.55969864", "0.55776936", "0.5576367", "0.55600154", "0.55572164", "0.5549492", "0.5548303", "0.5544117", "0.55429995", "0.5539376", "0.55371493", "0.553209", "0.55155426", "0.5513557", "0.5510501", "0.5499409", "0.5482551", "0.5482282", "0.5479534", "0.54706794", "0.54691213", "0.5468467", "0.54682827", "0.54625016", "0.54612386", "0.54464906", "0.5441014", "0.54408896", "0.5435558", "0.543024", "0.54292566", "0.5429205", "0.542626", "0.540652", "0.5404634", "0.54040754", "0.54021394", "0.5389361", "0.53859115", "0.53740066", "0.537204", "0.5369019", "0.5366231", "0.53621995", "0.53591967", "0.5356334", "0.53548884", "0.5349233", "0.5340918", "0.5334367", "0.532972", "0.53276247", "0.53255963", "0.5322092", "0.5321611", "0.5319587", "0.5308644", "0.53033304", "0.52992326", "0.5297726", "0.5296086", "0.5291975", "0.5289823", "0.5288043", "0.5288043", "0.5271185", "0.52661306", "0.526465", "0.5256709", "0.5240654", "0.52366126", "0.5230494", "0.5226178", "0.52065706", "0.5203489", "0.52021635" ]
0.0
-1
Test of createTimer method, of class FleaseStage.
public void testOpenAndGetLease() throws Exception { final ASCIIString CELL_ID = new ASCIIString("testcell"); final AtomicReference<Flease> result = new AtomicReference(); FleaseStage fs = new FleaseStage(cfg, "/tmp/xtreemfs-test/", new FleaseMessageSenderInterface() { @Override public void sendMessage(FleaseMessage message, InetSocketAddress recipient) { //ignore me } }, true, new FleaseViewChangeListenerInterface() { @Override public void viewIdChangeEvent(ASCIIString cellId, int viewId) { } },new FleaseStatusListener() { @Override public void statusChanged(ASCIIString cellId, Flease lease) { // System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder()); synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } } @Override public void leaseFailed(ASCIIString cellId, FleaseException error) { MasterEpochTest.fail(error.toString()); } }, new MasterEpochHandlerInterface() { long masterEpochNum = 0; @Override public void sendMasterEpoch(FleaseMessage response, Continuation callback) { // System.out.println("sending: "+masterEpochNum); response.setMasterEpochNumber(masterEpochNum); callback.processingFinished(); } @Override public void storeMasterEpoch(FleaseMessage request, Continuation callback) { masterEpochNum = request.getMasterEpochNumber(); // System.out.println("storing: "+masterEpochNum); callback.processingFinished(); } }); FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART); msg.setCellId(CELL_ID); fs.startAndWait(); fs.openCell(CELL_ID, new ArrayList(),true); synchronized(result) { if (result.get() == null) result.wait(1000); if (result.get() == null) fail("timeout!"); } assertEquals(result.get().getLeaseHolder(),cfg.getIdentity()); assertEquals(result.get().getMasterEpochNumber(),1); FleaseFuture f = fs.closeCell(CELL_ID, false); f.get(); Thread.sleep(12000); result.set(null); fs.openCell(CELL_ID, new ArrayList(), true); synchronized(result) { if (result.get() == null) result.wait(1000); if (result.get() == null) fail("timeout!"); } assertEquals(result.get().getLeaseHolder(),cfg.getIdentity()); assertEquals(result.get().getMasterEpochNumber(),2); fs.stopAndWait(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TimerType createTimerType();", "public void createTimer() {\n timer = new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (animal.changeScore()) {\n setNumber(animal.getPoints());\n }\n if (animal.getStop()) {\n System.out.println(\"Game Ended\");\n background.stopMusic();\n stop();\n background.stop();\n\n ArrayList list = null;\n try {\n list = scoreFile.sortFile(animal.getPoints());\n } catch (IOException e) {\n e.printStackTrace();\n }\n popUp(list);\n }\n }\n };\n }", "public abstract void startInitTimer();", "SwTimerResource createSwTimerResource();", "Timer getTimer();", "public void startTimer() {\n // TODO = handle more aspects of the behaviour required by the specification\n System.out.println(\"starting timer\");\n initialHeroCastle();\n isPaused = false;\n // trigger adding code to process main game logic to queue. JavaFX will target\n // framerate of 0.3 seconds\n timeline = new Timeline(new KeyFrame(Duration.seconds(0.1), event -> {\n if (world.getMode() == -1){\n modeSelectionSwitchToMainMenu();\n }\n world.runTickMoves();\n world.runBattles();\n world.updateGoal();\n if (world.goalAchieved()) {\n world.gameOver();\n deadSwitchToMainMenu(true);\n return;\n }\n List<Soldier> soldiers = world.possiblySpawnSoldiers();\n for (Soldier s : soldiers) {\n loadSoldier(s);\n }\n List<BasicEnemy> deadEnemies = world.cleanEnemies();\n for (BasicEnemy e : deadEnemies) {\n reactToEnemyDefeat(e);\n }\n List<BasicEnemy> newEnemies = world.possiblySpawnEnemies();\n for (BasicEnemy newEnemy : newEnemies) {\n loadEnemies(newEnemy);\n }\n printThreadingNotes(\"HANDLED TIMER\");\n loopNumber.setText(\"Loop: \" + (int) world.getCurrentLoop().get());\n if (world.isCharacterDead()) {\n if (!world.useOneRing())\n deadSwitchToMainMenu(false);\n return;\n }\n if (world.isAtHeroCastle() && world.shouldShopAppear()) {\n System.out.println(\"At Hero Castle. Shopping!\");\n shopSwitchToMainMenu();\n }\n }));\n timeline.setCycleCount(Animation.INDEFINITE);\n timeline.play();\n }", "public AnimationTimer createTimer() {\n return new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (!levelController.getLevelControllerMethods().getGamePaused()) {\n levelController.getBubbles().forEach(Monster.this::checkCollision);\n move();\n }\n\n setChanged();\n notifyObservers();\n }\n };\n\n }", "TimerSchedule createTimerSchedule();", "public Timer() {}", "public static void initTimer(){\r\n\t\ttimer = new Timer();\r\n\t timer.scheduleAtFixedRate(new TimerTask() {\r\n\t public void run() {\r\n\t \t//se o player coletar todas os lixos, o tempo para\r\n\t \tif(ScorePanel.getScore() == 100){\r\n\t \t\ttimer.cancel();\r\n\t \t}\r\n\t \t//se o Tempo se esgotar, é game over!!!\r\n\t \telse if (tempo == 0){\r\n\t \t timer.cancel();\r\n \t\tAvatar.noMotion();\r\n \t\t//System.exit(0);\r\n\t }\r\n\t \t//Senão, vai contando\r\n\t \telse{\r\n\t \tlbltimer.setText(\"Tempo: \"+ --tempo);\r\n\t }\r\n\t }\r\n\t\t}, 1000, 1000);\r\n\t}", "private void initializeTimer(){\n logger.trace(\"Sensor/\" + getModel().getId() + \" initialising timer\");\n //create timer\n newTimer = new Timer(true);\n }", "private static void timerTest1() {\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\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\tSystem.out.println(\"timertest1\");\n\t\t\t\ttimer.cancel();\n\n\t\t\t}\n\t\t}, 2000);\n\n\t}", "private void startNewTimer(){\n timer.cancel();\n timer = null;\n timesUp();\n timer = new MainGameTimer(this);\n timer.startNewRoundCountDown();\n }", "public void makeTimer(){\n\t\n\t\tframeIndex = 0;\n\t\n\t\t//Create a new interpolator\n\t\tInterpolator lint = new Interpolator();\n\t\n\t\t//interpolate between all of the key frames in the list to fill the array\n\t\tframes = lint.makeFrames(keyFrameList);\n\t\n\t\t//timer delay is set in milliseconds, so 1000/fps gives delay per frame\n\t\tint delay = 1000/fps; \n\t\n\t\n\t\tActionListener taskPerformer = new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tif(frameIndex == frames.length){ frameIndex = 0;}\n\n\t\t\t\tframes[frameIndex].display();\n\t\t\t\tframes[frameIndex].clearDisplay();\n\t\t\t\tframeIndex++;\n\t\t\t}\n\t\t};\n\n\t\ttimer = new Timer(delay, taskPerformer);\t\n\t}", "TimerStatus onTimer();", "public void setTimer() {\n\t\t\n\t}", "@Override\n public TimerEvent createActivity(TBoundaryEvent src, Hashtable keyedContext){\n\n return new TimerEvent();\n\n }", "public void testFindEmployeeOrdersWithTimer() {\n\t\tSystem.out.println(\"started test testFindEmployeeOrdersWithTimer\");\n\t\tlong start = System.currentTimeMillis();\n\t\tFlux<Order> empFoundOrders = employeeController.findEmployeeOrders(employee.getAge()).take(10);\n\t\t\n\t\tStepVerifier.withVirtualTime(() -> empFoundOrders)\n\t\t\t\t\t.expectSubscription()\n\t\t\t\t\t.thenAwait(Duration.ofHours(10))\n\t\t\t\t\t.expectNextCount(10)\n\t\t\t\t\t.verifyComplete();\n\t\tlong end = System.currentTimeMillis();\n\t\tdouble totatSeconds = (end-start)/1000;\n\t\tSystem.out.println(\"completed test testFindEmployeeOrdersWithTimer in time \"+totatSeconds);\n\t}", "public Timer()\n {\n // initialise instance variables\n startTime = 0;\n bonusTime = 0;\n }", "private void createWaveTimer()\n\t{\n\t\twaveTimer = new WaveTimer(\n\t\t\t\titemManager.getImage(INFERNAL_CAPE),\n\t\t\t\tthis,\n\t\t\t\tInstant.now().minus(Duration.ofSeconds(6)),\n\t\t\t\tnull\n\t\t);\n\t\tif (config.waveTimer())\n\t\t{\n\t\t\tinfoBoxManager.addInfoBox(waveTimer);\n\t\t}\n\t}", "Timer(int tempTotalTime) {\n totalTime = tempTotalTime;\n }", "private static void timerTest3() {\n\t\tTimer timer = new Timer();\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\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\tSystem.out.println(\"timertest3\");\n\n\t\t\t}\n\t\t}, 2000, 1000);\n\n\t}", "public void onTimerEvent();", "private UimaTimer getTimer() throws Exception {\n String uimaTimerClass = cpeFactory.getCPEConfig().getCpeTimer().get();\n if (uimaTimerClass != null) {\n new TimerFactory(uimaTimerClass);\n return TimerFactory.getTimer();\n }\n // If not timer defined return default timer based on System.currentTimeMillis()\n return new JavaTimer();\n }", "private static void timerTest2() {\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\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\tif (count < 5) {\n\t\t\t\t\tSystem.out.println(\"timertest2\" + \" \" + ++count);\n\t\t\t\t} else {\n\t\t\t\t\ttimer.cancel();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}, 2000, 1000);\n\n\t}", "private static void timerTest4() {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 14);\n\t\tcalendar.set(Calendar.MINUTE, 20);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tDate time = calendar.getTime();\n\n\t\tTimer timer = new Timer();\n\t\tSystem.out.println(\"wait ....\");\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\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\tSystem.out.println(\"timertest4\");\n\n\t\t\t}\n\t\t}, time, 24 * 60 * 60 * 1000);\n\n\t}", "public void createTimer()\n {\n if (timer != null )\n return;\n \n logger.trace(\"Creating rss timer and task.\");\n RssTimerRefreshFeed refresh = new RssTimerRefreshFeed(this);\n this.timer = new Timer();\n this.timer.scheduleAtFixedRate(refresh, 100, PERIOD_REFRESH_RSS);\n \n logger.trace(\"Done.\");\n }", "public void pickUpTimer()\r\n\t{\t\t\r\n\t\tSystem.out.println(timer.get());\r\n\t\tif(timer.get() < Config.Auto.timeIntakeOpen)\r\n\t\t{\r\n\t\t\t//claw.openClaw();\r\n\t\t\tSystem.out.println(\"in second if\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeElevatorStack)\r\n\t\t{\r\n\t\t\t//elevator.setLevel(elevatorLevel);\r\n\t\t\t//elevatorLevel++;\r\n\t\t}\r\n\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeIntakeClose)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"in first if\");\r\n\t\t\t//claw.closeClaw();\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tendRoutine();\r\n\t}", "public void startMiniTimer() {\n long millisInFuture = 10000;\r\n long countDownInterval = 1000;\r\n phaseTwoTimer = new CountDownTimer(millisInFuture, countDownInterval) {\r\n public void onTick(long millisUntilFinished) {\r\n long millis = millisUntilFinished;\r\n\r\n // notifications for time\r\n if (millis <= 10000 && millis > 9001) {\r\n Toast.makeText(getActivity(), \"10\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 9000 && millis >= 8001) {\r\n Toast.makeText(getActivity(), \"9\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 8000 && millis >= 7001) {\r\n Toast.makeText(getActivity(), \"8\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 7000 && millis >= 6001) {\r\n Toast.makeText(getActivity(), \"7\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 6000 && millis >= 5001) {\r\n Toast.makeText(getActivity(), \"6\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 5000 && millis >= 4001) {\r\n Toast.makeText(getActivity(), \"5\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 4000 && millis >= 3001) {\r\n Toast.makeText(getActivity(), \"4\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 3000 && millis >= 2001) {\r\n Toast.makeText(getActivity(), \"3\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 2000 && millis >= 1001) {\r\n Toast.makeText(getActivity(), \"2\", Toast.LENGTH_LONG).show();\r\n } else {\r\n Toast.makeText(getActivity(), \"1\", Toast.LENGTH_LONG).show();\r\n }\r\n }\r\n\r\n public void onFinish() {\r\n Toast.makeText(getActivity(), \"PHASE 2\", Toast.LENGTH_LONG).show(); // entering phase 2\r\n phase = 2;\r\n initTimer(rootView);\r\n drawNewBoards();\r\n }\r\n }.start();\r\n }", "void startGameTimer()\n {\n Timer.destroyTimer(\"starting_game_timer\");\n Timer timer = Timer.createTimer(\"starting_game_timer\", startTimerSeconds);\n timer.addTimerListener(this);\n timer.start();\n }", "private void setTimer() {\r\n timer = new Timer(TIMER_DELAY, new ActionListener() {\r\n public void actionPerformed(ActionEvent ae) {\r\n action();\r\n }\r\n });\r\n }", "private void initTimer(){\r\n\t\ttimer = new Timer() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tdisplayNext();\r\n\t\t\t}\r\n\t\t};\r\n\t}", "private void startTimer() {\n Timer.addTimeout(endTime, this);\n }", "public TimerCheck() {\n super(\"timer_check\");\n PlayerMovementListener.EVENT.register(this);\n }", "void startUpdateTimer();", "public Timer()\r\n\t{\r\n\t\tcurrentstate = TIMER_STOP;\r\n\t}", "public void startTimer(){\n logger.trace(\"Sensor/\" + getModel().getId() + \" timer started\");\n if(newTimer != null){\n //newTimer = new Timer();\n if(timerTask != null) timerTask.cancel();\n newTimer.purge();\n timerTask = new TimerTask() {\n @Override\n public void run() {\n timerEngine();\n }\n };\n newTimer.schedule(timerTask,(getModel().getRefreshTime()*1000),(getModel().getRefreshTime()*1000)/2);\n }\n }", "@Test\n public void testAdd(){\n \tCountDownTimer s1 = new CountDownTimer(1, 0, 0);\n \ts1.add(1800);\n \tassertEquals(s1.toString(), \"1:30:00\");\n \t\n \tCountDownTimer s2 = new CountDownTimer(0, 30, 0);\n \ts1.add(s2);\n \tassertEquals(s1.toString(), \"2:00:00\");\n }", "private void trackerTimer() {\n\n Thread timer;\n timer = new Thread() {\n\n @Override\n public void run() {\n while (true) {\n\n if (Var.timerStart) {\n try {\n Var.sec++;\n if (Var.sec == 59) {\n Var.sec = 0;\n Var.minutes++;\n }\n if (Var.minutes == 59) {\n Var.minutes = 0;\n Var.hours++;\n }\n Thread.sleep(1000);\n } catch (Exception cool) {\n System.out.println(cool.getMessage());\n }\n\n }\n timerText.setText(Var.hours + \":\" + Var.minutes + \":\" + Var.sec);\n }\n\n }\n };\n\n timer.start();\n }", "public void testTime()\n {\n SudokuTimer test = new SudokuTimer();\n\n mTimer.start();\n test.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertTrue(mTimer.toString().equals(test.toString()));\n\n mTimer.stop();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertFalse(mTimer.toString().equals(test.toString()));\n\n test.stop();\n mTimer.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n mTimer.stop();\n\n //checks to the nearest second\n assertEquals(mTimer.getElapsedTime() / 1000,\n test.getElapsedTime() / 1000);\n }", "public static void startTimerLabel()\n {\n {\n if (timeline != null) {\n timeline.stop();\n }\n timeSeconds.set(STARTTIME);\n //timeLabel.setText(timeSeconds.toString());\n timeline = new Timeline();\n //timeline.setCycleCount(timeline.INDEFINITE); // need this?\n\n timeline.getKeyFrames().add(\n new KeyFrame(Duration.seconds(STARTTIME+1),\n new EventHandler<ActionEvent>() {\n public void handle(ActionEvent event) {\n //System.out.println(\"Got Timer timeout.\");\n if (cancel == false) {\n SceneResultsTimed.updatePlayerScore();\n localStage.setScene(SceneMgr.getScene(SceneMgr.IDX_RESULTSTIMED));\n }\n }\n },\n new KeyValue(timeSeconds, 0)));\n timeline.playFromStart();\n }\n }", "public Timer() {\n\t\tthis.start = 0L;\n\t\tthis.end = 0L;\n\t}", "private void timerAction(){\n \n timerEnd();\n \n if (timerCounter == TEST_TARGET_APPERANCE + testTargetDelay){\n manageTestTarget();\n }\n \n if (timerCounter == TEST_TARGET_DISAPPERANCE + testTargetDelay){\n labelArray[TEST_TARGET_LOCATION].setIcon(iconSet.getGrayIcon());\n //System.out.println(\"Test End\");\n }\n //creates clickable red target in random, non occupied location\n //and handles removal of unclicked, expired targets\n int randRedTarget = generator.nextInt(100);\n while(labelArray[randRedTarget].getIcon()!=iconSet.getGrayIcon()){\n //System.out.println(\"Already a target in place\");\n randRedTarget = generator.nextInt(100);\n }\n labelArray[randRedTarget].setIcon(iconSet.getRedTargetIcon());\n \n if (timerCounter<ACTIVE_RED_TARGET_TOTAL){\n activeRedTarget[timerCounter] = randRedTarget;\n }\n \n if (timerCounter>=ACTIVE_RED_TARGET_TOTAL){\n if(labelArray[activeRedTarget[0]].getIcon()!=iconSet.getGrayIcon()){\n labelArray[activeRedTarget[0]].setIcon(iconSet.getGrayIcon());\n }\n for(int i = 0; i < activeRedTarget.length-1; i++){\n activeRedTarget[i] = activeRedTarget[i+1];\n }\n activeRedTarget[ACTIVE_RED_TARGET_TOTAL-1] = randRedTarget;\n }\n\n if (timerCounter%4==0){\n manageBlueTargets();\n }\n \n timerCounter++;\n \n if (timerCounter%4==0){\n manageGreenTargets();\n }\n \n System.out.println(\"Timer: \" + timerCounter); \n }", "private void setNewTimer() {\n if (!isSetNewTimerThreadEnabled) {\n return;\n }\n\n timer = new Timer();\n timer.scheduleAtFixedRate(new TimerTask() {\n\n @Override\n public void run() {\n // Send the message to the handler to update the UI of the GameView\n GameActivity.this.handler.sendEmptyMessage(UPDATE);\n\n // For garbage collection\n System.gc();\n }\n\n }, 0, 17);\n }", "public static void startTimer() {\n elapsedTime = 0;\r\n timerIsWorking = true;\r\n startTime = System.nanoTime() / 1000000; // ms\r\n }", "protected abstract T create(final double idealStartTime);", "private void startTimer(){\n scoreboard.disableStart(true);\n timer.scheduleAtFixedRate(new TimerTask(){\n @Override\n public void run(){\n Platform.runLater(new Runnable(){\n @Override\n public void run() {\n scoreboard.updateTime();\n }\n });\n }\n },0,1000);\n }", "public abstract void startLoadTimer();", "public void setupTimer() {\r\n\t\tmarcus.email.util.time.Timer actualTime = new marcus.email.util.time.Timer();\r\n\t\tactualTime.start();\r\n\t\tActionListener l = new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tlblTimeDate.setText(actualTime.getCurrentTime());\r\n\t\t\t}\r\n\t\t};\r\n\t\t//This is the Swing timer class that updates the actual timer\r\n\t\tTimer t = new Timer(100, l);\r\n\t\tt.start();\r\n\t}", "public void timer()\n{\n textSize(13);\n controlP5.getController(\"time\").setValue(runtimes);\n line(400, 748, 1192, 748);\n fill(255,0,0);\n for (int i =0; i<25; i++)\n {\n line(400+i*33, 743, 400+i*33, 753);\n text(i, 395 +i*33, 768);\n }\n if ((runtimes < 1 || runtimes > 28800) && s == true)\n {\n //origint = 0;\n runtimes = 1;\n //pausets = 0;\n runtimep = 0;\n } else if (runtimes > 0 && runtimes < 28800 && s == true)\n {\n runtimep = runtimes;\n runtimes = runtimes + speed;\n }\n timeh= runtimes/1200;\n timem= (runtimes%1200)/20;\n}", "public static void main(String[] args) \n { \n Timer timer = new Timer(); \n TimerTask task = new Helper(); \n\n timer.schedule(task, 3000, 5000); \n System.out.println(\"hi\");\n\n }", "public void StartTimer() {\n\t\tCount = new Timer();\n\t}", "private void startTimer() {\n\t\ttimer = new Timer();\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\n\t\t\tint currTime = 0;\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tjavafx.application.Platform.runLater(new Runnable () {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tcurrTime++;\n\t\t\t\t\t\ttimerLabel.setText(\"Time: \" + currTime);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}, 1000, 1000);\n\t}", "public Timer (String name, int duration, boolean starttimer, boolean loop)\n {\n Name = name;\n Timer = duration;\n TimerMax = duration;\n Loop = loop;\n isRunning = starttimer;\n \n }", "public void start() {timer.start();}", "RampDownTimer getRampDownTimer();", "public void timer()\n {\n if(exists == true)\n { \n if(counter < 500) \n { \n counter++; \n } \n else \n { \n Greenfoot.setWorld(new Test()); \n exists = false; \n } \n } \n }", "private void setEndTimer() {\n vertx.setTimer(10, id -> testComplete());\n }", "private void startTimer(){\n timer= new Timer();\r\n task = new TimerTask() {\r\n @Override\r\n public void run() {\r\n waitDuration++;\r\n\r\n timerLabel.setText(Integer.toString(waitDuration));\r\n }\r\n };\r\n timer.scheduleAtFixedRate(task,1000,1000);\r\n }", "@Test\n\tpublic void testStageProceed() {\n\t\t\n\t\tSystem.out.println(\"\\nTest case : Next stage\");\n\t\t\n\t\tStageScene test = new StageScene() ;\n\t\t\n\t\tassertEquals(0 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 1's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal1 = new Goal(10,105) ;\n\t\t\n\t\tAnimal animal = new Animal(\"file:Resources/Frog/frogUp1.png\") ;\n\t\tanimal.setX(10) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal1) ;\n\t\ttest.add(animal) ;\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\ttest.createStageTimer();\n\t\t\n\t\tassertEquals(1 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 1's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 1 is completed , proceed to stage 2\") ;\n\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 2's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal2 = new Goal(140,105) ;\n\t\t\n\t\tanimal.setX(140) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal2);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(2 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 2's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 2 is completed , proceed to stage 3\") ;\n\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 3's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal3 = new Goal(265,105) ;\n\t\t\n\t\tanimal.setX(265) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal3);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(3 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 3's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 3 is completed , proceed to stage 4\") ;\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 4's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal4 = new Goal(393,105) ;\n\t\t\n\t\tanimal.setX(393) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal4);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(4 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 4's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 4 is completed , proceed to stage 5\") ;\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 5's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal5 = new Goal(520,105) ;\n\t\t\n\t\tanimal.setX(520) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal5);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(5 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 5's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 5 is completed , end game\") ;\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorBadSecondsOne() {\n CountDownTimer s = new CountDownTimer(5, 5, 300);\n\n }", "public void startTimer() {\n timer = new Timer();\n //initialize the TimerTask's job\n initializeTimerTask();\n //schedule the timer, to wake up every 1 second\n timer.schedule(timerTask, 1000, 1000); //\n }", "@Test\n public void testTotalSeconds(){\n \tCountDownTimer s = new CountDownTimer(2, 45, 15);\n \tassertEquals(CountDownTimer.totalSeconds(s), 9915);\n \t\n \ts = new CountDownTimer();\n \tassertEquals(CountDownTimer.totalSeconds(s), 0);\n \t\n \ts = new CountDownTimer(\"1:00:30\");\n \tassertEquals(CountDownTimer.totalSeconds(s), 3630);\n }", "protected abstract ACATimer receive(Port p_, Object evt_, double duration_);", "private void startTime()\n {\n timer.start();\n }", "protected\n TimedRsp\n ( \n TaskTimer timer\n )\n { \n if(timer == null) \n throw new IllegalArgumentException(\"The timer cannot (null)!\");\n pTimer = new TaskTimer(timer);\n }", "Pane ContainerElapsedTime() {\r\n HBox pane = new HBox();\r\n\r\n HBox timerDigits = new HBox();\r\n VBox timerPane = new VBox(3);\r\n TimerBtn start = new TimerBtn(\"START\", 65, 40);\r\n TimerBtn stop = new TimerBtn(\"STOP\", 65, 40);\r\n TimerBtn reset = new TimerBtn(\"RESET\", 65, 40);\r\n\r\n elapsedTimer = new Label(\"00:00:00\");\r\n\r\n timeline = new Timeline(new KeyFrame(Duration.seconds(1), (ActionEvent event) -> {\r\n change(elapsedTimer);\r\n }));\r\n timeline.setCycleCount(Timeline.INDEFINITE);\r\n timeline.setAutoReverse(false);\r\n\r\n /*Start timer method when clicked the timer will start*/\r\n start.setOnAction(e -> {\r\n timeline.play();\r\n });\r\n\r\n /*Stop timer method when clicked the timer will pause*/\r\n stop.setOnAction(e -> {\r\n timeline.pause();\r\n });\r\n\r\n /*Reset timer method when clicked the timer will Reset timer to 0 */\r\n reset.setOnAction(e -> {\r\n hours = 0;\r\n mins = 0;\r\n seconds = 0;\r\n timeline.pause();\r\n elapsedTimer.setText(\"00:00:00\");\r\n });\r\n\r\n elapsedTimer.setPadding(new Insets(50, 25, 50, 25));\r\n timerDigits.setSpacing(50);\r\n elapsedTimer.setTextFill(Color.RED);\r\n elapsedTimer.setStyle(\"-fx-font: 90 arial;\");\r\n timerDigits.getChildren().addAll(elapsedTimer);\r\n\r\n pane.getChildren().add(timerDigits);\r\n\r\n timerPane.setSpacing(5);\r\n timerPane.setPadding(new Insets(20, 10, 20, 10));\r\n timerPane.setAlignment(Pos.CENTER);\r\n timerPane.getChildren().addAll(start, stop, reset);\r\n pane.getChildren().add(timerPane);\r\n return pane;\r\n\r\n }", "public GameTimer()\n \t{\n \t\tsuper();\n \t\tt = new Task();\n \t\tscheduleAtFixedRate( t, 0, 1000 );\n \t\tstartTime = System.currentTimeMillis();\n \t}", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeMinutesOne(){\n \tCountDownTimer s = new CountDownTimer(5, -5, 5);\n }", "public void initializeInstance() {\n instanceLife = new Timer();\n }", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeSecondsOne(){\n \tCountDownTimer s = new CountDownTimer(5, 5, -10);\n }", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeHoursOne(){\n \tCountDownTimer s = new CountDownTimer(-5, 5, 20);\n }", "public void setTimer(int timer) {\n this.timer = timer;\n }", "public void startTimer(){\n timerStarted = System.currentTimeMillis();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n timer = new Timer();\n timer.schedule(timerTask, 0, 60000);\n }", "@Test\n\tpublic void testObjectConstructor(){\n\t\tCountDownTimer s1 = new CountDownTimer(1, 30, 0);\n\t\tCountDownTimer s2 = new CountDownTimer(s1);\n\t\tassertEquals(s2.toString(), \"1:30:00\");\n\t}", "public void setUp()\n {\n mTimer = new SudokuTimer();\n }", "public void startTimer() {\n timer = new Timer();\n\n //initialize the TimerTask's job\n initializeTimerTask();\n\n //schedule the timer, to wake up every 1 second\n timer.schedule(timerTask, 10000, 10000);\n }", "private void setupAnimationTimer() {\n new AnimationTimer() {\n @Override\n public void handle(long l) {\n view.movePlayer();\n view.updateView();\n }\n }.start();\n\n // Timeline for UI stuff\n uiTimeline = new Timeline();\n\n KeyFrame keyStart = new KeyFrame(\n Duration.seconds(0),\n e -> view.updateUI((1160 / distance) * 0.005)\n );\n KeyFrame keyEnd = new KeyFrame(Duration.millis(5));\n\n uiTimeline.getKeyFrames().addAll(keyStart, keyEnd);\n uiTimeline.setCycleCount(Timeline.INDEFINITE);\n uiTimeline.setAutoReverse(false);\n\n countdownTimer = new Timeline(\n new KeyFrame(\n Duration.seconds(distance - (1160 / distance) * 0.005),\n e -> journeyComplete()\n )\n );\n\n // Timeline for asteroids\n Timeline asteroidTimer = new Timeline(\n new KeyFrame(Duration.millis(2000), e -> model.AsteroidPool.spawn())\n );\n asteroidTimer.setCycleCount(Timeline.INDEFINITE);\n asteroidTimer.play();\n }", "private AppTimer() {\n\t\tstart();\n\t}", "public Timer getTimer() {\n\t//if (heartbeat_==null) heartbeat_ = new Timer(100, 1000); // on demand: don't slow down startup\n\tif (timer_==null) timer_ = new java.util.Timer();\n\treturn timer_;\n }", "private void timerstart() {\n timer = new Timer(timer1, new ActionListener(){ \n \tpublic void actionPerformed(ActionEvent ae){\n \t\tcheckMatch();\n \t}});\n timer.start();\n timer.setRepeats(false);\n }", "public static void startTimeout() {\n t = new Timer();\n tt = new TimerTask() {\n\n public void run() {\n while (true) {\n if (diff[0] > 0 || diff[1] > 0) {\n try {\n runFocusPoint();\n Thread.sleep(50);\n } catch (InterruptedException ex) {\n //ex.printStackTrace();\n }\n } else {\n break;\n }\n }\n cancelTask();\n diff[0] = 0;\n diff[1] = 0;\n }\n };\n t.scheduleAtFixedRate(tt, 0, 50);\n }", "protected abstract void timed() throws Throwable;", "private void startNewTimer(Block block, int damage, TimerState state) {\n if (state == TimerState.RUN) {\n removeBlock(block);\n }\n\n addBlock(block, damage, MaterialManager.getInstance().getDurabilityResetTime(block.getType().name()));\n }", "@Override\n\tpublic void alter(LTimerContext timer) {\n\n\t}", "@Override\r\n\tpublic void alter(LTimerContext arg0) {\n\t\t\r\n\t}", "public Timer getOverallTimer();", "protected void processTimer(){\n if(timer != null){\n timer.cancel();\n timer = null;\n }\n // Verificamos si el partido esta en progreso\n if(match.status == Match.STATUS_PENDING || match.status == Match.STATUS_ENDED){\n return;\n }\n // Creamos temporizador 90 * 60 * 1000 = 5.400.000\n timer = new CountDownTimer(5400000, 1000) {\n @Override\n public void onTick(long l) {\n // Calcular los segundos que pasaron\n long seconds = (new Date().getTime() - matchDayLong) / 1000;\n // Calcular los minutos del partido\n long minutes = seconds / 60;\n //long minutes = TimeUnit.MILLISECONDS.toMinutes(uptime);\n if(minutes < 0){\n minutes = 0;\n seconds = 0;\n statusMedium.setText(\"PT\");\n }if(minutes > 45 && minutes < 60){\n minutes = 45;\n seconds = 60;\n }else if(minutes > 90){\n minutes = 90;\n seconds = 60;\n statusMedium.setText(\"ST\");\n }else if(minutes >= 60){\n minutes -= 15;\n statusMedium.setText(\"ST\");\n }else{\n statusMedium.setText(\"PT\");\n }\n\n statusTime.setText(String.format(\"%02d:%02d\", minutes, (seconds%60)));\n }\n\n @Override\n public void onFinish() {\n\n }\n }.start();\n }", "@Test\n\tpublic void testIntConstructors(){\n CountDownTimer s = new CountDownTimer(5, 10, 30);\n assertEquals(s.toString(), \"5:10:30\");\n \n\t\ts = new CountDownTimer(10, 30);\n\t\tassertEquals(s.toString(), \"0:10:30\");\n\t\t\n\t\ts = new CountDownTimer(30);\n\t\tassertEquals(s.toString(), \"0:00:30\");\n\t}", "@Override\r\n\tprotected void initEvent() {\n\t\ttimer = new Timer(1000, new ActionListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttimer_tick(e);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}", "@DISPID(31)\r\n\t// = 0x1f. The runtime will prefer the VTID if present\r\n\t@VTID(36)\r\n\tasci.activebatch.enumJobTimerTriggerType timerTrigger();", "private void getOneToteTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "public TimerDisplay()\n {\n timeElapsed = 0;\n }", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testConstructor3LargeMinute() {\n\t\tnew CountDownTimer(12, 60, 14);\n\t}", "private Timer() {\n myThread = new TimerThread();\n myThread.start();\n }", "public GameThread(Timer timer)\n\t{\n\t\tthis.timer = timer;\n\t}", "protected abstract ACATimer receiveAt(Port p_, Object evt_, double time_);", "private String doTimers(int i, String[] args)\r\n {\n return null;\r\n }", "@Test\n public void testStart() throws InterruptedException {\n Thread thread = new Thread(new Runnable() {\n\n @Override\n public void run() {\n new JFXPanel(); // Initializes the JavaFx Platform\n Platform.runLater(new Runnable() {\n\n @Override\n public void run() {\n try {\n new GOL_Main().start(new Stage()); // Create and\n // initialize app\n } catch (Exception ex) {\n Logger.getLogger(GOL_MainTest.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }\n });\n }\n });\n thread.start();// Initialize the thread\n Thread.sleep(10);\n System.out.println(\"start\");\n Stage stage = null;\n GOL_Main instance = new GOL_Main(); \n }", "public void initializeTimerTask() {\n timerTask = new TimerTask() {\n public void run() {\n Log.i(\"in timer\", \"in timer ++++ \"+ (counter++));\n cek_tugas();\n uploadphoto();\n cekNotifSampai();\n cekJanjiSurvey();\n }\n };\n }" ]
[ "0.6770262", "0.6528391", "0.6462217", "0.640483", "0.6399101", "0.6357699", "0.6265556", "0.61719257", "0.61485714", "0.60154593", "0.60149175", "0.5958902", "0.59085643", "0.589372", "0.5877599", "0.58649987", "0.586431", "0.58430594", "0.5836607", "0.58335733", "0.58303225", "0.5822555", "0.58116364", "0.58115417", "0.58094484", "0.5794204", "0.57691216", "0.5766639", "0.57584244", "0.5739979", "0.5726233", "0.57127535", "0.5701883", "0.56898654", "0.5685867", "0.5664026", "0.5645676", "0.5639264", "0.56343544", "0.56300217", "0.5583769", "0.5582966", "0.55648494", "0.5564619", "0.5562488", "0.5537989", "0.55378705", "0.5535007", "0.5531829", "0.55293584", "0.5522771", "0.55188143", "0.5518552", "0.55098104", "0.550693", "0.5500722", "0.54971606", "0.5496677", "0.5496368", "0.54941225", "0.5474137", "0.54525787", "0.54398805", "0.5430649", "0.5412885", "0.5400843", "0.5399654", "0.53851974", "0.5376917", "0.5343575", "0.53431034", "0.53348523", "0.5326324", "0.53187776", "0.5316909", "0.53075546", "0.5306839", "0.5301183", "0.52991265", "0.5289263", "0.5287386", "0.5275854", "0.5261177", "0.5256254", "0.5254364", "0.5251327", "0.5245609", "0.5245267", "0.5244022", "0.52322245", "0.52313185", "0.52297884", "0.5229698", "0.5223997", "0.52204496", "0.52168274", "0.52129865", "0.5202308", "0.52018535", "0.520091", "0.51967204" ]
0.0
-1
System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder());
@Override public void statusChanged(ASCIIString cellId, Flease lease) { synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getStateChange();", "public void testOpenAndGetLease() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, new MasterEpochHandlerInterface() {\n\n long masterEpochNum = 0;\n\n @Override\n public void sendMasterEpoch(FleaseMessage response, Continuation callback) {\n // System.out.println(\"sending: \"+masterEpochNum);\n response.setMasterEpochNumber(masterEpochNum);\n callback.processingFinished();\n }\n\n @Override\n public void storeMasterEpoch(FleaseMessage request, Continuation callback) {\n masterEpochNum = request.getMasterEpochNumber();\n // System.out.println(\"storing: \"+masterEpochNum);\n callback.processingFinished();\n }\n });\n\n FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART);\n msg.setCellId(CELL_ID);\n\n fs.startAndWait();\n\n fs.openCell(CELL_ID, new ArrayList(),true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),1);\n\n FleaseFuture f = fs.closeCell(CELL_ID, false);\n f.get();\n\n Thread.sleep(12000);\n\n result.set(null);\n\n fs.openCell(CELL_ID, new ArrayList(), true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),2);\n\n fs.stopAndWait();\n }", "@Test\n public void testUpdateCheckpointLeaseUpdated() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n leaseRefresher.renewLease(coordinator.getCurrentlyHeldLease(leaseKey));\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n lease.leaseCounter(lease.leaseCounter() + 1);\n // Counter and owner changed, but checkpoint did not.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "public I getChangeInfo(int startSeqNum);", "@Test\n public void testUpdateCheckpoint() throws Exception {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n // Run the taker and renewer in-between getting the Lease object and calling checkpoint\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n if (lease == null) {\n List<Lease> leases = leaseRefresher.listLeases();\n for (Lease kinesisClientLease : leases) {\n System.out.println(kinesisClientLease);\n }\n }\n\n assertNotNull(lease);\n final ExtendedSequenceNumber initialCheckpoint = new ExtendedSequenceNumber(\"initialCheckpoint\");\n final ExtendedSequenceNumber pendingCheckpoint = new ExtendedSequenceNumber(\"pendingCheckpoint\");\n final ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n final byte[] checkpointState = \"checkpointState\".getBytes();\n\n // lease's leaseCounter is wrong at this point, but it shouldn't matter.\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), initialCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtInitialCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, leaseFromDDBAtInitialCheckpoint);\n\n dynamoDBCheckpointer.prepareCheckpoint(lease.leaseKey(), pendingCheckpoint, lease.concurrencyToken().toString(), checkpointState);\n\n final Lease leaseFromDDBAtPendingCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.pendingCheckpoint(pendingCheckpoint);\n lease.pendingCheckpointState(checkpointState);\n assertEquals(lease, leaseFromDDBAtPendingCheckpoint);\n\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtNewCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(newCheckpoint);\n lease.pendingCheckpoint(null);\n lease.pendingCheckpointState(null);\n assertEquals(lease, leaseFromDDBAtNewCheckpoint);\n }", "@Override\n\tpublic void update() {\n\t\tSystem.out.println(\"Observer Pattern on Room Reservation Notification: \");\n\t\tSystem.out.println(\"Your room is \" + reserve.getState()+\"\\n\");\n\t}", "public long getStateChange() {\n return stateChange_;\n }", "@Override\n\tpublic void checkWayBillChange(String id) {\n\t\t\n\t}", "public long getStateChange() {\n return stateChange_;\n }", "public void changedUpdate(DocumentEvent evt, FoldHierarchyTransaction transaction) {\n }", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "public boolean isAlive ()\n {\n return cellStatus;\n }", "int getLeaseId() {\n return leaseId;\n }", "public void onCellEdit(CellEditEvent event) {\n Object oldValue = event.getOldValue();\n Object newValue = event.getNewValue();\n Object o = event.getSource();\n System.out.println(\"event called: \" + newValue + \" \" + oldValue);\n System.out.println(o.toString());\n DataTable table = (DataTable) event.getComponent();\n Long id = (Long) table.getRowKey();\n System.out.println(\"#### row key is : \" + id + \" ####\");\n if (newValue != null && !newValue.equals(oldValue)) {\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cell Changed\", \"Old: \" + oldValue + \", New:\" + newValue);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n for (Gnome gnome : user.getCart()) {\n if ((gnome.getId() != null) && (gnome.getId().compareTo(id) == 0)) {\n System.out.println(\"cart size on cell edit \" + user.getCart().size());\n gnome.setShopQuantity((Integer) newValue);\n userFacade.updateCart(user, gnome);\n }\n }\n }\n }", "public synchronized void switchCell()\n {\n cellValue = (cellValue == ALIVE) ? DEAD : ALIVE;\n }", "@Override\n protected void handleCellContentChange(int row,\n int column,\n Object oldValue,\n Object newValue)\n {\n // Store the log note with the log data and write it to the log\n // notes file\n perfLog.getPerfLogData().get(row).setNotes(newValue.toString());\n perfLog.writeLogNotes(row);\n }", "public void update() \n {\n System.out.print( \" \" + Integer.toHexString( subj.getState() ) ); \n}", "public void setCellState(int newState) {\n this.myState = newState;\n }", "public DBState() {\n\t\t\tthis.expandedElements=treeViewer.getExpandedElements();\n\t\t\tthis.treeSelection=treeViewer.getSelection();\n\t\t\tthis.tableSelection=txTableViewer.getSelection();\n\t\t}", "@Override\n\t\t\tpublic void editingStopped(ChangeEvent arg0) {\n\n\t\t\t\tSystem.out.println(tree.getCellEditor().getCellEditorValue());\n\t\t\t\ttree.getModel().valueForPathChanged(tree.getSelectionPath(),\n\t\t\t\t\t\ttree.getCellEditor().getCellEditorValue() + \"zzz\");\n\t\t\t\ttree.updateUI();\n\t\t\t}", "void oracle(){\n if (this.neighbors < 1){\n if (!isAlive()){\n observer.deleteCell(id);\n }\n }\n }", "void showchange() {\n\t\tif (printstatus != change)\n\t\t\tprintln(\">>>> \" + printoldline + \" CHANGED FROM <br/>\");\n\t\tprintstatus = change;\n\t\toutput+=oldinfo.symbol[printoldline].showSymbol();\n\t\toutput+=\"<br/>\";\n\t\tanyprinted = true;\n\t\tprintoldline++;\n\t}", "private CellBackup(CellRevision cellRevision, TechPool techPool, boolean modified) {\n this.cellRevision = cellRevision;\n this.techPool = techPool;\n this.modified = modified;\n cellBackupsCreated++;\n if (Job.getDebug())\n check();\n }", "private void verifyChanges() {\n System.out.println(\"Verify changes\"); \n }", "@Test\n public void testUpdateCheckpointBadConcurrencyToken() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, UUID.randomUUID()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n // Owner should be the only thing that changed.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "@Override\r\n\t\t\tpublic void update(final ViewerCell cell) {\n\t\t\t}", "@Override\r\n\t\t\tpublic void update(final ViewerCell cell) {\n\t\t\t}", "@Override\n public int getRowChange() {\n return rowChange;\n }", "void printstate()\n\t{\n\t\toperation.printstate();\n\t}", "public String toString() {\r\n\treturn \"batch image builder for:\\n\\tnew state: \"/*nonNLS*/ + getNewState();\r\n}", "synchronized boolean isLeaseHeld() {\n return leaseId > -1;\n }", "public Long getChangeNum() {\n return changeNum;\n }", "@Override\n public void stateChanged(ChangeEvent e) {\n model.generateGridWithSpecifiedProblemDifficulty(view.getSpinnerValue());\n view.updateGridPanel(model.getGrid(), model.getAgentLocation());\n }", "private void gridMain_CellLeave(Object sender, OpenDental.UI.ODGridClickEventArgs e) throws Exception {\n long codeNum = PIn.Long(ProcTable.Rows[e.getRow()][\"CodeNum\"].ToString());\n long feesched = FeeSchedC.getListShort()[listFeeSched.SelectedIndex].FeeSchedNum;\n Fee fee = Fees.getFee(codeNum,feesched);\n String strOld = \"\";\n if (fee != null)\n {\n strOld = fee.Amount.ToString(\"n\");\n }\n \n String strNew = gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text;\n if (StringSupport.equals(strOld, strNew))\n {\n return ;\n }\n \n if (!Security.isAuthorized(Permissions.Setup))\n {\n //includes dialog\n gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text = strOld;\n gridMain.Invalidate();\n return ;\n }\n \n double dNew = -1;\n if (!StringSupport.equals(strNew, \"\"))\n {\n try\n {\n dNew = PIn.Double(strNew);\n }\n catch (Exception __dummyCatchVar2)\n {\n gridMain.setSelected(new Point(e.getCol(), e.getRow()));\n MessageBox.Show(Lan.g(this,\"Please fix data entry error first.\"));\n return ;\n }\n\n gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text = dNew.ToString(\"n\");\n }\n \n //to standardize formatting. They probably didn't type .00\n //invalidate doesn't seem to be necessary here\n if (StringSupport.equals(strOld, \"\"))\n {\n //if no fee was originally entered and since it's no longer empty, then we need to insert a fee.\n //Somehow duplicate fees were being inserted so double check that this fee does not already exist.\n Fee tmpFee = Fees.getFee(codeNum,feesched);\n //Looks in cache.\n if (tmpFee != null)\n {\n return ;\n }\n \n //Fee exists. Must be unknown bug.\n fee = new Fee();\n fee.FeeSched = feesched;\n fee.CodeNum = codeNum;\n fee.Amount = dNew;\n Fees.insert(fee);\n Fees.getListt().Add(fee);\n }\n else\n {\n //if fee existed\n if (StringSupport.equals(strNew, \"\"))\n {\n //delete old fee\n Fees.delete(fee);\n Fees.getListt().Remove(fee);\n }\n else\n {\n //change fee\n fee.Amount = dNew;\n Fees.update(fee);\n Fees.getListt()[Fees.getListt().IndexOf(fee)].Amount = dNew;\n } \n } \n SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lan.g(this,\"Procedure\") + \": \" + ProcedureCodes.getStringProcCode(fee.CodeNum) + \", \" + Lan.g(this,\"Fee: \") + \"\" + fee.Amount.ToString(\"c\") + \", \" + Lan.g(this,\"Fee Schedule\") + \": \" + FeeScheds.getDescription(fee.FeeSched) + \". \" + Lan.g(this,\"Manual edit in grid from Procedure Codes list.\"), fee.CodeNum);\n }", "long getChangeset();", "@Override\n\tpublic void stateChanged(ChangeEvent arg0) {\n\t\t\n\t}", "public void testExistingSeqWithChangedSrcCuratorEdited() throws Exception\n {\n sqlMgr.executeUpdate(\"update prb_source set isCuratorEdited = 1 where _source_key = -40\");\n Integer C30 = this.cellLineLookup.lookup(\"C30\");\n String sql = \"select * from prb_source where _source_key \" +\n \"= -40 and _cellLine_key = \" + C30.toString();\n ResultsNavigator nav = sqlMgr.executeQuery(sql);\n assertTrue(!nav.next()); // assure no records found\n String accid = \"T00313\";\n MSRawAttributes raw = new MSRawAttributes();\n raw.setOrganism(\"mouse, laboratory\");\n raw.setCellLine(\"C30\");\n Integer seqKey = new Integer(-200);\n msProcessor.processExistingSeqSrc(accid, seqKey, null, raw);\n nav = sqlMgr.executeQuery(sql);\n assertTrue(!nav.next()); // assure record was not edited\n // check qc tables\n sql = \"select count(*) from QC_MS_AttrEdit \" +\n \"where _jobstream_key = \" + jobkey;\n nav = radar.executeQuery(sql);\n RowReference row = nav.getRowReference();\n nav.next();\n assertEquals(new Integer(1), row.getInt(1));\n\n }", "public void doEdit(TLDocument doc){\n\n\t\trememberDocument(doc);\n\t\t\n\t\t//\tSet the create and modify timestamps on the states.\n\t\tSet affectedStates = this.getAffectedStates();\n\t\tIterator iter = affectedStates.iterator();\n\t\tlong now = System.currentTimeMillis();\n\t\twhile (iter.hasNext()){\n\t\t\tTLState state = (TLState)iter.next();\n\t\t\tstate.setCreateTime(now);\n\t\t\tstate.setModifyTime(now);\n\t\t}\n\t\n\t\t//\tAsk the document to add these states.\n\t\tif (iDeleting)\n\t\t\tiDoc.editRemoveStates(this, affectedStates);\n\t\telse\n\t\t\tiDoc.editAddStates(this, affectedStates);\n\t}", "private void noteExpiredLease() {\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[noteExpiredLease] {}\", thread);\n }\n if (expiredLeases == null) {\n expiredLeases = new WeakHashMap();\n }\n expiredLeases.put(thread, null);\n }", "public void borrow()\n {\n borrowed++;\n }", "public LocalHolding getHoldingForUpdate();", "public void itemStateChanged(ItemEvent e)\r\n {\r\n System.out.println(\"*** get cell editor value:in itemStateChanged event ***\" +txtCell.getText()) ;\r\n super.fireEditingStopped();\r\n }", "OperationalState operationalState();", "OperationalState operationalState();", "public void updateCell() {\n alive = !alive;\n simulator.getSimulation().changeState(xPosition, yPosition);\n setColor();\n }", "public void stateChanged (ChangeEvent e)\n {\n }", "public boolean isCellEditable(Object cell) {\r\n \t\treturn cell instanceof JmtCell || cell instanceof BlockingRegion;\r\n \t}", "@Override\r\n public void stateChanged(ChangeEvent e) {\n }", "public String getNewState() {\n\t\treturn this.newState;\n\t}", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t}", "@DISPID(-2147412093)\n @PropGet\n java.lang.Object onrowenter();", "private StateHolder getStateHolder() {\n return stateHolder;\n }", "@Override\n public void cellChanged(String newCellValue) {\n\t \n }", "void showsame() {\n\t\tint count;\n\t\tprintstatus = idle;\n\t\tif (newinfo.other[printnewline] != printoldline) {\n\t\t\tSystem.err.println(\"BUG IN LINE REFERENCING\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tcount = blocklen[printoldline];\n\t\tprintoldline += count;\n\t\tprintnewline += count;\n\t}", "public void update()\n {\n System.out.print( \" \" + Integer.toBinaryString( subj.getState() ) );\n }", "void willDisplayUpdate(String change) throws RemoteException;", "public void stateChanged(ChangeEvent e){\n\r\n if (fLastEdit!=this){ // just a precaution against stateChange getting called many times\r\n\r\n if (fLastEdit != null) // kill the previous one so there's only one undo\r\n fLastEdit.die(); // don't kill ourselves\r\n\r\n fLastEdit = this;\r\n // fUndoListener.undoableEditHappened(new UndoableEditEvent(TShapePanel.this, this)); // tell the listener.\r\n\r\n tellListeners(new UndoableEditEvent(TShapePanel.this,this)); // tell the listeners.\r\n\r\n }\r\n\r\n }", "public void notifyChangementCroyants();", "public TransactionState state();", "public String getXmlChangedState() {\n String msg = \"<change_object_state idobj=\\\"\" + codObjeto + \"\\\" \";\n msg += \" status=\\\"\" + status + \"\\\" tag=\\\"\" + tag + \"\\\" \";\n msg += \" flagInventario=\\\"\" + flagInventario + \"\\\" \";\n msg += \" codUser=\\\"\" + codUser + \"\\\"\";\n msg += \" posx=\\\"\" + posX + \"\\\" posY=\\\"\" + posY + \"\\\">\";\n msg += \"</change_object_state>\";\n return msg;\n \n }", "public void stateChanged(ChangeEvent e){\n\r\n if (fLastEdit!=this){ // just a precaution against stateChange getting called many times\r\n\r\n if (fLastEdit != null) // kill the previous one so there's only one undo\r\n fLastEdit.die(); // don't kill ourselves\r\n\r\n fLastEdit = this;\r\n // fUndoListener.undoableEditHappened(new UndoableEditEvent(TShapePanel.this, this)); // tell the listener.\r\n\r\n tellListeners(new UndoableEditEvent(TShapePanel.this,this)); // tell the listeners.\r\n\r\n }\r\n\r\n }", "public Statement statemt() {\n try {\n Statement stmt = LidhjaMeDb.hapelidhjen();\n this.state = stmt;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return state;\n\n }", "void startEditing(Object cell) {\n\n\t}", "public State getState(){return this.state;}", "int getCellid();", "@Override public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException {\n IgniteThread cpThread = new IgniteThread(cctx.igniteInstanceName(), \"db-checkpoint-thread\", checkpointer);\n\n cpThread.start();\n\n checkpointerThread = cpThread;\n\n CheckpointProgressSnapshot chp = checkpointer.wakeupForCheckpoint(0, \"node started\");\n\n if (chp != null)\n chp.cpBeginFut.get();\n }", "public void testSimpleMasterEpochHandler() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n SimpleMasterEpochHandler meHandler = new SimpleMasterEpochHandler(\"/tmp/xtreemfs-test/\");\n Service.State svcState = meHandler.startAndWait();\n if (svcState != Service.State.RUNNING) {\n LOG.error(\"Unable to start Master Epoch Handler\", meHandler.failureCause());\n }\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, meHandler);\n\n FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART);\n msg.setCellId(CELL_ID);\n\n fs.startAndWait();\n\n fs.openCell(CELL_ID, new ArrayList(),true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(1, result.get().getMasterEpochNumber());\n\n FleaseFuture f = fs.closeCell(CELL_ID, false);\n f.get();\n\n fs.stopAndWait();\n meHandler.stopAndWait();\n\n Thread.sleep(12000);\n\n //restart\n meHandler = new SimpleMasterEpochHandler(\"/tmp/xtreemfs-test/\");\n if (meHandler.startAndWait() != Service.State.RUNNING) {\n LOG.error(\"Couldnt start meHandler\", meHandler.failureCause());\n }\n\n fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, meHandler);\n\n fs.startAndWait();\n\n result.set(null);\n\n fs.openCell(CELL_ID, new ArrayList(), true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),2);\n\n fs.stopAndWait();\n\n }", "public int getState() {return state;}", "public int getState() {return state;}", "@Override\n public void onNewClusterState(ClusterState state) {\n transportService.sendRequest(\n clusterService.localNode(),\n transportReplicaAction,\n replicaRequest,\n new ActionListenerResponseHandler<>(onCompletionListener, ReplicaResponse::new)\n );\n }", "@Override\n public String toString()\n {\n return state.toString();\n }", "private void updateAccPoolState() {\n List<AionAddress> clearAddr = new ArrayList<>();\n for (Entry<AionAddress, AccountState> e : this.accountView.entrySet()) {\n AccountState as = e.getValue();\n if (as.isDirty()) {\n\n if (as.getMap().isEmpty()) {\n this.poolStateView.remove(e.getKey());\n clearAddr.add(e.getKey());\n } else {\n // checking AccountState given by account\n List<PoolState> psl = this.poolStateView.get(e.getKey());\n if (psl == null) {\n psl = new LinkedList<>();\n }\n\n List<PoolState> newPoolState = new LinkedList<>();\n // Checking new tx has been include into old pools.\n BigInteger txNonceStart = as.getFirstNonce();\n\n if (txNonceStart != null) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState fn [{}]\",\n txNonceStart.toString());\n }\n for (PoolState ps : psl) {\n // check the previous txn status in the old\n // PoolState\n if (isClean(ps, as)\n && ps.firstNonce.equals(txNonceStart)\n && ps.combo == seqTxCountMax) {\n ps.resetInFeePool();\n newPoolState.add(ps);\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState add fn [{}]\",\n ps.firstNonce.toString());\n }\n\n txNonceStart = txNonceStart.add(BigInteger.valueOf(seqTxCountMax));\n } else {\n // remove old poolState in the feeMap\n if (this.feeView.get(ps.getFee()) != null) {\n\n if (e.getValue().getMap().get(ps.firstNonce) != null) {\n this.feeView\n .get(ps.getFee())\n .remove(\n e.getValue()\n .getMap()\n .get(ps.firstNonce)\n .getKey());\n }\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState remove fn [{}]\",\n ps.firstNonce.toString());\n }\n\n if (this.feeView.get(ps.getFee()).isEmpty()) {\n this.feeView.remove(ps.getFee());\n }\n }\n }\n }\n }\n\n int cnt = 0;\n BigInteger fee = BigInteger.ZERO;\n BigInteger totalFee = BigInteger.ZERO;\n\n for (Entry<BigInteger, SimpleEntry<ByteArrayWrapper, BigInteger>> en :\n as.getMap().entrySet()) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState mapsize[{}] nonce:[{}] cnt[{}] txNonceStart[{}]\",\n as.getMap().size(),\n en.getKey().toString(),\n cnt,\n txNonceStart != null ? txNonceStart.toString() : null);\n }\n if (en.getKey()\n .equals(\n txNonceStart != null\n ? txNonceStart.add(BigInteger.valueOf(cnt))\n : null)) {\n if (en.getValue().getValue().compareTo(fee) > -1) {\n fee = en.getValue().getValue();\n totalFee = totalFee.add(fee);\n\n if (++cnt == seqTxCountMax) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case1 - nonce:[{}] totalFee:[{}] cnt:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt);\n }\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n\n txNonceStart = en.getKey().add(BigInteger.ONE);\n totalFee = BigInteger.ZERO;\n fee = BigInteger.ZERO;\n cnt = 0;\n }\n } else {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case2 - nonce:[{}] totalFee:[{}] cnt:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt);\n }\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n\n // next PoolState\n txNonceStart = en.getKey();\n fee = en.getValue().getValue();\n totalFee = fee;\n cnt = 1;\n }\n }\n }\n\n if (totalFee.signum() == 1) {\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case3 - nonce:[{}] totalFee:[{}] cnt:[{}] bw:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt,\n e.getKey().toString());\n }\n\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n }\n\n this.poolStateView.put(e.getKey(), newPoolState);\n\n if (LOG.isTraceEnabled()) {\n this.poolStateView.forEach(\n (k, v) ->\n v.forEach(\n l -> {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState - the first nonce of the poolState list:[{}]\",\n l.firstNonce);\n }));\n }\n as.sorted();\n }\n }\n }\n\n if (!clearAddr.isEmpty()) {\n clearAddr.forEach(\n addr -> {\n lock.writeLock().lock();\n this.accountView.remove(addr);\n lock.writeLock().unlock();\n this.bestNonce.remove(addr);\n });\n }\n }", "void notifyChange(String name, T addressBook) {\n if (!addressBook.equals(history.get(current).getData())) {\n if (hasRedo()) {\n history.subList(current + 1, history.size()).clear();\n }\n history.get(current).subsequentCause = name;\n current++;\n history.add(new State(name, addressBook));\n }\n }", "@Override\n public void stateChanged(javax.swing.event.ChangeEvent e) {\n }", "public boolean isNewCell() {\n return cellNum == null;\n }", "private StateChangeMonitor() {\n\t\t// Create the registry of StateChangeListeners\n\t\tlisteners = new Hashtable();\n\t}", "private void changed() {\n // Ok to have a race here, see the field javadoc.\n if (!changed)\n changed = true;\n }", "public String getNewState()\n\t{\n\t\treturn (UUID.randomUUID().toString());\n\t}", "public void onAlivenessChange(long nodehash, boolean b) { synchronized (this.nodedb) {\n\t\tNodeDB.NodeInfo n = this.nodedb.get(nodehash);\n\t\tif (n == null) return;\n\t\tif (n.alive == b) return;\n\t\tif ((n.isLocal) && !b) throw new RuntimeException(\"Local liveness change!!\");\n\n\t\tn.timestamp = System.currentTimeMillis();\n\t\tn.alive = b;\n\t\t\n\t\tGossipThread.getInstance().replicateNodeInfo(n);\n\t}}", "@Test\n public void Create_A_Live_Cell()\n {\n GameCell cell = new GameCell();\n cell.setState(1);\n Assert.assertEquals(1, cell.getState());\n }", "public Cell() {\n\t\tthis.alive = false; // Initially dead\n\t\tthis.age = 0; // Initially age of 0\n\t}", "public String getCellid() {\r\n return cellid;\r\n }", "public void decisionOnCellState(int counter, int row, int column)\r\n {\r\n if (cellGrid[column][row].isAlive())\r\n {\r\n if (counter < 2)\r\n {\r\n cellGrid[column][row].setToBeAlive(false);\r\n }\r\n else if (counter == 2 || counter == 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(true);\r\n }\r\n else if (counter > 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(false);\r\n } // end of if (counter < 2)\r\n }\r\n else\r\n {\r\n if (counter == 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(true);\r\n } // end of if (counter == 3)\r\n } // end of if (cellGrid[column][row].isAlive())\r\n }", "public void getState();", "public void doChanges0() {\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compBounds.put(\"jScrollPane1\", new Rectangle(232, 11, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jScrollPane1-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compBounds.put(\"jScrollPane1\", new Rectangle(232, 11, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n // parentId-compId-dimension-compAlignment\n lm.removeComponent(\"jScrollPane1\", true);\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n }", "public void stateChanged( ChangeEvent event )\n {\n \n }", "private void transferPendingCellData()\r\n\t{\r\n\t\tsynchronized(dataLock)\r\n\t\t{\r\n\t\t\tcellData = pendingCellData;\r\n\t\t\trowCount = cellData.length;\r\n\t\t}\r\n\t}", "public void info() {\n\t\tstate.info();\n\t}", "@FXML\n public void changeMarksCellEvent(CellEditEvent<UGSubjectMarks, Integer> edittedCell) throws SQLException, ClassNotFoundException{\n UGSubjectMarks markSelected = subjectmarktbl.getSelectionModel().getSelectedItem();\n markSelected.SetSubMark(Integer.parseInt(edittedCell.getNewValue().toString()));\n int newMarks = Integer.parseInt(edittedCell.getNewValue().toString());\n UGSubject.setSubjectMarks(Integer.parseInt(studentID.getText()), sem, markSelected.getSubName(), newMarks);\n \n \n }", "public native CellRecord getEditedRecord(int rowNum, int colNum) /*-{\r\n var self = [email protected]::getOrCreateJsObj()();\r\n var record = self.getEditedRecord(rowNum, colNum);\r\n if (record == null) return null;\r\n return @com.smartgwt.client.widgets.cube.CellRecord::getOrCreateRef(Lcom/google/gwt/core/client/JavaScriptObject;)(record);\r\n }-*/;", "@Test\n public void isDirty_freshObject() {\n AlphaTransaction t = startTransaction();\n IntRef value = new IntRef(0);\n IntRefTranlocal tranlocal = (IntRefTranlocal) t.openForWrite(value);\n assertTrue(tranlocal.isDirty());\n }", "public void onEditTransaction(Transaction transaction) {\n\t}", "protected void updateCaseWithNewStatus(NbaDst caseDst,NbaDst tranDst) throws NbaBaseException { //NBLXA -1983\n \ttry {\n \t\tif (NbaConstants.A_QUEUE_UNDERWRITER_HOLD.equals(caseDst.getQueue())) {\n \t\t\t//Start NBLXA -1983\n \t\t\t/* Reinsurance Responses are bundled unless and until all the responses are received on the case. But if response for additional info is received case route to UW */\n \t\t\tboolean isFinalReplRecieve= true; \n \t\t\tif(((!NbaUtils.isBlankOrNull(tranDst.getNbaLob().hasAdditionalInfo()) && (!tranDst.getNbaLob().getAdditionalInfo()) ) ||\n \t\t\t\t\tNbaUtils.isBlankOrNull(tranDst.getNbaLob().hasAdditionalInfo()))){\n \t\t\t\tsetNbaTxLife(doHoldingInquiry(caseDst));\n \t\t\t\tif(!NbaUtils.isBlankOrNull(getNbaTxLife())){\n \t\t\t\t\tLong appType=getNbaTxLife().getPolicy().getApplicationInfo().getApplicationType();\n \t\t\t\t\tApplicationInfo appInfo = getNbaTxLife().getPolicy().getApplicationInfo();\n \t\t\t\t\tApplicationInfoExtension appInfoExt = NbaUtils.getFirstApplicationInfoExtension(appInfo);\n \t\t\t\t\tif( NbaOliConstants.OLI_ACTTYPE_1000500003 !=appType && NbaOliConstants.OLI_APPTYPE_SIMPLIFIEDISSUE !=appType \n \t\t\t\t\t\t\t&& (!NbaUtils.isBlankOrNull(appInfoExt) && !NbaUtils.isContractChange(getNbaTxLife()) && NbaUtils.isBlankOrNull(appInfoExt.getReopenDate()))){\n \t\t\t\t\t\tNbaDst parentCase = retrieveParentWork(tranDst, true,true);\n \t\t\t\t\t\tList transactions = parentCase.getNbaTransactions();\n \t\t\t\t\t\tNbaTransaction transaction = null; \t\t\n \t\t\t\t\t\tfor (int i = 0; i < transactions.size(); i++) {\n \t\t\t\t\t\t\ttransaction = (NbaTransaction) transactions.get(i);\n \t\t\t\t\t\t\tif (!tranDst.getID().equalsIgnoreCase( transaction.getID()) && NbaConstants.A_WT_REINSURANCE.equals(transaction.getWorkType()) && !transaction.isInEndQueue()) {\n \t\t\t\t\t\t\t\tisFinalReplRecieve =false;\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif(isFinalReplRecieve){\n \t\t\t\t//End NBLXA -1983\n \t\t\t\tupdateCaseStatus(caseDst);\n \t\t\t}\n \t\t\t//NBA208-32\n \t\t\tcaseDst.getCase().getWorkItemChildren().clear(); //clear child transaction\n \t\t\tcaseDst.setUpdate();\n \t\t}\n \t}catch (NbaBaseException e) {\n \t\tif (e.isFatal()) {\n \t\t\tthrow e;\n \t\t}\n \t\tgetLogger().logException(e);\n \t\tthrow new NbaBaseException(\"Unable to retrieve new status for case work item, reason: \" + e.getMessage(), e);\n \t}\n }", "R commit(C change);", "public String getCellid() {\n return cellid;\n }", "public String getCellid() {\n return cellid;\n }", "public void willbeUpdated() {\n\t\t\n\t}", "public void stateChanged(ChangeEvent e) {\n }" ]
[ "0.59451824", "0.5618135", "0.5451526", "0.5433061", "0.5431796", "0.54150623", "0.53984064", "0.5367134", "0.52899486", "0.523861", "0.5230157", "0.5217632", "0.52032053", "0.51949805", "0.519186", "0.5189909", "0.5182019", "0.5176364", "0.5144113", "0.51081574", "0.51062155", "0.50953823", "0.50944805", "0.5057024", "0.5049687", "0.50439805", "0.50439805", "0.50417745", "0.502732", "0.49989447", "0.49975684", "0.49919346", "0.49830884", "0.4975045", "0.49747354", "0.4972741", "0.49578685", "0.49549484", "0.49524257", "0.49514964", "0.49471122", "0.49385458", "0.49307385", "0.49307385", "0.49252173", "0.49243873", "0.4915735", "0.49037397", "0.4891673", "0.4888402", "0.48850673", "0.48743343", "0.48742318", "0.48741573", "0.4869571", "0.4867198", "0.4866739", "0.48603478", "0.484789", "0.4838406", "0.48328173", "0.48327208", "0.48322022", "0.48316714", "0.48273388", "0.4825359", "0.48209742", "0.48178408", "0.48178408", "0.48022756", "0.48021954", "0.48005778", "0.47822163", "0.478142", "0.477729", "0.4775268", "0.47743854", "0.4769961", "0.4762175", "0.47580054", "0.47562706", "0.4754717", "0.475006", "0.4744265", "0.47419202", "0.47412786", "0.47411075", "0.47408158", "0.47297564", "0.47297356", "0.4726536", "0.47265193", "0.47250164", "0.47199544", "0.47165555", "0.47165555", "0.47133648", "0.47120944" ]
0.7013319
2
Test of createTimer method, of class FleaseStage.
public void testSimpleMasterEpochHandler() throws Exception { final ASCIIString CELL_ID = new ASCIIString("testcell"); final AtomicReference<Flease> result = new AtomicReference(); SimpleMasterEpochHandler meHandler = new SimpleMasterEpochHandler("/tmp/xtreemfs-test/"); Service.State svcState = meHandler.startAndWait(); if (svcState != Service.State.RUNNING) { LOG.error("Unable to start Master Epoch Handler", meHandler.failureCause()); } FleaseStage fs = new FleaseStage(cfg, "/tmp/xtreemfs-test/", new FleaseMessageSenderInterface() { @Override public void sendMessage(FleaseMessage message, InetSocketAddress recipient) { //ignore me } }, true, new FleaseViewChangeListenerInterface() { @Override public void viewIdChangeEvent(ASCIIString cellId, int viewId) { } },new FleaseStatusListener() { @Override public void statusChanged(ASCIIString cellId, Flease lease) { // System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder()); synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } } @Override public void leaseFailed(ASCIIString cellId, FleaseException error) { MasterEpochTest.fail(error.toString()); } }, meHandler); FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART); msg.setCellId(CELL_ID); fs.startAndWait(); fs.openCell(CELL_ID, new ArrayList(),true); synchronized(result) { if (result.get() == null) result.wait(1000); if (result.get() == null) fail("timeout!"); } assertEquals(result.get().getLeaseHolder(),cfg.getIdentity()); assertEquals(1, result.get().getMasterEpochNumber()); FleaseFuture f = fs.closeCell(CELL_ID, false); f.get(); fs.stopAndWait(); meHandler.stopAndWait(); Thread.sleep(12000); //restart meHandler = new SimpleMasterEpochHandler("/tmp/xtreemfs-test/"); if (meHandler.startAndWait() != Service.State.RUNNING) { LOG.error("Couldnt start meHandler", meHandler.failureCause()); } fs = new FleaseStage(cfg, "/tmp/xtreemfs-test/", new FleaseMessageSenderInterface() { @Override public void sendMessage(FleaseMessage message, InetSocketAddress recipient) { //ignore me } }, true, new FleaseViewChangeListenerInterface() { @Override public void viewIdChangeEvent(ASCIIString cellId, int viewId) { } },new FleaseStatusListener() { @Override public void statusChanged(ASCIIString cellId, Flease lease) { // System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder()); synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } } @Override public void leaseFailed(ASCIIString cellId, FleaseException error) { MasterEpochTest.fail(error.toString()); } }, meHandler); fs.startAndWait(); result.set(null); fs.openCell(CELL_ID, new ArrayList(), true); synchronized(result) { if (result.get() == null) result.wait(1000); if (result.get() == null) fail("timeout!"); } assertEquals(result.get().getLeaseHolder(),cfg.getIdentity()); assertEquals(result.get().getMasterEpochNumber(),2); fs.stopAndWait(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TimerType createTimerType();", "public void createTimer() {\n timer = new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (animal.changeScore()) {\n setNumber(animal.getPoints());\n }\n if (animal.getStop()) {\n System.out.println(\"Game Ended\");\n background.stopMusic();\n stop();\n background.stop();\n\n ArrayList list = null;\n try {\n list = scoreFile.sortFile(animal.getPoints());\n } catch (IOException e) {\n e.printStackTrace();\n }\n popUp(list);\n }\n }\n };\n }", "public abstract void startInitTimer();", "SwTimerResource createSwTimerResource();", "Timer getTimer();", "public void startTimer() {\n // TODO = handle more aspects of the behaviour required by the specification\n System.out.println(\"starting timer\");\n initialHeroCastle();\n isPaused = false;\n // trigger adding code to process main game logic to queue. JavaFX will target\n // framerate of 0.3 seconds\n timeline = new Timeline(new KeyFrame(Duration.seconds(0.1), event -> {\n if (world.getMode() == -1){\n modeSelectionSwitchToMainMenu();\n }\n world.runTickMoves();\n world.runBattles();\n world.updateGoal();\n if (world.goalAchieved()) {\n world.gameOver();\n deadSwitchToMainMenu(true);\n return;\n }\n List<Soldier> soldiers = world.possiblySpawnSoldiers();\n for (Soldier s : soldiers) {\n loadSoldier(s);\n }\n List<BasicEnemy> deadEnemies = world.cleanEnemies();\n for (BasicEnemy e : deadEnemies) {\n reactToEnemyDefeat(e);\n }\n List<BasicEnemy> newEnemies = world.possiblySpawnEnemies();\n for (BasicEnemy newEnemy : newEnemies) {\n loadEnemies(newEnemy);\n }\n printThreadingNotes(\"HANDLED TIMER\");\n loopNumber.setText(\"Loop: \" + (int) world.getCurrentLoop().get());\n if (world.isCharacterDead()) {\n if (!world.useOneRing())\n deadSwitchToMainMenu(false);\n return;\n }\n if (world.isAtHeroCastle() && world.shouldShopAppear()) {\n System.out.println(\"At Hero Castle. Shopping!\");\n shopSwitchToMainMenu();\n }\n }));\n timeline.setCycleCount(Animation.INDEFINITE);\n timeline.play();\n }", "public AnimationTimer createTimer() {\n return new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (!levelController.getLevelControllerMethods().getGamePaused()) {\n levelController.getBubbles().forEach(Monster.this::checkCollision);\n move();\n }\n\n setChanged();\n notifyObservers();\n }\n };\n\n }", "TimerSchedule createTimerSchedule();", "public Timer() {}", "private void initializeTimer(){\n logger.trace(\"Sensor/\" + getModel().getId() + \" initialising timer\");\n //create timer\n newTimer = new Timer(true);\n }", "public static void initTimer(){\r\n\t\ttimer = new Timer();\r\n\t timer.scheduleAtFixedRate(new TimerTask() {\r\n\t public void run() {\r\n\t \t//se o player coletar todas os lixos, o tempo para\r\n\t \tif(ScorePanel.getScore() == 100){\r\n\t \t\ttimer.cancel();\r\n\t \t}\r\n\t \t//se o Tempo se esgotar, é game over!!!\r\n\t \telse if (tempo == 0){\r\n\t \t timer.cancel();\r\n \t\tAvatar.noMotion();\r\n \t\t//System.exit(0);\r\n\t }\r\n\t \t//Senão, vai contando\r\n\t \telse{\r\n\t \tlbltimer.setText(\"Tempo: \"+ --tempo);\r\n\t }\r\n\t }\r\n\t\t}, 1000, 1000);\r\n\t}", "private static void timerTest1() {\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\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\tSystem.out.println(\"timertest1\");\n\t\t\t\ttimer.cancel();\n\n\t\t\t}\n\t\t}, 2000);\n\n\t}", "private void startNewTimer(){\n timer.cancel();\n timer = null;\n timesUp();\n timer = new MainGameTimer(this);\n timer.startNewRoundCountDown();\n }", "public void makeTimer(){\n\t\n\t\tframeIndex = 0;\n\t\n\t\t//Create a new interpolator\n\t\tInterpolator lint = new Interpolator();\n\t\n\t\t//interpolate between all of the key frames in the list to fill the array\n\t\tframes = lint.makeFrames(keyFrameList);\n\t\n\t\t//timer delay is set in milliseconds, so 1000/fps gives delay per frame\n\t\tint delay = 1000/fps; \n\t\n\t\n\t\tActionListener taskPerformer = new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tif(frameIndex == frames.length){ frameIndex = 0;}\n\n\t\t\t\tframes[frameIndex].display();\n\t\t\t\tframes[frameIndex].clearDisplay();\n\t\t\t\tframeIndex++;\n\t\t\t}\n\t\t};\n\n\t\ttimer = new Timer(delay, taskPerformer);\t\n\t}", "TimerStatus onTimer();", "public void setTimer() {\n\t\t\n\t}", "@Override\n public TimerEvent createActivity(TBoundaryEvent src, Hashtable keyedContext){\n\n return new TimerEvent();\n\n }", "public void testFindEmployeeOrdersWithTimer() {\n\t\tSystem.out.println(\"started test testFindEmployeeOrdersWithTimer\");\n\t\tlong start = System.currentTimeMillis();\n\t\tFlux<Order> empFoundOrders = employeeController.findEmployeeOrders(employee.getAge()).take(10);\n\t\t\n\t\tStepVerifier.withVirtualTime(() -> empFoundOrders)\n\t\t\t\t\t.expectSubscription()\n\t\t\t\t\t.thenAwait(Duration.ofHours(10))\n\t\t\t\t\t.expectNextCount(10)\n\t\t\t\t\t.verifyComplete();\n\t\tlong end = System.currentTimeMillis();\n\t\tdouble totatSeconds = (end-start)/1000;\n\t\tSystem.out.println(\"completed test testFindEmployeeOrdersWithTimer in time \"+totatSeconds);\n\t}", "public Timer()\n {\n // initialise instance variables\n startTime = 0;\n bonusTime = 0;\n }", "private void createWaveTimer()\n\t{\n\t\twaveTimer = new WaveTimer(\n\t\t\t\titemManager.getImage(INFERNAL_CAPE),\n\t\t\t\tthis,\n\t\t\t\tInstant.now().minus(Duration.ofSeconds(6)),\n\t\t\t\tnull\n\t\t);\n\t\tif (config.waveTimer())\n\t\t{\n\t\t\tinfoBoxManager.addInfoBox(waveTimer);\n\t\t}\n\t}", "Timer(int tempTotalTime) {\n totalTime = tempTotalTime;\n }", "private static void timerTest3() {\n\t\tTimer timer = new Timer();\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\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\tSystem.out.println(\"timertest3\");\n\n\t\t\t}\n\t\t}, 2000, 1000);\n\n\t}", "public void onTimerEvent();", "private static void timerTest2() {\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\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\tif (count < 5) {\n\t\t\t\t\tSystem.out.println(\"timertest2\" + \" \" + ++count);\n\t\t\t\t} else {\n\t\t\t\t\ttimer.cancel();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}, 2000, 1000);\n\n\t}", "private UimaTimer getTimer() throws Exception {\n String uimaTimerClass = cpeFactory.getCPEConfig().getCpeTimer().get();\n if (uimaTimerClass != null) {\n new TimerFactory(uimaTimerClass);\n return TimerFactory.getTimer();\n }\n // If not timer defined return default timer based on System.currentTimeMillis()\n return new JavaTimer();\n }", "private static void timerTest4() {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 14);\n\t\tcalendar.set(Calendar.MINUTE, 20);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tDate time = calendar.getTime();\n\n\t\tTimer timer = new Timer();\n\t\tSystem.out.println(\"wait ....\");\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\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\tSystem.out.println(\"timertest4\");\n\n\t\t\t}\n\t\t}, time, 24 * 60 * 60 * 1000);\n\n\t}", "public void createTimer()\n {\n if (timer != null )\n return;\n \n logger.trace(\"Creating rss timer and task.\");\n RssTimerRefreshFeed refresh = new RssTimerRefreshFeed(this);\n this.timer = new Timer();\n this.timer.scheduleAtFixedRate(refresh, 100, PERIOD_REFRESH_RSS);\n \n logger.trace(\"Done.\");\n }", "public void pickUpTimer()\r\n\t{\t\t\r\n\t\tSystem.out.println(timer.get());\r\n\t\tif(timer.get() < Config.Auto.timeIntakeOpen)\r\n\t\t{\r\n\t\t\t//claw.openClaw();\r\n\t\t\tSystem.out.println(\"in second if\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeElevatorStack)\r\n\t\t{\r\n\t\t\t//elevator.setLevel(elevatorLevel);\r\n\t\t\t//elevatorLevel++;\r\n\t\t}\r\n\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeIntakeClose)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"in first if\");\r\n\t\t\t//claw.closeClaw();\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tendRoutine();\r\n\t}", "public void startMiniTimer() {\n long millisInFuture = 10000;\r\n long countDownInterval = 1000;\r\n phaseTwoTimer = new CountDownTimer(millisInFuture, countDownInterval) {\r\n public void onTick(long millisUntilFinished) {\r\n long millis = millisUntilFinished;\r\n\r\n // notifications for time\r\n if (millis <= 10000 && millis > 9001) {\r\n Toast.makeText(getActivity(), \"10\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 9000 && millis >= 8001) {\r\n Toast.makeText(getActivity(), \"9\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 8000 && millis >= 7001) {\r\n Toast.makeText(getActivity(), \"8\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 7000 && millis >= 6001) {\r\n Toast.makeText(getActivity(), \"7\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 6000 && millis >= 5001) {\r\n Toast.makeText(getActivity(), \"6\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 5000 && millis >= 4001) {\r\n Toast.makeText(getActivity(), \"5\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 4000 && millis >= 3001) {\r\n Toast.makeText(getActivity(), \"4\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 3000 && millis >= 2001) {\r\n Toast.makeText(getActivity(), \"3\", Toast.LENGTH_LONG).show();\r\n } else if (millis <= 2000 && millis >= 1001) {\r\n Toast.makeText(getActivity(), \"2\", Toast.LENGTH_LONG).show();\r\n } else {\r\n Toast.makeText(getActivity(), \"1\", Toast.LENGTH_LONG).show();\r\n }\r\n }\r\n\r\n public void onFinish() {\r\n Toast.makeText(getActivity(), \"PHASE 2\", Toast.LENGTH_LONG).show(); // entering phase 2\r\n phase = 2;\r\n initTimer(rootView);\r\n drawNewBoards();\r\n }\r\n }.start();\r\n }", "void startGameTimer()\n {\n Timer.destroyTimer(\"starting_game_timer\");\n Timer timer = Timer.createTimer(\"starting_game_timer\", startTimerSeconds);\n timer.addTimerListener(this);\n timer.start();\n }", "private void setTimer() {\r\n timer = new Timer(TIMER_DELAY, new ActionListener() {\r\n public void actionPerformed(ActionEvent ae) {\r\n action();\r\n }\r\n });\r\n }", "private void initTimer(){\r\n\t\ttimer = new Timer() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tdisplayNext();\r\n\t\t\t}\r\n\t\t};\r\n\t}", "private void startTimer() {\n Timer.addTimeout(endTime, this);\n }", "public TimerCheck() {\n super(\"timer_check\");\n PlayerMovementListener.EVENT.register(this);\n }", "void startUpdateTimer();", "public Timer()\r\n\t{\r\n\t\tcurrentstate = TIMER_STOP;\r\n\t}", "public void startTimer(){\n logger.trace(\"Sensor/\" + getModel().getId() + \" timer started\");\n if(newTimer != null){\n //newTimer = new Timer();\n if(timerTask != null) timerTask.cancel();\n newTimer.purge();\n timerTask = new TimerTask() {\n @Override\n public void run() {\n timerEngine();\n }\n };\n newTimer.schedule(timerTask,(getModel().getRefreshTime()*1000),(getModel().getRefreshTime()*1000)/2);\n }\n }", "@Test\n public void testAdd(){\n \tCountDownTimer s1 = new CountDownTimer(1, 0, 0);\n \ts1.add(1800);\n \tassertEquals(s1.toString(), \"1:30:00\");\n \t\n \tCountDownTimer s2 = new CountDownTimer(0, 30, 0);\n \ts1.add(s2);\n \tassertEquals(s1.toString(), \"2:00:00\");\n }", "private void trackerTimer() {\n\n Thread timer;\n timer = new Thread() {\n\n @Override\n public void run() {\n while (true) {\n\n if (Var.timerStart) {\n try {\n Var.sec++;\n if (Var.sec == 59) {\n Var.sec = 0;\n Var.minutes++;\n }\n if (Var.minutes == 59) {\n Var.minutes = 0;\n Var.hours++;\n }\n Thread.sleep(1000);\n } catch (Exception cool) {\n System.out.println(cool.getMessage());\n }\n\n }\n timerText.setText(Var.hours + \":\" + Var.minutes + \":\" + Var.sec);\n }\n\n }\n };\n\n timer.start();\n }", "public void testTime()\n {\n SudokuTimer test = new SudokuTimer();\n\n mTimer.start();\n test.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertTrue(mTimer.toString().equals(test.toString()));\n\n mTimer.stop();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertFalse(mTimer.toString().equals(test.toString()));\n\n test.stop();\n mTimer.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n mTimer.stop();\n\n //checks to the nearest second\n assertEquals(mTimer.getElapsedTime() / 1000,\n test.getElapsedTime() / 1000);\n }", "public static void startTimerLabel()\n {\n {\n if (timeline != null) {\n timeline.stop();\n }\n timeSeconds.set(STARTTIME);\n //timeLabel.setText(timeSeconds.toString());\n timeline = new Timeline();\n //timeline.setCycleCount(timeline.INDEFINITE); // need this?\n\n timeline.getKeyFrames().add(\n new KeyFrame(Duration.seconds(STARTTIME+1),\n new EventHandler<ActionEvent>() {\n public void handle(ActionEvent event) {\n //System.out.println(\"Got Timer timeout.\");\n if (cancel == false) {\n SceneResultsTimed.updatePlayerScore();\n localStage.setScene(SceneMgr.getScene(SceneMgr.IDX_RESULTSTIMED));\n }\n }\n },\n new KeyValue(timeSeconds, 0)));\n timeline.playFromStart();\n }\n }", "public Timer() {\n\t\tthis.start = 0L;\n\t\tthis.end = 0L;\n\t}", "private void timerAction(){\n \n timerEnd();\n \n if (timerCounter == TEST_TARGET_APPERANCE + testTargetDelay){\n manageTestTarget();\n }\n \n if (timerCounter == TEST_TARGET_DISAPPERANCE + testTargetDelay){\n labelArray[TEST_TARGET_LOCATION].setIcon(iconSet.getGrayIcon());\n //System.out.println(\"Test End\");\n }\n //creates clickable red target in random, non occupied location\n //and handles removal of unclicked, expired targets\n int randRedTarget = generator.nextInt(100);\n while(labelArray[randRedTarget].getIcon()!=iconSet.getGrayIcon()){\n //System.out.println(\"Already a target in place\");\n randRedTarget = generator.nextInt(100);\n }\n labelArray[randRedTarget].setIcon(iconSet.getRedTargetIcon());\n \n if (timerCounter<ACTIVE_RED_TARGET_TOTAL){\n activeRedTarget[timerCounter] = randRedTarget;\n }\n \n if (timerCounter>=ACTIVE_RED_TARGET_TOTAL){\n if(labelArray[activeRedTarget[0]].getIcon()!=iconSet.getGrayIcon()){\n labelArray[activeRedTarget[0]].setIcon(iconSet.getGrayIcon());\n }\n for(int i = 0; i < activeRedTarget.length-1; i++){\n activeRedTarget[i] = activeRedTarget[i+1];\n }\n activeRedTarget[ACTIVE_RED_TARGET_TOTAL-1] = randRedTarget;\n }\n\n if (timerCounter%4==0){\n manageBlueTargets();\n }\n \n timerCounter++;\n \n if (timerCounter%4==0){\n manageGreenTargets();\n }\n \n System.out.println(\"Timer: \" + timerCounter); \n }", "private void setNewTimer() {\n if (!isSetNewTimerThreadEnabled) {\n return;\n }\n\n timer = new Timer();\n timer.scheduleAtFixedRate(new TimerTask() {\n\n @Override\n public void run() {\n // Send the message to the handler to update the UI of the GameView\n GameActivity.this.handler.sendEmptyMessage(UPDATE);\n\n // For garbage collection\n System.gc();\n }\n\n }, 0, 17);\n }", "public static void startTimer() {\n elapsedTime = 0;\r\n timerIsWorking = true;\r\n startTime = System.nanoTime() / 1000000; // ms\r\n }", "protected abstract T create(final double idealStartTime);", "private void startTimer(){\n scoreboard.disableStart(true);\n timer.scheduleAtFixedRate(new TimerTask(){\n @Override\n public void run(){\n Platform.runLater(new Runnable(){\n @Override\n public void run() {\n scoreboard.updateTime();\n }\n });\n }\n },0,1000);\n }", "public abstract void startLoadTimer();", "public void setupTimer() {\r\n\t\tmarcus.email.util.time.Timer actualTime = new marcus.email.util.time.Timer();\r\n\t\tactualTime.start();\r\n\t\tActionListener l = new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tlblTimeDate.setText(actualTime.getCurrentTime());\r\n\t\t\t}\r\n\t\t};\r\n\t\t//This is the Swing timer class that updates the actual timer\r\n\t\tTimer t = new Timer(100, l);\r\n\t\tt.start();\r\n\t}", "public void timer()\n{\n textSize(13);\n controlP5.getController(\"time\").setValue(runtimes);\n line(400, 748, 1192, 748);\n fill(255,0,0);\n for (int i =0; i<25; i++)\n {\n line(400+i*33, 743, 400+i*33, 753);\n text(i, 395 +i*33, 768);\n }\n if ((runtimes < 1 || runtimes > 28800) && s == true)\n {\n //origint = 0;\n runtimes = 1;\n //pausets = 0;\n runtimep = 0;\n } else if (runtimes > 0 && runtimes < 28800 && s == true)\n {\n runtimep = runtimes;\n runtimes = runtimes + speed;\n }\n timeh= runtimes/1200;\n timem= (runtimes%1200)/20;\n}", "public static void main(String[] args) \n { \n Timer timer = new Timer(); \n TimerTask task = new Helper(); \n\n timer.schedule(task, 3000, 5000); \n System.out.println(\"hi\");\n\n }", "public void StartTimer() {\n\t\tCount = new Timer();\n\t}", "private void startTimer() {\n\t\ttimer = new Timer();\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\n\t\t\tint currTime = 0;\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tjavafx.application.Platform.runLater(new Runnable () {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tcurrTime++;\n\t\t\t\t\t\ttimerLabel.setText(\"Time: \" + currTime);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}, 1000, 1000);\n\t}", "public Timer (String name, int duration, boolean starttimer, boolean loop)\n {\n Name = name;\n Timer = duration;\n TimerMax = duration;\n Loop = loop;\n isRunning = starttimer;\n \n }", "public void start() {timer.start();}", "RampDownTimer getRampDownTimer();", "public void timer()\n {\n if(exists == true)\n { \n if(counter < 500) \n { \n counter++; \n } \n else \n { \n Greenfoot.setWorld(new Test()); \n exists = false; \n } \n } \n }", "private void setEndTimer() {\n vertx.setTimer(10, id -> testComplete());\n }", "private void startTimer(){\n timer= new Timer();\r\n task = new TimerTask() {\r\n @Override\r\n public void run() {\r\n waitDuration++;\r\n\r\n timerLabel.setText(Integer.toString(waitDuration));\r\n }\r\n };\r\n timer.scheduleAtFixedRate(task,1000,1000);\r\n }", "@Test\n\tpublic void testStageProceed() {\n\t\t\n\t\tSystem.out.println(\"\\nTest case : Next stage\");\n\t\t\n\t\tStageScene test = new StageScene() ;\n\t\t\n\t\tassertEquals(0 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 1's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal1 = new Goal(10,105) ;\n\t\t\n\t\tAnimal animal = new Animal(\"file:Resources/Frog/frogUp1.png\") ;\n\t\tanimal.setX(10) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal1) ;\n\t\ttest.add(animal) ;\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\ttest.createStageTimer();\n\t\t\n\t\tassertEquals(1 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 1's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 1 is completed , proceed to stage 2\") ;\n\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 2's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal2 = new Goal(140,105) ;\n\t\t\n\t\tanimal.setX(140) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal2);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(2 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 2's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 2 is completed , proceed to stage 3\") ;\n\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 3's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal3 = new Goal(265,105) ;\n\t\t\n\t\tanimal.setX(265) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal3);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(3 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 3's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 3 is completed , proceed to stage 4\") ;\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 4's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal4 = new Goal(393,105) ;\n\t\t\n\t\tanimal.setX(393) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal4);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(4 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 4's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 4 is completed , proceed to stage 5\") ;\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 5's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal5 = new Goal(520,105) ;\n\t\t\n\t\tanimal.setX(520) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal5);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(5 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 5's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 5 is completed , end game\") ;\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorBadSecondsOne() {\n CountDownTimer s = new CountDownTimer(5, 5, 300);\n\n }", "public void startTimer() {\n timer = new Timer();\n //initialize the TimerTask's job\n initializeTimerTask();\n //schedule the timer, to wake up every 1 second\n timer.schedule(timerTask, 1000, 1000); //\n }", "@Test\n public void testTotalSeconds(){\n \tCountDownTimer s = new CountDownTimer(2, 45, 15);\n \tassertEquals(CountDownTimer.totalSeconds(s), 9915);\n \t\n \ts = new CountDownTimer();\n \tassertEquals(CountDownTimer.totalSeconds(s), 0);\n \t\n \ts = new CountDownTimer(\"1:00:30\");\n \tassertEquals(CountDownTimer.totalSeconds(s), 3630);\n }", "protected abstract ACATimer receive(Port p_, Object evt_, double duration_);", "private void startTime()\n {\n timer.start();\n }", "protected\n TimedRsp\n ( \n TaskTimer timer\n )\n { \n if(timer == null) \n throw new IllegalArgumentException(\"The timer cannot (null)!\");\n pTimer = new TaskTimer(timer);\n }", "Pane ContainerElapsedTime() {\r\n HBox pane = new HBox();\r\n\r\n HBox timerDigits = new HBox();\r\n VBox timerPane = new VBox(3);\r\n TimerBtn start = new TimerBtn(\"START\", 65, 40);\r\n TimerBtn stop = new TimerBtn(\"STOP\", 65, 40);\r\n TimerBtn reset = new TimerBtn(\"RESET\", 65, 40);\r\n\r\n elapsedTimer = new Label(\"00:00:00\");\r\n\r\n timeline = new Timeline(new KeyFrame(Duration.seconds(1), (ActionEvent event) -> {\r\n change(elapsedTimer);\r\n }));\r\n timeline.setCycleCount(Timeline.INDEFINITE);\r\n timeline.setAutoReverse(false);\r\n\r\n /*Start timer method when clicked the timer will start*/\r\n start.setOnAction(e -> {\r\n timeline.play();\r\n });\r\n\r\n /*Stop timer method when clicked the timer will pause*/\r\n stop.setOnAction(e -> {\r\n timeline.pause();\r\n });\r\n\r\n /*Reset timer method when clicked the timer will Reset timer to 0 */\r\n reset.setOnAction(e -> {\r\n hours = 0;\r\n mins = 0;\r\n seconds = 0;\r\n timeline.pause();\r\n elapsedTimer.setText(\"00:00:00\");\r\n });\r\n\r\n elapsedTimer.setPadding(new Insets(50, 25, 50, 25));\r\n timerDigits.setSpacing(50);\r\n elapsedTimer.setTextFill(Color.RED);\r\n elapsedTimer.setStyle(\"-fx-font: 90 arial;\");\r\n timerDigits.getChildren().addAll(elapsedTimer);\r\n\r\n pane.getChildren().add(timerDigits);\r\n\r\n timerPane.setSpacing(5);\r\n timerPane.setPadding(new Insets(20, 10, 20, 10));\r\n timerPane.setAlignment(Pos.CENTER);\r\n timerPane.getChildren().addAll(start, stop, reset);\r\n pane.getChildren().add(timerPane);\r\n return pane;\r\n\r\n }", "public GameTimer()\n \t{\n \t\tsuper();\n \t\tt = new Task();\n \t\tscheduleAtFixedRate( t, 0, 1000 );\n \t\tstartTime = System.currentTimeMillis();\n \t}", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeMinutesOne(){\n \tCountDownTimer s = new CountDownTimer(5, -5, 5);\n }", "public void initializeInstance() {\n instanceLife = new Timer();\n }", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeSecondsOne(){\n \tCountDownTimer s = new CountDownTimer(5, 5, -10);\n }", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeHoursOne(){\n \tCountDownTimer s = new CountDownTimer(-5, 5, 20);\n }", "public void setTimer(int timer) {\n this.timer = timer;\n }", "public void startTimer(){\n timerStarted = System.currentTimeMillis();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n timer = new Timer();\n timer.schedule(timerTask, 0, 60000);\n }", "@Test\n\tpublic void testObjectConstructor(){\n\t\tCountDownTimer s1 = new CountDownTimer(1, 30, 0);\n\t\tCountDownTimer s2 = new CountDownTimer(s1);\n\t\tassertEquals(s2.toString(), \"1:30:00\");\n\t}", "public void setUp()\n {\n mTimer = new SudokuTimer();\n }", "public void startTimer() {\n timer = new Timer();\n\n //initialize the TimerTask's job\n initializeTimerTask();\n\n //schedule the timer, to wake up every 1 second\n timer.schedule(timerTask, 10000, 10000);\n }", "private void setupAnimationTimer() {\n new AnimationTimer() {\n @Override\n public void handle(long l) {\n view.movePlayer();\n view.updateView();\n }\n }.start();\n\n // Timeline for UI stuff\n uiTimeline = new Timeline();\n\n KeyFrame keyStart = new KeyFrame(\n Duration.seconds(0),\n e -> view.updateUI((1160 / distance) * 0.005)\n );\n KeyFrame keyEnd = new KeyFrame(Duration.millis(5));\n\n uiTimeline.getKeyFrames().addAll(keyStart, keyEnd);\n uiTimeline.setCycleCount(Timeline.INDEFINITE);\n uiTimeline.setAutoReverse(false);\n\n countdownTimer = new Timeline(\n new KeyFrame(\n Duration.seconds(distance - (1160 / distance) * 0.005),\n e -> journeyComplete()\n )\n );\n\n // Timeline for asteroids\n Timeline asteroidTimer = new Timeline(\n new KeyFrame(Duration.millis(2000), e -> model.AsteroidPool.spawn())\n );\n asteroidTimer.setCycleCount(Timeline.INDEFINITE);\n asteroidTimer.play();\n }", "private AppTimer() {\n\t\tstart();\n\t}", "public Timer getTimer() {\n\t//if (heartbeat_==null) heartbeat_ = new Timer(100, 1000); // on demand: don't slow down startup\n\tif (timer_==null) timer_ = new java.util.Timer();\n\treturn timer_;\n }", "private void timerstart() {\n timer = new Timer(timer1, new ActionListener(){ \n \tpublic void actionPerformed(ActionEvent ae){\n \t\tcheckMatch();\n \t}});\n timer.start();\n timer.setRepeats(false);\n }", "public static void startTimeout() {\n t = new Timer();\n tt = new TimerTask() {\n\n public void run() {\n while (true) {\n if (diff[0] > 0 || diff[1] > 0) {\n try {\n runFocusPoint();\n Thread.sleep(50);\n } catch (InterruptedException ex) {\n //ex.printStackTrace();\n }\n } else {\n break;\n }\n }\n cancelTask();\n diff[0] = 0;\n diff[1] = 0;\n }\n };\n t.scheduleAtFixedRate(tt, 0, 50);\n }", "protected abstract void timed() throws Throwable;", "private void startNewTimer(Block block, int damage, TimerState state) {\n if (state == TimerState.RUN) {\n removeBlock(block);\n }\n\n addBlock(block, damage, MaterialManager.getInstance().getDurabilityResetTime(block.getType().name()));\n }", "@Override\n\tpublic void alter(LTimerContext timer) {\n\n\t}", "@Override\r\n\tpublic void alter(LTimerContext arg0) {\n\t\t\r\n\t}", "public Timer getOverallTimer();", "protected void processTimer(){\n if(timer != null){\n timer.cancel();\n timer = null;\n }\n // Verificamos si el partido esta en progreso\n if(match.status == Match.STATUS_PENDING || match.status == Match.STATUS_ENDED){\n return;\n }\n // Creamos temporizador 90 * 60 * 1000 = 5.400.000\n timer = new CountDownTimer(5400000, 1000) {\n @Override\n public void onTick(long l) {\n // Calcular los segundos que pasaron\n long seconds = (new Date().getTime() - matchDayLong) / 1000;\n // Calcular los minutos del partido\n long minutes = seconds / 60;\n //long minutes = TimeUnit.MILLISECONDS.toMinutes(uptime);\n if(minutes < 0){\n minutes = 0;\n seconds = 0;\n statusMedium.setText(\"PT\");\n }if(minutes > 45 && minutes < 60){\n minutes = 45;\n seconds = 60;\n }else if(minutes > 90){\n minutes = 90;\n seconds = 60;\n statusMedium.setText(\"ST\");\n }else if(minutes >= 60){\n minutes -= 15;\n statusMedium.setText(\"ST\");\n }else{\n statusMedium.setText(\"PT\");\n }\n\n statusTime.setText(String.format(\"%02d:%02d\", minutes, (seconds%60)));\n }\n\n @Override\n public void onFinish() {\n\n }\n }.start();\n }", "@Test\n\tpublic void testIntConstructors(){\n CountDownTimer s = new CountDownTimer(5, 10, 30);\n assertEquals(s.toString(), \"5:10:30\");\n \n\t\ts = new CountDownTimer(10, 30);\n\t\tassertEquals(s.toString(), \"0:10:30\");\n\t\t\n\t\ts = new CountDownTimer(30);\n\t\tassertEquals(s.toString(), \"0:00:30\");\n\t}", "@Override\r\n\tprotected void initEvent() {\n\t\ttimer = new Timer(1000, new ActionListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttimer_tick(e);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}", "@DISPID(31)\r\n\t// = 0x1f. The runtime will prefer the VTID if present\r\n\t@VTID(36)\r\n\tasci.activebatch.enumJobTimerTriggerType timerTrigger();", "private void getOneToteTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "public TimerDisplay()\n {\n timeElapsed = 0;\n }", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testConstructor3LargeMinute() {\n\t\tnew CountDownTimer(12, 60, 14);\n\t}", "private Timer() {\n myThread = new TimerThread();\n myThread.start();\n }", "public GameThread(Timer timer)\n\t{\n\t\tthis.timer = timer;\n\t}", "@Test\n public void testStart() throws InterruptedException {\n Thread thread = new Thread(new Runnable() {\n\n @Override\n public void run() {\n new JFXPanel(); // Initializes the JavaFx Platform\n Platform.runLater(new Runnable() {\n\n @Override\n public void run() {\n try {\n new GOL_Main().start(new Stage()); // Create and\n // initialize app\n } catch (Exception ex) {\n Logger.getLogger(GOL_MainTest.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }\n });\n }\n });\n thread.start();// Initialize the thread\n Thread.sleep(10);\n System.out.println(\"start\");\n Stage stage = null;\n GOL_Main instance = new GOL_Main(); \n }", "protected abstract ACATimer receiveAt(Port p_, Object evt_, double time_);", "private String doTimers(int i, String[] args)\r\n {\n return null;\r\n }", "public void initializeTimerTask() {\n timerTask = new TimerTask() {\n public void run() {\n Log.i(\"in timer\", \"in timer ++++ \"+ (counter++));\n cek_tugas();\n uploadphoto();\n cekNotifSampai();\n cekJanjiSurvey();\n }\n };\n }" ]
[ "0.676967", "0.652761", "0.64619136", "0.6402427", "0.6397494", "0.63570243", "0.62658966", "0.6170769", "0.6147857", "0.60143554", "0.601388", "0.5958826", "0.5907815", "0.58907473", "0.58774704", "0.5864428", "0.586428", "0.58439445", "0.5836248", "0.58338976", "0.5829928", "0.58223015", "0.5810913", "0.58102494", "0.5809981", "0.5793839", "0.5768503", "0.57651776", "0.5758139", "0.5739746", "0.5724898", "0.57111955", "0.5702066", "0.5690292", "0.56845677", "0.56637114", "0.5644109", "0.5641225", "0.56336236", "0.56311625", "0.5582849", "0.5582448", "0.5563983", "0.55639356", "0.5562864", "0.55380356", "0.55369854", "0.55339515", "0.553077", "0.5527319", "0.55223227", "0.5518889", "0.5518104", "0.5509902", "0.5506313", "0.54995215", "0.5497601", "0.54967034", "0.5495262", "0.5494005", "0.54741865", "0.54517466", "0.5441061", "0.54294646", "0.5412485", "0.53996134", "0.53985083", "0.5384646", "0.5377532", "0.534387", "0.5343146", "0.5335318", "0.5324758", "0.53186876", "0.5317812", "0.5309062", "0.5307205", "0.5300639", "0.52985245", "0.52885586", "0.52867544", "0.5275394", "0.52602243", "0.5255863", "0.5253908", "0.5249595", "0.5244145", "0.52438545", "0.52436256", "0.5233542", "0.52294815", "0.5229389", "0.52281433", "0.5223378", "0.52215767", "0.5215793", "0.52111477", "0.5201402", "0.52008045", "0.52003044", "0.5195769" ]
0.0
-1
System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder());
@Override public void statusChanged(ASCIIString cellId, Flease lease) { synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getStateChange();", "public void testOpenAndGetLease() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, new MasterEpochHandlerInterface() {\n\n long masterEpochNum = 0;\n\n @Override\n public void sendMasterEpoch(FleaseMessage response, Continuation callback) {\n // System.out.println(\"sending: \"+masterEpochNum);\n response.setMasterEpochNumber(masterEpochNum);\n callback.processingFinished();\n }\n\n @Override\n public void storeMasterEpoch(FleaseMessage request, Continuation callback) {\n masterEpochNum = request.getMasterEpochNumber();\n // System.out.println(\"storing: \"+masterEpochNum);\n callback.processingFinished();\n }\n });\n\n FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART);\n msg.setCellId(CELL_ID);\n\n fs.startAndWait();\n\n fs.openCell(CELL_ID, new ArrayList(),true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),1);\n\n FleaseFuture f = fs.closeCell(CELL_ID, false);\n f.get();\n\n Thread.sleep(12000);\n\n result.set(null);\n\n fs.openCell(CELL_ID, new ArrayList(), true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),2);\n\n fs.stopAndWait();\n }", "@Test\n public void testUpdateCheckpointLeaseUpdated() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n leaseRefresher.renewLease(coordinator.getCurrentlyHeldLease(leaseKey));\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n lease.leaseCounter(lease.leaseCounter() + 1);\n // Counter and owner changed, but checkpoint did not.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "public I getChangeInfo(int startSeqNum);", "@Test\n public void testUpdateCheckpoint() throws Exception {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n // Run the taker and renewer in-between getting the Lease object and calling checkpoint\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n if (lease == null) {\n List<Lease> leases = leaseRefresher.listLeases();\n for (Lease kinesisClientLease : leases) {\n System.out.println(kinesisClientLease);\n }\n }\n\n assertNotNull(lease);\n final ExtendedSequenceNumber initialCheckpoint = new ExtendedSequenceNumber(\"initialCheckpoint\");\n final ExtendedSequenceNumber pendingCheckpoint = new ExtendedSequenceNumber(\"pendingCheckpoint\");\n final ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n final byte[] checkpointState = \"checkpointState\".getBytes();\n\n // lease's leaseCounter is wrong at this point, but it shouldn't matter.\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), initialCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtInitialCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, leaseFromDDBAtInitialCheckpoint);\n\n dynamoDBCheckpointer.prepareCheckpoint(lease.leaseKey(), pendingCheckpoint, lease.concurrencyToken().toString(), checkpointState);\n\n final Lease leaseFromDDBAtPendingCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.pendingCheckpoint(pendingCheckpoint);\n lease.pendingCheckpointState(checkpointState);\n assertEquals(lease, leaseFromDDBAtPendingCheckpoint);\n\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtNewCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(newCheckpoint);\n lease.pendingCheckpoint(null);\n lease.pendingCheckpointState(null);\n assertEquals(lease, leaseFromDDBAtNewCheckpoint);\n }", "@Override\n\tpublic void update() {\n\t\tSystem.out.println(\"Observer Pattern on Room Reservation Notification: \");\n\t\tSystem.out.println(\"Your room is \" + reserve.getState()+\"\\n\");\n\t}", "public long getStateChange() {\n return stateChange_;\n }", "@Override\n\tpublic void checkWayBillChange(String id) {\n\t\t\n\t}", "public long getStateChange() {\n return stateChange_;\n }", "public void changedUpdate(DocumentEvent evt, FoldHierarchyTransaction transaction) {\n }", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "public boolean isAlive ()\n {\n return cellStatus;\n }", "int getLeaseId() {\n return leaseId;\n }", "public void onCellEdit(CellEditEvent event) {\n Object oldValue = event.getOldValue();\n Object newValue = event.getNewValue();\n Object o = event.getSource();\n System.out.println(\"event called: \" + newValue + \" \" + oldValue);\n System.out.println(o.toString());\n DataTable table = (DataTable) event.getComponent();\n Long id = (Long) table.getRowKey();\n System.out.println(\"#### row key is : \" + id + \" ####\");\n if (newValue != null && !newValue.equals(oldValue)) {\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cell Changed\", \"Old: \" + oldValue + \", New:\" + newValue);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n for (Gnome gnome : user.getCart()) {\n if ((gnome.getId() != null) && (gnome.getId().compareTo(id) == 0)) {\n System.out.println(\"cart size on cell edit \" + user.getCart().size());\n gnome.setShopQuantity((Integer) newValue);\n userFacade.updateCart(user, gnome);\n }\n }\n }\n }", "public synchronized void switchCell()\n {\n cellValue = (cellValue == ALIVE) ? DEAD : ALIVE;\n }", "@Override\n protected void handleCellContentChange(int row,\n int column,\n Object oldValue,\n Object newValue)\n {\n // Store the log note with the log data and write it to the log\n // notes file\n perfLog.getPerfLogData().get(row).setNotes(newValue.toString());\n perfLog.writeLogNotes(row);\n }", "public void update() \n {\n System.out.print( \" \" + Integer.toHexString( subj.getState() ) ); \n}", "public void setCellState(int newState) {\n this.myState = newState;\n }", "public DBState() {\n\t\t\tthis.expandedElements=treeViewer.getExpandedElements();\n\t\t\tthis.treeSelection=treeViewer.getSelection();\n\t\t\tthis.tableSelection=txTableViewer.getSelection();\n\t\t}", "@Override\n\t\t\tpublic void editingStopped(ChangeEvent arg0) {\n\n\t\t\t\tSystem.out.println(tree.getCellEditor().getCellEditorValue());\n\t\t\t\ttree.getModel().valueForPathChanged(tree.getSelectionPath(),\n\t\t\t\t\t\ttree.getCellEditor().getCellEditorValue() + \"zzz\");\n\t\t\t\ttree.updateUI();\n\t\t\t}", "void oracle(){\n if (this.neighbors < 1){\n if (!isAlive()){\n observer.deleteCell(id);\n }\n }\n }", "void showchange() {\n\t\tif (printstatus != change)\n\t\t\tprintln(\">>>> \" + printoldline + \" CHANGED FROM <br/>\");\n\t\tprintstatus = change;\n\t\toutput+=oldinfo.symbol[printoldline].showSymbol();\n\t\toutput+=\"<br/>\";\n\t\tanyprinted = true;\n\t\tprintoldline++;\n\t}", "private CellBackup(CellRevision cellRevision, TechPool techPool, boolean modified) {\n this.cellRevision = cellRevision;\n this.techPool = techPool;\n this.modified = modified;\n cellBackupsCreated++;\n if (Job.getDebug())\n check();\n }", "private void verifyChanges() {\n System.out.println(\"Verify changes\"); \n }", "@Test\n public void testUpdateCheckpointBadConcurrencyToken() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, UUID.randomUUID()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n // Owner should be the only thing that changed.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "@Override\r\n\t\t\tpublic void update(final ViewerCell cell) {\n\t\t\t}", "@Override\r\n\t\t\tpublic void update(final ViewerCell cell) {\n\t\t\t}", "@Override\n public int getRowChange() {\n return rowChange;\n }", "void printstate()\n\t{\n\t\toperation.printstate();\n\t}", "public String toString() {\r\n\treturn \"batch image builder for:\\n\\tnew state: \"/*nonNLS*/ + getNewState();\r\n}", "synchronized boolean isLeaseHeld() {\n return leaseId > -1;\n }", "public Long getChangeNum() {\n return changeNum;\n }", "@Override\n public void stateChanged(ChangeEvent e) {\n model.generateGridWithSpecifiedProblemDifficulty(view.getSpinnerValue());\n view.updateGridPanel(model.getGrid(), model.getAgentLocation());\n }", "private void gridMain_CellLeave(Object sender, OpenDental.UI.ODGridClickEventArgs e) throws Exception {\n long codeNum = PIn.Long(ProcTable.Rows[e.getRow()][\"CodeNum\"].ToString());\n long feesched = FeeSchedC.getListShort()[listFeeSched.SelectedIndex].FeeSchedNum;\n Fee fee = Fees.getFee(codeNum,feesched);\n String strOld = \"\";\n if (fee != null)\n {\n strOld = fee.Amount.ToString(\"n\");\n }\n \n String strNew = gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text;\n if (StringSupport.equals(strOld, strNew))\n {\n return ;\n }\n \n if (!Security.isAuthorized(Permissions.Setup))\n {\n //includes dialog\n gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text = strOld;\n gridMain.Invalidate();\n return ;\n }\n \n double dNew = -1;\n if (!StringSupport.equals(strNew, \"\"))\n {\n try\n {\n dNew = PIn.Double(strNew);\n }\n catch (Exception __dummyCatchVar2)\n {\n gridMain.setSelected(new Point(e.getCol(), e.getRow()));\n MessageBox.Show(Lan.g(this,\"Please fix data entry error first.\"));\n return ;\n }\n\n gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text = dNew.ToString(\"n\");\n }\n \n //to standardize formatting. They probably didn't type .00\n //invalidate doesn't seem to be necessary here\n if (StringSupport.equals(strOld, \"\"))\n {\n //if no fee was originally entered and since it's no longer empty, then we need to insert a fee.\n //Somehow duplicate fees were being inserted so double check that this fee does not already exist.\n Fee tmpFee = Fees.getFee(codeNum,feesched);\n //Looks in cache.\n if (tmpFee != null)\n {\n return ;\n }\n \n //Fee exists. Must be unknown bug.\n fee = new Fee();\n fee.FeeSched = feesched;\n fee.CodeNum = codeNum;\n fee.Amount = dNew;\n Fees.insert(fee);\n Fees.getListt().Add(fee);\n }\n else\n {\n //if fee existed\n if (StringSupport.equals(strNew, \"\"))\n {\n //delete old fee\n Fees.delete(fee);\n Fees.getListt().Remove(fee);\n }\n else\n {\n //change fee\n fee.Amount = dNew;\n Fees.update(fee);\n Fees.getListt()[Fees.getListt().IndexOf(fee)].Amount = dNew;\n } \n } \n SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lan.g(this,\"Procedure\") + \": \" + ProcedureCodes.getStringProcCode(fee.CodeNum) + \", \" + Lan.g(this,\"Fee: \") + \"\" + fee.Amount.ToString(\"c\") + \", \" + Lan.g(this,\"Fee Schedule\") + \": \" + FeeScheds.getDescription(fee.FeeSched) + \". \" + Lan.g(this,\"Manual edit in grid from Procedure Codes list.\"), fee.CodeNum);\n }", "long getChangeset();", "@Override\n\tpublic void stateChanged(ChangeEvent arg0) {\n\t\t\n\t}", "public void testExistingSeqWithChangedSrcCuratorEdited() throws Exception\n {\n sqlMgr.executeUpdate(\"update prb_source set isCuratorEdited = 1 where _source_key = -40\");\n Integer C30 = this.cellLineLookup.lookup(\"C30\");\n String sql = \"select * from prb_source where _source_key \" +\n \"= -40 and _cellLine_key = \" + C30.toString();\n ResultsNavigator nav = sqlMgr.executeQuery(sql);\n assertTrue(!nav.next()); // assure no records found\n String accid = \"T00313\";\n MSRawAttributes raw = new MSRawAttributes();\n raw.setOrganism(\"mouse, laboratory\");\n raw.setCellLine(\"C30\");\n Integer seqKey = new Integer(-200);\n msProcessor.processExistingSeqSrc(accid, seqKey, null, raw);\n nav = sqlMgr.executeQuery(sql);\n assertTrue(!nav.next()); // assure record was not edited\n // check qc tables\n sql = \"select count(*) from QC_MS_AttrEdit \" +\n \"where _jobstream_key = \" + jobkey;\n nav = radar.executeQuery(sql);\n RowReference row = nav.getRowReference();\n nav.next();\n assertEquals(new Integer(1), row.getInt(1));\n\n }", "public void doEdit(TLDocument doc){\n\n\t\trememberDocument(doc);\n\t\t\n\t\t//\tSet the create and modify timestamps on the states.\n\t\tSet affectedStates = this.getAffectedStates();\n\t\tIterator iter = affectedStates.iterator();\n\t\tlong now = System.currentTimeMillis();\n\t\twhile (iter.hasNext()){\n\t\t\tTLState state = (TLState)iter.next();\n\t\t\tstate.setCreateTime(now);\n\t\t\tstate.setModifyTime(now);\n\t\t}\n\t\n\t\t//\tAsk the document to add these states.\n\t\tif (iDeleting)\n\t\t\tiDoc.editRemoveStates(this, affectedStates);\n\t\telse\n\t\t\tiDoc.editAddStates(this, affectedStates);\n\t}", "private void noteExpiredLease() {\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[noteExpiredLease] {}\", thread);\n }\n if (expiredLeases == null) {\n expiredLeases = new WeakHashMap();\n }\n expiredLeases.put(thread, null);\n }", "public void borrow()\n {\n borrowed++;\n }", "public LocalHolding getHoldingForUpdate();", "public void itemStateChanged(ItemEvent e)\r\n {\r\n System.out.println(\"*** get cell editor value:in itemStateChanged event ***\" +txtCell.getText()) ;\r\n super.fireEditingStopped();\r\n }", "OperationalState operationalState();", "OperationalState operationalState();", "public void updateCell() {\n alive = !alive;\n simulator.getSimulation().changeState(xPosition, yPosition);\n setColor();\n }", "public void stateChanged (ChangeEvent e)\n {\n }", "public boolean isCellEditable(Object cell) {\r\n \t\treturn cell instanceof JmtCell || cell instanceof BlockingRegion;\r\n \t}", "@Override\r\n public void stateChanged(ChangeEvent e) {\n }", "public String getNewState() {\n\t\treturn this.newState;\n\t}", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t}", "@DISPID(-2147412093)\n @PropGet\n java.lang.Object onrowenter();", "private StateHolder getStateHolder() {\n return stateHolder;\n }", "@Override\n public void cellChanged(String newCellValue) {\n\t \n }", "void showsame() {\n\t\tint count;\n\t\tprintstatus = idle;\n\t\tif (newinfo.other[printnewline] != printoldline) {\n\t\t\tSystem.err.println(\"BUG IN LINE REFERENCING\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tcount = blocklen[printoldline];\n\t\tprintoldline += count;\n\t\tprintnewline += count;\n\t}", "public void update()\n {\n System.out.print( \" \" + Integer.toBinaryString( subj.getState() ) );\n }", "void willDisplayUpdate(String change) throws RemoteException;", "public void stateChanged(ChangeEvent e){\n\r\n if (fLastEdit!=this){ // just a precaution against stateChange getting called many times\r\n\r\n if (fLastEdit != null) // kill the previous one so there's only one undo\r\n fLastEdit.die(); // don't kill ourselves\r\n\r\n fLastEdit = this;\r\n // fUndoListener.undoableEditHappened(new UndoableEditEvent(TShapePanel.this, this)); // tell the listener.\r\n\r\n tellListeners(new UndoableEditEvent(TShapePanel.this,this)); // tell the listeners.\r\n\r\n }\r\n\r\n }", "public void notifyChangementCroyants();", "public TransactionState state();", "public String getXmlChangedState() {\n String msg = \"<change_object_state idobj=\\\"\" + codObjeto + \"\\\" \";\n msg += \" status=\\\"\" + status + \"\\\" tag=\\\"\" + tag + \"\\\" \";\n msg += \" flagInventario=\\\"\" + flagInventario + \"\\\" \";\n msg += \" codUser=\\\"\" + codUser + \"\\\"\";\n msg += \" posx=\\\"\" + posX + \"\\\" posY=\\\"\" + posY + \"\\\">\";\n msg += \"</change_object_state>\";\n return msg;\n \n }", "public void stateChanged(ChangeEvent e){\n\r\n if (fLastEdit!=this){ // just a precaution against stateChange getting called many times\r\n\r\n if (fLastEdit != null) // kill the previous one so there's only one undo\r\n fLastEdit.die(); // don't kill ourselves\r\n\r\n fLastEdit = this;\r\n // fUndoListener.undoableEditHappened(new UndoableEditEvent(TShapePanel.this, this)); // tell the listener.\r\n\r\n tellListeners(new UndoableEditEvent(TShapePanel.this,this)); // tell the listeners.\r\n\r\n }\r\n\r\n }", "public Statement statemt() {\n try {\n Statement stmt = LidhjaMeDb.hapelidhjen();\n this.state = stmt;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return state;\n\n }", "void startEditing(Object cell) {\n\n\t}", "public State getState(){return this.state;}", "int getCellid();", "@Override public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException {\n IgniteThread cpThread = new IgniteThread(cctx.igniteInstanceName(), \"db-checkpoint-thread\", checkpointer);\n\n cpThread.start();\n\n checkpointerThread = cpThread;\n\n CheckpointProgressSnapshot chp = checkpointer.wakeupForCheckpoint(0, \"node started\");\n\n if (chp != null)\n chp.cpBeginFut.get();\n }", "public void testSimpleMasterEpochHandler() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n SimpleMasterEpochHandler meHandler = new SimpleMasterEpochHandler(\"/tmp/xtreemfs-test/\");\n Service.State svcState = meHandler.startAndWait();\n if (svcState != Service.State.RUNNING) {\n LOG.error(\"Unable to start Master Epoch Handler\", meHandler.failureCause());\n }\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, meHandler);\n\n FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART);\n msg.setCellId(CELL_ID);\n\n fs.startAndWait();\n\n fs.openCell(CELL_ID, new ArrayList(),true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(1, result.get().getMasterEpochNumber());\n\n FleaseFuture f = fs.closeCell(CELL_ID, false);\n f.get();\n\n fs.stopAndWait();\n meHandler.stopAndWait();\n\n Thread.sleep(12000);\n\n //restart\n meHandler = new SimpleMasterEpochHandler(\"/tmp/xtreemfs-test/\");\n if (meHandler.startAndWait() != Service.State.RUNNING) {\n LOG.error(\"Couldnt start meHandler\", meHandler.failureCause());\n }\n\n fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, meHandler);\n\n fs.startAndWait();\n\n result.set(null);\n\n fs.openCell(CELL_ID, new ArrayList(), true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),2);\n\n fs.stopAndWait();\n\n }", "public int getState() {return state;}", "public int getState() {return state;}", "@Override\n public void onNewClusterState(ClusterState state) {\n transportService.sendRequest(\n clusterService.localNode(),\n transportReplicaAction,\n replicaRequest,\n new ActionListenerResponseHandler<>(onCompletionListener, ReplicaResponse::new)\n );\n }", "@Override\n public String toString()\n {\n return state.toString();\n }", "private void updateAccPoolState() {\n List<AionAddress> clearAddr = new ArrayList<>();\n for (Entry<AionAddress, AccountState> e : this.accountView.entrySet()) {\n AccountState as = e.getValue();\n if (as.isDirty()) {\n\n if (as.getMap().isEmpty()) {\n this.poolStateView.remove(e.getKey());\n clearAddr.add(e.getKey());\n } else {\n // checking AccountState given by account\n List<PoolState> psl = this.poolStateView.get(e.getKey());\n if (psl == null) {\n psl = new LinkedList<>();\n }\n\n List<PoolState> newPoolState = new LinkedList<>();\n // Checking new tx has been include into old pools.\n BigInteger txNonceStart = as.getFirstNonce();\n\n if (txNonceStart != null) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState fn [{}]\",\n txNonceStart.toString());\n }\n for (PoolState ps : psl) {\n // check the previous txn status in the old\n // PoolState\n if (isClean(ps, as)\n && ps.firstNonce.equals(txNonceStart)\n && ps.combo == seqTxCountMax) {\n ps.resetInFeePool();\n newPoolState.add(ps);\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState add fn [{}]\",\n ps.firstNonce.toString());\n }\n\n txNonceStart = txNonceStart.add(BigInteger.valueOf(seqTxCountMax));\n } else {\n // remove old poolState in the feeMap\n if (this.feeView.get(ps.getFee()) != null) {\n\n if (e.getValue().getMap().get(ps.firstNonce) != null) {\n this.feeView\n .get(ps.getFee())\n .remove(\n e.getValue()\n .getMap()\n .get(ps.firstNonce)\n .getKey());\n }\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState remove fn [{}]\",\n ps.firstNonce.toString());\n }\n\n if (this.feeView.get(ps.getFee()).isEmpty()) {\n this.feeView.remove(ps.getFee());\n }\n }\n }\n }\n }\n\n int cnt = 0;\n BigInteger fee = BigInteger.ZERO;\n BigInteger totalFee = BigInteger.ZERO;\n\n for (Entry<BigInteger, SimpleEntry<ByteArrayWrapper, BigInteger>> en :\n as.getMap().entrySet()) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState mapsize[{}] nonce:[{}] cnt[{}] txNonceStart[{}]\",\n as.getMap().size(),\n en.getKey().toString(),\n cnt,\n txNonceStart != null ? txNonceStart.toString() : null);\n }\n if (en.getKey()\n .equals(\n txNonceStart != null\n ? txNonceStart.add(BigInteger.valueOf(cnt))\n : null)) {\n if (en.getValue().getValue().compareTo(fee) > -1) {\n fee = en.getValue().getValue();\n totalFee = totalFee.add(fee);\n\n if (++cnt == seqTxCountMax) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case1 - nonce:[{}] totalFee:[{}] cnt:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt);\n }\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n\n txNonceStart = en.getKey().add(BigInteger.ONE);\n totalFee = BigInteger.ZERO;\n fee = BigInteger.ZERO;\n cnt = 0;\n }\n } else {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case2 - nonce:[{}] totalFee:[{}] cnt:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt);\n }\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n\n // next PoolState\n txNonceStart = en.getKey();\n fee = en.getValue().getValue();\n totalFee = fee;\n cnt = 1;\n }\n }\n }\n\n if (totalFee.signum() == 1) {\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case3 - nonce:[{}] totalFee:[{}] cnt:[{}] bw:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt,\n e.getKey().toString());\n }\n\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n }\n\n this.poolStateView.put(e.getKey(), newPoolState);\n\n if (LOG.isTraceEnabled()) {\n this.poolStateView.forEach(\n (k, v) ->\n v.forEach(\n l -> {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState - the first nonce of the poolState list:[{}]\",\n l.firstNonce);\n }));\n }\n as.sorted();\n }\n }\n }\n\n if (!clearAddr.isEmpty()) {\n clearAddr.forEach(\n addr -> {\n lock.writeLock().lock();\n this.accountView.remove(addr);\n lock.writeLock().unlock();\n this.bestNonce.remove(addr);\n });\n }\n }", "void notifyChange(String name, T addressBook) {\n if (!addressBook.equals(history.get(current).getData())) {\n if (hasRedo()) {\n history.subList(current + 1, history.size()).clear();\n }\n history.get(current).subsequentCause = name;\n current++;\n history.add(new State(name, addressBook));\n }\n }", "@Override\n public void stateChanged(javax.swing.event.ChangeEvent e) {\n }", "public boolean isNewCell() {\n return cellNum == null;\n }", "private StateChangeMonitor() {\n\t\t// Create the registry of StateChangeListeners\n\t\tlisteners = new Hashtable();\n\t}", "private void changed() {\n // Ok to have a race here, see the field javadoc.\n if (!changed)\n changed = true;\n }", "public String getNewState()\n\t{\n\t\treturn (UUID.randomUUID().toString());\n\t}", "public void onAlivenessChange(long nodehash, boolean b) { synchronized (this.nodedb) {\n\t\tNodeDB.NodeInfo n = this.nodedb.get(nodehash);\n\t\tif (n == null) return;\n\t\tif (n.alive == b) return;\n\t\tif ((n.isLocal) && !b) throw new RuntimeException(\"Local liveness change!!\");\n\n\t\tn.timestamp = System.currentTimeMillis();\n\t\tn.alive = b;\n\t\t\n\t\tGossipThread.getInstance().replicateNodeInfo(n);\n\t}}", "@Test\n public void Create_A_Live_Cell()\n {\n GameCell cell = new GameCell();\n cell.setState(1);\n Assert.assertEquals(1, cell.getState());\n }", "public Cell() {\n\t\tthis.alive = false; // Initially dead\n\t\tthis.age = 0; // Initially age of 0\n\t}", "public String getCellid() {\r\n return cellid;\r\n }", "public void decisionOnCellState(int counter, int row, int column)\r\n {\r\n if (cellGrid[column][row].isAlive())\r\n {\r\n if (counter < 2)\r\n {\r\n cellGrid[column][row].setToBeAlive(false);\r\n }\r\n else if (counter == 2 || counter == 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(true);\r\n }\r\n else if (counter > 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(false);\r\n } // end of if (counter < 2)\r\n }\r\n else\r\n {\r\n if (counter == 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(true);\r\n } // end of if (counter == 3)\r\n } // end of if (cellGrid[column][row].isAlive())\r\n }", "public void getState();", "public void doChanges0() {\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compBounds.put(\"jScrollPane1\", new Rectangle(232, 11, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jScrollPane1-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compBounds.put(\"jScrollPane1\", new Rectangle(232, 11, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n // parentId-compId-dimension-compAlignment\n lm.removeComponent(\"jScrollPane1\", true);\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n }", "public void stateChanged( ChangeEvent event )\n {\n \n }", "private void transferPendingCellData()\r\n\t{\r\n\t\tsynchronized(dataLock)\r\n\t\t{\r\n\t\t\tcellData = pendingCellData;\r\n\t\t\trowCount = cellData.length;\r\n\t\t}\r\n\t}", "public void info() {\n\t\tstate.info();\n\t}", "@FXML\n public void changeMarksCellEvent(CellEditEvent<UGSubjectMarks, Integer> edittedCell) throws SQLException, ClassNotFoundException{\n UGSubjectMarks markSelected = subjectmarktbl.getSelectionModel().getSelectedItem();\n markSelected.SetSubMark(Integer.parseInt(edittedCell.getNewValue().toString()));\n int newMarks = Integer.parseInt(edittedCell.getNewValue().toString());\n UGSubject.setSubjectMarks(Integer.parseInt(studentID.getText()), sem, markSelected.getSubName(), newMarks);\n \n \n }", "public native CellRecord getEditedRecord(int rowNum, int colNum) /*-{\r\n var self = [email protected]::getOrCreateJsObj()();\r\n var record = self.getEditedRecord(rowNum, colNum);\r\n if (record == null) return null;\r\n return @com.smartgwt.client.widgets.cube.CellRecord::getOrCreateRef(Lcom/google/gwt/core/client/JavaScriptObject;)(record);\r\n }-*/;", "@Test\n public void isDirty_freshObject() {\n AlphaTransaction t = startTransaction();\n IntRef value = new IntRef(0);\n IntRefTranlocal tranlocal = (IntRefTranlocal) t.openForWrite(value);\n assertTrue(tranlocal.isDirty());\n }", "public void onEditTransaction(Transaction transaction) {\n\t}", "protected void updateCaseWithNewStatus(NbaDst caseDst,NbaDst tranDst) throws NbaBaseException { //NBLXA -1983\n \ttry {\n \t\tif (NbaConstants.A_QUEUE_UNDERWRITER_HOLD.equals(caseDst.getQueue())) {\n \t\t\t//Start NBLXA -1983\n \t\t\t/* Reinsurance Responses are bundled unless and until all the responses are received on the case. But if response for additional info is received case route to UW */\n \t\t\tboolean isFinalReplRecieve= true; \n \t\t\tif(((!NbaUtils.isBlankOrNull(tranDst.getNbaLob().hasAdditionalInfo()) && (!tranDst.getNbaLob().getAdditionalInfo()) ) ||\n \t\t\t\t\tNbaUtils.isBlankOrNull(tranDst.getNbaLob().hasAdditionalInfo()))){\n \t\t\t\tsetNbaTxLife(doHoldingInquiry(caseDst));\n \t\t\t\tif(!NbaUtils.isBlankOrNull(getNbaTxLife())){\n \t\t\t\t\tLong appType=getNbaTxLife().getPolicy().getApplicationInfo().getApplicationType();\n \t\t\t\t\tApplicationInfo appInfo = getNbaTxLife().getPolicy().getApplicationInfo();\n \t\t\t\t\tApplicationInfoExtension appInfoExt = NbaUtils.getFirstApplicationInfoExtension(appInfo);\n \t\t\t\t\tif( NbaOliConstants.OLI_ACTTYPE_1000500003 !=appType && NbaOliConstants.OLI_APPTYPE_SIMPLIFIEDISSUE !=appType \n \t\t\t\t\t\t\t&& (!NbaUtils.isBlankOrNull(appInfoExt) && !NbaUtils.isContractChange(getNbaTxLife()) && NbaUtils.isBlankOrNull(appInfoExt.getReopenDate()))){\n \t\t\t\t\t\tNbaDst parentCase = retrieveParentWork(tranDst, true,true);\n \t\t\t\t\t\tList transactions = parentCase.getNbaTransactions();\n \t\t\t\t\t\tNbaTransaction transaction = null; \t\t\n \t\t\t\t\t\tfor (int i = 0; i < transactions.size(); i++) {\n \t\t\t\t\t\t\ttransaction = (NbaTransaction) transactions.get(i);\n \t\t\t\t\t\t\tif (!tranDst.getID().equalsIgnoreCase( transaction.getID()) && NbaConstants.A_WT_REINSURANCE.equals(transaction.getWorkType()) && !transaction.isInEndQueue()) {\n \t\t\t\t\t\t\t\tisFinalReplRecieve =false;\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif(isFinalReplRecieve){\n \t\t\t\t//End NBLXA -1983\n \t\t\t\tupdateCaseStatus(caseDst);\n \t\t\t}\n \t\t\t//NBA208-32\n \t\t\tcaseDst.getCase().getWorkItemChildren().clear(); //clear child transaction\n \t\t\tcaseDst.setUpdate();\n \t\t}\n \t}catch (NbaBaseException e) {\n \t\tif (e.isFatal()) {\n \t\t\tthrow e;\n \t\t}\n \t\tgetLogger().logException(e);\n \t\tthrow new NbaBaseException(\"Unable to retrieve new status for case work item, reason: \" + e.getMessage(), e);\n \t}\n }", "R commit(C change);", "public String getCellid() {\n return cellid;\n }", "public String getCellid() {\n return cellid;\n }", "public void willbeUpdated() {\n\t\t\n\t}", "public void stateChanged(ChangeEvent e) {\n }" ]
[ "0.59451824", "0.5618135", "0.5451526", "0.5433061", "0.5431796", "0.54150623", "0.53984064", "0.5367134", "0.52899486", "0.523861", "0.5230157", "0.5217632", "0.52032053", "0.51949805", "0.519186", "0.5189909", "0.5182019", "0.5176364", "0.5144113", "0.51081574", "0.51062155", "0.50953823", "0.50944805", "0.5057024", "0.5049687", "0.50439805", "0.50439805", "0.50417745", "0.502732", "0.49989447", "0.49975684", "0.49919346", "0.49830884", "0.4975045", "0.49747354", "0.4972741", "0.49578685", "0.49549484", "0.49524257", "0.49514964", "0.49471122", "0.49385458", "0.49307385", "0.49307385", "0.49252173", "0.49243873", "0.4915735", "0.49037397", "0.4891673", "0.4888402", "0.48850673", "0.48743343", "0.48742318", "0.48741573", "0.4869571", "0.4867198", "0.4866739", "0.48603478", "0.484789", "0.4838406", "0.48328173", "0.48327208", "0.48322022", "0.48316714", "0.48273388", "0.4825359", "0.48209742", "0.48178408", "0.48178408", "0.48022756", "0.48021954", "0.48005778", "0.47822163", "0.478142", "0.477729", "0.4775268", "0.47743854", "0.4769961", "0.4762175", "0.47580054", "0.47562706", "0.4754717", "0.475006", "0.4744265", "0.47419202", "0.47412786", "0.47411075", "0.47408158", "0.47297564", "0.47297356", "0.4726536", "0.47265193", "0.47250164", "0.47199544", "0.47165555", "0.47165555", "0.47133648", "0.47120944" ]
0.7013319
0
System.out.println("state change: "+cellId+" owner="+lease.getLeaseHolder());
@Override public void statusChanged(ASCIIString cellId, Flease lease) { synchronized (result) { result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber())); result.notify(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getStateChange();", "public void testOpenAndGetLease() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, new MasterEpochHandlerInterface() {\n\n long masterEpochNum = 0;\n\n @Override\n public void sendMasterEpoch(FleaseMessage response, Continuation callback) {\n // System.out.println(\"sending: \"+masterEpochNum);\n response.setMasterEpochNumber(masterEpochNum);\n callback.processingFinished();\n }\n\n @Override\n public void storeMasterEpoch(FleaseMessage request, Continuation callback) {\n masterEpochNum = request.getMasterEpochNumber();\n // System.out.println(\"storing: \"+masterEpochNum);\n callback.processingFinished();\n }\n });\n\n FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART);\n msg.setCellId(CELL_ID);\n\n fs.startAndWait();\n\n fs.openCell(CELL_ID, new ArrayList(),true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),1);\n\n FleaseFuture f = fs.closeCell(CELL_ID, false);\n f.get();\n\n Thread.sleep(12000);\n\n result.set(null);\n\n fs.openCell(CELL_ID, new ArrayList(), true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),2);\n\n fs.stopAndWait();\n }", "@Test\n public void testUpdateCheckpointLeaseUpdated() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n leaseRefresher.renewLease(coordinator.getCurrentlyHeldLease(leaseKey));\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n lease.leaseCounter(lease.leaseCounter() + 1);\n // Counter and owner changed, but checkpoint did not.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "public I getChangeInfo(int startSeqNum);", "@Test\n public void testUpdateCheckpoint() throws Exception {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n // Run the taker and renewer in-between getting the Lease object and calling checkpoint\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n if (lease == null) {\n List<Lease> leases = leaseRefresher.listLeases();\n for (Lease kinesisClientLease : leases) {\n System.out.println(kinesisClientLease);\n }\n }\n\n assertNotNull(lease);\n final ExtendedSequenceNumber initialCheckpoint = new ExtendedSequenceNumber(\"initialCheckpoint\");\n final ExtendedSequenceNumber pendingCheckpoint = new ExtendedSequenceNumber(\"pendingCheckpoint\");\n final ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n final byte[] checkpointState = \"checkpointState\".getBytes();\n\n // lease's leaseCounter is wrong at this point, but it shouldn't matter.\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), initialCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtInitialCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, leaseFromDDBAtInitialCheckpoint);\n\n dynamoDBCheckpointer.prepareCheckpoint(lease.leaseKey(), pendingCheckpoint, lease.concurrencyToken().toString(), checkpointState);\n\n final Lease leaseFromDDBAtPendingCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.pendingCheckpoint(pendingCheckpoint);\n lease.pendingCheckpointState(checkpointState);\n assertEquals(lease, leaseFromDDBAtPendingCheckpoint);\n\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtNewCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(newCheckpoint);\n lease.pendingCheckpoint(null);\n lease.pendingCheckpointState(null);\n assertEquals(lease, leaseFromDDBAtNewCheckpoint);\n }", "@Override\n\tpublic void update() {\n\t\tSystem.out.println(\"Observer Pattern on Room Reservation Notification: \");\n\t\tSystem.out.println(\"Your room is \" + reserve.getState()+\"\\n\");\n\t}", "public long getStateChange() {\n return stateChange_;\n }", "@Override\n\tpublic void checkWayBillChange(String id) {\n\t\t\n\t}", "public long getStateChange() {\n return stateChange_;\n }", "public void changedUpdate(DocumentEvent evt, FoldHierarchyTransaction transaction) {\n }", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "public boolean isAlive ()\n {\n return cellStatus;\n }", "int getLeaseId() {\n return leaseId;\n }", "public void onCellEdit(CellEditEvent event) {\n Object oldValue = event.getOldValue();\n Object newValue = event.getNewValue();\n Object o = event.getSource();\n System.out.println(\"event called: \" + newValue + \" \" + oldValue);\n System.out.println(o.toString());\n DataTable table = (DataTable) event.getComponent();\n Long id = (Long) table.getRowKey();\n System.out.println(\"#### row key is : \" + id + \" ####\");\n if (newValue != null && !newValue.equals(oldValue)) {\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cell Changed\", \"Old: \" + oldValue + \", New:\" + newValue);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n for (Gnome gnome : user.getCart()) {\n if ((gnome.getId() != null) && (gnome.getId().compareTo(id) == 0)) {\n System.out.println(\"cart size on cell edit \" + user.getCart().size());\n gnome.setShopQuantity((Integer) newValue);\n userFacade.updateCart(user, gnome);\n }\n }\n }\n }", "public synchronized void switchCell()\n {\n cellValue = (cellValue == ALIVE) ? DEAD : ALIVE;\n }", "@Override\n protected void handleCellContentChange(int row,\n int column,\n Object oldValue,\n Object newValue)\n {\n // Store the log note with the log data and write it to the log\n // notes file\n perfLog.getPerfLogData().get(row).setNotes(newValue.toString());\n perfLog.writeLogNotes(row);\n }", "public void update() \n {\n System.out.print( \" \" + Integer.toHexString( subj.getState() ) ); \n}", "public void setCellState(int newState) {\n this.myState = newState;\n }", "public DBState() {\n\t\t\tthis.expandedElements=treeViewer.getExpandedElements();\n\t\t\tthis.treeSelection=treeViewer.getSelection();\n\t\t\tthis.tableSelection=txTableViewer.getSelection();\n\t\t}", "@Override\n\t\t\tpublic void editingStopped(ChangeEvent arg0) {\n\n\t\t\t\tSystem.out.println(tree.getCellEditor().getCellEditorValue());\n\t\t\t\ttree.getModel().valueForPathChanged(tree.getSelectionPath(),\n\t\t\t\t\t\ttree.getCellEditor().getCellEditorValue() + \"zzz\");\n\t\t\t\ttree.updateUI();\n\t\t\t}", "void oracle(){\n if (this.neighbors < 1){\n if (!isAlive()){\n observer.deleteCell(id);\n }\n }\n }", "void showchange() {\n\t\tif (printstatus != change)\n\t\t\tprintln(\">>>> \" + printoldline + \" CHANGED FROM <br/>\");\n\t\tprintstatus = change;\n\t\toutput+=oldinfo.symbol[printoldline].showSymbol();\n\t\toutput+=\"<br/>\";\n\t\tanyprinted = true;\n\t\tprintoldline++;\n\t}", "private CellBackup(CellRevision cellRevision, TechPool techPool, boolean modified) {\n this.cellRevision = cellRevision;\n this.techPool = techPool;\n this.modified = modified;\n cellBackupsCreated++;\n if (Job.getDebug())\n check();\n }", "private void verifyChanges() {\n System.out.println(\"Verify changes\"); \n }", "@Test\n public void testUpdateCheckpointBadConcurrencyToken() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, UUID.randomUUID()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n // Owner should be the only thing that changed.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "@Override\r\n\t\t\tpublic void update(final ViewerCell cell) {\n\t\t\t}", "@Override\r\n\t\t\tpublic void update(final ViewerCell cell) {\n\t\t\t}", "@Override\n public int getRowChange() {\n return rowChange;\n }", "void printstate()\n\t{\n\t\toperation.printstate();\n\t}", "public String toString() {\r\n\treturn \"batch image builder for:\\n\\tnew state: \"/*nonNLS*/ + getNewState();\r\n}", "synchronized boolean isLeaseHeld() {\n return leaseId > -1;\n }", "public Long getChangeNum() {\n return changeNum;\n }", "@Override\n public void stateChanged(ChangeEvent e) {\n model.generateGridWithSpecifiedProblemDifficulty(view.getSpinnerValue());\n view.updateGridPanel(model.getGrid(), model.getAgentLocation());\n }", "private void gridMain_CellLeave(Object sender, OpenDental.UI.ODGridClickEventArgs e) throws Exception {\n long codeNum = PIn.Long(ProcTable.Rows[e.getRow()][\"CodeNum\"].ToString());\n long feesched = FeeSchedC.getListShort()[listFeeSched.SelectedIndex].FeeSchedNum;\n Fee fee = Fees.getFee(codeNum,feesched);\n String strOld = \"\";\n if (fee != null)\n {\n strOld = fee.Amount.ToString(\"n\");\n }\n \n String strNew = gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text;\n if (StringSupport.equals(strOld, strNew))\n {\n return ;\n }\n \n if (!Security.isAuthorized(Permissions.Setup))\n {\n //includes dialog\n gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text = strOld;\n gridMain.Invalidate();\n return ;\n }\n \n double dNew = -1;\n if (!StringSupport.equals(strNew, \"\"))\n {\n try\n {\n dNew = PIn.Double(strNew);\n }\n catch (Exception __dummyCatchVar2)\n {\n gridMain.setSelected(new Point(e.getCol(), e.getRow()));\n MessageBox.Show(Lan.g(this,\"Please fix data entry error first.\"));\n return ;\n }\n\n gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text = dNew.ToString(\"n\");\n }\n \n //to standardize formatting. They probably didn't type .00\n //invalidate doesn't seem to be necessary here\n if (StringSupport.equals(strOld, \"\"))\n {\n //if no fee was originally entered and since it's no longer empty, then we need to insert a fee.\n //Somehow duplicate fees were being inserted so double check that this fee does not already exist.\n Fee tmpFee = Fees.getFee(codeNum,feesched);\n //Looks in cache.\n if (tmpFee != null)\n {\n return ;\n }\n \n //Fee exists. Must be unknown bug.\n fee = new Fee();\n fee.FeeSched = feesched;\n fee.CodeNum = codeNum;\n fee.Amount = dNew;\n Fees.insert(fee);\n Fees.getListt().Add(fee);\n }\n else\n {\n //if fee existed\n if (StringSupport.equals(strNew, \"\"))\n {\n //delete old fee\n Fees.delete(fee);\n Fees.getListt().Remove(fee);\n }\n else\n {\n //change fee\n fee.Amount = dNew;\n Fees.update(fee);\n Fees.getListt()[Fees.getListt().IndexOf(fee)].Amount = dNew;\n } \n } \n SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lan.g(this,\"Procedure\") + \": \" + ProcedureCodes.getStringProcCode(fee.CodeNum) + \", \" + Lan.g(this,\"Fee: \") + \"\" + fee.Amount.ToString(\"c\") + \", \" + Lan.g(this,\"Fee Schedule\") + \": \" + FeeScheds.getDescription(fee.FeeSched) + \". \" + Lan.g(this,\"Manual edit in grid from Procedure Codes list.\"), fee.CodeNum);\n }", "long getChangeset();", "@Override\n\tpublic void stateChanged(ChangeEvent arg0) {\n\t\t\n\t}", "public void testExistingSeqWithChangedSrcCuratorEdited() throws Exception\n {\n sqlMgr.executeUpdate(\"update prb_source set isCuratorEdited = 1 where _source_key = -40\");\n Integer C30 = this.cellLineLookup.lookup(\"C30\");\n String sql = \"select * from prb_source where _source_key \" +\n \"= -40 and _cellLine_key = \" + C30.toString();\n ResultsNavigator nav = sqlMgr.executeQuery(sql);\n assertTrue(!nav.next()); // assure no records found\n String accid = \"T00313\";\n MSRawAttributes raw = new MSRawAttributes();\n raw.setOrganism(\"mouse, laboratory\");\n raw.setCellLine(\"C30\");\n Integer seqKey = new Integer(-200);\n msProcessor.processExistingSeqSrc(accid, seqKey, null, raw);\n nav = sqlMgr.executeQuery(sql);\n assertTrue(!nav.next()); // assure record was not edited\n // check qc tables\n sql = \"select count(*) from QC_MS_AttrEdit \" +\n \"where _jobstream_key = \" + jobkey;\n nav = radar.executeQuery(sql);\n RowReference row = nav.getRowReference();\n nav.next();\n assertEquals(new Integer(1), row.getInt(1));\n\n }", "public void doEdit(TLDocument doc){\n\n\t\trememberDocument(doc);\n\t\t\n\t\t//\tSet the create and modify timestamps on the states.\n\t\tSet affectedStates = this.getAffectedStates();\n\t\tIterator iter = affectedStates.iterator();\n\t\tlong now = System.currentTimeMillis();\n\t\twhile (iter.hasNext()){\n\t\t\tTLState state = (TLState)iter.next();\n\t\t\tstate.setCreateTime(now);\n\t\t\tstate.setModifyTime(now);\n\t\t}\n\t\n\t\t//\tAsk the document to add these states.\n\t\tif (iDeleting)\n\t\t\tiDoc.editRemoveStates(this, affectedStates);\n\t\telse\n\t\t\tiDoc.editAddStates(this, affectedStates);\n\t}", "private void noteExpiredLease() {\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[noteExpiredLease] {}\", thread);\n }\n if (expiredLeases == null) {\n expiredLeases = new WeakHashMap();\n }\n expiredLeases.put(thread, null);\n }", "public void borrow()\n {\n borrowed++;\n }", "public LocalHolding getHoldingForUpdate();", "public void itemStateChanged(ItemEvent e)\r\n {\r\n System.out.println(\"*** get cell editor value:in itemStateChanged event ***\" +txtCell.getText()) ;\r\n super.fireEditingStopped();\r\n }", "OperationalState operationalState();", "OperationalState operationalState();", "public void updateCell() {\n alive = !alive;\n simulator.getSimulation().changeState(xPosition, yPosition);\n setColor();\n }", "public void stateChanged (ChangeEvent e)\n {\n }", "public boolean isCellEditable(Object cell) {\r\n \t\treturn cell instanceof JmtCell || cell instanceof BlockingRegion;\r\n \t}", "@Override\r\n public void stateChanged(ChangeEvent e) {\n }", "public String getNewState() {\n\t\treturn this.newState;\n\t}", "@Override\n\tpublic void stateChanged(ChangeEvent e) {\n\t}", "@DISPID(-2147412093)\n @PropGet\n java.lang.Object onrowenter();", "private StateHolder getStateHolder() {\n return stateHolder;\n }", "@Override\n public void cellChanged(String newCellValue) {\n\t \n }", "void showsame() {\n\t\tint count;\n\t\tprintstatus = idle;\n\t\tif (newinfo.other[printnewline] != printoldline) {\n\t\t\tSystem.err.println(\"BUG IN LINE REFERENCING\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tcount = blocklen[printoldline];\n\t\tprintoldline += count;\n\t\tprintnewline += count;\n\t}", "public void update()\n {\n System.out.print( \" \" + Integer.toBinaryString( subj.getState() ) );\n }", "void willDisplayUpdate(String change) throws RemoteException;", "public void stateChanged(ChangeEvent e){\n\r\n if (fLastEdit!=this){ // just a precaution against stateChange getting called many times\r\n\r\n if (fLastEdit != null) // kill the previous one so there's only one undo\r\n fLastEdit.die(); // don't kill ourselves\r\n\r\n fLastEdit = this;\r\n // fUndoListener.undoableEditHappened(new UndoableEditEvent(TShapePanel.this, this)); // tell the listener.\r\n\r\n tellListeners(new UndoableEditEvent(TShapePanel.this,this)); // tell the listeners.\r\n\r\n }\r\n\r\n }", "public void notifyChangementCroyants();", "public TransactionState state();", "public String getXmlChangedState() {\n String msg = \"<change_object_state idobj=\\\"\" + codObjeto + \"\\\" \";\n msg += \" status=\\\"\" + status + \"\\\" tag=\\\"\" + tag + \"\\\" \";\n msg += \" flagInventario=\\\"\" + flagInventario + \"\\\" \";\n msg += \" codUser=\\\"\" + codUser + \"\\\"\";\n msg += \" posx=\\\"\" + posX + \"\\\" posY=\\\"\" + posY + \"\\\">\";\n msg += \"</change_object_state>\";\n return msg;\n \n }", "public void stateChanged(ChangeEvent e){\n\r\n if (fLastEdit!=this){ // just a precaution against stateChange getting called many times\r\n\r\n if (fLastEdit != null) // kill the previous one so there's only one undo\r\n fLastEdit.die(); // don't kill ourselves\r\n\r\n fLastEdit = this;\r\n // fUndoListener.undoableEditHappened(new UndoableEditEvent(TShapePanel.this, this)); // tell the listener.\r\n\r\n tellListeners(new UndoableEditEvent(TShapePanel.this,this)); // tell the listeners.\r\n\r\n }\r\n\r\n }", "public Statement statemt() {\n try {\n Statement stmt = LidhjaMeDb.hapelidhjen();\n this.state = stmt;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return state;\n\n }", "void startEditing(Object cell) {\n\n\t}", "public State getState(){return this.state;}", "int getCellid();", "@Override public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException {\n IgniteThread cpThread = new IgniteThread(cctx.igniteInstanceName(), \"db-checkpoint-thread\", checkpointer);\n\n cpThread.start();\n\n checkpointerThread = cpThread;\n\n CheckpointProgressSnapshot chp = checkpointer.wakeupForCheckpoint(0, \"node started\");\n\n if (chp != null)\n chp.cpBeginFut.get();\n }", "public void testSimpleMasterEpochHandler() throws Exception {\n final ASCIIString CELL_ID = new ASCIIString(\"testcell\");\n\n final AtomicReference<Flease> result = new AtomicReference();\n\n SimpleMasterEpochHandler meHandler = new SimpleMasterEpochHandler(\"/tmp/xtreemfs-test/\");\n Service.State svcState = meHandler.startAndWait();\n if (svcState != Service.State.RUNNING) {\n LOG.error(\"Unable to start Master Epoch Handler\", meHandler.failureCause());\n }\n\n FleaseStage fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, meHandler);\n\n FleaseMessage msg = new FleaseMessage(FleaseMessage.MsgType.EVENT_RESTART);\n msg.setCellId(CELL_ID);\n\n fs.startAndWait();\n\n fs.openCell(CELL_ID, new ArrayList(),true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(1, result.get().getMasterEpochNumber());\n\n FleaseFuture f = fs.closeCell(CELL_ID, false);\n f.get();\n\n fs.stopAndWait();\n meHandler.stopAndWait();\n\n Thread.sleep(12000);\n\n //restart\n meHandler = new SimpleMasterEpochHandler(\"/tmp/xtreemfs-test/\");\n if (meHandler.startAndWait() != Service.State.RUNNING) {\n LOG.error(\"Couldnt start meHandler\", meHandler.failureCause());\n }\n\n fs = new FleaseStage(cfg, \"/tmp/xtreemfs-test/\", new FleaseMessageSenderInterface() {\n\n @Override\n public void sendMessage(FleaseMessage message, InetSocketAddress recipient) {\n //ignore me\n }\n }, true, new FleaseViewChangeListenerInterface() {\n\n @Override\n public void viewIdChangeEvent(ASCIIString cellId, int viewId) {\n }\n },new FleaseStatusListener() {\n\n @Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n // System.out.println(\"state change: \"+cellId+\" owner=\"+lease.getLeaseHolder());\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }\n\n @Override\n public void leaseFailed(ASCIIString cellId, FleaseException error) {\n MasterEpochTest.fail(error.toString());\n }\n }, meHandler);\n\n fs.startAndWait();\n\n result.set(null);\n\n fs.openCell(CELL_ID, new ArrayList(), true);\n\n synchronized(result) {\n if (result.get() == null)\n result.wait(1000);\n if (result.get() == null)\n fail(\"timeout!\");\n }\n\n assertEquals(result.get().getLeaseHolder(),cfg.getIdentity());\n assertEquals(result.get().getMasterEpochNumber(),2);\n\n fs.stopAndWait();\n\n }", "public int getState() {return state;}", "public int getState() {return state;}", "@Override\n public void onNewClusterState(ClusterState state) {\n transportService.sendRequest(\n clusterService.localNode(),\n transportReplicaAction,\n replicaRequest,\n new ActionListenerResponseHandler<>(onCompletionListener, ReplicaResponse::new)\n );\n }", "@Override\n public String toString()\n {\n return state.toString();\n }", "private void updateAccPoolState() {\n List<AionAddress> clearAddr = new ArrayList<>();\n for (Entry<AionAddress, AccountState> e : this.accountView.entrySet()) {\n AccountState as = e.getValue();\n if (as.isDirty()) {\n\n if (as.getMap().isEmpty()) {\n this.poolStateView.remove(e.getKey());\n clearAddr.add(e.getKey());\n } else {\n // checking AccountState given by account\n List<PoolState> psl = this.poolStateView.get(e.getKey());\n if (psl == null) {\n psl = new LinkedList<>();\n }\n\n List<PoolState> newPoolState = new LinkedList<>();\n // Checking new tx has been include into old pools.\n BigInteger txNonceStart = as.getFirstNonce();\n\n if (txNonceStart != null) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState fn [{}]\",\n txNonceStart.toString());\n }\n for (PoolState ps : psl) {\n // check the previous txn status in the old\n // PoolState\n if (isClean(ps, as)\n && ps.firstNonce.equals(txNonceStart)\n && ps.combo == seqTxCountMax) {\n ps.resetInFeePool();\n newPoolState.add(ps);\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState add fn [{}]\",\n ps.firstNonce.toString());\n }\n\n txNonceStart = txNonceStart.add(BigInteger.valueOf(seqTxCountMax));\n } else {\n // remove old poolState in the feeMap\n if (this.feeView.get(ps.getFee()) != null) {\n\n if (e.getValue().getMap().get(ps.firstNonce) != null) {\n this.feeView\n .get(ps.getFee())\n .remove(\n e.getValue()\n .getMap()\n .get(ps.firstNonce)\n .getKey());\n }\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState remove fn [{}]\",\n ps.firstNonce.toString());\n }\n\n if (this.feeView.get(ps.getFee()).isEmpty()) {\n this.feeView.remove(ps.getFee());\n }\n }\n }\n }\n }\n\n int cnt = 0;\n BigInteger fee = BigInteger.ZERO;\n BigInteger totalFee = BigInteger.ZERO;\n\n for (Entry<BigInteger, SimpleEntry<ByteArrayWrapper, BigInteger>> en :\n as.getMap().entrySet()) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState mapsize[{}] nonce:[{}] cnt[{}] txNonceStart[{}]\",\n as.getMap().size(),\n en.getKey().toString(),\n cnt,\n txNonceStart != null ? txNonceStart.toString() : null);\n }\n if (en.getKey()\n .equals(\n txNonceStart != null\n ? txNonceStart.add(BigInteger.valueOf(cnt))\n : null)) {\n if (en.getValue().getValue().compareTo(fee) > -1) {\n fee = en.getValue().getValue();\n totalFee = totalFee.add(fee);\n\n if (++cnt == seqTxCountMax) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case1 - nonce:[{}] totalFee:[{}] cnt:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt);\n }\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n\n txNonceStart = en.getKey().add(BigInteger.ONE);\n totalFee = BigInteger.ZERO;\n fee = BigInteger.ZERO;\n cnt = 0;\n }\n } else {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case2 - nonce:[{}] totalFee:[{}] cnt:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt);\n }\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n\n // next PoolState\n txNonceStart = en.getKey();\n fee = en.getValue().getValue();\n totalFee = fee;\n cnt = 1;\n }\n }\n }\n\n if (totalFee.signum() == 1) {\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case3 - nonce:[{}] totalFee:[{}] cnt:[{}] bw:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt,\n e.getKey().toString());\n }\n\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n }\n\n this.poolStateView.put(e.getKey(), newPoolState);\n\n if (LOG.isTraceEnabled()) {\n this.poolStateView.forEach(\n (k, v) ->\n v.forEach(\n l -> {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState - the first nonce of the poolState list:[{}]\",\n l.firstNonce);\n }));\n }\n as.sorted();\n }\n }\n }\n\n if (!clearAddr.isEmpty()) {\n clearAddr.forEach(\n addr -> {\n lock.writeLock().lock();\n this.accountView.remove(addr);\n lock.writeLock().unlock();\n this.bestNonce.remove(addr);\n });\n }\n }", "void notifyChange(String name, T addressBook) {\n if (!addressBook.equals(history.get(current).getData())) {\n if (hasRedo()) {\n history.subList(current + 1, history.size()).clear();\n }\n history.get(current).subsequentCause = name;\n current++;\n history.add(new State(name, addressBook));\n }\n }", "@Override\n public void stateChanged(javax.swing.event.ChangeEvent e) {\n }", "public boolean isNewCell() {\n return cellNum == null;\n }", "private StateChangeMonitor() {\n\t\t// Create the registry of StateChangeListeners\n\t\tlisteners = new Hashtable();\n\t}", "private void changed() {\n // Ok to have a race here, see the field javadoc.\n if (!changed)\n changed = true;\n }", "public String getNewState()\n\t{\n\t\treturn (UUID.randomUUID().toString());\n\t}", "public void onAlivenessChange(long nodehash, boolean b) { synchronized (this.nodedb) {\n\t\tNodeDB.NodeInfo n = this.nodedb.get(nodehash);\n\t\tif (n == null) return;\n\t\tif (n.alive == b) return;\n\t\tif ((n.isLocal) && !b) throw new RuntimeException(\"Local liveness change!!\");\n\n\t\tn.timestamp = System.currentTimeMillis();\n\t\tn.alive = b;\n\t\t\n\t\tGossipThread.getInstance().replicateNodeInfo(n);\n\t}}", "@Test\n public void Create_A_Live_Cell()\n {\n GameCell cell = new GameCell();\n cell.setState(1);\n Assert.assertEquals(1, cell.getState());\n }", "public Cell() {\n\t\tthis.alive = false; // Initially dead\n\t\tthis.age = 0; // Initially age of 0\n\t}", "public String getCellid() {\r\n return cellid;\r\n }", "public void decisionOnCellState(int counter, int row, int column)\r\n {\r\n if (cellGrid[column][row].isAlive())\r\n {\r\n if (counter < 2)\r\n {\r\n cellGrid[column][row].setToBeAlive(false);\r\n }\r\n else if (counter == 2 || counter == 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(true);\r\n }\r\n else if (counter > 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(false);\r\n } // end of if (counter < 2)\r\n }\r\n else\r\n {\r\n if (counter == 3)\r\n {\r\n cellGrid[column][row].setToBeAlive(true);\r\n } // end of if (counter == 3)\r\n } // end of if (cellGrid[column][row].isAlive())\r\n }", "public void getState();", "public void doChanges0() {\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compBounds.put(\"jScrollPane1\", new Rectangle(232, 11, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jScrollPane1-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compBounds.put(\"jScrollPane1\", new Rectangle(232, 11, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n // parentId-compId-dimension-compAlignment\n lm.removeComponent(\"jScrollPane1\", true);\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton2-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jToggleButton3-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jToggleButton2-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jToggleButton3-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n contInterior.put(\"Form\", new Rectangle(0, 0, 436, 300));\n compBounds.put(\"jTextField1\", new Rectangle(10, 11, 216, 20));\n baselinePosition.put(\"jTextField1-216-20\", new Integer(14));\n compBounds.put(\"jToggleButton2\", new Rectangle(10, 118, 105, 23));\n baselinePosition.put(\"jToggleButton2-105-23\", new Integer(15));\n compBounds.put(\"jToggleButton3\", new Rectangle(121, 118, 105, 23));\n baselinePosition.put(\"jToggleButton3-105-23\", new Integer(15));\n compBounds.put(\"jTextField2\", new Rectangle(10, 37, 216, 20));\n baselinePosition.put(\"jTextField2-216-20\", new Integer(14));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n }", "public void stateChanged( ChangeEvent event )\n {\n \n }", "private void transferPendingCellData()\r\n\t{\r\n\t\tsynchronized(dataLock)\r\n\t\t{\r\n\t\t\tcellData = pendingCellData;\r\n\t\t\trowCount = cellData.length;\r\n\t\t}\r\n\t}", "public void info() {\n\t\tstate.info();\n\t}", "@FXML\n public void changeMarksCellEvent(CellEditEvent<UGSubjectMarks, Integer> edittedCell) throws SQLException, ClassNotFoundException{\n UGSubjectMarks markSelected = subjectmarktbl.getSelectionModel().getSelectedItem();\n markSelected.SetSubMark(Integer.parseInt(edittedCell.getNewValue().toString()));\n int newMarks = Integer.parseInt(edittedCell.getNewValue().toString());\n UGSubject.setSubjectMarks(Integer.parseInt(studentID.getText()), sem, markSelected.getSubName(), newMarks);\n \n \n }", "public native CellRecord getEditedRecord(int rowNum, int colNum) /*-{\r\n var self = [email protected]::getOrCreateJsObj()();\r\n var record = self.getEditedRecord(rowNum, colNum);\r\n if (record == null) return null;\r\n return @com.smartgwt.client.widgets.cube.CellRecord::getOrCreateRef(Lcom/google/gwt/core/client/JavaScriptObject;)(record);\r\n }-*/;", "@Test\n public void isDirty_freshObject() {\n AlphaTransaction t = startTransaction();\n IntRef value = new IntRef(0);\n IntRefTranlocal tranlocal = (IntRefTranlocal) t.openForWrite(value);\n assertTrue(tranlocal.isDirty());\n }", "public void onEditTransaction(Transaction transaction) {\n\t}", "protected void updateCaseWithNewStatus(NbaDst caseDst,NbaDst tranDst) throws NbaBaseException { //NBLXA -1983\n \ttry {\n \t\tif (NbaConstants.A_QUEUE_UNDERWRITER_HOLD.equals(caseDst.getQueue())) {\n \t\t\t//Start NBLXA -1983\n \t\t\t/* Reinsurance Responses are bundled unless and until all the responses are received on the case. But if response for additional info is received case route to UW */\n \t\t\tboolean isFinalReplRecieve= true; \n \t\t\tif(((!NbaUtils.isBlankOrNull(tranDst.getNbaLob().hasAdditionalInfo()) && (!tranDst.getNbaLob().getAdditionalInfo()) ) ||\n \t\t\t\t\tNbaUtils.isBlankOrNull(tranDst.getNbaLob().hasAdditionalInfo()))){\n \t\t\t\tsetNbaTxLife(doHoldingInquiry(caseDst));\n \t\t\t\tif(!NbaUtils.isBlankOrNull(getNbaTxLife())){\n \t\t\t\t\tLong appType=getNbaTxLife().getPolicy().getApplicationInfo().getApplicationType();\n \t\t\t\t\tApplicationInfo appInfo = getNbaTxLife().getPolicy().getApplicationInfo();\n \t\t\t\t\tApplicationInfoExtension appInfoExt = NbaUtils.getFirstApplicationInfoExtension(appInfo);\n \t\t\t\t\tif( NbaOliConstants.OLI_ACTTYPE_1000500003 !=appType && NbaOliConstants.OLI_APPTYPE_SIMPLIFIEDISSUE !=appType \n \t\t\t\t\t\t\t&& (!NbaUtils.isBlankOrNull(appInfoExt) && !NbaUtils.isContractChange(getNbaTxLife()) && NbaUtils.isBlankOrNull(appInfoExt.getReopenDate()))){\n \t\t\t\t\t\tNbaDst parentCase = retrieveParentWork(tranDst, true,true);\n \t\t\t\t\t\tList transactions = parentCase.getNbaTransactions();\n \t\t\t\t\t\tNbaTransaction transaction = null; \t\t\n \t\t\t\t\t\tfor (int i = 0; i < transactions.size(); i++) {\n \t\t\t\t\t\t\ttransaction = (NbaTransaction) transactions.get(i);\n \t\t\t\t\t\t\tif (!tranDst.getID().equalsIgnoreCase( transaction.getID()) && NbaConstants.A_WT_REINSURANCE.equals(transaction.getWorkType()) && !transaction.isInEndQueue()) {\n \t\t\t\t\t\t\t\tisFinalReplRecieve =false;\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif(isFinalReplRecieve){\n \t\t\t\t//End NBLXA -1983\n \t\t\t\tupdateCaseStatus(caseDst);\n \t\t\t}\n \t\t\t//NBA208-32\n \t\t\tcaseDst.getCase().getWorkItemChildren().clear(); //clear child transaction\n \t\t\tcaseDst.setUpdate();\n \t\t}\n \t}catch (NbaBaseException e) {\n \t\tif (e.isFatal()) {\n \t\t\tthrow e;\n \t\t}\n \t\tgetLogger().logException(e);\n \t\tthrow new NbaBaseException(\"Unable to retrieve new status for case work item, reason: \" + e.getMessage(), e);\n \t}\n }", "R commit(C change);", "public String getCellid() {\n return cellid;\n }", "public String getCellid() {\n return cellid;\n }", "public void willbeUpdated() {\n\t\t\n\t}", "public void stateChanged(ChangeEvent e) {\n }" ]
[ "0.59451824", "0.5618135", "0.5451526", "0.5433061", "0.5431796", "0.54150623", "0.53984064", "0.5367134", "0.52899486", "0.523861", "0.5230157", "0.5217632", "0.52032053", "0.51949805", "0.519186", "0.5189909", "0.5182019", "0.5176364", "0.5144113", "0.51081574", "0.51062155", "0.50953823", "0.50944805", "0.5057024", "0.5049687", "0.50439805", "0.50439805", "0.50417745", "0.502732", "0.49989447", "0.49975684", "0.49919346", "0.49830884", "0.4975045", "0.49747354", "0.4972741", "0.49578685", "0.49549484", "0.49524257", "0.49514964", "0.49471122", "0.49385458", "0.49307385", "0.49307385", "0.49252173", "0.49243873", "0.4915735", "0.49037397", "0.4891673", "0.4888402", "0.48850673", "0.48743343", "0.48742318", "0.48741573", "0.4869571", "0.4867198", "0.4866739", "0.48603478", "0.484789", "0.4838406", "0.48328173", "0.48327208", "0.48322022", "0.48316714", "0.48273388", "0.4825359", "0.48209742", "0.48178408", "0.48178408", "0.48022756", "0.48021954", "0.48005778", "0.47822163", "0.478142", "0.477729", "0.4775268", "0.47743854", "0.4769961", "0.4762175", "0.47580054", "0.47562706", "0.4754717", "0.475006", "0.4744265", "0.47419202", "0.47412786", "0.47411075", "0.47408158", "0.47297564", "0.47297356", "0.4726536", "0.47265193", "0.47250164", "0.47199544", "0.47165555", "0.47165555", "0.47133648", "0.47120944" ]
0.7013319
1
Default constructor does nothing.
public LoansInfoPolitics() { super(new BorderLayout()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "defaultConstructor(){}", "void DefaultConstructor(){}", "private Default()\n {}", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "private Instantiation(){}", "public Basic() {}", "public Constructor(){\n\t\t\n\t}", "public Generic(){\n\t\tthis(null);\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "O() { super(null); }", "public None()\n {\n \n }", "private SingleObject()\r\n {\r\n }", "public Parser()\n {\n //nothing to do\n }", "public AllDifferent()\n {\n this(0);\n }", "private SingleObject(){}", "public no() {}", "public Method() {\n }", "public lo() {}", "public GTFTranslator()\r\n {\r\n // do nothing - no variables to instantiate\r\n }", "private Node() {\n\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public Orbiter() {\n }", "public Node() {\n\t}", "public Node() {\r\n\t}", "public Node() {\r\n\t}", "public CyanSus() {\n\n }", "public Person()\n {\n //intentionally left empty\n }", "public Chick() {\n\t}", "@SuppressWarnings(\"unused\")\n public Item() {\n }", "public D() {}", "public Node() {\n }", "public SgaexpedbultoImpl()\n {\n }", "public Model() {\n\t}", "public Model() {\n\t}", "public CSSTidier() {\n\t}", "public Data() {}", "@Test\n public void constructorDefault() {\n final CourseType courseType = new CourseType();\n\n assertNull(courseType.getId());\n assertNull(courseType.getName());\n assertNull(courseType.getPicture());\n assertNull(courseType.getPosition());\n assertNull(courseType.getStatus());\n assertNull(courseType.getCourses());\n assertNull(courseType.getAllowedDishes());\n }", "public Curso() {\r\n }", "public TennisCoach () {\n\t\tSystem.out.println(\">> inside default constructor.\");\n\t}", "public God() {}", "public SpeakerSerivceImpl() {\n\t\tSystem.out.println(\"No args in constructor\");\n\t}", "public Pitonyak_09_02() {\r\n }", "private Rekenhulp()\n\t{\n\t}", "public BasicLineParser() {\n/* 99 */ this(null);\n/* */ }", "public Parser()\n{\n //nothing to do\n}", "public Demo() {\n\t\t\n\t}", "public Person() {}", "public Student()\r\n {\r\n //This is intended to be empty\r\n }", "public Member() {}", "private Model(){}", "public Instance() {\n }", "public Person() {\n\t\t\n\t}", "public Pasien() {\r\n }", "private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "public Clade() {}", "public Demo3() {}", "public Counter()\n {\n this(0);\n }", "public Aanbieder() {\r\n\t\t}", "public Pleasure() {\r\n\t\t}", "private Converter()\n\t{\n\t\tsuper();\n\t}", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "public Stat()\n {\n // empty constructor\n }", "public Ruby() {}", "public PSRelation()\n {\n }", "public Lanceur() {\n\t}", "private Sequence() {\n this(\"<Sequence>\", null, null);\n }", "public Node() {}", "public Node() {}", "public Node() {}", "public Node() {}", "public Connection() {\n\t\t\n\t}", "public TeeWriter() {\r\n ; // nothing to do\r\n }", "public Soil()\n\t{\n\n\t}", "private WebXmlIo()\n {\n // Voluntarily empty constructor as utility classes should not have a public or default\n // constructor\n }", "protected SAXParser() {\n // Does nothing.\n }", "Reproducible newInstance();", "public Anschrift() {\r\n }", "DefaultConstructor(int a){}", "public Test() {\n }", "public Member() {\r\n\t}", "public Data() {\n }", "public Data() {\n }", "private UI()\n {\n this(null, null);\n }", "protected SimpleMatrix() {}", "private MApi() {}", "public Mitarbeit() {\r\n }", "public Car() {\r\n this(\"\", \"\", \"\", 0, Category.EMPTY, 0.00, \"\", 0, \"\", 0.00, \"\", DriveTrain.EMPTY,\r\n Aspiration.EMPTY, 0.00, 0.00, 0.00, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n }", "public Cache() {\n this(null);\n }", "public User() {\r\n this(\"\", \"\");\r\n }", "public TTau() {}", "public TV() {\r\n\t}", "public Book() {\n\t\t// Default constructor\n\t}", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "public Dog() {\n // Default constructor\n }", "private TMCourse() {\n\t}", "public Node(){}", "public Mueble() {\n }", "@SuppressWarnings(\"unused\")\r\n private Rental() {\r\n }" ]
[ "0.84495765", "0.81525123", "0.81511194", "0.78258723", "0.75096065", "0.74775475", "0.7421495", "0.7364523", "0.7351661", "0.73146206", "0.72444093", "0.72125804", "0.71801627", "0.7152324", "0.7106019", "0.7097337", "0.70769495", "0.7058723", "0.7039895", "0.70390165", "0.7026287", "0.70123523", "0.70120984", "0.7007036", "0.70020026", "0.6987142", "0.6987142", "0.6969442", "0.69547063", "0.6953651", "0.6952059", "0.69504863", "0.6948102", "0.69324714", "0.6928907", "0.6928907", "0.69265366", "0.69238997", "0.6922084", "0.69190866", "0.69160926", "0.69160557", "0.6912246", "0.6909615", "0.68903226", "0.6889559", "0.6886904", "0.68867517", "0.6882576", "0.68775684", "0.6871303", "0.6870441", "0.6869857", "0.6864247", "0.68585384", "0.6857588", "0.68556213", "0.68541783", "0.68447566", "0.68217474", "0.68172675", "0.6815912", "0.68155605", "0.6803608", "0.68012017", "0.6800253", "0.67976093", "0.6795213", "0.6792433", "0.67867553", "0.67867553", "0.67867553", "0.67867553", "0.6785522", "0.678344", "0.67814183", "0.67792356", "0.6773628", "0.67689914", "0.6764762", "0.67643505", "0.6762791", "0.6762655", "0.67623407", "0.67623407", "0.6760944", "0.67599607", "0.6759069", "0.67577696", "0.67576885", "0.6756347", "0.6754764", "0.6754187", "0.67522186", "0.6751723", "0.6748852", "0.67474234", "0.67473024", "0.67447984", "0.67375237", "0.67355067" ]
0.0
-1
Returns the Short Label
@Override public String getShortLabel() { return label; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getLabel();", "public java.lang.String getLabel();", "String getLabel();", "String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel();", "public String getLabel() {\n return name().toLowerCase().replace(\"_\", \"\");\n }", "public String getExperimentShortLabel();", "public String getLabel() {\r\n\t\tif (label != null)\r\n\t\t\treturn label;\r\n\t\tif (classSimpleName==null)\r\n\t\t\treturn null;\r\n\t\treturn classSimpleName.replace('.', '_');\r\n\t}", "public String getLabel() { //gets the label\n\n\t\treturn rawLabel;\n\t}", "public String getLabel() {\n return _label == null ? name() : _label;\n }", "public String getLabel()\n {\n return label;\n }", "public String getLabel()\n { \n return label;\n }", "public String getLabel() {\r\n return lbl;\r\n }", "public String getShort() { \n\t\treturn getShortElement().getValue();\n\t}", "public String getLabel()\r\n {\r\n return label;\r\n }", "public String getLabel()\r\n {\r\n return label;\r\n }", "public String getLabel(){\n\t\treturn label;\n\t}", "public String getLabel(){\n return label;\n }", "Label getLabel();", "Label getLabel();", "Label getLabel();", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel()\n\t{\n\t\treturn label;\n\t}", "public String getLabel()\n {\n return label;\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n\t\treturn myLabel;\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getLabel()\n {\n return m_label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "public String getLabel() {\n return label;\n }", "static String getShortLabel(IJavaElement element) {\n return JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT | JavaElementLabels.ALL_POST_QUALIFIED | JavaElementLabels.P_COMPRESSED);\n }", "String getLabel() {\n return label;\n }", "public String getLabel() {\r\n return label;\r\n }", "public String getLabel() {\n\t\treturn label;\n\t}", "public com.commercetools.api.models.common.LocalizedString getLabel() {\n return this.label;\n }", "@Nullable\n public CharSequence getLabel() {\n return mPrimaryLabel;\n }", "public final String getLabel() {\n\t\treturn _label;\n\t}", "public String getLabel() {\n return label == null ? StringUtils.EMPTY : label;\n }", "public String getLabelText();", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "public String getLabel() {\n return this.label;\n }", "private String getLabel() {\n return this.label;\n }", "public String getShortName() { return shortName; }", "public String getShortName()\r\n\t{\r\n\t\treturn shortName;\r\n\t}", "public String getLabel() {\n\t\treturn this._label;\n\t}", "String getShortName();", "public String getLabel() {\n return this.label;\n }", "public java.lang.String getLabel() {\n\t\treturn this.label;\n\t}", "public String getLabel() {\n return getElement().getChildren()\n .filter(child -> child.getTag().equals(\"label\")).findFirst()\n .get().getText();\n }", "public String getShort() {\n return m_short;\n }", "public String label() {\n\t\treturn \"LABEL_\" + (labelCount++);\n\t}", "public abstract String getLabel();", "public String getLabel(){\n\t\treturn sAnzeige;\n\t}", "String nameLabel();", "public L getLabel() {\n\t\tcheckRep();\n\t\treturn this.label;\n\t}", "public int getLabel() {\n\t\treturn label;\n\t}", "public T2 getLabel() {\r\n\t\treturn label;\r\n\t}", "public String getShortName() {\n return shortName;\n }", "public String getShortName() {\n return shortName;\n }", "public String getShortName() {\n return shortName;\n }", "final public String getShortDesc()\n {\n return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));\n }", "public String label() {\n return this.label;\n }", "public Object getLabel() \n {\n return label;\n }", "public Label getLabel() {\n\t\treturn label;\n\t}", "public Label getLabel() {\n\t\treturn label;\n\t}", "@Override\n public String getLabel() {\n return label;\n }", "public String getShortName() {\n\t\treturn SHORT_NAME;\n\t}", "@Nullable\n public final CharSequence getLabel1() {\n return mLabel1;\n }", "public final String getShortname() {\n\t\treturn JsUtils.getNativePropertyString(this, \"shortname\");\n\t}", "public String getShortName() {\n/* 118 */ return this.shortname;\n/* */ }", "com.google.ads.googleads.v6.resources.Label getLabel();", "public String getLabel() {\r\n return layout.label;\r\n }", "public String getShortContent();", "public double getLabel() {\n\t\treturn label;\n\t}", "public abstract String getShortName();", "public abstract String getShortName();", "public abstract String getShortName();", "public String getShortTitle() {\n\t\tString t = doc.get(\"shorttitle\");\n\n\t\tif (t == null) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\treturn t;\n\t\t}\n\t}", "public Label getLabel() {\n\t\treturn this.label;\n\t}", "public Label getLabel() {\n return this.label;\n }", "public String getShortName() {\n\n\t\treturn shortName;\n\t}", "@Override\n\t\t\tpublic String getLabel() {\n\t\t\t\treturn null;\n\t\t\t}", "@Nullable String getShortName();", "public String getShortCode() {\n return (String) getAttributeInternal(SHORTCODE);\n }", "public String getLabel() {\n return TrackerRes.getString(\"ModelFunctionPanel.Label\"); //$NON-NLS-1$\n }", "public String displayShort(){\n return \"\\tId: \" + id + \"\\n\" +\n \"\\tName: \" + name + \"\\n\" +\n \"\\tDescription: \" + description + \"\\n\";\n }", "@DerivedProperty\n\tString getShortRepresentation();" ]
[ "0.78969336", "0.7871197", "0.78600055", "0.78600055", "0.7724171", "0.7724171", "0.7724171", "0.7724171", "0.76259804", "0.76039714", "0.74660647", "0.7418911", "0.7411434", "0.74063694", "0.7404107", "0.74017346", "0.73835737", "0.7375636", "0.7375636", "0.7373839", "0.73612005", "0.7354981", "0.7354981", "0.7354981", "0.7345546", "0.7340653", "0.73358697", "0.7323071", "0.7315911", "0.7315911", "0.7315911", "0.7308339", "0.7304496", "0.7287632", "0.7287632", "0.7287632", "0.7287632", "0.7284913", "0.72804093", "0.72804093", "0.72804093", "0.7269101", "0.7260951", "0.7259056", "0.72522295", "0.72419024", "0.7210555", "0.7210275", "0.72007227", "0.71977", "0.7196781", "0.7196781", "0.7196781", "0.7196781", "0.7178962", "0.71680343", "0.71518254", "0.7140776", "0.71405333", "0.7136361", "0.71360475", "0.71267855", "0.71230036", "0.7109203", "0.7104662", "0.7089915", "0.7089205", "0.70763826", "0.70736283", "0.7072461", "0.7066137", "0.7066137", "0.7066137", "0.7058793", "0.7052764", "0.70431656", "0.70178676", "0.70178676", "0.70158", "0.7002594", "0.69965667", "0.6989103", "0.69804937", "0.6958426", "0.6955599", "0.695019", "0.69150597", "0.6913575", "0.6913575", "0.6913575", "0.6913002", "0.6906942", "0.6882891", "0.6877946", "0.6867284", "0.68184185", "0.6817264", "0.6811435", "0.68108773", "0.6777436" ]
0.84020495
0
Creates a new instance of Loans Log called during simulation
@Override public void initialise(Simulation sim) { this.sim = sim; this.en = (Environment)sim.environment; this.add(new JScrollPane(new JList(data))); setBackground(Color.LIGHT_GRAY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MyLogs() {\n }", "@Override\n\tpublic CreditrepayplanLog getLogInstance() {\n\t\treturn new CreditrepayplanLog();\n\t}", "public LogX() {\n\n }", "public LogEntry generateLogEntry() {\n long time = getTime();\n int bloodGlucose = getBloodGlucose();\n double bolus = getBolus();\n int carbohydrate = getCarbohydrate();\n return new LogEntry(time, bloodGlucose, bolus, carbohydrate);\n }", "public Logger(int loglv) {\r\n LOGLV = loglv;\r\n }", "private Log() {\r\n\t}", "public static Log instantiate(List<XmlDoc.Element> les) throws Throwable {\n if (les != null && !les.isEmpty()) {\n return new Log(les);\n } else {\n return new Log();\n }\n }", "private Log() {\n }", "public TOpLogs() {\n this(DSL.name(\"t_op_logs\"), null);\n }", "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "public Log() { //Null constructor is adequate as all values start at zero\n\t}", "public SensorLog() {\n }", "private static Log getLog() {\n if (log == null) {\n log = new SystemStreamLog();\n }\n\n return log;\n }", "abstract void initiateLog();", "public Loan() {\n this(2.5, 1, 1000);\n }", "private TypicalLogEntries() {}", "public Log(Logger logger) {\n this.logger = logger;\n }", "public Log()\n {\n filePath = String.format(\"log-%d.sl\", System.currentTimeMillis());\n\n open();\n }", "public static TournamentLogger createDummyLogger(){\n\t\tTournamentLogger logger = new TournamentLogger();\n\t\tlogger.setEventLogPath(null);\n\t\tlogger.setPrintStdOut(false);\n\t\tlogger.setPrintStdErr(false);\n\t\treturn logger;\n\t}", "private Log()\n {\n //Hides implicit constructor.\n }", "private TicketLog createLog() throws SQLException {\n\t\t\t\t\treturn new TicketLog(rs.getLong(1), rs.getString(2),\n\t\t\t\t\t\t\trs.getLong(3),\n\t\t\t\t\t\t\tTicketLog.Action.valueOf(rs.getString(4)),\n\t\t\t\t\t\t\trs.getInt(5));\n\t\t\t\t}", "protected abstract Logger newInstance(String name);", "public CommandNew(LogsPanel logsWindow) {\n super(logsWindow);\n }", "public LogEvent newInstance()\n {\n return new LogEvent();\n }", "public SystemLog () {\r\n\t\tsuper();\r\n\t}", "void log(Log log);", "public Auditor () {\n\n\t\t// Create a new log file without deleting existing logs. Use the current time. \n\t\ttry {\n\t\t\tlog = new File( \"log: \" + Double.toString( new Date().getTime()) + \".txt\" );\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public DNSLog() {}", "public LALParser() {\n logins = new ArrayList<>();\n }", "public Logs() {\n initComponents();\n }", "@Override\r\n\tpublic ItemLog createItemLog() {\n\t\treturn new HpLog();\r\n\t}", "Object createLogger(String name);", "public abstract void logLap(int currentLap);", "public ETLLogDAOImpl() {\r\n this(new Configuration());\r\n }", "public LogBook() {\n logs = new UniqueLogList();\n exercises = new UniqueExerciseList();\n }", "public TActLogsExample() {\n oredCriteria = new ArrayList<Criteria>();\n offset = 0;\n limit = Integer.MAX_VALUE;\n }", "public void createLog(double initialFitness, double mst) {\n createLog(initialFitness, mst, null, null);\n }", "public JmxLogLevel() {\n this(RunTimeSingleton.instance());\n log.error(\"Wrong constructor\");\n }", "public Loan(){\n\t\tthis(\"\", 0, 0, 0, 0);\n\t\tstart_date = null;\n\t}", "void createincomingLobs()\n {\n iIncomingLobs.setLoadDetails(createloadDetails(\"loadDetails\"));\n iIncomingLobs.setLoad(0,createload(\"load\"));\n iIncomingLobs.setTotal(createtotal(\"total\"));\n }", "public TOpLogs(Name alias) {\n this(alias, T_OP_LOGS);\n }", "public Lightning() {\n super(\"Death Lightning\", 2);\n }", "public Logger (){}", "private Logger() {\n\n }", "LogAction createLogAction();", "void newLoans(List<Loan> loans);", "private void initLog() {\n _logsList = (ListView) findViewById(R.id.lv_log);\n setupLogger();\n }", "private Logistic() {\n }", "public MyLogger () {}", "public LossyTCLogger(TCLogger logger, long logInterval) {\n this(logger, logInterval, LossyTCLoggerType.TIME_BASED);\n }", "@Override\n public Logger getLog(Class clazz) {\n return new Slf4jLogger(LoggerFactory.getLogger(clazz));\n }", "public JmxLogLevel(RunTimeSingleton glob) {\n this.glob = glob;\n log.debug(\"Constructor created\");\n }", "private Logger(){\n\n }", "public LogEntry () {\n }", "@Override\n\tpublic LightTank create() {\n\t\treturn new LightTank(GameContext.getGameContext());\n\t}", "public static TimeTakenLogEntry create() {\n return builder().build();\n }", "public Log(String name) {\n this.name = name;\n this.entries = new ArrayList<>();\n }", "public Log newInstance(String str) {\n Log log;\n try {\n if (this.logConstructor == null) {\n log = discoverLogImplementation(str);\n } else {\n log = (Log) this.logConstructor.newInstance(new Object[]{str});\n }\n if (this.logMethod != null) {\n this.logMethod.invoke(log, new Object[]{this});\n }\n return log;\n } catch (LogConfigurationException e) {\n throw e;\n } catch (InvocationTargetException e2) {\n Throwable targetException = e2.getTargetException();\n if (targetException != null) {\n throw new LogConfigurationException(targetException);\n }\n throw new LogConfigurationException((Throwable) e2);\n } catch (Throwable th) {\n throw new LogConfigurationException(th);\n }\n }", "private LoggerSingleton() {\n\n }", "private LogService()\n {\n logWriter = new CleanSweepLogWriterImpl();\n\n Calendar date = Calendar.getInstance();\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH)+1;\n int day = date.get(Calendar.DAY_OF_MONTH);\n\n todaysDate=\"\";\n if(day<10) {\n todaysDate += year + \"\" + month + \"0\" + day;\n }\n else\n {\n todaysDate += year + \"\" + month + \"\" + day;\n }\n\n }", "public lo() {}", "public static Log getInstance() {\r\n if (firstInstance == null) {\r\n firstInstance = new Log();\r\n }\r\n return firstInstance;\r\n }", "private Logger(){ }", "public LimeLight() {\n m_tableName = \"limelight\";\n m_table = NetworkTableInstance.getDefault().getTable(m_tableName);\n _hearBeat.startPeriodic(_hearBeatPeriod);\n }", "public LossyTCLogger(TCLogger logger, long logInterval, LossyTCLoggerType type) {\n this(logger, logInterval, type, false);\n }", "LogRecorder getLogRecorder();", "LogRecorder getLogRecorder();", "public static Log getLoggerBase() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLogBase();\r\n }\r\n return l;\r\n }", "private static Logger createLogger(String className) {\n\n /*\n * No need to set level values explicitly. This is managed in the\n * standard way by java.util.logging.LogManager.\n */\n Logger logger = Logger.getLogger(className);\n\n /*\n * We've debated permitting the logger to use parental handlers, which\n * would permit using the standard java.util.logging policy of setting\n * tbe property com.sleepycat.je.handlers as a way of customizing\n * handlers. This was not useful because of the need to specify\n * handlers per environment, and also caused a process monitor echo\n * issue within NoSQL DB.\n */\n logger.setUseParentHandlers(false);\n\n return logger;\n }", "public LogContract(){}", "public SystemLog (\r\n\t\t Long in_logId\r\n ) {\r\n\t\tthis.setLogId(in_logId);\r\n }", "public MLPAgent(StateObservation stateObs, ElapsedCpuTimer elapsedTimer) {\n\n }", "public LogAnalyzer()\n { \n // Create the array object to hold the hourly\n // access counts.\n hourCounts = new int[24];\n // Create the reader to obtain the data.\n reader = new LogfileReader();\n }", "public Logger() {\n map = new LinkedHashMap<>();\n }", "public LogNormalDistribution(){\n\t\tthis(0, 1);\n\t}", "public TOpLogs(String alias) {\n this(DSL.name(alias), T_OP_LOGS);\n }", "public LossyTCLogger(TCLogger logger, long logInterval, LossyTCLoggerType type, boolean lossyLogOnlyIfSameContent) {\n Assert.eval(logInterval > 0);\n this.logger = logger;\n if (type == LossyTCLoggerType.TIME_BASED) {\n this.decider = new TimeBasedDecider(logInterval, lossyLogOnlyIfSameContent);\n } else {\n this.decider = new CountBasedDecider(logInterval, lossyLogOnlyIfSameContent);\n }\n this.lossyInfo = \" [lossy interval: \" + logInterval + (type == LossyTCLoggerType.TIME_BASED ? \"ms]\" : \"]\");\n this.logCount = 0;\n }", "public LogKitLogger(String name)\n/* */ {\n/* 64 */ this.name = name;\n/* 65 */ this.logger = getLogger();\n/* */ }", "public WekaLogitLearner() { super(new Logistic2()); }", "public static ADFLogger createLogger(Class className) {\r\n return ADFLogger.createADFLogger(className);\r\n }", "public Catelog() {\n super();\n }", "private ExtentLogger() {}", "private static LogUtil getInstance() {\r\n if (instance == null) {\r\n final LogUtil l = new LogUtil();\r\n l.init();\r\n if (isShutdown) {\r\n // should not be possible :\r\n if (l.log.isErrorEnabled()) {\r\n l.log.error(\"LogUtil.getInstance : shutdown detected : \", new Throwable());\r\n }\r\n return l;\r\n }\r\n instance = l;\r\n\r\n if (instance.logBase.isInfoEnabled()) {\r\n instance.logBase.info(\"LogUtil.getInstance : new singleton : \" + instance);\r\n }\r\n }\r\n\r\n return instance;\r\n }", "@Override\n public LoggerBackend create(String loggingClassName) {\n Logger logger = (Logger) LogManager.getLogger(loggingClassName.replace('$', '.'));\n return new Log4j2LoggerBackend(logger);\n }", "protected static Logger log() {\n return LogSingleton.INSTANCE.value;\n }", "public static ARXLogisticRegressionConfiguration create() {\n return new ARXLogisticRegressionConfiguration();\n }", "public EqpmentLogExample() {\n oredCriteria = new ArrayList();\n }", "public Relayer(RELAY2 relay, Log log) {\n this.relay=relay;\n this.stats=relay.statsEnabled();\n this.log=log;\n }", "@Override\n public void setLogTracer(LogTracer log) {\n\n }", "public interface ILog {\n /**\n * 打印日志\n * @param L 虚拟机地址,可通过 {@link org.luaj.vm2.Globals#getGlobalsByLState(long)}获取\n */\n void l(long L, String tag, String log);\n\n /**\n * 打印错误日志\n * @param L 虚拟机地址,可通过 {@link org.luaj.vm2.Globals#getGlobalsByLState(long)}获取\n */\n void e(long L, String tag, String log);\n}", "public RevisorLogger getLogger();", "public void setLOG(Logger newLog)\r\n\t{\r\n\t\tlog = newLog;\r\n\t}", "public LOAN() {\n initComponents();\n }", "public static void log(LoanResponse loanResponse) {\n }", "public Trace() {\n\t}", "private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }", "public File newLogFile() {\n File flog = null;\n try {\n this.logFileName = getTimestamp() + \".xml\";\n this.pathToLogFile = logFileFolder + logFileName;\n URL logURL = new URL(this.pathToLogFile);\n flog = new File(logURL.toURI());\n if (!flog.exists()) {\n flog.createNewFile();\n }\n } catch (Exception ex) {\n log.error(\"newLogFile :\"+ ex.getMessage());\n } finally{\n this.fLogFile = flog;\n return flog;\n }\n }", "@Override\r\n\tpublic Log getLog() {\n\t\treturn log;\r\n\t}", "public ManagedProductosDivisionLotes() {\n this.LOGGER = LogManager.getRootLogger();\n }", "public static Log get(Class<? extends Object> clazz) {\n return new Log(clazz);\n }", "Lobs initLobs(Lobs iLobs)\n {\n iLobs.updateElementValue(\"Lobs\");\n return iLobs;\n }" ]
[ "0.63554406", "0.633445", "0.6159419", "0.6133346", "0.6083166", "0.6066735", "0.59849423", "0.59683836", "0.5942043", "0.58809924", "0.5842549", "0.5819151", "0.5807998", "0.5763665", "0.57351273", "0.5720036", "0.567826", "0.5670431", "0.5643496", "0.5605676", "0.5598119", "0.5591572", "0.5555873", "0.55356336", "0.55078495", "0.5502662", "0.5486235", "0.54761225", "0.546982", "0.5451908", "0.54498863", "0.544226", "0.5441896", "0.5431174", "0.541289", "0.5406324", "0.5383659", "0.53710365", "0.5370636", "0.5357209", "0.53553396", "0.5340638", "0.53363687", "0.5330345", "0.53226876", "0.5319583", "0.531252", "0.52970654", "0.52906716", "0.5289168", "0.5279409", "0.52730244", "0.5271522", "0.5269567", "0.52643555", "0.52594244", "0.5254303", "0.5245781", "0.5245484", "0.52450395", "0.52372986", "0.52319646", "0.52289265", "0.52284145", "0.5223079", "0.5218696", "0.5218696", "0.5217988", "0.5205953", "0.52040863", "0.51988924", "0.5181848", "0.5179018", "0.5173023", "0.5167724", "0.5150505", "0.5120918", "0.511588", "0.51030374", "0.51026464", "0.51014423", "0.50993866", "0.50883263", "0.50856715", "0.5085302", "0.5084252", "0.5052124", "0.504427", "0.50433964", "0.504117", "0.5039093", "0.50362736", "0.50345665", "0.50339675", "0.5021655", "0.5019996", "0.5004837", "0.5001003", "0.4997358", "0.49832037", "0.4982764" ]
0.0
-1
Marks the beginning of a new cycle
@Override public void execute() { SortedSet<String> active_agent_ids = sim.getactiveParticipantIdSet("group"); Iterator<String> iter = active_agent_ids.iterator(); String name; updateLoanPlayers(active_agent_ids, iter); if (en.getRoundsPassed() == rounds) { data.add( " ==== Cycle " + sim.getTime() + " Begins (" + en.getRoundsPassed() + ':' + en.getCurrentTurnType() + ") ==== "); data.add( "************************************************************************************************************ "); for (Map.Entry<String, PoliticalGroup> entry : p_players.entrySet()) { while (iter.hasNext()) { String id = iter.next(); if (p_players.get(id) != null) { name = p_players.get(id).getDataModel().getName(); data.add( "===============================" + name + "==============================="); data.add( "Group population: " + p_players.get(id).getDataModel().getMemberList().size()); data.add( "Current reserve: " + p_players.get(id).getDataModel().getCurrentReservedFood()); data.add("Greediness: " + PoliticalGroup.getGreediness(p_players.get( id).getDataModel())); data.add("++++++LOAN HISTORY OF THIS GROUP++++++"); //Display debtors / loans given data.add("Debtors History-------------------------------"); Map<String, List<Tuple<Double, Double>>> loansGiven = PoliticalGroup.getLoansGiven(p_players.get( id).getDataModel()); if (loansGiven != null) { Set<String> debtors = loansGiven.keySet(); for (String deb : debtors) { String gname; if (PublicEnvironmentConnection.getInstance().getGroupById(deb) == null) { gname = "A DEAD GROUP"; } else { gname = PublicEnvironmentConnection.getInstance().getGroupById( deb).getName(); } data.add("---->Debtor: " + gname + " has been given: " + loansGiven.get( deb).size() + " loans from this group!"); double amountBorrowed = 0; for (Tuple<Double, Double> t : loansGiven.get(deb)) { amountBorrowed += t.getKey() * (1 + t.getValue()); } data.add( " This debtor has borrowed " + amountBorrowed + " units of food"); } } else { data.add("No loans given at the moment!"); } data.add("Creditors History-------------------------------"); //Display debtors / loans given Map<String, List<Tuple<Double, Double>>> loansTaken = PoliticalGroup.getLoansTaken(p_players.get( id).getDataModel()); if (loansTaken != null) { Set<String> creditors = loansTaken.keySet(); for (String cred : creditors) { String gname; if (PublicEnvironmentConnection.getInstance().getGroupById(cred) == null) { gname = "A DEAD GROUP"; } else { gname = PublicEnvironmentConnection.getInstance().getGroupById( cred).getName(); } data.add("---->Creditor: " + gname + " has given this group: " + loansTaken.get( cred).size() + " loans!"); double amountBorrowed = 0; for (Tuple<Double, Double> t : loansTaken.get(cred)) { amountBorrowed += t.getKey() * (1 + t.getValue()); } data.add( " This group has been given " + amountBorrowed + " units of food from this creditor"); } } else { data.add("No loans taken at the moment!"); } } } data.add(" "); iter = active_agent_ids.iterator(); } rounds++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isFirstCycle() {\n return cycle == 0;\n }", "public void start( )\r\n {\r\n if (cursor != head){\r\n \t cursor = head; // Implemented by student.\r\n \t precursor = null;\r\n }\r\n }", "public void markRunStart(){\r\n runStart = stepCount;\r\n }", "@Override\n public void cycle(long cycle) {\n\n boolean previousState = state();\n\n manageDIV();\n\n incTIMAIfChange(previousState);\n }", "void forceStart(int id, int ticks, boolean repeat);", "public void forceStart() {\r\n\t\tchaseObj = true;\r\n\t}", "protected void onCycle() {\n\n }", "public void beforeFirst() {\n\t\tmoveTo(0);\n\t}", "void setZeroStart();", "public void markContentBegin() {\n this.ris.markContentBegin();\n }", "public void moveToStart() {\r\n\t\tcurr = head;\r\n\t}", "public void goToStart() {\n\t\tsetPosition(0);\n\t}", "void moveToStart();", "public void start(){\n //Set pausing to false\n pausing = false;\n next();\n }", "public void beginNextRound() {\n\t\tsetBeginNextRound(true);\n\t}", "@Override\n public void start() {\n if (size > 0) {\n cursor = head;\n prev = null;\n } else {\n cursor = null; }\n }", "void changeStart(int newStart) {\n if (newStart < 0 || newStart >= endBeat) {\n throw new IllegalArgumentException(\"Invalid startBeat\");\n }\n this.startBeat = newStart;\n }", "public abstract void setNextBlockInstant();", "public void start() {\n\t\tcurrentFrameIndex = 0;\n\t}", "public void setStart(){\n\t\tthis.isStart=true;\n\t}", "public void startAnimation() {\n animationStart = System.currentTimeMillis();\n }", "public void moveStart(\n )\n {\n index = StartIndex;\n if(state == null)\n {\n if(parentLevel == null)\n {state = new GraphicsState(this);}\n else\n {state = parentLevel.state.clone(this);}\n }\n else\n {\n if(parentLevel == null)\n {state.initialize();}\n else\n {parentLevel.state.copyTo(state);}\n }\n\n notifyStart();\n\n refresh();\n }", "public void start(float delta) {\n\t\t\n\t}", "public void start() {\r\n\t\tif (animationFigure instanceof TrainFigure) {\r\n\t\t\t((TrainFigure) animationFigure).setBusyColor(org.eclipse.draw2d.ColorConstants.red);\r\n\t\t}\r\n\t\tcounter = 1;\r\n\t\t//notify Listeners\r\n\t\tanimationFigure.notifyAnimationListener(new AnimationStartedEvent(animationFigure, AnimationStartedEvent.BUSY_STARTED));\r\n\t\tthis.stopped=false;\r\n\t\tmap.getDisplay().asyncExec(this);\r\n\t}", "void start(int id, int ticks, boolean repeat);", "@Override\n public void onStart(boolean fromBeginning)\n {\n if(fromBeginning)\n {\n System.out.println(mLabel + \" Started!\");\n }\n else\n {\n System.out.println(mLabel + \" resumed\");\n }\n }", "public void restart() {\n\t\td1 = 6;\n\t\td2 = 6;\n\t\tthis.rolled = false;\n\t}", "public final void forceStartMoveLoop() {\r\n\t\txOff = 0;\r\n\t\tzOff = 0;\r\n\t\tmoveStart = System.currentTimeMillis();\r\n\t}", "public void beginCall() {\n yielding = false;\n\n currentFrame++;\n if(currentFrame >= frames.length) {\n ensureSize(frames.length * 2);\n frames[currentFrame] = null;\n\n programCounter = -1;\n } else {\n ExecutionFrame frame = getCurrentFrame();\n if(frame == null) {\n programCounter = -1;\n } else {\n programCounter = frame.programCounter;\n }\n }\n }", "public void start() {\n if(mCancelAnim){\n setCancelAnimator(false);\n onEnd();\n return;\n }\n if (count <= 0) {\n setCancelNext(true);\n onEnd();\n return; //end\n }\n //start once now\n /* Logger.d(\"AnimateHelper\",\"start_before_start\",\"count = \" + count +\n \",already started ?=\" + anim.isStarted());*/\n --count;\n anim.start();\n }", "public void startNew(){\n action = true;\n started = false;\n drawCanvas.drawColor(0, PorterDuff.Mode.CLEAR);\n invalidate();\n }", "public int getCycle() {\n return cycle;\n }", "public void advanceSimulation () {\n\t\tstep_++;\n\t}", "public final void start(){\n cpt = 0;\n inProgress = true;\n init();\n UpdateableManager.addToUpdate(this);\n }", "public void start(){\n\t\tthis.lastUpdate = System.currentTimeMillis();\n\t\tthis.millisIntoFrame=0;\n\t\tthis.currentFrame=0;\n\t}", "@Override\n void advance() {\n }", "public void beginGame() {\r\n data.gameState = 3;\r\n data.gameStartFlag = true;\r\n setChanged();\r\n notifyObservers(data);\r\n data.gameStartFlag = false; //Set the gameStart flag to false so the relevant update lines aren't ever run a second time\r\n }", "public void start()\r\n\t{\r\n\t\tcurrentstate = TIMER_START;\r\n\t\tstarttime = Calendar.getInstance();\r\n\t\tamountOfPause = 0;\r\n\t\trunningTime = 0;\r\n\t\tlastRunningTime = 0;\r\n\t\tpassedTicks = 0;\r\n\t}", "public void setStart(int start) {\n this.start=start;\n }", "public void connectCurrentToLoopStart() {\n LoopScope loopScope =\n (LoopScope) lang.getScopeManager().getFirstScopeThat(scope -> scope instanceof LoopScope);\n loopScope.starts().forEach(node -> addMultipleIncomingEOGEdges(this.currentEOG, node));\n }", "public void mark()\n {\n mark = true;\n }", "public void begin(){\n\t\tTransaction block = new Transaction();\n\t\tblock.setPrev(blocks.getLast());\n\t\tblocks.add(block);\n\t}", "public void setIteratorBegin() {\n iter = (next > 0 ? 0 : -1);\n }", "private void rewind() {\n currentPos = markPos;\n }", "public final void yybegin(int newState) {\n\t\tzzLexicalState = newState;\n\t}", "public void start() {\n isStarted = true;\n clearBoard();\n newPiece();\n }", "public void trackStart (int cell, int steps) {\r\n\t\toriginalCell = cell; \r\n\t\tstartTargets(cell, steps);\r\n\t}", "public static void repeatFromTheBeginning()\n {\n if (JSoundsMainWindowViewController.jtbRepeatSongs.isSelected())\n MusicPlayerControl.repeatSongsFromTheBeginning(true);\n else\n MusicPlayerControl.repeatSongsFromTheBeginning(false);\n }", "public void start(){\n\t\tstarted = true;\n\t\tlastTime = System.nanoTime();\n\t}", "public void setStart(int start) {\r\n this.start = start;\r\n }", "private void startOver(){\n result = 0;\n display.setText(\"0\");\n lastCommand = \"=\";\n start = true;\n }", "public void onRepeat() {\n\t\t// TODO Auto-generated method stub\n\t\tLastWholeDelta = 0;\n\t}", "public abstract void nextAnimationStep();", "public void startGame() {\n\t\tif (chordImpl.getPredecessorID().compareTo(chordImpl.getID()) > 0) {\n\t\t\tGUIMessageQueue.getInstance().addMessage(\"I Start!\");\n\t\t\tshoot();\n\t\t}\n\t}", "public void reset() {\n next = 1000;\n }", "public void resetX() {this.startX = 0f;}", "public void start() {\n setClosedLoopControl(true);\n }", "public void mark() {\r\n\t\tmark = cursor;\r\n\t}", "protected final void onCycle(CommandSender sender) {\n setInteracting(sender);\n onCycle();\n }", "public static void chartNext() {\n\t\tchartId = (chartId+(hsPage = 1)) % chary.length;\n\t}", "private void changeNextDay(){\n\t\tplanet.getClimate().nextDay();\n\t}", "private void setNextSuccessor() {\n if (lastBlock != null) // if it is the first block, do nothing\n lastBlock.addSuccessor(currentBlock);\n blocks.add(currentBlock); // Add currentBlock to the global list of blocks\n lastBlock = currentBlock;\n }", "public final void yybegin(int newState) {\r\n zzLexicalState = newState;\r\n }", "public final void yybegin(int newState) {\r\n zzLexicalState = newState;\r\n }", "public final void yybegin(int newState) {\r\n zzLexicalState = newState;\r\n }", "public final void yybegin(int newState) {\r\n zzLexicalState = newState;\r\n }", "public final void yybegin(int newState) {\r\n zzLexicalState = newState;\r\n }", "void setNilSearchRecurrenceStart();", "protected void resetNextAdvanceLineNumber() {\n this.nextAdvanceLineNumber = new Integer(1);\n }", "public void reset() {\n\t\tmCycleFlip = false;\n\t\tmRepeated = 0;\n\t\tmMore = true;\n //mOneMoreTime = true;\n \n\t\t// 추가\n\t\tmStarted = mEnded = false;\n\t\tmCanceled = false;\n }", "void start() \r\n {\r\n while (controller.clock <= controller.totalBurstTime) {\r\n this.clock();\r\n }\r\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }", "public final void yybegin(int newState) {\n zzLexicalState = newState;\n }" ]
[ "0.67895997", "0.6479103", "0.63145953", "0.6204192", "0.6168962", "0.61196345", "0.61170477", "0.6082777", "0.5990207", "0.59738517", "0.596891", "0.59662527", "0.5928955", "0.59075433", "0.5848559", "0.5827462", "0.5807064", "0.5802355", "0.5785135", "0.57816106", "0.57392657", "0.5714323", "0.57135504", "0.57089525", "0.57070655", "0.57046956", "0.5679906", "0.56530684", "0.56525904", "0.5647733", "0.5605273", "0.55933195", "0.5581515", "0.55810523", "0.5573926", "0.55680704", "0.5565281", "0.5537601", "0.5510588", "0.5506692", "0.549933", "0.5499014", "0.5497656", "0.5496686", "0.54965985", "0.5480744", "0.5472113", "0.5471111", "0.5465377", "0.5463094", "0.5462679", "0.5451546", "0.5450911", "0.54396856", "0.5431718", "0.54258204", "0.54216874", "0.5421543", "0.5418196", "0.54164267", "0.54139113", "0.5411101", "0.5406024", "0.5406024", "0.5406024", "0.5406024", "0.5406024", "0.5403594", "0.5395328", "0.5394207", "0.53934675", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115", "0.53903115" ]
0.0
-1
Deals with plugin upon plugin deletion
@Deprecated @Override public void onDelete() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public void callPluginDestroy(Object plugin)\n {\n callSpecialFunc(plugin, \"destroy\");\n }", "@Override\n public synchronized void unload() {\n if (hasPlugin()) {\n try {\n plugin.unload();\n plugin = null;\n } catch (Throwable ex) {\n LOGGER.log(Level.SEVERE, \"Plugin \\\"\" + getName() + \"\\\" has failed while unloading with exception:\", ex);\n }\n }\n }", "public void deletePlugin( final String pluginName )\n {\n Log.debug( \"Deleting plugin '{}'...\", pluginName );\n\n try ( final DirectoryStream<Path> ds = Files.newDirectoryStream( getPluginsDirectory(), new DirectoryStream.Filter<Path>()\n {\n @Override\n public boolean accept( final Path path ) {\n if ( Files.isDirectory( path ) )\n {\n return false;\n }\n\n final String fileName = path.getFileName().toString().toLowerCase();\n return ( fileName.equals( pluginName + \".jar\" ) || fileName.equals( pluginName + \".war\" ) );\n }\n } ) )\n {\n for ( final Path pluginFile : ds )\n {\n try\n {\n Files.delete( pluginFile );\n pluginMonitor.runNow( true ); // trigger unload by running the monitor (which is more thread-safe than calling unloadPlugin directly).\n }\n catch ( IOException ex )\n {\n Log.warn( \"Unable to delete plugin '{}', as the plugin jar/war file cannot be deleted. File path: {}\", pluginName, pluginFile, ex );\n }\n }\n }\n catch ( Throwable e )\n {\n Log.error( \"An unexpected exception occurred while deleting plugin '{}'.\", pluginName, e );\n }\n }", "public void firePluginRemoved()\n\t{\n\t\tfor (PluginListener pl : this.pluginListeners)\n\t\t{\n\t\t\tpl.pluginRemoved(pluginEvent);\n\t\t}\t\n\t}", "void unsetPluginstate();", "public void run() {\n\t\tnew UsageCheckAdapter(EventSourceID.CD_PLUGIN_UNINSTALL);\n\t\t\n\t\tInstallationView view = CodeGeneratorActivator.getDefault().getInstallationView();\n\t\tview.uninstallPlugin();\n\t}", "@Override\n public void shutdown() throws PluginException {\n\n }", "public void delete( int nMediaHandlerId, Plugin plugin )\n {\n DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE, plugin );\n daoUtil.setInt( 1, nMediaHandlerId );\n daoUtil.executeUpdate( );\n daoUtil.free( );\n }", "@Override\n public void onDestroy() {\n mPluginManager = null;\n \n super.onDestroy();\n }", "public void stopPlugin() {\n try {\n ServicesRegisterManager.removeService(Parameters.JAR_REPOSITORY_MANAGER);\n }\n catch (ServiceClosedException sce) {}\n }", "public void destroy(PluginNode node, DMConnection con, ALogger logger) {\n\r\n\t}", "public void destroy(PluginNode node, DMConnection con, ALogger logger) {\n\r\n\t}", "void delete( int nIdFormResponse, Plugin plugin );", "@SuppressWarnings(\"unchecked\")\r\n private boolean unloadPlugin(PluginCommandManager manager, CommandSender player, String pluginName) {\r\n PluginManager pluginManager = Bukkit.getServer().getPluginManager();\r\n Plugin plugin = getPlugin(pluginName);\r\n if (plugin == null) {\r\n manager.sendMessage(player, \"A plugin with the name '\" + pluginName + \"' could not be found.\");\r\n return true;\r\n }\r\n SimplePluginManager simplePluginManager = (SimplePluginManager) pluginManager;\r\n try {\r\n Field pluginsField = simplePluginManager.getClass().getDeclaredField(\"plugins\");\r\n pluginsField.setAccessible(true);\r\n List<Plugin> plugins = (List<Plugin>) pluginsField.get(simplePluginManager);\r\n Field lookupNamesField = simplePluginManager.getClass().getDeclaredField(\"lookupNames\");\r\n lookupNamesField.setAccessible(true);\r\n Map<String, Plugin> lookupNames = (Map<String, Plugin>) lookupNamesField.get(simplePluginManager);\r\n Field commandMapField = simplePluginManager.getClass().getDeclaredField(\"commandMap\");\r\n commandMapField.setAccessible(true);\r\n SimpleCommandMap commandMap = (SimpleCommandMap) commandMapField.get(simplePluginManager);\r\n Field knownCommandsField;\r\n Map<String, Command> knownCommands = null;\r\n if (commandMap != null) {\r\n knownCommandsField = commandMap.getClass().getDeclaredField(\"knownCommands\");\r\n knownCommandsField.setAccessible(true);\r\n knownCommands = (Map<String, Command>) knownCommandsField.get(commandMap);\r\n }\r\n pluginManager.disablePlugin(plugin);\r\n if (plugins != null && plugins.contains(plugin)) {\r\n plugins.remove(plugin);\r\n }\r\n if (lookupNames != null && lookupNames.containsKey(pluginName)) {\r\n lookupNames.remove(pluginName);\r\n }\r\n if (commandMap != null && knownCommands != null) {\r\n for (Iterator<Map.Entry<String, Command>> it = knownCommands.entrySet().iterator(); it.hasNext();) {\r\n Map.Entry<String, Command> entry = it.next();\r\n if (entry.getValue() instanceof PluginCommand) {\r\n PluginCommand command = (PluginCommand) entry.getValue();\r\n if (command.getPlugin() == plugin) {\r\n command.unregister(commandMap);\r\n it.remove();\r\n }\r\n }\r\n }\r\n }\r\n } catch (NoSuchFieldException ex) {\r\n manager.sendMessage(player, \"Failed to query plugin manager, could not unload plugin.\");\r\n return true;\r\n } catch (SecurityException ex) {\r\n manager.sendMessage(player, \"Failed to query plugin manager, could not unload plugin.\");\r\n return true;\r\n } catch (IllegalArgumentException ex) {\r\n manager.sendMessage(player, \"Failed to query plugin manager, could not unload plugin.\");\r\n return true;\r\n } catch (IllegalAccessException ex) {\r\n manager.sendMessage(player, \"Failed to query plugin manager, could not unload plugin.\");\r\n return true;\r\n }\r\n \r\n manager.sendMessage(player, \"The plugin '\" + pluginName + \"' was successfully unloaded.\");\r\n m_plugin.cachePluginDetails();\r\n return true;\r\n }", "public void pluginComponentRemoved(PluginComponentEvent event)\n {\n PluginComponentFactory factory = event.getPluginComponentFactory();\n\n if (factory.getContainer().equals(Container.CONTAINER_CHAT_WINDOW)\n || factory.getContainer().equals(\n Container.CONTAINER_CHAT_STATUS_BAR))\n {\n Object borderLayoutConstraint = UIServiceImpl\n .getBorderLayoutConstraintsFromContainer(\n factory.getConstraints());\n\n this.removePluginComponent(\n (Component)factory.getPluginComponentInstance(\n ChatWindow.this).getComponent(),\n factory.getContainer(),\n borderLayoutConstraint);\n\n this.pack();\n }\n }", "@Override\n public void stop(BundleContext context) throws Exception {\n super.stop(context);\n plugin = null;\n }", "@Override\r\n public void delete( int nComponentId, Plugin plugin )\r\n {\r\n DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_APPLICATION, plugin );\r\n daoUtil.setInt( 1, nComponentId );\r\n daoUtil.executeUpdate( );\r\n daoUtil.free( );\r\n\r\n daoUtil = new DAOUtil( SQL_QUERY_DELETE, plugin );\r\n daoUtil.setInt( 1, nComponentId );\r\n daoUtil.executeUpdate( );\r\n daoUtil.free( );\r\n }", "public void cleanup() {\n\t\t\t// force Cordova to discard the callbacks by making\n\t\t\t// NO_RESULT calls without setting keepCallback\n\t\t\tPluginResult result = new PluginResult(Status.NO_RESULT);\n\t\t\tif (connectionLostCallback != null) {\n\t\t\t\tconnectionLostCallback.sendPluginResult(result);\n\t\t\t\tconnectionLostCallback = null;\n\t\t\t}\n\t\t\tif (messageArrivedCallback != null) {\n\t\t\t\tmessageArrivedCallback.sendPluginResult(result);\n\t\t\t\tmessageArrivedCallback = null;\n\t\t\t}\n\t\t\tif (deliveryCompleteCallback != null) {\n\t\t\t\tdeliveryCompleteCallback.sendPluginResult(result);\n\t\t\t\tdeliveryCompleteCallback = null;\n\t\t\t}\n\t\t}", "private void showDeleteSuccess() {\n Notification notification = Notification.show(\"Your Advert Has Been Deleted \");\n notification.addThemeVariants(NotificationVariant.LUMO_ERROR);\n UI.getCurrent().getPage().reload();\n }", "@Override\n public void deleted(String pid) {\n ServiceRegistration oldRegistration = registrations.remove(pid);\n if (bundleContext != null) {\n Connect connect = (Connect) bundleContext.getService(oldRegistration.getReference());\n try {\n connect.close();\n } catch (LibvirtException e) {\n LOG.error(\"Error closing libvirt connection\", e);\n }\n }\n if (oldRegistration != null) {\n oldRegistration.unregister();\n }\n }", "public void onUninstalled() {\n }", "@Override\n\tpublic boolean removePluginChunkTicket(Plugin plugin)\n\t{\n\t\tthrow new UnimplementedOperationException();\n\t}", "void firePluginDestroyedEvent( String name, Plugin plugin )\n {\n for ( final PluginListener listener : pluginListeners )\n {\n try\n {\n listener.pluginDestroyed( name, plugin );\n }\n catch ( Exception ex )\n {\n Log.warn( \"An exception was thrown when one of the pluginManagerListeners was notified of a 'destroyed' event for plugin '{}'!\", name, ex );\n }\n }\n }", "public void resetPlugin(){\n\t\tpriorj.getTechniques().clear();\n\t}", "public static void deletePluginData(ATPluginData pluginData) throws Exception {\n try {\n DomainAccessObject access =\n DomainAccessObjectFactory.getInstance().getDomainAccessObject(ATPluginData.class);\n access.getLongSession();\n access.deleteLongSession(pluginData);\n } catch(Exception e) {\n e.printStackTrace();\n throw new Exception(\"Error Deleting Plugin Data to Database ...\");\n }\n }", "@OnClick(R.id.cancelButton)\n public void deleteUpload() {\n callback.deleteUpload(contribution);\n }", "public boolean unHookPlugin(String id) {\n\t\tsynchronized(this.hookedPlugins) {\n\t\t\tif (id == null || !this.hookedPlugins.containsKey(id))\n\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\tPluginLogListener listener = this.hookedPlugins.get(id);\n\t\t\tlistener.dispose(); \n\t\t\tthis.hookedPlugins.remove(id);\n\t\t}\t\t\n\t\treturn true;\n\t}", "public void delete() {\n\t\tcmd = new DeleteCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "private void delete() {\n\n\t}", "public void onDelete() {\n if (DEBUG) Log.e(Thread.currentThread().getStackTrace()[2].getClassName(), Thread.currentThread().getStackTrace()[2].getMethodName());\n showDialog(R.id.dialog_confirm_delete);\n }", "@Override\n\tpublic void doDelete() {\n\t\tLOG.info(\"deleting agent\");\n\t\tsuper.doDelete();\n\t}", "private void delete() {\n\t\tComponents.questionDialog().message(\"Are you sure?\").callback(answeredYes -> {\n\n\t\t\t// if confirmed, delete the current product PropertyBox\n\t\t\tdatastore.delete(TARGET, viewForm.getValue());\n\t\t\t// Notify the user\n\t\t\tNotification.show(\"Product deleted\", Type.TRAY_NOTIFICATION);\n\n\t\t\t// navigate back\n\t\t\tViewNavigator.require().navigateBack();\n\n\t\t}).open();\n\t}", "@Override\n\tpublic void stop(BundleContext context) throws Exception {\n\t\tm_plugin = null;\n\t\tsuper.stop(context);\n\t}", "@Override\r\n public void onCleanup() {\n }", "@Override\n\tprotected void cleanupAddon(SkyAddon registeredAddon)\n\t{\n\t}", "@Override\n\tpublic void destroy() {\n\t\tSystem.out.println(\"Passage dans destroy\");\n\t}", "@Override\n\tpublic void excluir() {\n\t\t\n\t}", "@Override\n public void onDisable() {\n try {\n System.out.println(\"Cleaning Dynamic Server System Processes.\");\n for (MinigameServer minigameServer : dynamicServerSystemManager.getServers())\n minigameServer.deleteServer();\n\n // Clean the output directory.\n FileUtils.deleteDirectory(new File(\"../minigameservers\"));\n new File(\"../minigameservers\").mkdirs();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n plugin = null;\n }", "public void removePlugin(@NotNull EditorPlugin plugin) {\n pluginSystem.removePlugin(plugin);\n }", "public static void deleteAlert() {\n\n }", "@Override\n\tpublic void onGuiClosed() {\n\t\tfield_154330_a.removed();\n\t\tsuper.onGuiClosed();\n\t}", "public void delete( int nIdSuggestSubmit, Plugin plugin )\n {\n DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE, plugin );\n daoUtil.setInt( 1, nIdSuggestSubmit );\n daoUtil.executeUpdate( );\n daoUtil.free( );\n }", "@Override\n\tpublic void onDeleting(PhotoFragment f, NPPhoto photo) {\n\t\tfinish();\n\t}", "private void removePlugIn(WebSocketConnector aConnector, Token aToken) {\n\t\tif (mService == null) {\n\t\t\tmService = new AdminPlugInService(NS_ADMIN, mNumberOfDays, getServer());\n\t\t}\n\n\t\tif (mLog.isDebugEnabled()) {\n\t\t\tmLog.debug(\"Processing 'removePlugIn'...\");\n\t\t}\n\n\t\tgetServer().sendToken(aConnector, mService.removePlugIn(aConnector, aToken));\n\t}", "@Override\n public void onTerminate() {\n super.onTerminate();\n /*2012-8-3, add by bvq783 for plugin*/\n if (mModel != null && mModel.getPluginHost() != null)\n mModel.getPluginHost().onModelDestroy();\n /*2012-8-3, add end*/\n unregisterReceiver(mModel);\n\n ContentResolver resolver = getContentResolver();\n resolver.unregisterContentObserver(mFavoritesObserver);\n }", "@Override\n\t\tpublic void delete() {\n\t\t\tSystem.out.println(\"새로운 삭제\");\n\t\t}", "@Override\n\tpublic void delete() {\n\t\t\n\t}", "@Override\n\tpublic void delete() {\n\t\t\n\t}", "@Override\n\tpublic void deletePlayer(Joueur joueur) {\n\t\t\n\t}", "@Override\n\tpublic void deleteModule() throws Exception {\n\n\t}", "private void delete() {\n AltDatabase.getInstance().getAlts().remove(getCurrentAsEditable());\n if (selectedAccountIndex > 0)\n selectedAccountIndex--;\n updateQueried();\n updateButtons();\n }", "private void actionDelete() {\r\n showDeleteDialog();\r\n }", "@Override\r\n\tpublic void deleteObjectListener(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tUiUpdater.unregisterClient(handler);\r\n\t}", "public boolean deleteOnExit();", "@Override\n\tpublic void delete() {\n\n\t}", "@Override\n\tpublic void delete(Game game) {\n\t\t\n\t}", "@Override\n\tpublic void onDelete() {\n\t\tif (testSessionChangedHandler != null) {\n\t\t\ttestSessionChangedHandler.removeHandler();\n\t\t\ttestSessionChangedHandler = null;\n\t\t}\n\t\t// Release the acmi\n\t\tif (acmiSaveButton !=null) {\n\t\t\tif (PasswordManagement.adminMenuItemList.contains(acmiSaveButton))\n\t\t\t\tPasswordManagement.adminMenuItemList.remove(acmiSaveButton);\n\t\t}\n\t\tif (acmiPromoteSite!=null) {\n\t\t\tif (PasswordManagement.adminMenuItemList.contains(acmiPromoteSite))\n\t\t\t\tPasswordManagement.adminMenuItemList.remove(acmiPromoteSite);\n\t\t}\n\t\tif (acmiDeleteSite!=null) {\n\t\t\tif (PasswordManagement.adminMenuItemList.contains(acmiDeleteSite))\n\t\t\t\tPasswordManagement.adminMenuItemList.remove(acmiDeleteSite);\n\t\t}\n\t\tif (acmiCreateSite!=null) {\n\t\t\tif (PasswordManagement.adminMenuItemList.contains(acmiCreateSite))\n\t\t\t\tPasswordManagement.adminMenuItemList.remove(acmiCreateSite);\n\t\t}\n\t}", "public void handleDeleteCode() {\n // make sure the user didn't hide the sketch folder\n ensureExistence();\n\n // if read-only, give an error\n if (isReadOnly()) {\n // if the files are read-only, need to first do a \"save as\".\n Base.showMessage(_(\"Sketch is Read-Only\"),\n _(\"Some files are marked \\\"read-only\\\", so you'll\\n\" +\n \"need to re-save the sketch in another location,\\n\" +\n \"and try again.\"));\n return;\n }\n\n // confirm deletion with user, yes/no\n Object[] options = { _(\"OK\"), _(\"Cancel\") };\n String prompt = (currentIndex == 0) ?\n _(\"Are you sure you want to delete this sketch?\") :\n I18n.format(_(\"Are you sure you want to delete \\\"{0}\\\"?\"), current.getPrettyName());\n int result = JOptionPane.showOptionDialog(editor,\n prompt,\n _(\"Delete\"),\n JOptionPane.YES_NO_OPTION,\n JOptionPane.QUESTION_MESSAGE,\n null,\n options,\n options[0]);\n if (result == JOptionPane.YES_OPTION) {\n if (currentIndex == 0) {\n // need to unset all the modified flags, otherwise tries\n // to do a save on the handleNew()\n\n // delete the entire sketch\n Base.removeDir(folder);\n\n // get the changes into the sketchbook menu\n //sketchbook.rebuildMenus();\n\n // make a new sketch, and i think this will rebuild the sketch menu\n //editor.handleNewUnchecked();\n //editor.handleClose2();\n editor.base.handleClose(editor);\n\n } else {\n // delete the file\n if (!current.deleteFile()) {\n Base.showMessage(_(\"Couldn't do it\"),\n I18n.format(_(\"Could not delete \\\"{0}\\\".\"), current.getFileName()));\n return;\n }\n\n // remove code from the list\n removeCode(current);\n\n // just set current tab to the main tab\n setCurrentCode(0);\n\n // update the tabs\n editor.header.repaint();\n }\n }\n }", "@Override\r\n\tpublic void onCustomDestroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void delete(Player t) {\n\r\n\t}", "@FxThread\n private void onFinishLoading() {\n pluginSystem.getPlugins().stream()\n .filter(EditorPlugin.class::isInstance)\n .map(EditorPlugin.class::cast)\n .forEach(editorPlugin -> editorPlugin.onFinishLoading(pluginSystem));\n }", "public abstract void onRemoveAction();", "@Override\n\tprotected void onDestroy() {\n\t\tif (themeHandler!=null) \n\t\t\tthemeHandler.removeCallbacksAndMessages(null);\n\t\tsuper.onDestroy();\n\t}", "public void onDestroy(Bundle params) {\n }", "@Override\r\n\tpublic void delete() {\n\r\n\t}", "@Override\n\t\tpublic void delete() {\n\n\t\t}", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"no goin\");\n\t\t\n\t}", "public void removed() {\n }", "@Override\n\tpublic boolean delete(Langues obj) {\n\t\treturn false;\n\t}", "@Override\n\tpublic void delete() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void finished(String plugin)\n {\n synchronized(this.monitor)\n {\n if ( this.running.remove(plugin) )\n { \n this.finished = plugin; // Updated shared resource\n }\n this.monitor.notify(); // Notify filter to start\n }\n }", "private boolean actionDelete()\n {\n Debug.enter();\n onDeleteListener.onDelete();\n dismiss();\n Debug.leave();\n return true;\n }", "void internalShutdown() {\n\t\tsynchronized(this.hookedPlugins) {\n\t\t\tIterator<String> it = this.hookedPlugins.keySet().iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tString id = it.next(); \n\t\t\t\tPluginLogListener listener = this.hookedPlugins.get(id);\n\t\t\t\tlistener.dispose(); \n\t\t\t}\n\t\t\tthis.hookedPlugins.clear(); \n\t\t}\t\n\t\tthis.hierarchy.shutdown();\n\t}", "@Override\n\t\tpublic void onDeletionNotice(long arg0, long arg1) {\n\t\t\t\n\t\t}", "protected void uninstall() {\n\t\t//\n\t}", "private void deleteButtonClicked(){\n\t\tif (theDialogClient != null) theDialogClient.dialogFinished(DialogClient.operation.DELETEING);\n\t\tdispose();\n\t}", "@Override\n\tpublic void destroy() {\n\t\tgeneralServices.getCallbackApi().removeReplayOpsPopupMenuItem(\n\t\t\t\tshowSc2ConverterForPatternMiningItemHandler);\n\t}", "@Override\n\tpublic void firePluginEvent(PluginEvent event) {\n\t\t//do nothing\n\t}", "@Override\n public void deletedResource( ResourceEvent event )\n {\n\n }", "@Override\n public void onDestroy(boolean isChangingConfiguration) {\n\n }", "@Override\n\tpublic void destroyAction(int id) {\n\t\t\n\t}", "@Override\r\n\tpublic void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "void deletePodcastMP3(ActionEvent event){\n //removes the context menu that was displayed\n cm.hide();\n //Creates and shows a pop-up box that will prompt the user to decide what happens to the mp3 file\n Alert alert = new Alert(Alert.AlertType.NONE, \"Delete the mp3 file for \"+this.podcast.getTitle()+\"?\", ButtonType.YES, ButtonType.NO, ButtonType.CANCEL);\n alert.showAndWait();\n\n //CASE: YES, removes the podcast from queue since file is deleted and updates status\n if(alert.getResult() == ButtonType.YES){\n if(model.DEBUG)\n System.err.println(\"[LibCell] Deleting \"+this.podcast.getTitle()+\"\\'s mp3 file\");\n\n this.podcast.deleteMP3();\n this.podcast.setQueued(false);\n model.getQueueList().remove(this.podcast);\n\n if(this.podcast.isQueued()){\n model.getQueueList().remove(this.podcast);\n model.getMainWindow().setSelection();\n }\n //CASE: NO, hides alert\n } else {\n alert.hide();\n }\n }", "protected void uninstallComponents() {\n }", "@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)\n public void onPluginDisable(@NotNull PluginDisableEvent event) {\n if (event.getPlugin() != plugin) {\n return;\n }\n\n int counter = 0; //callbacks might open GUIs, eg. in nested menus\n\t\tint maxCount = 10;\n while (!activeGuiInstances.isEmpty() && counter++ < maxCount) {\n for (Gui gui : new ArrayList<>(activeGuiInstances)) {\n for (HumanEntity viewer : gui.getViewers()) {\n viewer.closeInventory();\n }\n }\n }\n\n if (counter == maxCount) {\n\t\t\tplugin.getLogger().warning(\"Unable to close GUIs on plugin disable: they keep getting opened \"\n\t\t\t\t\t+ \"(tried: \" + maxCount + \" times)\");\n\t\t}\n }", "void onDelete();", "@Deactivate\n public void deactivate()\n {\n m_PluginFactoryTracker.close();\n if (m_RegistryComponent != null)\n {\n m_RegistryComponent.dispose();\n }\n }", "void processDeleteCategoryEvent(AchieveSettings settings, String category);", "public void destroyAction() {\n\r\n\t}", "@Override\n\tpublic void destroy() {\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\n\t\t// Put your code here\n\t}", "@Override\n\tpublic void deleteCB(CB cb) {\n\t\t\n\t}", "private void onOK() {\n if (TextUtil.isEmpty(nick.getText())) {\n showMessage(\"插件名称\");\n return;\n }\n if (TextUtil.isEmpty(name.getText())) {\n showMessage(\"插件代号\");\n return;\n }\n if (TextUtil.isEmpty(version.getText())) {\n showMessage(\"插件版本\");\n return;\n }\n if (TextUtil.isEmpty(path.getText())) {\n showMessage(\"插件路径\");\n return;\n }\n String nickV = nick.getText();\n String nameV = name.getText();\n String versionV = version.getText();\n UploadPluginDto dto = RequestManagement.uploadPlugin(selectFile, nameV, versionV, nickV);\n if (dto != null && dto.getResult() != null) {\n if (pluginPanel != null) {\n pluginPanel.addItem(dto.getResult());\n }\n }\n dispose();\n }", "protected void uninstallComponents() {\n\t}", "@Override\r\n\tpublic void onDelete() {\n\t\tsuper.onDelete();\r\n\t}", "public void stop(BundleContext context) throws Exception {\n\t\tsuper.stop(context);\n\t\tplugin = null;\n\t}", "@Override\r\n public void onDisable() {\r\n log.info(\"[SeattleSummer] plugin disabled.\");\r\n }", "private void removePluginComponent( Component c,\n Container container,\n Object constraints)\n {\n if (container.equals(Container.CONTAINER_CHAT_WINDOW))\n {\n if (constraints.equals(BorderLayout.SOUTH))\n pluginPanelSouth.remove(c);\n else if (constraints.equals(BorderLayout.WEST))\n pluginPanelWest.remove(c);\n else if (constraints.equals(BorderLayout.EAST))\n pluginPanelEast.remove(c);\n }\n else if (container.equals(Container.CONTAINER_CHAT_STATUS_BAR))\n {\n this.statusBarPanel.remove(c);\n }\n }", "@Override\n\tpublic boolean preDelete() {\n\t\teliminarCuentasHijas(instance);\n\t\treturn true;\n\t}", "public void actionPerformed( ActionEvent event )\n {\n software.getUpdatePlan().remove( configurationFile );\n // add an event\n parent.getEnvironmentWindow().getChangeEvents().add(\n \"Delete software \" + name + \" configuration file \" + configurationFile.getName() );\n // update the journal pane\n parent.getEnvironmentWindow().updateJournalPane();\n // update the pane\n update();\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tCleanup();\r\n\t}" ]
[ "0.6936949", "0.65166175", "0.65003467", "0.64659727", "0.63592356", "0.63131213", "0.6271974", "0.62632346", "0.6207412", "0.6149668", "0.6081953", "0.6081953", "0.60625213", "0.6007127", "0.6005684", "0.58895487", "0.587734", "0.5870661", "0.585111", "0.5846115", "0.5839398", "0.58305603", "0.5819423", "0.5819238", "0.58185", "0.5792568", "0.575841", "0.5753799", "0.5739025", "0.5736204", "0.5730354", "0.5719389", "0.571084", "0.5709916", "0.5692289", "0.5683053", "0.56630075", "0.56381446", "0.56262267", "0.5620376", "0.56122154", "0.56032485", "0.5598539", "0.5596405", "0.5589958", "0.55752295", "0.5565187", "0.5565187", "0.55566233", "0.5550919", "0.55432415", "0.55398464", "0.55390376", "0.5538179", "0.55268145", "0.55255926", "0.552298", "0.55210286", "0.5519668", "0.5517993", "0.551466", "0.55146027", "0.5513029", "0.55109394", "0.55070627", "0.5506231", "0.5491059", "0.5489877", "0.5489587", "0.548793", "0.5480843", "0.5480211", "0.54764795", "0.54741055", "0.5465783", "0.5462283", "0.5461793", "0.54610837", "0.5459525", "0.54569083", "0.5455199", "0.545291", "0.54405713", "0.5428098", "0.54271215", "0.5426232", "0.5420666", "0.5418346", "0.5407792", "0.5404203", "0.53931594", "0.53928757", "0.5389558", "0.53893614", "0.53871566", "0.538679", "0.53852403", "0.53834736", "0.5379414", "0.53766525", "0.53760964" ]
0.0
-1
1st create index for all xml files, set the index dir and data dir (xml location) RepRiskIndexer.createIndex();
public static void main(String[] args) throws IOException { RepRiskIndexer.createIndex(AppConstants.INDEX_DIR, AppConstants.DATA_DIR); long totalIndexed = RepRiskIndexer.getTotalIndexed(); // 2nd lets get the contents from csv (RepRisk Companies) RepRiskCsvParser csvParser = new RepRiskCsvParser(); csvParser.setDELIMITER(';'); List<Company> companies = csvParser.readCsvFile("C:\\Lucene\\RepRisk\\company_list.csv"); System.out.println(companies); // 3rd lets get relevant results and documents for each of the companies Map<Company, SearchResults> relevantDocs = new HashMap<>(); RepRiskSearcher searcher = new RepRiskSearcher(); for(Company company : companies) { relevantDocs.put(company, new SearchResults( searcher.absoluteSearch(company.getName()), searcher.relevantSearch(company.getName()))); } // 4th initialize Precision and Recall PrecisionRecallCalculator calc = new PrecisionRecallCalculator(totalIndexed); for(Map.Entry<Company, SearchResults> doc : relevantDocs.entrySet()) { Company company = doc.getKey(); PrecisionRecall result = calc.calculate(doc.getValue()); System.out.println(company.getName() + " " + result); } // 5th print results calc.calculateAveragePrecision(); calc.calculate11point(); calc.printAllResults(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createIndex(String dataDirPath){\n\t\tFile[] files = new File(dataDirPath).listFiles();\n\n\t\tfor (File file : files) {\n\t\t\tif(!file.isDirectory()\n\t\t\t\t\t&& !file.isHidden()\n\t\t\t\t\t&& file.exists()\n\t\t\t\t\t){\n\t\t\t\t//add to Map\n\t\t\t\t// m.put(file.getAbsolutePath(), new RankModel(file,0,getOutLinks(file.getAbsolutePath())));\n\t\t\t\tallFiles.add(file.getAbsolutePath());\n\t\t\t}else{\n\t\t\t\tcreateIndex(file.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t\t// return writer.numDocs();\n\t}", "private static void createIndex() {\n XML_Shell workFile = new XML_Shell();\n String messageFromServer = ClientService.getLastMessageFromServer();\n\n try {\n XML_Manager.stringToDom(messageFromServer, workFile);\n } catch (SAXException | ParserConfigurationException | IOException | TransformerException e) {\n e.printStackTrace();\n }\n\n }", "public void testCreIdx(){\r\n\t \r\n\t String dataDir = \"C:\\\\study\\\\Lucene\\\\Data\";\r\n\t String idxDir = \"C:\\\\study\\\\Lucene\\\\Index\";\r\n\t \r\n\t LuceneUtils.delAll(idxDir);\r\n\t \r\n\t CreateIndex ci = new CreateIndex();\r\n\t \r\n\t ci.Indexer(new File(idxDir), new File(dataDir));\r\n\t \r\n\t\t\r\n\t}", "public void createIndex(String dirPath) throws IOException {\n\n\t\tFile[] files = new File(dirPath).listFiles();\n\n\t\tfor (File f : files) {\n\t\t\tindexDocument(f);\n\t\t}\n\n\t\tclose();\n\t\tprintStatistics();\n\t}", "private void configuration() throws IOException {\n IndexReader reader = DirectoryReader.open(FSDirectory.open(new File(\n luceneIndexDir)));\n\n analyzer = new SimpleAnalyzer(Version.LUCENE_47);\n searcher = new IndexSearcher(reader);\n\n // Creates the directory for Storing the search results.\n File file = new File(SEARCH_RESULT_DIR);\n file.mkdir();\n\n }", "public generateIndex() {\n\n\t\tthis.analyzer = \"StandardAnalyzer\";\n\t}", "indexSet createindexSet();", "@SuppressWarnings(\"unused\")\n public void buildIndex() throws IOException {\n indexWriter = getIndexWriter(indexDir);\n ArrayList <JSONObject> jsonArrayList = parseJSONFiles(JSONdir);\n indexTweets(jsonArrayList, indexWriter);\n indexWriter.close();\n }", "public void start() throws Exception {\n\n createIndex();\n }", "public void init() {\n File file=new File(\"D:\\\\lucene\\\\index\");\n if(file.isDirectory())\n { //否则如果它是一个目录\n File files[] = file.listFiles(); //声明目录下所有的文件 files[];\n for(int i=0;i<files.length;i++)\n { //遍历目录下所有的文件\n files[i].delete(); //把每个文件 用这个方法进行迭代\n }\n }\n String indexPath = \"D:\\\\lucene\\\\index\";\n //String docsPath = \"D:\\\\lucene\\\\data\";\n boolean create = true;\n try\n {\n Session session=factory.openSession();\n String hql = \"from Book\";\n org.hibernate.Query query = session.createQuery(hql);\n List<Book> list=query.list();\n Directory indexDir = FSDirectory.open(Paths.get(\"D:\\\\lucene\\\\index\"));\n Analyzer luceneAnalyzer = new StandardAnalyzer(); //新建一个分词器实例 \n IndexWriterConfig config = new IndexWriterConfig(luceneAnalyzer); \n IndexWriter indexWriter = new IndexWriter(indexDir,config);\n for(int i=0;i<list.size();i++)\n {\n Document document = new Document();\n Field field1 = new StringField(\"id\",list.get(i).getBookid().toString(),Field.Store.YES); \n Field field2 = new StringField(\"bookname\",list.get(i).getBookname(),Field.Store.YES); \n Field field3 = new StringField(\"author\",list.get(i).getAuthor(),Field.Store.YES); \n Field field4 = new StringField(\"category\",list.get(i).getCategory(),Field.Store.YES); \n Field field5 = new StringField(\"price\", Double.toString(list.get(i).getPrice()),Field.Store.YES); \n document.add(field1); \n document.add(field2); \n document.add(field3); \n document.add(field4);\n document.add(field5);\n indexWriter.addDocument(document);\n }\n indexWriter.close();\n }\n catch(IOException e)\n {\n System.out.println(\"error\");\n return;\n }\n }", "@Test\n public void testProcessAll() throws TikaException, SAXException, IOException, Exception {\n PaperIndexer indexer = new PaperIndexer(BaseDirInfo.getPath(\"test.properties\"));\n indexer.processAll();\n\n Properties prop = indexer.getProperties();\n String paraIndexPath = prop.getProperty(\"para.index\");\n prop.setProperty(\"para.index\", paraIndexPath + \"/1\");\n\n final String[] indexes = { \"index\", \"para.index\", \"para.index.all\" };\n\n // Test global index and para index\n for (String indexPath : indexes) {\n File indexDir = new File(BaseDirInfo.getPath(indexer.getProperties().getProperty(indexPath)));\n try (Directory dir = FSDirectory.open(indexDir.toPath());\n IndexReader reader = DirectoryReader.open(dir)) {\n assertNotNull(reader); // reader must not be null\n\n int nDocs = reader.numDocs();\n assertNotEquals(nDocs, 0); // Number of docs must not be zero\n }\n }\n\n // Since we put one document in the test folder, we should have one folder in the para index\n prop.setProperty(\"para.index\", paraIndexPath);\n File[] dirs = new File(prop.getProperty(\"para.index\")).listFiles();\n assertEquals(dirs.length, 1);\n\n // clean folders\n indexer.removeIndexDirs();\n }", "public void createIndex() throws IOException {\n\t\tindexWriter.commit();\n\t\ttaxoWriter.commit();\n\n\t\t// categories\n\t\tfor (Article.Facets f : Article.Facets.values()) {\n\t\t\ttaxoWriter.addCategory(new CategoryPath(f.toString()));\n\t\t}\n\t\ttaxoWriter.commit();\n\n\t\tfinal Iterable<Article> articles = articleRepository.findAll();\n\t\tint c = 0;\n\t\tfor (Article article : articles) {\n\t\t\taddArticle(indexWriter, taxoWriter, article);\n\t\t\tc++;\n\t\t}\n\t\t// commit\n\t\ttaxoWriter.commit();\n\t\tindexWriter.commit();\n\n\t\ttaxoWriter.close();\n\t\tindexWriter.close();\n\n\t\ttaxoDirectory.close();\n\t\tindexDirectory.close();\n\t\tLOGGER.debug(\"{} articles indexed\", c);\n\t}", "public int createIndex(String dataDirPath, FileFilter filter) throws IOException {\n\t\tFile[] files = new File(dataDirPath).listFiles();\r\n\t\tfor (int i = 0; i < files.length; i++) {\r\n\t\t\tif (!files[i].isDirectory() && !files[i].isHidden() && files[i].exists() && files[i].canRead()\r\n\t\t\t\t\t&& filter.accept(files[i])) {\r\n\t\t\t\tindexFile(files[i], (i % 2));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn writer.numDocs();\r\n\t}", "private static RDFIndex createDefaultIndex() {\n defaultIndex = new RDFIndex(com.hp.hpl.jena.graph.Factory.createGraphMem());\n try {\n File indexFile = new File(INDEX_FILE);\n if(indexFile.exists()) {\n defaultIndex.read(new FileReader(indexFile),Constants.RESOURCE_URL);\n }\n } catch(Throwable t) {\n t.printStackTrace();\n }\n return defaultIndex;\n }", "@Override\n public void setupIndex() {\n List lst = DBClient.getList(\"SELECT a FROM AppMenu a WHERE a.moduleName='MyBranchMemberExt'\");\n if (lst!=null && !lst.isEmpty()) {\n return;\n }\n AppMenu.createAppMenuObj(\"MyBranchMemberExt\", \"Main\", \"Branch Member\", 110).save();\n AppMenu.createAppMenuObj(\"MyCenterMemberExt\", \"Main\", \"Center Member\", 120).save();\n AppMenu.createAppMenuObj(\"SearchAllMembersOnlyExt\", \"Main\", \"Search Member\", 130).save();\n AppMenu.createAppMenuObj(\"ReferenceForm\", \"Reference\", \"Reference\", 200).save();\n runUniqueIndex(8, \"firstName\", \"lastName\");\n }", "public void setUp() throws Exception {\n Project project = new Project();\n\n IndexTask task = new IndexTask();\n FileSet fs = new FileSet();\n fs.setDir(new File(docsDir));\n task.addFileset(fs);\n task.setOverwrite(true);\n task.setDocumentHandler(docHandler);\n task.setIndex(new File(indexDir));\n task.setProject(project);\n task.execute();\n\n searcher = new IndexSearcher(indexDir);\n analyzer = new StopAnalyzer();\n }", "public IndexWriter(String indexDir) {\n\t\t//TODO : YOU MUST IMPLEMENT THIS\n\tif (indexDir!=null)\n\t{System.setProperty(\"INDEX.DIR\",(this.indexDir=indexDir));\n\tisvaliddir=true;\n\tiutil=new IndexUtil(indexDir);\n\t}\n\t\n\t}", "public SearchDocuments(String indexPath) throws IOException{\r\n this.setIndexPath(indexPath); \r\n \r\n //TO DO : add config.properties file\r\n //read configuration file and update static variables adequately\r\n// readConf();\r\n\r\n // Supported index Fields and their pubmed counterpart (\"Title\",\"ArticleTitle\") \r\n supportedIndexFields.put(\"Title\", \"ArticleTitle\");\r\n supportedIndexFields.put(\"TI\", \"ArticleTitle\");\r\n supportedIndexFields.put(\"Abstract\", \"AbstractText\");\r\n supportedIndexFields.put(\"AB\", \"AbstractText\");\r\n supportedIndexFields.put(\"PMID\", \"PMID\");\r\n supportedIndexFields.put(\"UID\", \"PMID\");\r\n //TO DO : add all supported index fields\r\n //TO DO : special words (i.e. nothascommenton etc) \r\n \r\n // Lucene objects\r\n \r\n /* Sorting */\r\n // Fields used for reverse chronological sorting of results\r\n // This Fields are indexed with no tokenization (for each element a StringField AND a SortedDocValuesField are added)\r\n // Using SortField.Type.STRING is valid (as an exception) beacause years are 4-digit numbers resulting in identical String-sorting and number-sorting.\r\n SortField sortFieldYear = new SortField(\"PubDate-Year\", SortField.Type.STRING, true);\r\n \r\n //TO DO : make custom comparators for the rest fields where lexilogical comparison is not valid\r\n // OR, store Pud Date as Date and use date comparison\r\n // Idealy one \"complex-field\" should be used for sorting, taking into account Year, Month, Day, Season and MedlineDate together)\r\n// SortField sortFieldMonth = new SortField(\"PubDate-Month\",SortField.Type.STRING,true);\r\n// SortField sortFieldDay = new SortField(\"PubDate-Day\",SortField.Type.STRING,true);\r\n// SortField sortFieldSeason = new SortField(\"PubDate-Season\",SortField.Type.STRING,true);\r\n// SortField sortFieldMedlineDate = new SortField(\"PubDate-MedlineDate\",SortField.Type.STRING,true);\r\n// this.setSort(new Sort(sortFieldYear, sortFieldMonth, sortFieldDay, sortFieldSeason, sortFieldMedlineDate));\r\n this.setSort(new Sort(sortFieldYear));\r\n \r\n /* Reading the index */\r\n// this.setReader(DirectoryReader.open(FSDirectory.open(Paths.get(getIndexPath()))));\r\n this.setReader(DirectoryReader.open(MMapDirectory.open(Paths.get(getIndexPath()))));\r\n this.setSearcher(new IndexSearcher(getReader()));\r\n this.setAnalyzer(new StandardAnalyzer());\r\n \r\n /* Caching */\r\n // these cache and policy instances can be shared across several queries and readers\r\n // it is fine to eg. store them into static variables\r\n // TO DO: Use stored (old) expert-queries (from mongoDB) and MESH terms to \"prepare\" cache.\r\n queryCache = new LRUQueryCache(maxNumberOfCachedQueries, maxRamBytesUsed);\r\n// defaultCachingPolicy = new UsageTrackingQueryCachingPolicy();\r\n defaultCachingPolicy = new QueryCachingPolicy.CacheOnLargeSegments(minIndexSize, minSizeRatio);\r\n this.getSearcher().setQueryCache(queryCache);\r\n this.getSearcher().setQueryCachingPolicy(defaultCachingPolicy);\r\n \r\n /* All fields as default for search */\r\n Iterator <String> allFieldsIterator = org.apache.lucene.index.MultiFields.getFields(reader).iterator();\r\n ArrayList <String> a = new ArrayList();\r\n String current = \"\";\r\n while(allFieldsIterator.hasNext()){\r\n current = allFieldsIterator.next();\r\n if(!current.startsWith(\"PubDate-\")){\r\n a.add(current);\r\n }\r\n }\r\n \r\n String[] allFields = new String[a.size()];\r\n allFields = a.toArray(allFields); //All index fields to be used as default search fields\r\n this.setParser( new MultiFieldQueryParser( allFields, getAnalyzer())); \r\n }", "public void indexFileOrDirectory(String fileName) {\r\n\r\n addFiles(new File(fileName));\r\n\r\n int originalNumDocs = writer.numRamDocs();\r\n for (File f : queue) {\r\n try {\r\n Document doc = new Document();\r\n\r\n // Creation of a simpledateformatter in order to print the last-modified-date of our files.\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\r\n String date = sdf.format(f.lastModified());\r\n\r\n if (f.getName().endsWith(\".html\")) {\r\n\r\n // Creation of a jsoup document to help us with our html parsing.\r\n org.jsoup.nodes.Document htmlFile = Jsoup.parse(f, null);\r\n String body = htmlFile.body().text();\r\n String title = htmlFile.title();\r\n String summary = getSummary(htmlFile);\r\n\r\n\r\n doc.add(new TextField(\"contents\", body + \" \" + title + \" \" + date, Field.Store.YES));\r\n doc.add(new TextField(\"title\", title, Field.Store.YES));\r\n doc.add(new StringField(\"path\", f.getPath(), Field.Store.YES));\r\n doc.add(new TextField(\"modified-date\", date, Field.Store.YES));\r\n doc.add(new StringField(\"summary\", summary, Field.Store.YES));\r\n\r\n }\r\n else {\r\n String content = FileUtils.readFileToString(f, StandardCharsets.UTF_8);\r\n\r\n doc.add(new TextField(\"contents\", content + \" \" + date, Field.Store.YES));\r\n doc.add(new StringField(\"path\", f.getPath(), Field.Store.YES));\r\n doc.add(new TextField(\"modified-date\", date, Field.Store.YES));\r\n }\r\n doc.add(new StringField(\"filename\", f.getName(), Field.Store.YES));\r\n\r\n writer.addDocument(doc);\r\n System.out.println(\"Added: \" + f);\r\n } catch (Exception e) {\r\n System.out.println(\"Could not add: \" + f);\r\n }\r\n }\r\n\r\n int newNumDocs = writer.numDocs();\r\n System.out.println(\"\");\r\n System.out.println(\"************************\");\r\n System.out.println((newNumDocs - originalNumDocs) + \" documents added.\");\r\n System.out.println(\"************************\");\r\n\r\n queue.clear();\r\n }", "private void createReviewIndex() {\n\t\t// Revise the review dictionary to the correct structure & change productIDs to product index\n\t\tLinkedList<List<Integer>> dictValues = new LinkedList<>();\n\t\tfor (int review : reviewIds.keySet()) {\n\t\t\tArrayList<String> vals = reviewIds.get(review);\n\t\t\tArrayList<Integer> new_vals = new ArrayList<>(List.of(0, 0, 0, 0, 0));\n\t\t\tnew_vals.set(ReviewIndex.PRODUCTID_INDEX, productIds.headMap(vals.get(0)).size());\n\t\t\tString[] helpf = vals.get(2).split(\"/\");\n\t\t\tnew_vals.set(ReviewIndex.HELPFNUM_INDEX, Integer.parseInt(helpf[0]));\n\t\t\tnew_vals.set(ReviewIndex.HELPFDNOM_INDEX, Integer.parseInt(helpf[1]));\n\t\t\tnew_vals.set(ReviewIndex.REVIEWLENGTH_INDEX, Integer.parseInt(vals.get(3)));\n\t\t\tnew_vals.set(ReviewIndex.SCORE_INDEX, (int) Float.parseFloat(vals.get(1)));\n\t\t\tdictValues.add(new_vals);\n\t\t}\n\t\tReviewIndex rIndex = new ReviewIndex();\n\t\trIndex.insertData(dictValues);\n\n\t\tsaveToDir(REVIEW_INDEX_FILE, rIndex);\n\t}", "@Override\n\tpublic void build(Index index) {\n\t\tthis.indexdir = index.getPath();\n\t\tLuceneIndex luceneIndex = (LuceneIndex) index;\n\t\tthis.indexSearcher = new IndexSearcher(luceneIndex.getReader());\n\n\t}", "public static void main(String[] args) throws IOException {\n\t\tif (args.length != 2) {\n\t\t\tSystem.err\n\t\t\t\t\t.println(\"You need to give database directory path and output directory path as arguments.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tdirectory = args[0];\n\t\toutputFilePath = args[1];\n\t\t// Get list of all files.\n\t\tFile[] listOfFiles = Util.getAllFiles(directory);\n\t\t// Get all the stop words in the sorted order.\n\t\tTreeMap<String, String> stopWords = Util\n\t\t\t\t.getStopWordsFromFile(stopWordFile);\n\t\tint numberOfFiles = listOfFiles.length;\n\t\t// 2D array to store the required information about each doc.\n\t\tInteger[][] docInfo = new Integer[numberOfFiles + 1][2];\n\t\tdouble timeForIndexVersion1 = 0.0d, timeForIndexVersion2 = 0.0d;\n\t\tlong startTime, endTime;\n\t\tif (numberOfFiles != 0) {\n\n\t\t\t// Starting creating Index version 1.\n\t\t\tstartTime = System.currentTimeMillis();\n\t\t\tfor (File file : listOfFiles) {\n\t\t\t\t// Get the doc id.\n\t\t\t\tint docId = Integer.parseInt(file.getName().substring(9));\n\t\t\t\t// For version 1:\n\t\t\t\t// do lemmatization\n\t\t\t\tMap<String, Integer> lemmasFromFile = lemmatizer\n\t\t\t\t\t\t.lemmatize(file);\n\t\t\t\t// remove stop words,\n\t\t\t\tMap<String, Integer> lemmasWoStopWords = Util.removeStopWords(\n\t\t\t\t\t\tlemmasFromFile, stopWords);\n\t\t\t\t// create index.\n\t\t\t\tindexVersion1.creatIndex(docId, lemmasWoStopWords);\n\t\t\t}\n\t\t\tendTime = System.currentTimeMillis();\n\t\t\t// calculate total time taken\n\t\t\ttimeForIndexVersion1 = (endTime - startTime) / 1000.0d;\n\n\t\t\t// indexVersion1.printIndex();\n\t\t\t// write uncompressed index of version 1 to a binary file.\n\t\t\tindexVersion1.writeIndexUncompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version1.uncompress\");\n\t\t\t// compress index\n\t\t\tindexVersion1.compressIndex();\n\t\t\t// write compressed index of version 1 to a binary file.\n\t\t\tindexVersion1.writeIndexCompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version1.compress\");\n\n\t\t\t// Starting creating Index version 2.\n\t\t\tstartTime = System.currentTimeMillis();\n\t\t\tfor (File file : listOfFiles) {\n\t\t\t\tint docId = Integer.parseInt(file.getName().substring(9));\n\t\t\t\t// For version 2:\n\t\t\t\t// generate tokens from the file\n\t\t\t\tMap<String, Integer> tokensFromFile = Util\n\t\t\t\t\t\t.getTokensFromFile(file);\n\t\t\t\t// do stemming\n\t\t\t\tMap<String, Integer> stemmedTokens = Util\n\t\t\t\t\t\t.getStemmedTokens(tokensFromFile);\n\t\t\t\t// remove stop words\n\t\t\t\tMap<String, Integer> stemmedTokensWoStopWords = Util\n\t\t\t\t\t\t.removeStopWords(stemmedTokens, stopWords);\n\t\t\t\t// update the information about current document.\n\t\t\t\tUtil.updateDocInfo(docInfo, docId, stemmedTokens,\n\t\t\t\t\t\tstemmedTokensWoStopWords);\n\t\t\t\t// System.out.println(\"DocId: \" + docId + \" Max Freq: \"\n\t\t\t\t// + docInfo[docId][0].toString() + \" Doc length: \"\n\t\t\t\t// + docInfo[docId][1].toString());\n\t\t\t\t// create index\n\t\t\t\tindexVersion2.creatIndex(docId, stemmedTokensWoStopWords);\n\n\t\t\t}\n\t\t\tendTime = System.currentTimeMillis();\n\t\t\t// calculate total time taken\n\t\t\ttimeForIndexVersion2 = (endTime - startTime) / 1000.0d;\n\t\t\t// write documents information to a binary file\n\t\t\twriteDocInfo(docInfo, outputFilePath, \"docs.info\");\n\t\t\t// write uncompressed index of version 2 to a binary file.\n\n\t\t\t// indexVersion2.printIndex();\n\t\t\tindexVersion2.writeIndexUncompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version2.uncompress\");\n\t\t\t// compress index\n\t\t\tindexVersion2.compressIndex();\n\t\t\t// write compressed index of version 2 to a binary file.\n\t\t\tindexVersion2.writeIndexCompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version2.compress\");\n\n\t\t\t// display the required information.\n\t\t\tdisplayOutput(timeForIndexVersion1, timeForIndexVersion2);\n\t\t} else {\n\t\t\tSystem.err.println(\"Empty folder\");\n\t\t}\n\t}", "public void createIndex(Configuration configuration){\n }", "public void createIndex(String dataDirPath, String txType) throws IOException {\n\t\ttry {\n\t\t\tString inLoc = \"/mnt/3TB/in.csv\";\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(inLoc), \"UTF-8\"));\n\n\t\t\tString line;\n\t\t\tboolean first = true;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tString[] items = line.split(\",\");\n\t\t\t\tif (items.length > 3) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tDocument doc = makeTx(items[0], items[1], Long.parseLong(items[2]), txType);\n\t\t\t\twriter.addDocument(doc);\n\t\t\t}\n\t\t\tbr.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private IndexHandler (boolean test) throws IOException {\n analyzer = new StandardAnalyzer();\n indexDir = test ? new RAMDirectory() : new DistributedDirectory(new MongoDirectory(mongoClient, \"search-engine\", \"index\"));\n //storePath = storedPath;\n config = new IndexWriterConfig(analyzer);\n\n // write separate IndexWriter to RAM for each IndexHandler\n // writer will have to be manually closed with each instance call\n // see IndexWriter documentation for .close()\n // explaining continuous closing of IndexWriter is an expensive operation\n try {\n writer = new IndexWriter(indexDir, config);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws Exception {\n\t\t\tString indexPath = \"F:/IRS/search/pr/sig_index_naive\";\n\t\t\tString docsPath = \"F:/IRS/search/vldb_icse_id.txt\";\n\t\t\tDirectory dir = FSDirectory.open(Paths.get(indexPath));\n\t\t\tAnalyzer analyzer = new StandardAnalyzer();\n\t\t\tIndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n\t\t\tIndexWriter writer = new IndexWriter(dir, iwc);\n\t\t\t\n\t\t\tFileReader f1 = new FileReader(docsPath);\n\t\t\tBufferedReader br = new BufferedReader(f1);\n\t\t\t\n\t\t\tdouble d;\n\t\t\t//String d=null;\n\t\t\tString lineTxt = null;\n\t\t\t\n\t\t\twhile ((lineTxt = br.readLine()) != null)\n\t\t {\n\t\t\t\t\t String[] splits = lineTxt.split(\"\\t\");\n\t\t\tDocument doc = new Document();\n\n\t\t\tdoc.add(new StringField(\"docid\", splits[0] , Field.Store.YES));\n\n\t\t\tdoc.add(new TextField(\"title\", splits[1], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"title\", splits[1], Field.Store.YES));\t\n\t\t\tdoc.add(new SortedField);\n\n\t\t\tdoc.add(new TextField(\"titlexn\", splits[2], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"titlexn\", splits[2], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"year\", splits[3], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"date\", splits[4], Field.Store.YES));\n\t\t\tdoc.add(new TextField(\"conf\", splits[7], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"conf\", splits[7], Field.Store.YES));\n\t\t\t\n\t\t\twriter.addDocument(doc);\n\t\t\t\n\t\t}\n\n\t\t\twriter.close();\n\t\t}", "public CreateIndex(File selectedFolder) {\n\n\t\tFile selectedFilePeople = new File(selectedFolder + Settings.nameOfPeopleFile);\n\t\tFile selectedFileEvents = new File(selectedFolder + Settings.nameOfEventsFile);\n\t\t\n\t\ttry {\n\t\t\tpeopleAndEventsCreate(selectedFolder, selectedFilePeople, Settings.nameOfLuceneIndexPeople);\n\t\t\tpeopleAndEventsCreate(selectedFolder, selectedFileEvents, Settings.nameOfLuceneIndexEvents);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run() {\n\t\t\t\t\tboolean b = false;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tb = IreportRmiClient.rmiInterfactRemote.generateIndex();\r\n\t\t\t\t\t\tif (!b) {\r\n\t\t\t\t\t\t\t// 0个索引文件\r\n\t\t\t\t\t\t\tAddedOperator.log(\"索引到0个文件..可能你的路径配置错误,请查看服务端输出信息\",\r\n\t\t\t\t\t\t\t\t\tIreportConstant.WARN_);\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tAddedOperator.log(\"新建索引成功\", IreportConstant.RIGHT_);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (RemoteException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\tAddedOperator.log(\"新建索引错误:\" + e.getMessage(),\r\n\t\t\t\t\t\t\t\tIreportConstant.ERROR_);\r\n\t\t\t\t\t\tDialogFactory.showErrorMessageDialog(jb,\r\n\t\t\t\t\t\t\t\te.getMessage(), \"新建索引错误\");\r\n\t\t\t\t\t\tthrow new RuntimeException(e.getMessage());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}", "private void createFileTableIndexes() throws Exception {\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index FILE_ID_INDEX_FILE on FILE(FILE_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index START_REVISION_ID_INDEX_FILE on FILE(START_REVISION_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index END_REVISION_ID_INDEX_FILE on FILE(END_REVISION_ID)\");\n \t}", "public static void main(String[] args) throws IOException\r\n\t{\n\t\tif (args.length <= 0)\r\n\t\t{\r\n System.out.println(\"Expected corpus as input\");\r\n System.exit(1);\r\n }\r\n\r\n\t\t// Analyzer that is used to process TextField\r\n\t\tAnalyzer analyzer = new StandardAnalyzer();\r\n\r\n\t\t// ArrayList of documents in the corpus\r\n\t\tArrayList<Document> documents = new ArrayList<Document>();\r\n\r\n\t\t// Open the directory that contains the search index\r\n\t\tDirectory directory = FSDirectory.open(Paths.get(INDEX_DIRECTORY));\r\n\r\n\t\t// Set up an index writer to add process and save documents to the index\r\n\t\tIndexWriterConfig config = new IndexWriterConfig(analyzer);\r\n\t\tconfig.setOpenMode(IndexWriterConfig.OpenMode.CREATE);\r\n\t\tIndexWriter iwriter = new IndexWriter(directory, config);\r\n\r\n\r\n\t\tfor (String arg : args)\r\n\t\t{\r\n\r\n\t\t\t// Load the contents of the file\r\n\t\t\t//System.out.printf(\"Indexing \\\"%s\\\"\\n\", arg);\r\n\t\t\tString content = new String(Files.readAllBytes(Paths.get(arg)));\r\n\r\n\t\t\tString[] big = content.split(\".I\");\r\n\t\t\tfor (String a : big) {\r\n\t\t\t\tDocument doc = new Document();\r\n\t\t\t\tint count = 0;\r\n\t\t\t\tString[] small = a.split(\".A\");\r\n\t\t\t\tfor (String b : small) {\r\n\t\t\t\t\tif (count == 0) {\r\n\t\t\t\t\t\tdoc.add(new StringField(\"filename\", b, Field.Store.YES));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tdoc.add(new TextField(\"content\", b, Field.Store.YES));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\tdocuments.add(doc);\r\n\t\t\t}\r\n\t\t\tfor (Document doc : documents) {\r\n\t\t\t\tSystem.out.println(doc.get(\"filename\"));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Write all the documents in the linked list to the search index\r\n\t\tiwriter.addDocuments(documents);\r\n\r\n\t\t// Commit everything and close\r\n\t\tiwriter.close();\r\n\t\tdirectory.close();\r\n\t}", "private static void createIndexDocument(String path, Configuration c, LODEParser l, Properties lang){\n //the boolean valuas come from the configuration.\n String textToWrite = Constants.getIndexDocument(\"resources\",c, l, lang);\n saveDocument(path+File.separator+\"index-\"+c.getCurrentLanguage()+\".html\", textToWrite,c);\n }", "public void populateBinaryTrees(){\n\t\tIndex[] codeIndexes = readIndexes(new File(ApplicationConstants.CODE_INDEX_FILE));\n\t\tIndex[] nameIndexes = readIndexes(new File(ApplicationConstants.NAME_INDEX_FILE));\n\n\t\tcreateIndexBinaryTree(codeIndexes, MainScreen.codeIndexTree);\n\t\tcreateIndexBinaryTree(nameIndexes, MainScreen.nameIndexTree);\n\n\t}", "@Override\n public void buildIndexes(Properties props)\n {\n Statement statement;\n try\n {\n statement = connection.createStatement();\n \n //Create Indexes\n statement.executeUpdate(\"CREATE INDEX CONFFRIENDSHIP_INVITEEID ON CONFFRIENDSHIP (INVITEEID)\");\n statement.executeUpdate(\"CREATE INDEX CONFFRIENDSHIP_INVITERID ON CONFFRIENDSHIP (INVITERID)\");\n statement.executeUpdate(\"CREATE INDEX PENDFRIENDSHIP_INVITEEID ON PENDFRIENDSHIP (INVITEEID)\");\n statement.executeUpdate(\"CREATE INDEX PENDFRIENDSHIP_INVITERID ON PENDFRIENDSHIP (INVITERID)\");\n statement.executeUpdate(\"CREATE INDEX MANIPULATION_RID ON MANIPULATION (RID)\");\n statement.executeUpdate(\"CREATE INDEX MANIPULATION_CREATORID ON MANIPULATION (CREATORID)\");\n statement.executeUpdate(\"CREATE INDEX RESOURCES_WALLUSERID ON RESOURCES (WALLUSERID)\");\n statement.executeUpdate(\"CREATE INDEX RESOURCE_CREATORID ON RESOURCES (CREATORID)\");\n \n System.out.println(\"Indexes Built\");\n }\n catch (Exception ex)\n {\n Logger.getLogger(WindowsAzureClientInit.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Error in building indexes!\");\n }\n }", "private void createInvertedIndex() {\n\t\tArrayList<Index> invertedIndex=new ArrayList<>();\n\t\ttry{\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\part-r-00001\"));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tString parts[] = line.split(\"\\t\");\n\t\t\t\tparts[1]=parts[1].replace(\"{\", \"\").replace(\"}\", \"\");\n\t\t\t\tString counts[]=parts[1].split(\",\");\n\t\t\t\tHashMap<String,Integer> fileList=new HashMap<String,Integer>();\n\t\t\t\tfor (String count : counts) {\n\t\t\t\t\tString file[]=count.split(\"=\");\n\t\t\t\t\tfileList.put(file[0].trim().replace(\".txt\", \"\"), Integer.parseInt(file[1].trim()));\n\t\t\t\t}\n\t\t\t\tIndex index=new Index();\n\t\t\t\tindex.setWord(parts[0]);\n\t\t\t\tindex.setFileList(fileList);\n\t\t\t\tinvertedIndex.add(index);\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.insertIndex(invertedIndex);\n\t}", "@Ignore\n @Test\n public void testCreateIndex() {\n System.out.println(\"createIndex\");\n Util.commonServiceIPs=\"127.0.0.1\";\n \n EntityManager em=Util.getEntityManagerFactory(100).createEntityManager();\n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client client = ESUtil.getClient(em,platformEm,1,false);\n \n RuntimeContext.dataobjectTypes = Util.getDataobjectTypes();\n String indexName = \"test000000\";\n try {\n ESUtil.createIndex(platformEm, client, indexName, true);\n }\n catch(Exception e)\n {\n \n }\n \n\n }", "LuceneMemoryIndex createLuceneMemoryIndex();", "public static void main(String[] args) throws CorruptIndexException, LockObtainFailedException, IOException, ParseException{\n\t\tboolean lucene_im_mem = false;\n\t\t//1. Build the Index with varying \"database size\"\n\t\tString dirName =\"/data/home/duy113/SupSearchExp/AIDSNew/\";\n//\t\tString dirName = \"/Users/dayuyuan/Documents/workspace/Experiment/\";\n\t\tString dbFileName = dirName + \"DBFile\";\n\t\tString trainQueryName= dirName + \"TrainQuery\";\n//\t\tString testQuery15 = dirName + \"TestQuery15\";\n\t\tString testQuery25 = dirName + \"TestQuery25\";\n//\t\tString testQuery35 = dirName + \"TestQuery35\";\n\t\tGraphDatabase query = new GraphDatabase_OnDisk(testQuery25, MyFactory.getSmilesParser());\n\t\tdouble[] minSupts = new double[4];\n\t\tminSupts[0] = 0.05; minSupts[1] = 0.03; minSupts[2] =0.02; minSupts[3] = 0.01;\n \t\tint lwIndexCount[] = new int[1];\n\t\tlwIndexCount[0] = 479;\t\n//\t\tSystem.out.println(\"Build CIndexFlat Left-over: \");\n//\t\tfor(int j = 3; j< 4; j++){\n//\t\t\tdouble minSupt = minSupts[j];\n//\t\t\tfor(int i = 4; i<=10; i = i+2){\n//\t\t\t\tString baseName = dirName + \"G_\" + i + \"MinSup_\" + minSupt + \"/\";\n//\t\t\t\tGraphDatabase trainingDB = new GraphDatabase_OnDisk(dbFileName + i, MyFactory.getDFSCoder());\n//\t\t\t\tGraphDatabase trainQuery = new GraphDatabase_OnDisk(trainQueryName, MyFactory.getSmilesParser());\t\t\n//\t\t\t\tif(i == 2){\n//\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat\");\n//\t\t\t\t\tCIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, baseName, minSupt, lwIndexCount[0]);\n//\t\t\t\t}\n//\t\t\t\telse{\n//\t\t\t\t\tString featureBaseName = dirName + \"G_2\" + \"MinSup_\" + minSupt + \"/\";\n//\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat with Features \" + featureBaseName);\n//\t\t\t\t\tCIndexExp.buildIndex(featureBaseName, trainingDB, baseName, minSupt);\n//\t\t\t\t}\n//\t\t\t\tSystem.gc();\n//\t\t\t}\n//\t\t}\n\t\tSystem.out.println(\"Run Query Processing: \");\n\t\tfor(int j = 0; j< 4; j++){\n\t\t\tdouble minSupt = minSupts[j];\n\t\t\tfor(int i = 2; i<=10; i = i+2){\n\t\t\t\tString baseName = dirName + \"G_\" + i + \"MinSup_\" + minSupt + \"/\";\n\t\t\t\tGraphDatabase trainingDB = new GraphDatabase_OnDisk(dbFileName + i, MyFactory.getDFSCoder());\n\t\t\t\tGraphDatabase trainQuery = new GraphDatabase_OnDisk(trainQueryName, MyFactory.getSmilesParser());\t\t\n\t\t\t\tif(j!=0 || i!=2){\n\t\t\t\t\tSystem.out.println(baseName + \"LWindex\");\n\t\t\t\t\t//LWIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, trainQuery.getParser(),baseName, minSupt, lwIndexCount);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tLWIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tLWIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\t\t\n\t\t\t\t\tSystem.out.println(baseName + \"PrefixIndex\");\n\t\t\t\t\t//PrefixIndexExp.buildIndex(trainingDB, trainingDB, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tPrefixIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tPrefixIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\t\t\n\t\t\t\t\tSystem.out.println(baseName + \"PrefixIndexHi\");\n\t\t\t\t\t//PrefixIndexExp.buildHiIndex(trainingDB, trainingDB, 2, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tPrefixIndexExp.runHiIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tPrefixIndexExp.runHiIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tSystem.out.println(baseName + \"GPTree\");\n\t\t\t\t\t//GPTreeExp.buildIndex(trainingDB, trainingDB, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tGPTreeExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tGPTreeExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat\");\n\t\t\t\t\t//CIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, baseName, minSupt, lwIndexCount[0]);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tCIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tCIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t}\n\t\t\t\tif(j==0&&i==2){\n\t\t\t\t\tSystem.out.println(baseName + \"CIndexTopDown: \" + lwIndexCount[0]);\n\t\t\t\t\tCIndexExp.buildIndexTopDown(trainingDB, trainQuery, trainingDB,MyFactory.getUnCanDFS(), baseName, minSupt, 2*trainQuery.getTotalNum()/lwIndexCount[0] ); // 8000 test queries\n\t\t\t\t\t//System.gc();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(baseName + \"CIndexTopDown: \" + lwIndexCount[0]);\n\t\t\t\tCIndexExp.runIndexTopDown(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\tCIndexExp.runIndexTopDown(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\tSystem.gc();\n\t\t\t}\n\t\t}\n\t\tAIDSLargeExp.main(args);\n\t}", "private void ensureIndexes() throws Exception {\n LOGGER.info(\"Ensuring all Indexes are created.\");\n\n QueryResult indexResult = bucket.query(\n Query.simple(select(\"indexes.*\").from(\"system:indexes\").where(i(\"keyspace_id\").eq(s(bucket.name()))))\n );\n\n\n List<String> indexesToCreate = new ArrayList<String>();\n indexesToCreate.addAll(Arrays.asList(\n \"def_sourceairport\", \"def_airportname\", \"def_type\", \"def_faa\", \"def_icao\", \"def_city\"\n ));\n\n boolean hasPrimary = false;\n List<String> foundIndexes = new ArrayList<String>();\n for (QueryRow indexRow : indexResult) {\n String name = indexRow.value().getString(\"name\");\n if (name.equals(\"#primary\")) {\n hasPrimary = true;\n } else {\n foundIndexes.add(name);\n }\n }\n indexesToCreate.removeAll(foundIndexes);\n\n if (!hasPrimary) {\n String query = \"CREATE PRIMARY INDEX def_primary ON `\" + bucket.name() + \"` WITH {\\\"defer_build\\\":true}\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully created primary index.\");\n } else {\n LOGGER.warn(\"Could not create primary index: {}\", result.errors());\n }\n }\n\n for (String name : indexesToCreate) {\n String query = \"CREATE INDEX \" + name + \" ON `\" + bucket.name() + \"` (\" + name.replace(\"def_\", \"\") + \") \"\n + \"WITH {\\\"defer_build\\\":true}\\\"\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully created index with name {}.\", name);\n } else {\n LOGGER.warn(\"Could not create index {}: {}\", name, result.errors());\n }\n }\n\n LOGGER.info(\"Waiting 5 seconds before building the indexes.\");\n\n Thread.sleep(5000);\n\n StringBuilder indexes = new StringBuilder();\n boolean first = true;\n for (String name : indexesToCreate) {\n if (first) {\n first = false;\n } else {\n indexes.append(\",\");\n }\n indexes.append(name);\n }\n\n if (!hasPrimary) {\n indexes.append(\",\").append(\"def_primary\");\n }\n\n String query = \"BUILD INDEX ON `\" + bucket.name() + \"` (\" + indexes.toString() + \")\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully executed build index query.\");\n } else {\n LOGGER.warn(\"Could not execute build index query {}.\", result.errors());\n }\n }", "private void addNetworkIndexes() {\r\n try {\r\n addIndex(NodeTypes.SITE.getId(), NeoUtils.getLocationIndexProperty(basename));\r\n } catch (IOException e) {\r\n throw (RuntimeException)new RuntimeException().initCause(e);\r\n }\r\n \r\n }", "private static PlaceIndex buildIndex(File repo) throws RepositoryException, SailException {\n PlaceIndex index = new PlaceIndex();\n\n // start repository\n NativeStore store = new NativeStore(repo);\n Repository repository = new SailRepository(store);\n repository.initialize();\n RepositoryConnection connection = repository.getConnection();\n\n // create the root place\n ValueFactory factory = repository.getValueFactory();\n Value root = factory.createURI(Place.ROOT.toURL().toString());\n\n try {\n\n // prepare SPARQL queries\n TupleQuery queryChildren = connection.prepareTupleQuery(QueryLanguage.SPARQL, QUERY_CHILDREN);\n TupleQuery queryNamesOff = connection.prepareTupleQuery(QueryLanguage.SPARQL, QUERY_NAMES_OFF);\n TupleQuery queryNamesAlt = connection.prepareTupleQuery(QueryLanguage.SPARQL, QUERY_NAMES_ALT);\n\n // add children recursively, starting from the root\n queryChildren.setBinding(\"parent\", root);\n addChildren(index, Place.ROOT, queryChildren, queryNamesOff, queryNamesAlt);\n\n } catch (RepositoryException e) {\n LOGGER.error(\"exception while building index\", e);\n } finally {\n connection.close();\n repository.shutDown();\n store.shutDown();\n return index;\n }\n }", "public void controlIndex(String path)\n { \t \n \t JSONParser parser = new JSONParser();\n \t \n \t try\n \t {\n \t\t JSONArray array = (JSONArray)parser.parse(new FileReader(path));\n \t\t \n \t\t JSONObject jsonObject = new JSONObject();\n \t\t JSONObject metaObj;\n \t\t \n \t\t for(Object obj : array)\n \t\t {\n \t\t\t jsonObject = (JSONObject) obj;\n \t\t\t String p = jsonObject.get(\"p\").toString().replaceAll(\"\\\\\\\\\", \"/\");\n \t\t\t metaObj = (JSONObject) jsonObject.get(\"metadata\");\n \t\t\t \n \t\t\t String title = \"\";\n \t\t\t String description = \"\"; \n \t\t\t if(metaObj.get(\"title\")!=null)\n \t\t\t {\n \t\t\t\t title = metaObj.get(\"title\").toString();\n \t\t\t }\n \t\t\t if(metaObj.get(\"description\")!=null)\n \t\t\t {\n \t\t\t\t description = metaObj.get(\"description\").toString();\n \t\t\t }\n \t\t\t \n \t\t\t String id = p.substring(p.lastIndexOf(\"/\")+1,p.lastIndexOf(\".\"));\n \t\t\t \n \t\t\t performIndex(p,id,title,description);\n \t\t\t performMetaIndex(jsonObject.get(\"metadata\"),id);\n \t\t }\n \t\t fileWriter();\n \t\t }\n \t catch(Exception e)\n \t { \t\n \t\t e.printStackTrace();\n \t }\n }", "public static void main(String[] args) throws Exception {\n String usage =\n \"Usage:\\tjava org.apache.lucene.demo.SearchFiles [-index dir] [-field f] [-repeat n] [-queries file] [-query string] [-raw] [-paging hitsPerPage]\\n\\nSee http://lucene.apache.org/core/4_1_0/demo/ for details.\";\n if (args.length > 0 && (\"-h\".equals(args[0]) || \"-help\".equals(args[0]))) {\n System.out.println(usage);\n System.exit(0);\n }\n\n String index = \"index\";\n String field = \"contents\";\n String queries = null;\n int repeat = 0;\n boolean raw = false;\n String queryString = null;\n int hitsPerPage = 10;\n String[] fileTypes = null;\n Date fileDate = null;\n Set<String> mFilesSet = new HashSet<>();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n String fileDateString = null;\n\n for (int i = 0; i < args.length; i++) {\n if (\"-index\".equals(args[i])) {\n index = args[i + 1];\n i++;\n } else if (\"-field\".equals(args[i])) {\n field = args[i + 1];\n i++;\n } else if (\"-queries\".equals(args[i])) {\n queries = args[i + 1];\n i++;\n } else if (\"-query\".equals(args[i])) {\n queryString = args[i + 1];\n i++;\n } else if (\"-repeat\".equals(args[i])) {\n repeat = Integer.parseInt(args[i + 1]);\n i++;\n } else if (\"-raw\".equals(args[i])) {\n raw = true;\n } else if (\"-paging\".equals(args[i])) {\n hitsPerPage = Integer.parseInt(args[i + 1]);\n if (hitsPerPage <= 0) {\n System.err.println(\"There must be at least 1 hit per page.\");\n System.exit(1);\n }\n i++;\n } else if(\"-filter\".equals(args[i])){\n filtering = true;\n }\n }\n\n if(filtering) {\n //read the filters file\n try (\n InputStream fis = new FileInputStream(\"filters.txt\");\n InputStreamReader isr = new InputStreamReader(fis, Charset.defaultCharset());\n BufferedReader br = new BufferedReader(isr);\n ) {\n //read first line which contains the types of the files to be searched\n Stream<String> lines;\n lines = br.lines();\n\n\n for (Iterator<String> i = lines.iterator(); i.hasNext(); ) {\n String line;\n line = i.next();\n if (line.startsWith(\"#\")) { //ignore comments in filters file\n } else if (line.startsWith(\"files: \")) {\n line = line.replaceFirst(\"files: \", \"\");\n fileTypes = line.split(\",\");\n mFilesSet.add(\"pdf\");\n mFilesSet.add(\"txt\");\n mFilesSet.add(\"epub\");\n for (int j = 0; j < fileTypes.length; j++) {\n mFilesSet.remove(fileTypes[j]); //remove from the hashset those file types parsed from the user file\n }\n } else if (line.startsWith(\"date:\")) {\n line = line.replaceFirst(\"date: \", \"\");\n fileDate = dateFormat.parse(line);\n fileDateString = line;\n //System.out.println(fileDateString);\n //System.out.println(\"Date: \" + fileDate.toString());\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(index)));\n IndexSearcher searcher = new IndexSearcher(reader);\n Analyzer analyzer = new MyAnalyzer();\n\n BufferedReader in = null;\n\n if (queries != null) {\n in = Files.newBufferedReader(Paths.get(queries), StandardCharsets.UTF_8);\n } else {\n in = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));\n }\n\n QueryParser parser = new QueryParser(field, analyzer);\n BooleanQuery.Builder booleanQueryBuilder = new BooleanQuery.Builder();\n BooleanQuery booleanQuery = booleanQueryBuilder.build();\n while (true) {\n if (queries == null && queryString == null) {// prompt the user\n System.out.println(\"Enter query: \");\n }\n\n String line = queryString != null ? queryString : in.readLine();\n\n if (line == null || line.length() == -1) {\n break;\n }\n\n line = line.trim();\n if (line.length() == 0) {\n break;\n }\n\n Query query;\n\n if(filtering) {\n for (Iterator<String> iterator = mFilesSet.iterator(); iterator.hasNext(); ) {\n String mString = iterator.next();\n Query mQuery = new TermQuery(new Term(\"filetype\", mString));\n booleanQueryBuilder.add(mQuery, BooleanClause.Occur.MUST_NOT);\n }\n query = parser.parse(line);\n\n Date currentDate = new Date();\n BytesRef lowerTerm = new BytesRef(fileDateString);\n BytesRef upperTerm = new BytesRef(dateFormat.format(currentDate));\n //System.out.println(dateFormat.format(currentDate));\n TermRangeQuery dateQuery = TermRangeQuery.newStringRange(\"modified\",fileDateString,dateFormat.format(currentDate),false,false);\n //Query dateQuery = IntPoint.newRangeQuery(\"modified\", ((int) fileDate.getTime()),(int)currentDate.getTime());\n booleanQueryBuilder.add(dateQuery, BooleanClause.Occur.MUST);\n booleanQueryBuilder.add(query, BooleanClause.Occur.MUST);\n //booleanQueryBuilder.add(dateQuery, BooleanClause.Occur.MUST);\n\n booleanQuery = booleanQueryBuilder.build();\n //System.out.println(\"Query: \" + booleanQuery.toString());\n //System.out.println(\"Searching for: \" + query.toString(field));\n }\n else {\n query = parser.parse(line);\n }\n if (repeat > 0) { // repeat & time as benchmark\n Date start = new Date();\n for (int i = 0; i < repeat; i++) {\n searcher.search(query, 100);\n }\n Date end = new Date();\n System.out.println(\"Time: \" + (end.getTime() - start.getTime()) + \"ms\");\n }\n\n if(filtering){\n doPagingSearch(in, searcher, booleanQuery, hitsPerPage, raw, queries == null && queryString == null);\n }\n else {\n doPagingSearch(in, searcher, query, hitsPerPage, raw, queries == null && queryString == null);\n }\n if (queryString != null) {\n break;\n }\n }\n reader.close();\n\n }", "static File getIndexFile(File indexName) throws FileNotFoundException {\n\t\tfor (int i = 0; i < 2; i++)\n\t\t\ttry {\n\t\t\t\tFile raf = new File(indexName, \"rw\");\n\t\t\t\tif (!raf.isFile()) {\n\t\t\t\t\traf.getParentFile().mkdirs();\n\t\t\t\t} else return raf;\n\t\t\t} catch (Exception e) { System.err.println(\"\"); }\n\t\treturn null;\n\t}", "public TranscriptionIndexer() throws SQLException, CorruptIndexException, IOException\r\n {\r\n\r\n\r\n IndexWriter writer = null;\r\n Analyzer analyser;\r\n Directory directory;\r\n /**@TODO parameterized location*/\r\n String dest = \"/usr/indexTranscriptions\";\r\n\r\n directory = FSDirectory.getDirectory(dest, true);\r\n analyser = new StandardAnalyzer();\r\n writer = new IndexWriter(directory, analyser, true);\r\n PreparedStatement stmt=null;\r\n Connection j = null;\r\n try {\r\n j=DatabaseWrapper.getConnection();\r\n String query=\"select * from transcription where text!='' and creator>0 order by folio, line\";\r\n stmt=j.prepareStatement(query);\r\n ResultSet rs=stmt.executeQuery();\r\n while(rs.next())\r\n {\r\n int folio=rs.getInt(\"folio\");\r\n int line=rs.getInt(\"line\");\r\n int UID=rs.getInt(\"creator\");\r\n int id=rs.getInt(\"id\");\r\n Transcription t=new Transcription(id);\r\n Document doc = new Document();\r\n Field field;\r\n field = new Field(\"text\", t.getText(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"comment\", t.getComment(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"creator\", \"\" + t.UID, Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"security\", \"\" + \"private\", Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"line\", \"\" + t.getLine(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"page\", \"\" + t.getFolio(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"id\", \"\" + t.getLineID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"manuscript\", \"\" + new Manuscript(t.getFolio()).getID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"projectID\", \"\" + t.getProjectID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n writer.addDocument(doc);\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n if(writer!=null)\r\n {\r\n writer.commit();\r\n \twriter.close();\r\n return;\r\n }\r\n ex.printStackTrace();\r\n }\r\n finally{\r\n DatabaseWrapper.closeDBConnection(j);\r\n DatabaseWrapper.closePreparedStatement(stmt);\r\n }\r\n\r\n writer.commit();\r\n \twriter.close();\r\n}", "public static synchronized void indexDocuments(Queue<CodeIndexDocument> codeIndexDocumentQueue) throws IOException {\n // Index all documents and commit at the end for performance gains\n Directory dir = FSDirectory.open(Paths.get(Properties.getProperties().getProperty(Values.INDEXLOCATION, Values.DEFAULTINDEXLOCATION)));\n Directory facetsdir = FSDirectory.open(Paths.get(Properties.getProperties().getProperty(Values.FACETSLOCATION, Values.DEFAULTFACETSLOCATION)));\n\n Analyzer analyzer = new CodeAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n FacetsConfig facetsConfig = new FacetsConfig();\n SearchcodeLib scl = new SearchcodeLib();\n\n iwc.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND);\n\n IndexWriter writer = new IndexWriter(dir, iwc);\n TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(facetsdir);\n\n\n try {\n CodeIndexDocument codeIndexDocument = codeIndexDocumentQueue.poll();\n int count = 0;\n\n while (codeIndexDocument != null) {\n Singleton.getLogger().info(\"Indexing file \" + codeIndexDocument.getRepoLocationRepoNameLocationFilename());\n Singleton.decrementCodeIndexLinesCount(codeIndexDocument.getCodeLines());\n\n Document doc = new Document();\n // Path is the primary key for documents\n // needs to include repo location, project name and then filepath including file\n Field pathField = new StringField(\"path\", codeIndexDocument.getRepoLocationRepoNameLocationFilename(), Field.Store.YES);\n doc.add(pathField);\n\n // Add in facets\n facetsConfig = new FacetsConfig();\n facetsConfig.setIndexFieldName(Values.LANGUAGENAME, Values.LANGUAGENAME);\n facetsConfig.setIndexFieldName(Values.REPONAME, Values.REPONAME);\n facetsConfig.setIndexFieldName(Values.CODEOWNER, Values.CODEOWNER);\n\n if (Helpers.isNullEmptyOrWhitespace(codeIndexDocument.getLanguageName()) == false) {\n doc.add(new SortedSetDocValuesFacetField(Values.LANGUAGENAME, codeIndexDocument.getLanguageName()));\n }\n if (Helpers.isNullEmptyOrWhitespace(codeIndexDocument.getRepoName()) == false) {\n doc.add(new SortedSetDocValuesFacetField(Values.REPONAME, codeIndexDocument.getRepoName()));\n }\n if (Helpers.isNullEmptyOrWhitespace(codeIndexDocument.getCodeOwner()) == false) {\n doc.add(new SortedSetDocValuesFacetField(Values.CODEOWNER, codeIndexDocument.getCodeOwner()));\n }\n\n String indexContents = Values.EMPTYSTRING;\n\n Singleton.getLogger().info(\"Splitting keywords\");\n indexContents += scl.splitKeywords(codeIndexDocument.getContents());\n Singleton.getLogger().info(\"Cleaning pipeline\");\n indexContents += scl.codeCleanPipeline(codeIndexDocument.getContents());\n Singleton.getLogger().info(\"Adding to spelling corrector\");\n scl.addToSpellingCorrector(codeIndexDocument.getContents()); // Store in spelling corrector\n\n indexContents = indexContents.toLowerCase();\n\n doc.add(new TextField(Values.REPONAME, codeIndexDocument.getRepoName(), Field.Store.YES));\n doc.add(new TextField(Values.FILENAME, codeIndexDocument.getFileName(), Field.Store.YES));\n doc.add(new TextField(Values.FILELOCATION, codeIndexDocument.getFileLocation(), Field.Store.YES));\n doc.add(new TextField(Values.FILELOCATIONFILENAME, codeIndexDocument.getFileLocationFilename(), Field.Store.YES));\n doc.add(new TextField(Values.MD5HASH, codeIndexDocument.getMd5hash(), Field.Store.YES));\n doc.add(new TextField(Values.LANGUAGENAME, codeIndexDocument.getLanguageName(), Field.Store.YES));\n doc.add(new IntField(Values.CODELINES, codeIndexDocument.getCodeLines(), Field.Store.YES));\n doc.add(new TextField(Values.CONTENTS, indexContents, Field.Store.NO));\n doc.add(new TextField(Values.REPOLOCATION, codeIndexDocument.getRepoRemoteLocation(), Field.Store.YES));\n doc.add(new TextField(Values.CODEOWNER, codeIndexDocument.getCodeOwner(), Field.Store.YES));\n\n // Extra metadata in this case when it was last indexed\n doc.add(new LongField(Values.MODIFIED, new Date().getTime(), Field.Store.YES));\n\n writer.updateDocument(new Term(Values.PATH, codeIndexDocument.getRepoLocationRepoNameLocationFilename()), facetsConfig.build(taxoWriter, doc));\n\n count++;\n if (count >= 1000) { // Only index 1000 documents at most each time\n codeIndexDocument = null;\n }\n else {\n codeIndexDocument = codeIndexDocumentQueue.poll();\n }\n\n }\n }\n finally {\n Singleton.getLogger().info(\"Closing writers\");\n writer.close();\n taxoWriter.close();\n }\n }", "private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }", "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}", "private void indexDocument(File f) throws IOException {\n\n\t\tHashMap<String, StringBuilder> fm;\n\t\tif (!f.getName().equals(\".DS_Store\")) {\n\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\n\t\t\tString s = \"\";\n\t\t\twhile ((s = br.readLine()) != null) {\n\n\t\t\t\tString temp = \"\";\n\n\t\t\t\tif (s.contains(\"<DOC>\")) {\n\n\t\t\t\t\ts = br.readLine();\n\n\t\t\t\t\twhile (!s.contains(\"</DOC>\")) {\n\n\t\t\t\t\t\ttemp += s + \" \";\n\n\t\t\t\t\t\ts = br.readLine();\n\t\t\t\t\t}\n\n\t\t\t\t\tfm = parseTags(temp);\n\t\t\t\t\tindexDocumentHelper(fm);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tbr.close();\n\t\t}\n\n\t}", "public void enableIndexAutoCreation() {\n client.setIndexAutoCreationEnabled(true);\n }", "public void addDocument(Document d) throws IndexerException {\n\t\t\n\t//if (!isvaliddir) {System.out.println(\"INVALID PATH/execution !\");return;}\n\t\n\t\n\t//Tokenizing\n\t//one thgread\n\tDocID did=new DocID(d.getField(FieldNames.FILEID),\n\t\t\td.getField(FieldNames.CATEGORY),\n\t\t\td.getField(FieldNames.AUTHOR));\n\t\n\tTokenStream stream=tokenize(FieldNames.CATEGORY,d);\n\tAnalyzer analyz=analyze(FieldNames.CATEGORY, stream);\n\tCategoryIndex.getInst().doIndexing(did.getdID(), stream);\n\t/*\t}catch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);\n\t}\n\ttry{*/TokenStream stream1=tokenize(FieldNames.AUTHOR,d);\n\tAnalyzer analyz1=analyze(FieldNames.AUTHOR, stream1);\n\tAuthorIndex.getInst().doIndexing(did.getdID(), stream1);\n\t/*}catch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);}\n\ttry{*/TokenStream stream2=tokenize(FieldNames.PLACE,d);\n\tAnalyzer analyz2=analyze(FieldNames.PLACE, stream2);\n\tPlaceIndex.getInst().doIndexing(did.getdID(), stream2);\n/*}catch(Exception e)\n\t{\n\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t);}\n\ttry{*/tkizer = new Tokenizer();\n\tTokenStream stream3=tokenize(FieldNames.CONTENT,d);\n\tfactory = AnalyzerFactory.getInstance();\n\tAnalyzer analyz3=analyze(FieldNames.CONTENT, stream3);\n\tnew Indxr(IndexType.TERM).doIndexing(did, stream3);\n\t/*}\tcatch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);}\n\t*/\n\tdocs.add(did==null?\" \":did.toString());\n\t \n\t\na_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.AUTHOR);\nc_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.CATEGORY);\np_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.PLACE);\nt_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.TERM);\n\t\t}", "public void testIndexCosts() {\n this.classHandler.applyIndexes();\n }", "boolean createIndex(String indexName);", "IIndexFragmentFileSet createFileSet();", "@Scheduled(fixedRate = 5000)\n public void refreshAllIndex() {\n\n HashMap<String, String> dictlist = new HashMap<>();\n\n //get the file list\n try {\n dictlist = FileUtil.subFolderList(fieryConfig.getIndexpath());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n //load all index if not contain on folder\n for (Map.Entry<String, String> e : dictlist.entrySet()) {\n String foldername = e.getKey();\n String folderpath = e.getValue();\n if (!readerList.containsKey(foldername)) {\n log.info(\"start load index foldername:\" + foldername + \" abspath:\" + folderpath);\n //open index\n boolean ret = this.openIndex(foldername, folderpath);\n\n //warning this may cause bug\n //loaded fail? clean it\n if (!ret) {\n FileUtil.deleteDir(folderpath);\n }\n }\n }\n\n\n /////////////////////\n // recycle expire index\n /////////////////////\n for (Map.Entry<String, DirectoryReader> e : readerList.entrySet()) {\n String dbname = e.getKey();\n\n try {\n Long dbtime = Long.parseLong(dbname);\n\n if (dbtime < DateTimeHepler.getBeforDay(fieryConfig.getKeepdataday())) {\n //closed all\n if (analyzerList.containsKey(dbname)) {\n analyzerList.get(dbname).close();\n analyzerList.remove(dbname);\n }\n if (directorList.containsKey(dbname)) {\n directorList.get(dbname).close();\n directorList.remove(dbname);\n }\n if (readerList.containsKey(dbname)) {\n readerList.get(dbname).close();\n readerList.remove(dbname);\n }\n\n //remove the folder\n FileUtil.deleteDir(fieryConfig.getIndexpath() + \"/\" + dbname);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n\n\n /////////////////////\n // refresh already loaded index\n /////////////////////\n for (Map.Entry<String, DirectoryReader> e : readerList.entrySet()) {\n\n String dbname = e.getKey();\n DirectoryReader diskReader = e.getValue();\n\n try {\n Date start = new Date();\n\n DirectoryReader tmp = DirectoryReader.openIfChanged(diskReader);\n if (tmp != null) {\n diskReader.close();\n diskReader = tmp;\n readerList.put(dbname, diskReader);\n Date end = new Date();\n log.info(\"Reload Index:\" + dbname + \" cost:\" + (end.getTime() - start.getTime()) + \" totalcount:\" + diskReader.numDocs());\n }\n\n } catch (Exception exx) {\n exx.printStackTrace();\n log.error(exx.getMessage());\n }\n }\n /////////////////////\n //refresh the all in one searcher\n /////////////////////\n\n this.reloadSearch();\n\n }", "private Reindex() {}", "private Reindex() {}", "public void createIndex() throws IOException {\n\t\tLOGGER.info(\"creating photo index...\");\n\t\tCreateIndexRequest request = new CreateIndexRequest(\"files\");\n\t\tInputStream in = getClass().getClassLoader().getResourceAsStream(\"photo.json\");\n\t\tString mapping = new String(in.readAllBytes());\n\t\tin.close();\n\t\trequest.mapping(\"photo\", mapping, XContentType.JSON);\n\t\tCreateIndexResponse response = client.indices().create(request);\n\t\tLOGGER.info(\"photo index created: \" + response.toString());\n\t}", "private void createProductIndex() {\n\t\tLinkedList<String> ids = new LinkedList<>(productIds.keySet());\n\t\tArrayList<ArrayList<Integer>> vals = new ArrayList<>(productIds.values());\n\t\tint k = 8;\n\t\tKFront kf = new KFront();\n\t\tkf.createKFront(k, ids);\n\t\tfor (int i = 0; i < vals.size(); i++) {\n\t\t\tkf.getTable().get(i).addAll(vals.get(i));\n\t\t}\n\n\t\tProductIndex pIndex = new ProductIndex(k);\n\t\tpIndex.insertData(kf.getTable(), kf.getConcatString());\n\t\tsaveToDir(PRODUCT_INDEX_FILE, pIndex);\n\t}", "public static void main(String[] args) throws Exception {\n\t\tqueryIndexPattern();\n\t\t\n\t}", "void testSetup() {\n\t\t// Delete any existing index\n\t\tdeleteIndex();\n\n\t\t// Create the index\n\t\tcreateIndex();\n\n\t\t// Apply mappings for type and subtypes\n\t\tBufferedReader br;\n\t\tString line;\n\t\tStringBuffer sb;\n\t\ttry {\n\t\t\t// Mappings for index + type\n\t\t\tbr = new BufferedReader(new FileReader(\n\t\t\t\t\t\"./data/mappings_domeo_v2.json\"));\n\t\t\tsb = new StringBuffer();\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tsb.append(line + NEWLINE);\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tdoMapping(sb.toString(), false, HTTP_POST);\n\n\t\t\t// Mappings for index + sub-type\n\t\t\tbr = new BufferedReader(new FileReader(\n\t\t\t\t\t\"./data/mappings_domeo_subtype_v2.json\"));\n\t\t\tsb = new StringBuffer();\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tsb.append(line + NEWLINE);\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tdoMapping(sb.toString(), true, HTTP_POST);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Index a doc\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(\"./data/sample_docs.json\"));\n\t\t\tif ((line = br.readLine()) != null) {\n\t\t\t\tinsertDocument(line);\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\trefreshIndex();\n\t}", "void createIndexDir(String indexDirPath) throws IOException {\n File indexDir = new File(indexDirPath);\n if (!indexDir.exists())\n indexDir.mkdir();\n else {\n removeIndexDir(indexDirPath);\n indexDir.mkdir(); \n }\n }", "private void indexItem(IndexDocument indexDoc) {\n if(bDebug) System.out.println(\"\\n*** document to index - \" + indexDoc);\n Indexer indexer=null;\n try {\n indexer=new Indexer(PetstoreConstants.PETSTORE_INDEX_DIRECTORY, false);\n PetstoreUtil.getLogger().log(Level.FINE, \"Adding document to index: \" + indexDoc.toString());\n indexer.addDocument(indexDoc);\n } catch (Exception e) {\n PetstoreUtil.getLogger().log(Level.WARNING, \"index.exception\", e);\n e.printStackTrace();\n } finally {\n try {\n // must close file or will not be able to reindex\n if(indexer != null) {\n indexer.close();\n }\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n }", "private static void peopleAndEventsCreate(File selectedFolder, File selectedFile, String nameOfLuceneIndex) throws Exception {\n\t\tStandardAnalyzer analyzer = new StandardAnalyzer();\n\n\t /* Where to store index */\n\t\tFile directoryOfIndex = new File(selectedFolder + nameOfLuceneIndex);\n\t\tdeleteDirectory(directoryOfIndex);\t\t\t\t\t\t\t\t\t\t\t\t\t\t// before creating new index, the old one is deleted\n\t Directory index = FSDirectory.open(directoryOfIndex);\n\n\t IndexWriterConfig config = new IndexWriterConfig(Version.LATEST, analyzer);\n\t IndexWriter w = new IndexWriter(index, config);\n\t \n\t\tBufferedReader in;\n\t\ttry {\n\t\t\tin = new BufferedReader(new InputStreamReader(new FileInputStream(selectedFile), \"UTF-8\"));\n\n\t\t\twhile (in.ready()) {\n\t\t\t\tString oneLine = in.readLine();\n\t\t\t\t\n\t\t\t\tString[] splittedString = oneLine.split(\";\");\n\t\t\t\t\n\t\t\t\tif(splittedString.length == 2) {\n\t\t\t\t\taddDoc(w, splittedString[0], splittedString[1], \"\");\n\t\t\t\t}\n\t\t\t\telse if(splittedString.length == 3) {\n\t\t\t\t\taddDoc(w, splittedString[0], splittedString[1], splittedString[2]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t \n\t w.close();\n\t}", "public void addIndex() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"index\",\n null,\n childrenNames());\n }", "public static void main(String[] args)\n\t{\n\t\tsqlindexer si=new sqlindexer();\n\t\tsi.indexAll();\n\t\t\n\t\t\n\t}", "public SimpleIndexFactory() {\n\t}", "InstAssignIndex createInstAssignIndex();", "public void indexCreate()\n {\n try{\n Directory dir = FSDirectory.open(Paths.get(\"indice/\"));\n Analyzer analyzer = new StandardAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n iwc.setOpenMode(OpenMode.CREATE);\n IndexWriter writer = new IndexWriter(dir,iwc);\n MongoConnection mongo = MongoConnection.getMongo();\n mongo.OpenMongoClient();\n DBCursor cursor = mongo.getTweets();\n Document doc = null;\n\n while (cursor.hasNext()) {\n DBObject cur = cursor.next();\n if (cur.get(\"retweet\").toString().equals(\"false\")) {\n doc = new Document();\n doc.add(new StringField(\"id\", cur.get(\"_id\").toString(), Field.Store.YES));\n doc.add(new TextField(\"text\", cur.get(\"text\").toString(), Field.Store.YES));\n doc.add(new StringField(\"analysis\", cur.get(\"analysis\").toString(), Field.Store.YES));\n //doc.add(new StringField(\"finalCountry\",cur.get(\"finalCountry\").toString(),Field.Store.YES));\n doc.add(new StringField(\"userScreenName\", cur.get(\"userScreenName\").toString(), Field.Store.YES));\n doc.add(new StringField(\"userFollowersCount\", cur.get(\"userFollowersCount\").toString(), Field.Store.YES));\n doc.add(new StringField(\"favoriteCount\", cur.get(\"favoriteCount\").toString(), Field.Store.YES));\n\n if (writer.getConfig().getOpenMode() == OpenMode.CREATE) {\n System.out.println(\"Indexando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.addDocument(doc);\n System.out.println(doc);\n } else {\n System.out.println(\"Actualizando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.updateDocument(new Term(\"text\" + cur.get(\"text\")), doc);\n System.out.println(doc);\n }\n }\n }\n cursor.close();\n writer.close();\n }\n catch(IOException ioe){\n System.out.println(\" Error en \"+ ioe.getClass() + \"\\n mensaje: \" + ioe.getMessage());\n }\n }", "public void forceUpdateSearchIndexes() throws InterruptedException {\n\t getFullTextEntityManager().createIndexer().startAndWait();\n\t}", "public void WriteIndex() throws Exception {\n CorpusReader corpus = new CorpusReader();\n // initiate the output object\n IndexWriter output = new IndexWriter();\n\n // Map to hold doc_id and doc content;\n Map<String, String> doc;\n\n // index the corpus, load the doc one by one\n while ((doc = corpus.NextDoc()) != null){\n // get the doc_id and content of the current doc.\n String doc_id = doc.get(\"DOC_ID\");\n String content = doc.get(\"CONTENT\");\n\n // index the doc\n output.IndexADoc(doc_id, content);\n }\n output.close_index_writer();\n }", "void index(IDocument document, IIndexerOutput output) throws java.io.IOException;", "public String createDSIndex(String dsID, String dschemaID, String attriName);", "public Indexer() {\n }", "public void openIndex(String indexPath) throws IOException {\n\n }", "public void indexFileOrDirectory(String fileName, String packageType) throws IOException {\n //===================================================\n //gets the list of files in a folder (if user has submitted\n //the name of a folder) or gets a single file name (is user\n //has submitted only the file name)\n //===================================================\n this.setThreadCount(this.queue.size());\n int originalNumDocs = writer.numDocs();\n startTime = System.currentTimeMillis();\n for (File f : queue) {\n LogReader lr = new LogReader(f.getAbsolutePath());\n \n Thread t = new Thread(new Runnable(){//Using thread \n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tcurrentThreadCount = currentThreadCount + 1;\n\t\t\t\t\tSystem.out.println(\"Number of thread: \" + currentThreadCount);\n\t\t\t\t\ttry {\n\t\t for (int cnt = 0; ; cnt++) {\n\t\t \tif(lr == null){\n\t\t \t\tSystem.out.println(\"hello\");\n\t\t \t}\n\t\t ArrayList<Package> list = lr.PackagesWrapper(2000);\n\t\t if (list == null || list.size() <= 0)\n\t\t {\n\t\t break;\n\t\t }\n\n\t\t int size = list.size();\n\t\t ArrayList<Document> docs = new ArrayList<Document>();\n\t\t for (int i = 0; i < size; i++)\n\t\t {\n\t\t Package p = list.get(i);\n\t\t Document doc = new Document();\n\t\t deWrapString(packageType, p, doc);\n\t\t \n\t\t docs.add(doc);\n\t\t }\n\n\t\t writer.addDocuments(docs);\n\n\t\t if (cnt != 0 && cnt % 10 == 0) {\n\t\t flush();\n\t\t currentTime = System.currentTimeMillis();\n\t\t \n\t\t System.out.println(\"Current document: \" + writer.numDocs() + \n\t\t \t\t\", current indexing rate: \" + (writer.numDocs()/ (currentTime - startTime)) * 1000);\n\t\t }\n\t\t }\n\t\t System.out.println(\"Added: \" + f);\n\t\t } catch (Exception e) {\n\t\t \te.printStackTrace();\n\t\t System.out.println(\"Could not add: \" + f);\n\t\t } finally {\n\t\t \tthreadCount--;\n\t\t }\n\t\t\t\t}\n \t\n });\n t.start(); \n /*\n try {\n for (int cnt = 0; ; cnt++) {\n ArrayList<Package> list = lr.PackagesWrapper(2000);\n if (list == null || list.size() <= 0)\n {\n break;\n }\n\n int size = list.size();\n ArrayList<Document> docs = new ArrayList<Document>();\n for (int i = 0; i < size; i++)\n {\n Package p = list.get(i);\n Document doc = new Document();\n this.deWrapString(packageType, p, doc);\n \n docs.add(doc);\n }\n\n writer.addDocuments(docs);\n\n if (cnt % 10 == 0) {\n flush();\n System.out.println(\"bulk count: \" + cnt);\n }\n }\n System.out.println(\"Added: \" + f);\n } catch (Exception e) {\n System.out.println(\"Could not add: \" + f);\n } finally {\n\n }*/\n }\n \n /*\n int newNumDocs = writer.numDocs();\n System.out.println(\"\");\n System.out.println(\"************************\");\n System.out.println((newNumDocs - originalNumDocs) + \" documents added.\");\n System.out.println(\"************************\");\n queue.clear();\n */\n }", "@Override\n public void indexPersistable() {\n searchIndexService.indexAllResourcesInCollectionSubTreeAsync(getPersistable());\n }", "public boolean setIndex(String name){\n\n //array to hold all database names from file\n ArrayList<String> dbNames = new ArrayList<String>();\n\n //create index if it doesn't exist\n File file = new File(\"databases/index.txt\");\n Scanner sc;\n FileWriter fw; \n\n try {\n sc = new Scanner(file); \n //read current database names to array\n String currName; \n if (sc.hasNextLine()){\n while(sc.hasNextLine()){\n currName = sc.nextLine();\n dbNames.add(currName);\n } \n }\n sc.close();\n\n //if database name already in index, exit\n if ( dbNames.contains(name) ){return true;}\n\n } catch(FileNotFoundException ex){}\n \n //add new database name to list of dbs\n dbNames.add(name);\n\n //create / overwrite index file\n try {\n fw = new FileWriter(\"databases/index.txt\");\n } catch (IOException ex2){\n System.out.println(\"ERROR: index not found and could not be created\");\n return false;\n }\n\n //write array of database names to file\n for (String dbName : dbNames){\n try {\n fw.write(dbName);\n fw.write(\"\\n\");\n } catch (IOException ex3) {\n System.out.println(\"ERROR: could not write to index\");\n }\n }\n\n try {\n fw.close();\n } catch (IOException ex4){\n System.out.println(\"ERROR: filewriter could not be closed\");\n return false;\n }\n\n return true;\n }", "@Override\r\n public void execute() throws BuildException \r\n {\r\n try {\r\n //Use Xerces as the parser. Does not support Saxon6.5.5 parser \r\n System.setProperty(\"org.xml.sax.driver\", \"org.apache.xerces.parsers.SAXParser\");\r\n System.setProperty(\"javax.xml.parsers.SAXParserFactory\", \"org.apache.xerces.jaxp.SAXParserFactoryImpl\");\r\n // System.setProperty(\"org.xml.sax.driver\", \"com.icl.saxon.aelfred.SAXDriver\");\r\n // System.setProperty(\"javax.xml.parsers.SAXParserFactory\", \"com.icl.saxon.aelfred.SAXParserFactoryImpl\");\r\n } catch (SecurityException se){\r\n System.out.println(\"[WARNING] Default parser is not set to Xerces. Make sure Saxon6.5.5 \" +\r\n \"is not in your CLASSPATH.\");\r\n } catch (Exception e){\r\n System.out.println(\"[WARNING] Default parser is not set to Xerces. Make sure Saxon6.5.5 \" +\r\n \"is not in your CLASSPATH\");\r\n }\r\n\r\n ArrayList<DocFileInfo> filesDescription = null; // list of information about the topic files\r\n ArrayList<File> htmlFiles = null; // topic files listed in the given directory\r\n ArrayList<String> htmlFilesPathRel = null;\r\n Map<String, String> tempDico = new HashMap<String, String>(); \r\n Iterator it;\r\n\r\n //File name initialization\r\n String htmlList = \"htmlFileList.js\";\r\n String htmlInfoList = \"htmlFileInfoList.js\";\r\n String indexName = \".js\";\r\n\r\n //timing\r\n Date dateStart = new Date();\r\n\t\t\r\n if (htmldir == null) {\r\n System.out.println(txt_no_args + \".\");\r\n return;\r\n }\r\n // Init input directory\r\n inputDir = new File(htmldir);\r\n\r\n // Begin of init\r\n\r\n // check if inputdir exists\t\t\r\n if ((inputDir == null) || !inputDir.exists()) {\r\n System.out.println(txt_no_inputdir + \" \"+ inputDir + \".\");\r\n return;\r\n }\r\n\r\n // check if outputdir defined\r\n if (outputDir == null) {\r\n //set the output directory: path= {inputDir}/search \r\n outputDir = inputDir.getPath().concat(File.separator).concat(searchdir);\r\n }\r\n\r\n // check if outputdir exists\r\n File tempfile = new File(outputDir); \r\n if (!tempfile.exists()) {\r\n boolean b = (new File(outputDir)).mkdir();\r\n if (!b) {\r\n System.out.println(txt_cannot_create_outputdir + \" \"+ outputDir + \".\");\r\n return;\r\n }\r\n }\r\n\t\t\r\n String inputPath = inputDir.getPath();\r\n \r\n //end of init\r\n\r\n\r\n // Get the list of all html files but the tocs, covers and indexes\r\n DirList nsiDoc = new DirList(inputDir, \"^.*\\\\.\" + htmlExtension + \"?$\", 1);\r\n htmlFiles = nsiDoc.getListFiles();\r\n // Check if found html files\r\n if ((htmlFiles == null) || htmlFiles.isEmpty()) {\r\n System.out.println(txt_no_html_files + \" \"+ inputDir + \".\");\r\n return;\r\n }\r\n // Get the list of all html files with relative paths \r\n htmlFilesPathRel = nsiDoc.getListFilesRelTo(inputPath);\r\n if (htmlFilesPathRel == null) {\r\n System.out.println(txt_no_relative_files_found);\r\n return;\t\t\t\r\n }\r\n\t\t\r\n // Create the list of the existing html files (index starts at 0)\r\n String htmlListPath = outputDir.concat(File.separator).concat(htmlList);\r\n WriteJSFiles.WriteHTMLList(htmlListPath, htmlFilesPathRel);\r\n\r\n // Parse each html file to retrieve the words:\r\n // ------------------------------------------\r\n\r\n // Retrieve the clean-up properties for indexing\r\n RetrieveCleanUpProps();\r\n RetrieveEncodingProps();\r\n // System.out.print(\"clean\"+\" \" +cleanUpStrings);\r\n\r\n //create a default handler\r\n //SaxHTMLIndex spe = new SaxHTMLIndex (); // do not use clean-up props files\r\n //SaxHTMLIndex spe = new SaxHTMLIndex (cleanUpStrings); // use clean-up props files\r\n FilesIndexer spe = new FilesIndexer(cleanUpStrings, cleanUpChars, encodingProps); // use clean-up props files\r\n\r\n if ( spe.init(tempDico) == 0 ) {\r\n\r\n //create a html file description list\r\n filesDescription = new ArrayList <DocFileInfo> ();\r\n\r\n it = htmlFiles.iterator ( ) ;\r\n\r\n // parse each html files\r\n while ( it.hasNext ( ) ) {\r\n File ftemp = (File) it.next();\r\n //tempMap.put(key, value);\r\n //The HTML file information are added in the list of FileInfoObject\r\n DocFileInfo docFileInfoTemp = new DocFileInfo(spe.runExtractData(ftemp, IndexerTask.indexerLanguage));\r\n\r\n // Set path relative to inputPath\r\n ftemp = docFileInfoTemp.getFullpath();\r\n String stemp = ftemp.toString(); \r\n int i = stemp.indexOf(inputPath);\r\n if ( i != 0 ) {\r\n System.out.println(\"The file path does not match with the input path: \" + stemp);\r\n continue;\r\n }\r\n int ad = stemp.equals(inputPath) ? 0 : 1;\r\n stemp = stemp.substring(inputPath.length() + ad);\r\n ftemp = new File (stemp);\r\n docFileInfoTemp.setFullpath(ftemp);\r\n\r\n filesDescription.add(docFileInfoTemp);\r\n }\r\n \r\n /*remove empty strings from the map*/\r\n if (tempDico.containsKey(\"\")) {\r\n tempDico.remove(\"\");\r\n }\r\n \r\n // write the index files\r\n if (tempDico.isEmpty()) {\r\n System.out.println(txt_no_words_gathered + \" \"+ inputDir + \".\");\r\n return;\r\n }\r\n\r\n WriteJSFiles.WriteIndex(outputDir.concat(File.separator).concat(indexName), tempDico);\r\n\r\n // write the html list file with title and shortdesc\r\n // create the list of the existing html files (index starts at 0)\r\n WriteJSFiles.WriteHTMLInfoList(outputDir.concat(File.separator).concat(htmlInfoList), filesDescription);\r\n\r\n // perf measurement\r\n Date dateEnd = new Date();\r\n long diff = dateEnd.getTime() - dateStart.getTime();\r\n if(diff < 1000) {\r\n System.out.println(\"Delay = \" + diff + \" milliseconds\");\r\n } else {\r\n System.out.println(\"Delay = \" + diff/1000 + \" seconds\");\r\n }\r\n } else {\r\n System.out.println(txt_wrong_dita_basedir);\r\n }\r\n }", "private void createDocs() {\n\t\t\n\t\tArrayList<Document> docs=new ArrayList<>();\n\t\tString foldername=\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\input\";\n\t\tFile folder=new File(foldername);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tfor (File file : listOfFiles) {\n\t\t\ttry {\n\t\t\t\tFileInputStream fisTargetFile = new FileInputStream(new File(foldername+\"\\\\\"+file.getName()));\n\t\t\t\tString fileContents = IOUtils.toString(fisTargetFile, \"UTF-8\");\n\t\t\t\tString[] text=fileContents.split(\"ParseText::\");\n\t\t\t\tif(text.length>1){\n\t\t\t\t\tString snippet=text[1].trim().length()>100 ? text[1].trim().substring(0, 100): text[1].trim();\n\t\t\t\t\tDocument doc=new Document();\n\t\t\t\t\tdoc.setFileName(file.getName().replace(\".txt\", \"\"));\n\t\t\t\t\tdoc.setUrl(text[0].split(\"URL::\")[1].trim());\n\t\t\t\t\tdoc.setText(snippet+\"...\");\n\t\t\t\t\tdocs.add(doc);\n\t\t\t\t}\n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\n\t\t}\t\n\t\tDBUtil.insertDocs(docs);\n\t}", "public boolean initializeIndexReader() {\n return initializeIndexReader(Constants.INDEX_DIRECTORY);\n }", "public void createIndexOnProcessName() throws ServiceFailureException;", "@Override\n public void updateItemSearchIndex() {\n try {\n // all item IDs that don't have a search index yet\n int[] allMissingIds = mDatabaseAccess.itemsDAO().selectMissingSearchIndexIds();\n // Selects the item to the id, extract all parts of the item name to create the\n // search index (all ItemSearchEntity's) and insert them into the database\n for (int missingId : allMissingIds) {\n try {\n ItemEntity item = mDatabaseAccess.itemsDAO().selectItem(missingId);\n List<ItemSearchEntity> searchEntities = createItemSearchIndex(item);\n mDatabaseAccess.itemsDAO().insertItemSearchParts(searchEntities);\n } catch (Exception ex) {\n Log.e(TAG, \"An error occurred trying to create the search index to the id\" +\n missingId, ex);\n }\n }\n } catch (Exception ex) {\n Log.e(TAG, \"A general failure has occurred while trying to load and process all \" +\n \"item IDs to generate a search index\", ex);\n }\n }", "private IndexWriter getIndexWriter() throws IOException {\n\n\t\tAnalyzer a = getAnaLyzer();\n\n\t\tif (idxWriter == null) {\n\n\t\t\tindexPath = this.analyzer + \" index-directory\";\n\t\t\tDirectory indexDir = FSDirectory.open(Paths.get(indexPath));\n\t\t\tIndexWriterConfig config = new IndexWriterConfig(a);\n\n\t\t\tconfig.setOpenMode(OpenMode.CREATE);\n\n\t\t\tidxWriter = new IndexWriter(indexDir, config);\n\t\t}\n\n\t\treturn idxWriter;\n\t}", "public PPIndexManager(FileHelper file_helper) {\n\t\tthis.file_helper = file_helper;\n\t}", "protected TreeIndex(@Nullable File indexParentDir,\n\t @NotNull File rootFile) {\n\t\tUtil.checkNotNull(rootFile);\n\t\tthis.indexParentDir = indexParentDir;\n\t\t\n\t\t// Create config\n\t\tthis.config = new IndexingConfig() {\n\t\t\t@Override\n\t\t\tprotected void onStoreRelativePathsChanged() {\n\t\t\t\tFile oldFile = rootFolder.getPath().getCanonicalFile();\n\t\t\t\tPath newPath = config.getStorablePath(oldFile);\n\t\t\t\trootFolder.setPath(newPath);\n\t\t\t}\n\t\t\tprotected void onWatchFoldersChanged() {\n\t\t\t\tLuceneIndex.evtWatchFoldersChanged.fire(TreeIndex.this);\n\t\t\t}\n\t\t};\n\t\t\n\t\t// Create root folder\n\t\trootFile = Util.getCanonicalFile(rootFile);\n\t\tPath newPath = config.getStorablePath(rootFile);\n\t\trootFolder = createRootFolder(newPath);\n\t\tUtil.checkNotNull(rootFolder);\n\t\t\n\t\t// Create index directory or RAM directory\n\t\tcreated = Util.getTimestamp();\n\t\tif (indexParentDir == null) {\n\t\t\tfileIndexDirPath = null;\n\t\t\tramIndexDir = new RAMDirectory();\n\t\t}\n\t\telse {\n\t\t\tString indexDirName = getIndexDirName(rootFile) + \"_\" + created;\n\t\t\tFile indexDir = new File(indexParentDir, indexDirName);\n\t\t\tif (AppUtil.isPortable())\n\t\t\t\tfileIndexDirPath = new Path(UtilModel.getRelativePathIfPossible(indexDir));\n\t\t\telse\n\t\t\t\tfileIndexDirPath = new Path(indexDir);\n\t\t}\n\t}", "public String getIndexDir() { return this.indexDir; }", "private static void createIndexEntry(Document document, int menuId, String filename, String path) throws Exception {\r\n Indexer index = (Indexer) Context.getInstance().getBean(Indexer.class);\r\n index.deleteFile(String.valueOf(menuId), document.getLanguage());\r\n index.addDirectory(new File(path + filename), document);\r\n }", "public synchronized void setNewReader(File indexDir) throws IOException{\r\n \tsynchronized (mReaders) {\r\n \t\ttry{\r\n \tList<ReaderContainer> lReader;\r\n \tif (!mReaders.containsKey(indexDir)){\r\n \t\tlReader = new ArrayList<ReaderContainer>();\r\n \t\tlReader.add(new ReaderContainer(IndexReader.open(FSDirectory.open(indexDir))));\r\n \t\tmReaders.put(indexDir, lReader);\r\n \t} else {\r\n \t\tlReader = mReaders.get(indexDir);\r\n \t\t\r\n \t\tif (lReader.size() > 0){\r\n \t\t\tlog.debug(\"setNewReader-STEP1 :: lReader.size() = \" + lReader.size());\r\n// \t\t\tfor (int i = lReader.size() - 1; i >= 0 ; i--) {\r\n// \t\t\t\tReaderContainer readerContainer = lReader.get(i);\r\n \t\t\tReaderContainer readerContainer = lReader.get(lReader.size() - 1);\r\n \t\t\t\r\n \tif (readerContainer.isClosable()){\r\n \t\treaderContainer.close();\r\n \t\tlReader.remove(readerContainer);\r\n \t}\r\n// \t\t\t}\r\n \t}\r\n \t\tlReader.add(new ReaderContainer(IndexReader.open(FSDirectory.open(indexDir))));\r\n \t\tlog.debug(\"setNewReader :: lReader.size() = \" + lReader.size());\r\n \t}\r\n \t\r\n \t\t} catch(Exception ex){\r\n \t\tlog.fatal(\"setNewReader :: mReaders.containsKey(indexDir)\" +mReaders.containsKey(indexDir)+\" indexDir \"+indexDir.getCanonicalPath()+\" ERR:\"+ex);\r\n \t}\r\n\t\t}\r\n }", "@Test\n public void storesIndexIfNone() throws Exception {\n final String name = \"talk\";\n final Talks talks = new Talks.InDir();\n talks.create(\"\", name);\n talks.get(name).modify(\n new Directives()\n .xpath(\"/talk\").push().xpath(\"wire\").remove().pop()\n .add(\"wire\").add(\"href\").set(\"#1\").up().up()\n .add(\"request\").attr(\"id\", \"a12345\")\n .add(\"author\").set(\"yegor256\").up()\n .add(\"args\").up()\n .add(\"type\").set(\"deploy\").up()\n );\n new IndexesRequests().execute(talks);\n MatcherAssert.assertThat(\n talks.get(name).read(),\n XhtmlMatchers.hasXPaths(\"/talk/request[@index='1']\")\n );\n }", "public static void initData() throws Exception {\n LOG.info(\"init data\");\n loginedUser = new LoginedUser();\n loginedUser2 = new LoginedUser();\n loginedUser3 = new LoginedUser();\n loginedAdmin = new LoginedUser();\n groupuser1 = new LoginedUser();\n groupuser2 = new LoginedUser();\n \n loginedUser.setLocale(Locale.ENGLISH);\n loginedUser2.setLocale(Locale.ENGLISH);\n loginedUser3.setLocale(Locale.ENGLISH);\n loginedAdmin.setLocale(Locale.ENGLISH);\n groupuser1.setLocale(Locale.ENGLISH);\n groupuser2.setLocale(Locale.ENGLISH);\n\n synchronized (KNOWLEDGE_TEST_HOME) {\n Thread.sleep(WAIT_MILLSEC);\n }\n \n // DBを完全初期化\n DatabaseControlDao dao1 = new DatabaseControlDao();\n dao1.dropAllTable();\n org.support.project.web.dao.gen.DatabaseControlDao dao2 = new org.support.project.web.dao.gen.DatabaseControlDao();\n dao2.dropAllTable();\n \n synchronized (KNOWLEDGE_TEST_HOME) {\n Thread.sleep(WAIT_MILLSEC);\n }\n \n InitDB.main(new String[0]);\n \n synchronized (KNOWLEDGE_TEST_HOME) {\n Thread.sleep(WAIT_MILLSEC);\n }\n \n // 全文検索エンジンのインデックスの消去\n Analyzer analyzer = new JapaneseAnalyzer();\n AppConfig appConfig = ConfigLoader.load(AppConfig.APP_CONFIG, AppConfig.class);\n File indexDir = new File(appConfig.getIndexPath());\n Directory dir = FSDirectory.open(indexDir);\n IndexWriterConfig iwc = new IndexWriterConfig(Version.LUCENE_4_10_2, analyzer);\n iwc.setOpenMode(OpenMode.CREATE_OR_APPEND);\n IndexWriter writer = null;\n try {\n writer = new IndexWriter(dir, iwc);\n writer.deleteAll();\n writer.commit();\n } finally {\n if (writer != null) {\n writer.close();\n }\n }\n \n Integer[] rolesAdmin = {1}; // 2はユーザ、1はAdmin\n Integer[] roles = {2}; // 2はユーザ、1はAdmin\n addUser(loginedUser, \"テストユーザ1\", roles);\n addUser(loginedUser2, \"テストユーザ2\", roles);\n addUser(loginedUser3, \"テストユーザ3\", roles);\n addUser(loginedAdmin, \"管理者\", rolesAdmin);\n \n addUser(groupuser1, \"GroupUser1\", roles);\n addUser(groupuser2, \"GroupUser2\", roles);\n \n GroupsEntity groupsEntity = new GroupsEntity();\n groupsEntity.setGroupName(\"テストグループ\");\n groupsEntity.setGroupKey(\"TestGroup\");\n group = GroupsDao.get().save(groupsEntity);\n \n UserGroupsEntity usergroup = new UserGroupsEntity();\n usergroup.setGroupId(group.getGroupId());\n usergroup.setUserId(groupuser1.getUserId());\n UserGroupsDao.get().save(usergroup);\n \n usergroup = new UserGroupsEntity();\n usergroup.setGroupId(group.getGroupId());\n usergroup.setUserId(groupuser2.getUserId());\n UserGroupsDao.get().save(usergroup);\n }", "private void indexUpdates(UpdateQueryResult updates) {\r\n Iterator<HashMap<String, String>> i = updates.getIterator();\r\n while (i.hasNext()) {\r\n HashMap<String, String> values = i.next();\r\n \r\n \t// during index default solr fields are indexed separately\r\n \tString articleId = values.get(\"KnowledgeArticleId\");\r\n \tString title = values.get(\"Title\");\r\n \tvalues.remove(\"Title\");\r\n \tString summary = values.get(\"Summary\");\r\n \tvalues.remove(\"Summary\");\r\n \t\r\n \ttry {\r\n \t\tif (UtilityLib.notEmpty(articleId) && UtilityLib.notEmpty(title)) {\r\n \t\t\t// index sObject\r\n \t\t\t// default fields every index must have\r\n \t\t\tStringBuilder sb = new StringBuilder();\r\n \t\t\tContent c = new Content();\r\n \t\t\tc.setKey(articleId);\r\n \t\t\tsb.setLength(0);\r\n \t\t\tsb.append(summary);\r\n \t\t\tc.setData(sb.toString().getBytes());\r\n \t\t\tc.addMetadata(\"Content-Type\", \"text/html\");\r\n \t\t\tc.addMetadata(\"title\", title);\r\n \t\t\t\r\n \t\t\tLOG.debug(\"Salesforce Crawler: Indexing articleId=\"+articleId+\" title=\"+title+\" summary=\"+summary);\r\n \t\t\t\r\n \t\t\t// index articleType specific fields\r\n \t\t\tfor (Entry<String, String> entry : values.entrySet()) {\r\n \t\t\t\tc.addMetadata(entry.getKey(), entry.getValue().toString());\r\n \t\t\t\tif (!entry.getKey().equals(\"Attachment__Body__s\")) {\r\n \t\t\t\t\tLOG.debug(\"Salesforce Crawler: Indexing field key=\"+entry.getKey()+\" value=\"+entry.getValue().toString());\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tstate.getProcessor().process(c);\r\n \t\t}\r\n } catch (Exception e) {\r\n \tUtilityLib.errorException(LOG, e);\r\n \tstate.getStatus().incrementCounter(Counter.Failed);\r\n }\r\n }\r\n }", "private void createIndexes(GenericDAO genericDAO, Schema schema) {\n\t\tfor (List<MatchingDependency> searchAttributeMDs : schema.getMatchingDependencies().values()) {\n\t\t\tfor (MatchingDependency md : searchAttributeMDs) {\n\t\t\t\tString relation = md.getRightPredicateName();\n\t\t\t\tString attribute = schema.getRelations().get(relation.toUpperCase()).getAttributeNames()\n\t\t\t\t\t\t.get(md.getRightAttributeNumber());\n\t\t\t\tint attributePosition = md.getRightAttributeNumber();\n\n\t\t\t\tPair<String, Integer> key = new Pair<String, Integer>(relation, attributePosition);\n\t\t\t\tif (!hsTrees.containsKey(key)) {\n\t\t\t\t\tList<String> values = projectSelectIn(genericDAO, relation, attribute);\n\t\t\t\t\tHSTree hsTree = HSTreeCreator.buildHSTree(values);\n\t\t\t\t\thsTrees.put(key, hsTree);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void testBasic() throws IOException {\n Set<String> fileExtensions = new HashSet<String>();\n fileExtensions.add(IndexFileNames.FIELDS_EXTENSION);\n fileExtensions.add(IndexFileNames.FIELDS_INDEX_EXTENSION);\n \n Directory primaryDir = new MockDirectoryWrapper(new RAMDirectory());\n Directory secondaryDir = new MockDirectoryWrapper(new RAMDirectory());\n \n FileSwitchDirectory fsd = new FileSwitchDirectory(fileExtensions, primaryDir, secondaryDir, true);\n IndexWriter writer = new IndexWriter(fsd, new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer()));\n ((LogMergePolicy) writer.getConfig().getMergePolicy()).setUseCompoundFile(false);\n ((LogMergePolicy) writer.getConfig().getMergePolicy()).setUseCompoundDocStore(false);\n TestIndexWriterReader.createIndexNoClose(true, \"ram\", writer);\n IndexReader reader = IndexReader.open(writer);\n assertEquals(100, reader.maxDoc());\n writer.commit();\n // we should see only fdx,fdt files here\n String[] files = primaryDir.listAll();\n assertTrue(files.length > 0);\n for (int x=0; x < files.length; x++) {\n String ext = FileSwitchDirectory.getExtension(files[x]);\n assertTrue(fileExtensions.contains(ext));\n }\n files = secondaryDir.listAll();\n assertTrue(files.length > 0);\n // we should not see fdx,fdt files here\n for (int x=0; x < files.length; x++) {\n String ext = FileSwitchDirectory.getExtension(files[x]);\n assertFalse(fileExtensions.contains(ext));\n }\n reader.close();\n writer.close();\n\n files = fsd.listAll();\n for(int i=0;i<files.length;i++) {\n assertNotNull(files[i]);\n }\n fsd.close();\n }", "@Override\n public void postInserts() \n {\n for(IndexObject i: myIndex.values())\n {\n i.tfidf(documentData);\n }\n }", "public void run() {\n System.out.println(\"Running Indexing\");\n Indexer.index();\n }", "private static Positional_inverted_index posindexCorpus(DocumentCorpus corpus) throws ClassNotFoundException, InstantiationException, IllegalAccessException, FileNotFoundException, IOException {\n\n NewTokenProcessor processor = new NewTokenProcessor();\n Iterable<Document> docs = corpus.getDocuments(); //call registerFileDocumentFactory first?\n\n List<Double> Doc_length = new ArrayList<>();\n Positional_inverted_index index = new Positional_inverted_index();\n\n double token_count = 0;\n\n // Iterate through the documents, and:\n for (Document d : docs) {\n //File f = new File(path + \"\\\\\" + d.getTitle());\n File f = new File(path + \"\\\\\" + d.getFileName().toString());\n double Filesize = f.length();\n //edited by bhavya\n double doc_weight = 0; //first entry in docweights.bin\n double doc_tokens = 0;\n double doc_length = 0;\n HashMap<String, Integer> tftd = new HashMap<>();\n // Tokenize the document's content by constructing an EnglishTokenStream around the document's content.\n Reader reader = d.getContent();\n EnglishTokenStream stream = new EnglishTokenStream(reader); //can access tokens through this stream\n N++;\n // Iterate through the tokens in the document, processing them using a BasicTokenProcessor,\n //\t\tand adding them to the HashSet vocabulary.\n Iterable<String> tokens = stream.getTokens();\n int i = 0;\n\n for (String token : tokens) {\n\n //adding token in index\n List<String> word = new ArrayList<String>();\n word = processor.processToken(token);\n //System.out.println(word.get(0));\n if (word.get(0).matches(\"\")) {\n continue;\n } else {\n\n index.addTerm(word.get(0), i, d.getId());\n\n }\n i = i + 1;\n\n //we check if token already exists in hashmap or not. \n //if it exists, increase its freq by 1 else make a new entry.\n if (tftd.containsKey(word.get(0))) {\n doc_tokens++;\n int count = tftd.get(word.get(0));\n tftd.replace(word.get(0), count + 1);\n } else {\n doc_tokens++;\n// token_count++; //gives total number of tokens.\n tftd.put(word.get(0), 1);\n }\n\n }\n double length = 0;\n double wdt = 0;\n\n double total_tftd = 0;\n for (Map.Entry<String, Integer> entry : tftd.entrySet()) {\n\n wdt = 1 + log(entry.getValue());\n\n length = length + pow(wdt, 2);\n total_tftd = total_tftd + entry.getValue();\n }\n token_count = token_count + doc_tokens;\n doc_weight = pow(length, 0.5);\n double avg_tftd = total_tftd / (double) tftd.size();\n\n Doc_length.add(doc_weight);\n Doc_length.add(avg_tftd);\n Doc_length.add(doc_tokens);\n Doc_length.add(Filesize);\n }\n Doc_length.add(token_count / N);\n\n DiskIndexWriter d = new DiskIndexWriter();\n d.write_doc(path, Doc_length);\n\n return index;\n }", "@Test\n public void retrievesIndexFromLog() throws Exception {\n final String name = \"talk\";\n final Talks talks = new Talks.InDir();\n talks.create(\"\", name);\n talks.get(name).modify(\n new Directives().xpath(\"/talk\")\n .push().xpath(\"wire\").remove().pop()\n .add(\"wire\").add(\"href\").set(\"#2\").up().up()\n .add(\"archive\")\n .add(\"log\").attr(\"id\", \"1\").attr(\"title\", \"title1\")\n .attr(\"index\", \"1\").up()\n .add(\"log\").attr(\"id\", \"2\").attr(\"title\", \"title2\")\n .attr(\"index\", \"2\").up().up()\n .add(\"request\").attr(\"id\", \"a12345\")\n .add(\"author\").set(\"yegor256\").up()\n .add(\"args\").up()\n .add(\"type\").set(\"deploy\").up()\n );\n new IndexesRequests().execute(talks);\n MatcherAssert.assertThat(\n talks.get(name).read(),\n XhtmlMatchers.hasXPaths(\"/talk/request[@index='3']\")\n );\n }", "void addIndexForRepository(long repositoryId);", "public H_index() {\n\t\tsuper();\n\t}", "protected void index()\r\n\t{\n\t}" ]
[ "0.7020719", "0.68551266", "0.68089515", "0.6683049", "0.6420755", "0.64115214", "0.6337615", "0.633271", "0.62682205", "0.6263379", "0.62361467", "0.6145296", "0.61243546", "0.609093", "0.6004094", "0.5995686", "0.59776497", "0.5973409", "0.596048", "0.59567606", "0.5956644", "0.5933401", "0.59329545", "0.59083855", "0.58736503", "0.5867413", "0.58658385", "0.5858674", "0.58569455", "0.58033985", "0.5780504", "0.57783896", "0.5771922", "0.57674617", "0.5748939", "0.5728033", "0.5727127", "0.56901616", "0.56777173", "0.56565344", "0.56562924", "0.56509537", "0.56450105", "0.5639406", "0.56376064", "0.5631147", "0.5617518", "0.5616991", "0.5614762", "0.55954385", "0.5591155", "0.5585313", "0.5571722", "0.55696154", "0.55688787", "0.55688787", "0.5550969", "0.554581", "0.551019", "0.55081713", "0.54961395", "0.54953146", "0.5466573", "0.5463777", "0.54489887", "0.5445297", "0.5442738", "0.54361504", "0.5410264", "0.5407629", "0.54010624", "0.5398874", "0.5379472", "0.53657085", "0.53628635", "0.5347754", "0.53374904", "0.5336887", "0.5331872", "0.5326861", "0.5324747", "0.532164", "0.53151244", "0.5307312", "0.529386", "0.5285686", "0.52796006", "0.52719325", "0.527112", "0.52662116", "0.5263091", "0.52584386", "0.5257889", "0.52572095", "0.52360123", "0.5235643", "0.52330935", "0.5231888", "0.52244925", "0.5223939" ]
0.568169
38
A common index value can be very generic but must have a way to identify its visibility
public interface CommonIndexValue { public byte[] getVisibility(); public void setVisibility( byte[] visibility ); public boolean overlaps( NumericDimensionField[] field, NumericData[] rangeData ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int getIndex();", "@VTID(10)\n int getIndex();", "public abstract long getIndex();", "boolean isIndex();", "boolean getIsIndexOnValues();", "public int getIndex();", "public int getIndex();", "public int getIndex();", "abstract int get(int index);", "public int index();", "boolean hasIndex();", "boolean hasIndex();", "boolean hasIndex();", "boolean hasIndex();", "boolean hasIndex();", "boolean hasIndex();", "boolean isIndexed();", "boolean isIndexed();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "abstract public Object getValue(int index);", "int get(int idx);", "private int getIndex() {\n\t\treturn this.index;\r\n\t}", "StorableIndexInfo getIndexInfo();", "public int getIndex() { return this.index; }", "public interface CompanyIndexed {\n\n String getCompanyName();\n\n long getCIK();\n\n}", "public interface FieldIndex<T> extends GenericIndex<T> \r\n{ \r\n /**\r\n * Put new object in the index. \r\n * @param obj object to be inserted in index. Object should contain indexed field. \r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @return <code>true</code> if object is successfully inserted in the index, \r\n * <code>false</code> if index was declared as unique and there is already object with such value\r\n * of the key in the index. \r\n */\r\n public boolean put(T obj);\r\n\r\n /**\r\n * Associate new object with the key specified by object field value. \r\n * If there is already object with such key in the index, \r\n * then it will be removed from the index and new value associated with this key.\r\n * @param obj object to be inserted in index. Object should contain indexed field. \r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @return object previously associated with this key, <code>null</code> if there was no such object\r\n */\r\n public T set(T obj);\r\n\r\n /**\r\n * Assign to the integer indexed field unique autoicremented value and \r\n * insert object in the index. \r\n * @param obj object to be inserted in index. Object should contain indexed field\r\n * of integer (<code>int</code> or <code>long</code>) type.\r\n * This field is assigned unique value (which will not be reused while \r\n * this index exists) and object is marked as modified.\r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @exception StorageError(StorageError.INCOMPATIBLE_KEY_TYPE) when indexed field\r\n * has type other than <code>int</code> or <code>long</code>\r\n */\r\n public void append(T obj);\r\n\r\n /**\r\n * Remove object with specified key from the unique index\r\n * @param key value of removed key\r\n * @return removed object\r\n * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no such key in the index,\r\n * or StorageError(StorageError.KEY_NOT_UNIQUE) if index is not unique.\r\n */\r\n public T remove(Key key);\r\n\r\n /**\r\n * Remove object with specified key from the unique index\r\n * @param key value of removed key\r\n * @return removed object\r\n * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no such key in the index,\r\n * or StorageError(StorageError.KEY_NOT_UNIQUE) if index is not unique.\r\n */\r\n public T removeKey(Object key);\r\n\r\n /**\r\n * Check if index contains specified object instance.\r\n * @param obj object to be searched in the index. Object should contain indexed field. \r\n * @return <code>true</code> if object is present in the index, <code>false</code> otherwise\r\n */\r\n public boolean containsObject(T obj);\r\n\r\n /**\r\n * Locate objects with the same value of the key as specified object\r\n * @param obj object specifying search key value\r\n * @return selection iterator\r\n */\r\n public IterableIterator<T> queryByExample(T obj);\r\n\r\n /**\r\n * Get class obejct objects which can be inserted in this index\r\n * @return class specified in Storage.createFielIndex method\r\n */\r\n public Class getIndexedClass();\r\n\r\n /**\r\n * Get fields used as a key\r\n * @return array of index key fields\r\n */\r\n public Field[] getKeyFields();\r\n\r\n /**\r\n * Select members of the collection using search predicate\r\n * This iterator doesn't support remove() method.\r\n * To make it possible to update, remove or add members to the index \r\n * during iteration it is necessary to set \"perst.concurrent.iterator\"\r\n * property (by default it is not supported because it cause extra overhead during iteration)\r\n * @param predicate JSQL condition\r\n * @return iterator through members of the collection matching search condition\r\n */\r\n public IterableIterator<T> select(String predicate);\r\n\r\n /**\r\n * Check if field index is case insensitive\r\n * @return true if index ignore case of string keys\r\n */\r\n boolean isCaseInsensitive(); \r\n}", "public ATExpression base_indexExpression();", "boolean getIsIndexOnKeys();", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "public int getIndex(\n )\n {return index;}", "int index();", "public abstract int indexFor(Object obj);", "@Nullable\n public abstract Index getIndex();", "public Type get(int index);", "IndexType type();", "public int getIndex(){\r\n \treturn index;\r\n }", "Expression getIndexExpr();", "private int indexFor(K key) {\n int hash = hash(key.hashCode());\n return hash % this.container.length;\n }", "public int getInt(int index)\r\n/* 372: */ {\r\n/* 373:386 */ ensureAccessible();\r\n/* 374:387 */ return _getInt(index);\r\n/* 375: */ }", "public T get(int aIndex);", "@Override\r\n\tpublic int getIndex() {\n\t\treturn index;\r\n\t}", "public int get(int index);", "@Test\n public void testIndexMaintenanceWithIndexOnMethodGetValues() throws Exception {\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.getValues() pf\");\n assertTrue(i1 instanceof CompactRangeIndex);\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "public interface Indexable {\n\n char getIndexForPosition(int position);\n\n int getCount();\n}", "public int getIndex()\n/* */ {\n/* 46 */ return this.index;\n/* */ }", "short getKeyIx();", "@Test\n public void testIndexMaintenanceWithIndexOnMethodValues() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.values() pf\");\n assertTrue(i1 instanceof CompactRangeIndex);\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "@Nullable\n abstract Integer getInstanceIndex();", "public abstract int getNumIndexes();", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "public int getIndex(){\n return index;\n }", "public int getIndex(){\n return index;\n }", "public interface CacheIndex {\n \n /**\n * Puts index on indexedKey.\n *\n * @param indexedKey the indexed key\n * @param key the key\n */\n void put(Object indexedKey, Object key);\n \n /**\n * Removes the index from indexedKey.\n *\n * @param indexedKey the indexed key\n * @param key the key\n */\n void remove(Object indexedKey, Object key);\n \n /**\n * Equals to.\n *\n * @param expectedValue the expected value\n * @return the list\n */\n List<Object> equalsTo(Object expectedValue);\n \n /**\n * Less than.\n *\n * @param value the value\n * @return the list\n */\n List<Object> lessThan(Object value);\n \n /**\n * Less than or equals to.\n *\n * @param value the value\n * @return the list\n */\n List<Object> lessThanOrEqualsTo(Object value);\n \n /**\n * Greater than.\n *\n * @param value the value\n * @return the list\n */\n List<Object> greaterThan(Object value);\n \n /**\n * Greater than or equals to.\n *\n * @param value the value\n * @return the list\n */\n List<Object> greaterThanOrEqualsTo(Object value);\n \n /**\n * Between.\n *\n * @param lowerBound the lower bound\n * @param upperBound the upper bound\n * @return the list\n */\n List<Object> between(Object lowerBound, Object upperBound);\n \n}", "public int getIndex() {\r\n \t\t\treturn index;\r\n \t\t}", "public int typeIndex();", "public void setIndexedVariable() {\n indexed = true;\n }", "public final int getIndex(){\n return index_;\n }", "long getOverridden(int index);", "public int getIndex() {\n\t\treturn 0;\n\t}", "public Object getValue(int index);", "int getRequestedValues(int index);", "Index getIndices(int index);", "int getIndex(){\r\n\t\treturn index;\r\n\t}", "@Override\n public final int getIndex() {\n return index;\n }", "@Contract(pure = true)\n default boolean isDefinedAt(int index) {\n return index >= 0 && sizeGreaterThan(index);\n }", "protected final int getIndex() {\n return index;\n }", "public int getIndex()\n {\n return getInt(\"Index\");\n }", "public int getIndex() {\r\n return _index;\r\n }", "public int getIndex() {\r\n return _index;\r\n }", "public interface IndexSearch {\n /**\n * Returns the index type.\n * @return type\n */\n IndexType type();\n\n /**\n * Returns the current token.\n * @return token\n */\n byte[] token();\n}", "public abstract T get(int index);", "public int getIndex(){\n\t\treturn index;\n\t}", "public int getIndex(){\n\t\treturn index;\n\t}", "public int getIndex(){\n\t\treturn index;\n\t}", "public abstract E get(int index);", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "int getIndex() {\n\t\treturn index;\n\t}", "public boolean isInternalIndex() {\n return (this == itemIndex || this == withdrawnIndex || this == privateIndex);\n }", "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 }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "public int getIndex()\n {\n return index;\n }", "public interface IdentifierIndexIF extends IndexIF {\n \n /**\n * PUBLIC: Returns all the item identifiers of all the objects in the topicmap.\n * @return all the item identifiers of all the objects in the topicmap.\n * @since 5.4.0\n */\n Collection<LocatorIF> getItemIdentifiers();\n\n /**\n * PUBLIC: Returns all the item identifiers of all the objects in the topicmap that start with\n * the provided prefix.\n * @return all the matched item identifiers\n * @since 5.4.0\n */\n Collection<LocatorIF> getItemIdentifiersByPrefix(String prefix);\n \n /**\n * PUBLIC: Returns all the subject identifiers of all the topics in the topicmap.\n * @return all the subject identifiers of all the topics in the topicmap.\n * @since 5.4.0\n */\n Collection<LocatorIF> getSubjectIdentifiers();\n\n /**\n * PUBLIC: Returns all the subject identifiers of all the topics in the topicmap that start with\n * the provided prefix.\n * @return all the matched subject identifiers\n * @since 5.4.0\n */\n Collection<LocatorIF> getSubjectIdentifiersByPrefix(String prefix);\n \n}", "public boolean isIndex() { return this.isIndex; }", "public int getIndex() {\n \t\treturn index;\n \t}" ]
[ "0.6604585", "0.65618825", "0.6524679", "0.63245577", "0.62623996", "0.62558776", "0.62558776", "0.62558776", "0.6159118", "0.61397266", "0.61245495", "0.61245495", "0.61245495", "0.61245495", "0.61245495", "0.61245495", "0.61009324", "0.61009324", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60978496", "0.60238796", "0.5922008", "0.5917796", "0.5899126", "0.58711016", "0.58671135", "0.58471704", "0.58280367", "0.5811332", "0.5798817", "0.5793924", "0.57907116", "0.5786203", "0.57732993", "0.57618123", "0.5752638", "0.5746846", "0.5745391", "0.57388264", "0.57351655", "0.5705873", "0.5691506", "0.5686599", "0.56801265", "0.5679099", "0.56746423", "0.56646246", "0.56645644", "0.5657107", "0.5651595", "0.56472063", "0.5630529", "0.5630529", "0.56287247", "0.560859", "0.5600029", "0.5596937", "0.5591311", "0.5591049", "0.5588146", "0.55859554", "0.55825907", "0.55809194", "0.5580321", "0.55697095", "0.5560845", "0.5552219", "0.5550441", "0.55486536", "0.55486536", "0.55474335", "0.55418015", "0.5525648", "0.5525648", "0.5525648", "0.5522156", "0.55069834", "0.55069834", "0.55069834", "0.55020845", "0.55011815", "0.54842985", "0.5482308", "0.5482308", "0.5482308", "0.54734737", "0.5461752", "0.5460544", "0.54572" ]
0.7661389
0
Return all the relations on the given user without any filter.
private Collection<EaterRelation> getRelations(Eater ofUser) { Conjunction pendingFriend = Restrictions.conjunction(); pendingFriend.add(Restrictions.eq(EaterRelation.TO_USER, ofUser)); Disjunction inOr = Restrictions.disjunction(); inOr.add(pendingFriend); inOr.add(Restrictions.eq(EaterRelation.FROM_USER, ofUser)); List<EaterRelation> results = findByCriteria(inOr); return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<JRuleRelation> getAllRuleRelations(final String userToken) {\n System.out.println(\"Invoking getAllRuleRelations...\");\n logger.info(\"Invoking getAllRuleRelations...\");\n final JCredentials credentials = new JCredentials();\n credentials.setUserToken(userToken);\n final Holder<List<JRuleRelation>> ruleRelations = new Holder<List<JRuleRelation>>();\n port.getAllRuleRelations(credentials, ruleRelations);\n return ruleRelations.value;\n }", "public Collection<Relation> getAllRelations() {\n return Collections.unmodifiableCollection(relations.values());\n }", "public ReadOnlyIterator<Relation> getAllRelations();", "@Transactional(readOnly = true)\n public List<UserDto> findAll() {\n return userRepository.findAllWithEagerRelationships()\n .stream()\n .map(UserDto::new)\n .collect(Collectors.toList());\n }", "public Set<Relation> getRelations();", "public ReadOnlyIterator<Relation> getAllIncomingRelations();", "public ReadOnlyIterator<Relation> getRelations();", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Relation> getRelations(String requestorJID, String targetJID) throws UserNotFoundException {\n\t\tfinal EntityManager em = OswPlugin.getEmFactory().createEntityManager();\n\t\tQuery query = em.createQuery(\"SELECT DISTINCT relation FROM Relation relation WHERE relation.owner = :target\");\n\n\t\t// Parametrize the query\n\t\tquery.setParameter(\"target\", targetJID);\n\t\tList<Relation> result = query.getResultList();\n\t\tem.close();\n\n\t\treturn result;\n\t}", "public ReadOnlyIterator<Relation> getIncomingRelations();", "@Override\n\tpublic List getAlls(TbUser user) {\n\t\treturn new userDaoImpl().getAlls(user);\n\t}", "@GET(\"user-relation?expand=userOne,userTwo&per-page=333\")\n Call<UserRelationVisitsResponse>getUsersRelationForVisits();", "@Override\n @SuppressWarnings(\"unchecked\")\n public List<RecipeEntity> getAllRecipe(long idUser)\n {\n return (List<RecipeEntity>)\n this.find(\"from RecipeEntity inner join UserEntity \" +\n \"where RecipeEntity.userByIdUser =:idUser\", idUser);\n }", "@Override\r\n\tpublic List<Permission> queryPermissionsByUsers(User dbUser) {\n\t\treturn permissionDao.queryPermissionsByUsers(dbUser);\r\n\t}", "Page<ParaUserDTO> findAllWithEagerRelationships(Pageable pageable);", "public String[] listRelations();", "public List getUsers(User user);", "@Override\r\n public List<User> userfindAll() {\n return userMapper.userfindAll();\r\n }", "@Override\n\tpublic ArrayList<User> findAll() {\n\t\t\n\t\treturn userDao.querydAll();\n\t}", "public List<RelationMention> getAllRelations(RelationMentionFactory factory) {\n List<RelationMention> allRelations = new ArrayList<RelationMention>(relationMentions);\n allRelations.addAll(getAllUnrelatedRelations(factory));\n return allRelations;\n }", "public Iterable<Relationship> getRelationships();", "public List<Menu> findMenus(User user) {\n\n List<Resource> resources = findAll(new Sort(Sort.Direction.DESC,\"parentId\",\"weight\"));\n Set<String> userPermissions = userAuthService.findStringPermissions(user);\n Iterator<Resource> iter = resources.iterator();\n while (iter.hasNext()) {\n if (!hasPermission(iter.next(), userPermissions)) {\n iter.remove();\n }\n }\n return convertToMenus(resources);\n }", "public Vector getResources(TIdentifiable user) {\r\n int row = m_users.getIndex(user);\r\n Vector result = new Vector();\r\n TUseStatus useStatus;\r\n\t if (row >= 0) {\r\n for (int a=0; a < m_current_resources_count; a++)\r\n if (m_associations[a][row]!=null) {\r\n useStatus = m_associations[a][row];\r\n if (useStatus.getStatus()!=useStatus.NO_ASSOCIATION) result.addElement(useStatus);\r\n }\r\n return result;\r\n } else return null;\r\n }", "Optional<List<User>> findAllUser() throws LogicException;", "Iterable<User> getAllUsers();", "public List<UserModel> getAllUsers()\n {\n List<UserModel> userModels =new ArrayList<>();\n //user.findAll().forEach(topics::add);\n for(UserModel userModel : userRepository.findAll())\n {\n userModels.add(userModel);\n }\n return userModels;\n }", "public List<UsersRobots> findAll(){\n CriteriaBuilder cb = entityManager.getCriteriaBuilder();\n CriteriaQuery<UsersRobots> cq = cb.createQuery(UsersRobots.class);\n Root<UsersRobots> rootEntry = cq.from(UsersRobots.class);\n CriteriaQuery<UsersRobots> all = cq.select(rootEntry);\n TypedQuery<UsersRobots> allQuery = entityManager.createQuery(all);\n return allQuery.getResultList();\n }", "@Override\n public List<Long> findContactsWithoutUser() {\n\tList<Long> ids = from(USER).where(USER.contact.isNotNull()).list(USER.contact.id);\n\n\t// id of contacts that hasn't user\n\tList<Long> result = from(CONTACT).where(CONTACT.id.notIn(ids)).list(CONTACT.id);\n\n\treturn result;\n }", "public NavigableSet<Utilisateur> getUtilisateurs();", "public ArrayList<CompraRelatorio> getComprasRelatorios(Usuario user){\r\n CriarConexao();\r\n ArrayList<CompraRelatorio> compras = new ArrayList<CompraRelatorio>();\r\n uDao = new UsuarioDao();\r\n \r\n try {\r\n resultado = consulta.executeQuery(\"SELECT * FROM comprarelatorio WHERE usuario_id = \"+user.getId());\r\n \r\n while(resultado.next()){\r\n compras.add(new CompraRelatorio(\r\n resultado.getInt(\"id\"), \r\n resultado.getDouble(\"valorCompra\"), \r\n resultado.getInt(\"parcelas\"), \r\n resultado.getInt(\"quantidade\"), \r\n resultado.getDate(\"dataCompraRelatorio\"), \r\n uDao.select(user.getId()))\r\n );\r\n }\r\n \r\n \r\n } catch (SQLException ex) {\r\n Logger.getLogger(UsuarioDao.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n fecharConexao();\r\n }\r\n \r\n return compras;\r\n }", "public List<User> getDisabledUsers();", "List<User> getFollowersForUser(User user);", "@Override\n public List<User> findAll() {\n return null;\n }", "@Override\r\n\tpublic List<Map<String, Object>> findAllUser() {\n\t\treturn userMapper.findAllUser();\r\n\t}", "@Override\r\n\tpublic List<User> findAll() {\n\t\treturn null;\r\n\t}", "List<User> getFollowingForUser(User user);", "public static List<LogEntry> getAllForUser ( final String user ) {\n return getWhere( createCriterionList(\n Restrictions.or( createCriterion( \"primaryUser\", user ), createCriterion( \"secondaryUser\", user ) ) ) );\n }", "public List<User> getUsers();", "@Override\n @Transactional(readOnly = true)\n public List<UserDashboardDTO> findAll() {\n log.debug(\"Request to get all UserDashboards\");\n List<UserDashboardDTO> result = userDashboardRepository.findAllWithEagerRelationships().stream()\n .map(userDashboardMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n\n return result;\n }", "List<User> getUsers();", "List<User> getUsers();", "public Set<Relationship> getRelations() {\n return this.relations;\n }", "List<ObjectRelation> getObjectRelations(int otId) throws AccessDeniedException;", "@Override\r\n\tpublic List<User> queryAllUsers() {\n\t\tList<User> users = userMapper.queryAllUsers();\r\n\t\treturn users;\r\n\t}", "public List<UserModel> getAllUsers() {\n List<UserModel> totalUsers = userRepository.findAll();\n URole role = uRoleRepository.findByName(\"ROLE_ADMIN\");\n return totalUsers\n .stream()\n .filter(userModel -> !userModel.getRoles().contains(role))\n .collect(Collectors.toList());\n }", "public static List<User> findAll()\n {\n return null;\n }", "public List<User> getAllUsers();", "public ru.terralink.mvideo.sap.Relations getRelations()\n {\n if (! __relationsValid)\n {\n if( (__relationsFK != null))\n {\n __relations = ru.terralink.mvideo.sap.Relations.find(__relationsFK);\n }\n __relationsValid = true;\n }\n return __relations;\n }", "@Override\r\n\tpublic List<User> getAllUser() {\n\t\tList<User> listStudents = new ArrayList<User>();\r\n\t\tlistStudents = userReposotory.findAll();\r\n\t\treturn listStudents;\r\n\t}", "@Override\n\tpublic List<User> getAll() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<User> getAll() {\n\t\treturn null;\n\t}", "public String[] getRelations() {\n/* 270 */ return getStringArray(\"relation\");\n/* */ }", "@Override\n\tpublic List<User> findAllUser() {\n\t\treturn userDao.findAllUser();\n\t}", "List<User> fetchAllUSers();", "@Override\r\n\tpublic List<UserEntity> findUserList(UserEntity user) {\n\t\treturn userDao.findUserList(user);\r\n\t}", "@Override\n\tpublic List<User> findAll() {\n\t\treturn null;\n\t}", "public List<User> findAll();", "public List<User> findAll();", "@Override\n\tpublic List<User> findAllUser() {\n\t\treturn mapper.findAllUser();\n\t}", "public List<Person> findAllUsers(){\n\t\t\n\t\tQuery q = em.createQuery(\"SELECT p FROM Person p \");\n\t\tList<Person> users = q.getResultList();\n\t\treturn users;\n\t}", "public Webpage[] getFathers(String user) {\n\t\tArrayList<Webpage> pages = new ArrayList<Webpage>();\n\t\tWebpage[] fathers = getFathers();\n\t\tfor (int i = 0; i < fathers.length; i++) {\n\t\t\tif(fathers[i].getVisitorByName(user) != null) {\n\t\t\t\tpages.add(fathers[i]);\n\t\t\t}\n\t\t}\n\t\tWebpage[] result = new Webpage[pages.size()];\n\t\treturn pages.toArray(result);\n\t}", "List<User> loadAll();", "public List<User> findAll() {\n return store.findAll();\n }", "public static List<Connection> getAllUserConnections() {\n List<Connection> userConnections = new ArrayList<Connection>();\n for (User user : UserManager.getUserStore()) {\n if (user.getConnection()!=null) {\n userConnections.add(user.getConnection());\n }\n }\n return userConnections;\n }", "public List<User> getEnabledUsers();", "@Override\n\tpublic Iterable<User> getAllUser() {\n\t\treturn userRepository.findAll();\n\t}", "@Override\r\n\tpublic List<AccountDTO> getUserByFilter(UserFilter userFilter) {\n\t\treturn accountDao.getUserByFilter(userFilter);\r\n\t}", "public void filter1NRelations() {\n this.relations.removeIf(Relationship::isOneToOne);\n }", "@Override\n\tpublic List<UserWithoutPassword> getUserList() {\n\t\treturn userDao.findAll();\n\t}", "public List<String> getAll() {\r\n List<String> listOfUser = new ArrayList<>();\r\n for(User user : userRepository.findAll()){\r\n listOfUser.add(user.toString());\r\n }\r\n return listOfUser;\r\n }", "public List<Trip> getTripsByUser(User byUser) throws UserNotLoggedInException {\n\t\t// recup du \"LoggedUser\"\n\t\tUser loggedUser = getSession().getLoggedUser();\n\t\tif (loggedUser == null) {\n\t\t\tthrow new UserNotLoggedInException();\n\t\t}\n\n\t\t// détermine si \"isFriend\"\n\t\t// vrai si un des friends du byUser est le loggedUser\n\t\tboolean isFriend = false;\n\t\tfor (User friend : byUser.getFriends()) {\n\t\t\tif (friend.equals(loggedUser)) {\n\t\t\t\tisFriend = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// si isFriend, on appel le DAO pour trouver les trips du byUser\n\t\tList<Trip> tripList = new ArrayList<Trip>();\n\t\tif (isFriend) {\n tripList = findTripsByUser(byUser);\n }\n\t\treturn tripList;\n\t}", "public RealmResults<User> getUsers() {\n\n return realm.where(User.class).findAll();\n }", "public static List<User> all() \n {\n return find.all();\n }", "public List<User> getAllUser() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List reterive() {\n\t\tString str=\"SELECT allusers FROM User allusers\";\n\t\tTypedQuery<User> query=em.createQuery(str,User.class);\n\t\treturn query.getResultList();\n\t\t\n\t}", "List<User> getAllUsers();", "List<User> getAllUsers();", "List<User> findAll();", "List<User> findAll();", "List<User> findAll();", "List<User> findAll();", "@Override\n\tpublic List<User> findAll() {\n\t\treturn this.userMapper.findAll();\n\t}", "@Override\r\n\tpublic Map<String, Object> getRelationsAndComments(Long userId) {\n\t\tMap<String,Object> map = new HashMap<String,Object>();\r\n\t\tInteger fans = this.userRelationMapper.selectFans(Integer.parseInt(userId+\"\"));\r\n\t\tInteger star = this.userRelationMapper.selectStars(Integer.parseInt(userId+\"\"));\r\n\t\tInteger giftNum = this.giftRecordMapper.selectGiftNum(Integer.parseInt(userId+\"\"));\r\n\t\tInteger giftn = this.giftUserMapper.getUserGiftNum(userId);\r\n\t\tgiftNum = (giftNum==null?0:giftNum)+(giftn==null?0:giftn);\r\n\t\tmap.put(\"fans\", fans==null?0:fans);\r\n\t\tmap.put(\"star\", star==null?0:star);\r\n\t\tmap.put(\"giftNum\", giftNum==null?0:giftNum);\r\n\t\treturn map;\r\n\t}", "public List<User> getAll() {\n\t\treturn null;\n\t}", "@Override\n public Set<String> getRelations() {\n if (cachedRelations != null) {\n return cachedRelations;\n }\n cachedRelations = new LinkedHashSet<String>();\n for (EventNode node : nodes) {\n cachedRelations.addAll(node.getNodeRelations());\n }\n return cachedRelations;\n }", "List<UserDTO> findAll();", "public List<User> findAllUser() {\n\t\treturn null;\n\t}", "@Override\n public List<Order> findOrdersByUser(User user) {\n return orderRepository.findByCustomerUsernameOrderByCreatedDesc(user.getUsername()).stream()\n .filter(t -> t.getOrder_state().equals(\"ACTIVE\"))\n .map(mapper::toDomainEntity)\n .collect(toList());\n }", "@Override\n public List<User> findAll() {\n return dao.findAll();\n }", "List<UserEntity> findAll();", "static Map<Utilisateur,Utilisateur.RELATION> getRelations(int id) {\n Map<Utilisateur, Utilisateur.RELATION> rels = new HashMap<>();\n Cursor c = selectRelations(id);\n\n try {\n while (c.moveToNext())\n {\n if (c.getInt(0) == 2)\n rels.put(get(c.getString(1)), Utilisateur.RELATION.fromInt(c.getInt(0)));\n else\n rels.put(get(c.getString(2)), Utilisateur.RELATION.fromInt(c.getInt(0)));\n }\n }\n finally {\n c.close();\n }\n return rels;\n }", "public List<User> findAll() {\n return userRepository.findAll();\n }", "@Override\n\tpublic ArrayList<user> getAllUser() {\n\t\treturn null;\n\t}", "public List<User> getAllUsers(){\n return userRepository.findAll();\n }", "@Override\n\tpublic List<User> findAll() {\n\t\treturn userRepository.findAll();\n\t}", "public abstract List<AbstractRelationshipTemplate> getIngoingRelations();", "public HashMap<String, Relation> getRelations() {\n return relations;\n }", "public List<UserReference> getUserReferences() {\n return userReferences;\n }", "public List<UserReference> getUserReferences() {\n return userReferences;\n }", "@Override\r\n\tpublic List<User> findAllUsers() {\n\t\treturn null;\r\n\t}", "public List<IUser> getUsers();" ]
[ "0.62841296", "0.6018845", "0.59979427", "0.59721345", "0.5912042", "0.5908607", "0.5678431", "0.5606617", "0.5590949", "0.55476874", "0.55444705", "0.5535472", "0.55196196", "0.5518894", "0.5496911", "0.54842186", "0.54529345", "0.54158986", "0.54076445", "0.54065263", "0.54048854", "0.54018754", "0.5390905", "0.53837425", "0.53666294", "0.534725", "0.5329408", "0.5327742", "0.5321522", "0.5319667", "0.5319056", "0.5317233", "0.5312472", "0.52938193", "0.52900225", "0.528702", "0.5274918", "0.5270492", "0.5268495", "0.5268495", "0.52672255", "0.52628917", "0.52541184", "0.5253517", "0.5251689", "0.5248044", "0.5238609", "0.52372205", "0.52348363", "0.52348363", "0.52271295", "0.5209894", "0.52092785", "0.5208772", "0.5204658", "0.520011", "0.520011", "0.5199948", "0.5199371", "0.51972777", "0.5197183", "0.51923233", "0.5187639", "0.5175462", "0.5172525", "0.5165943", "0.51534784", "0.5150741", "0.5145439", "0.51420116", "0.51414025", "0.5140324", "0.51375616", "0.5136678", "0.51311946", "0.51311946", "0.5127716", "0.5127716", "0.5127716", "0.5127716", "0.5126532", "0.51238376", "0.5122321", "0.51155895", "0.5112373", "0.51085156", "0.51071554", "0.5099894", "0.5089795", "0.508834", "0.50877875", "0.50848955", "0.5077898", "0.50749147", "0.5069839", "0.5064564", "0.5061721", "0.5061721", "0.5060108", "0.50575304" ]
0.74310577
0
Class constructor for testing purposes.
public PhylogeneticTree(Model model) { this.model = model; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Instantiation(){}", "private QcTestRunner()\n\t{\n\t\t// To prevent external instantiation of this class\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "Reproducible newInstance();", "public Test() {\n }", "public BookcaseTest () {\n }", "public Test()\n {\n }", "public Constructor(){\n\t\t\n\t}", "private Mocks() { }", "public RookTest()\r\n {\r\n }", "public AcuityTest() {\r\n }", "protected TestBench() {}", "public FlightTest(){\n }", "public CyanSus() {\n\n }", "public GetResponseTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code\n\t\t * should be placed in the setUp() method instead.\n\t\t */\n\n\t}", "private DataClayMockObject() {\n\n\t}", "public Spec__1() {\n }", "public ClientInformationTest()\n {\n }", "@Test\n public void constructor(){\n /**Positive tests*/\n Road road = new Road(cityA, cityB, 4);\n assertEquals(road.getFrom(), cityA);\n assertEquals(road.getTo(), cityB);\n assertEquals(road.getLength(), 4);\n }", "public StrandUnitTest()\n {\n }", "public PerezosoTest()\n {\n }", "private Driver() {\n\n }", "private XMLUtils()\r\n\t{\r\n\t}", "private Verify(){\n\t\t// Private constructor to prevent instantiation\n\t}", "public AllLaboTest() {\n }", "public Pitonyak_09_02() {\r\n }", "@Test\n public void goalCustomConstructor_isCorrect() throws Exception {\n\n int goalId = 11;\n int userId = 1152;\n String name = \"Test Name\";\n int timePeriod = 1;\n int unit = 2;\n double amount = 1000.52;\n\n\n //Create goal\n Goal goal = new Goal(goalId, userId, name, timePeriod, unit, amount);\n\n // Verify Values\n assertEquals(goalId, goal.getGoalId());\n assertEquals(userId, goal.getUserId());\n assertEquals(name, goal.getGoalName());\n assertEquals(timePeriod, goal.getTimePeriod());\n assertEquals(unit, goal.getUnit());\n assertEquals(amount, goal.getAmount(),0);\n }", "public void testConstructor() {\r\n assertNotNull(\"unable to create instance\", instance);\r\n }", "private JsonUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "private TestReporter() {\n\n }", "public Tests(){\n \n }", "public ClimbingClubTest()\n {\n \n }", "private AccuracyTestHelper() {\n // empty\n }", "public PthTestContentsInfo() {\n }", "public SwerveAutoTest() {\n // Initialize base classes.\n // All via self-construction.\n\n // Initialize class members.\n // All via self-construction.\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public BookingSystemTest()\n {\n }", "public TokenControllerTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code\n\t\t * should be placed in the setUp() method instead.\n\t\t */\n\n\t}", "public HockeyTeamTest()\n {\n }", "public MockClass(String arg) {\n\t}", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "private Driver(){\n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "@Test\n public void ctor(){\n assertNotNull(CuT.templateEngine, \"The Template Engine is Null and should not be\");\n }", "public ApplicationTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code should be\n\t\t * placed in the setUp() method instead.\n\t\t */\n\n\t}", "public tester() {\r\n }", "private StressTestHelper() {\n // Empty constructor.\n }", "private TMCourse() {\n\t}", "private SingleObject()\r\n {\r\n }", "public Demo() {\n\t\t\n\t}", "private Source() {\n throw new AssertionError(\"This class should not be instantiated.\");\n }", "private Utils()\n {\n // Private constructor to prevent instantiation\n }", "private Rekenhulp()\n\t{\n\t}", "private Consts(){\n //this prevents even the native class from \n //calling this ctor as well :\n throw new AssertionError();\n }", "private WebXmlIo()\n {\n // Voluntarily empty constructor as utility classes should not have a public or default\n // constructor\n }", "public SsOhMapTest()\n {\n }", "public TestPrelab2()\n {\n }", "public Utils() {}", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "private TagCacheManager(){\n //AssertionError不是必须的. 但它可以避免不小心在类的内部调用构造器. 保证该类在任何情况下都不会被实例化.\n //see 《Effective Java》 2nd\n throw new AssertionError(\"No \" + getClass().getName() + \" instances for you!\");\n }", "public _355() {\n\n }", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "public CSSTidier() {\n\t}", "@Test\n void constructorTest() {\n super.checkConstruction();\n }", "@Test\n public void constructor() {\n\n {\n NodeFullUpdateRequest tested = new NodeFullUpdateRequest();\n Assert.assertNull(tested.getRequest());\n }\n\n {\n FullUpdateRequest request = new FullUpdateRequest();\n NodeFullUpdateRequest tested = new NodeFullUpdateRequest(\"myNode\", request);\n Assert.assertEquals(request, tested.getRequest());\n }\n\n }", "private OMUtil() { }", "private DiagnosticMessageUtilities()\n {\n }", "public CacheTest() {\n }", "private ClassUtil() {}", "private MemoryTest() {\r\n }", "private ProtomakEngineTestHelper() {\r\n\t}", "private XMLUtil() {\n\t}", "private UnitFactory() {\n\t}", "private MApi() {}", "public FileTest() {\n }", "public RemoteFilingTest() {\n }", "public Clade() {}", "private GeoUtil()\n\t{\n\t}", "public BirdFoodTest()\r\n {\r\n }", "protected BaseTestObject()\n {\n\n fProp = new Properties(); // empty properties object\n fLog = TestLogger.getInstance(); // default level is DEBUG\n\n }", "private CoverageParser() {\n }", "private Marinator() {\n }", "private Marinator() {\n }", "public Orbiter() {\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "public Utils() {\n }", "public TestSequence() {\n }", "private JacobUtils() {}", "public Basic() {}", "public ResourceUtils() {\r\n //stub\r\n }", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "public BazaarTests() {\r\n\t\tsuper();\r\n\t}", "private RestClient() {\n }", "public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }", "public TestBuffer() {\n }", "private DVSTestConstants()\n {\n\n }", "public PSRelation()\n {\n }", "public SgaexpedbultoImpl()\n {\n }", "private CLUtil()\n {\n }" ]
[ "0.7628332", "0.7518788", "0.74350184", "0.7414113", "0.7395444", "0.7387784", "0.736933", "0.7366341", "0.7342239", "0.7316366", "0.72538924", "0.72378296", "0.7234938", "0.72281736", "0.72162014", "0.7215353", "0.7212276", "0.7192927", "0.7171558", "0.71650743", "0.71421987", "0.7135779", "0.71260923", "0.71237195", "0.7120297", "0.70697755", "0.70662236", "0.706189", "0.70590913", "0.7058893", "0.70483613", "0.70463544", "0.70424384", "0.7026424", "0.70166236", "0.7014319", "0.7008841", "0.7006678", "0.7002524", "0.69998026", "0.69968057", "0.69951296", "0.6992672", "0.6990178", "0.6978473", "0.69555676", "0.69535005", "0.69488406", "0.6947508", "0.6941074", "0.69398403", "0.69385546", "0.6937479", "0.6936525", "0.6936023", "0.6927489", "0.69104266", "0.6909286", "0.6909084", "0.6902363", "0.6894204", "0.68884736", "0.6883005", "0.688266", "0.68814045", "0.68786615", "0.6875673", "0.68705773", "0.68692434", "0.6866724", "0.68625546", "0.6859543", "0.6857445", "0.68572545", "0.6851671", "0.6851224", "0.68490845", "0.68482465", "0.68405604", "0.6837715", "0.6828037", "0.6827167", "0.6827167", "0.6826685", "0.6826483", "0.6826483", "0.6826483", "0.6823093", "0.68221164", "0.6821696", "0.682112", "0.68186414", "0.6815954", "0.6815358", "0.6811747", "0.68113166", "0.68055815", "0.6799076", "0.6798094", "0.67950654", "0.679425" ]
0.0
-1
Get the model of the PhylogeneticTree.
public Model getModel() { return model; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PhylogeneticTree(Model model) {\n this.model = model;\n }", "public TreeModel getTreeModel() {\r\n return ModelBuilder.getSingleton().buildTreeModelAsync(this);\r\n }", "public HierarchicalConfiguration getTreeModel()\n {\n return treeModel;\n }", "@Override\n\tpublic KnowLedgeTreeVo getModel() {\n\t\treturn ktvo;\n\t}", "public DefaultMutableTreeNode getModel(){\n return addToModel(parent);\n }", "public DefaultTreeModel getModel()\n {\n return new DefaultTreeModel(root);\n }", "NCModel getModel();", "public InMemoryNodeModel getParentModel()\n {\n return getParentModelSupport().getNodeModel();\n }", "public OntModel getModel()\r\n\t{\r\n\t\treturn this.ONT_MODEL;\r\n\t}", "public java.lang.String getPhy() {\n java.lang.Object ref = phy_;\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 phy_ = s;\n }\n return s;\n }\n }", "M getModel();", "public PhylogeneticTree loadPhylogeneticTree(int treeId) {\n if (treeId == 0) {\n phylogeneticTree = new PhylogeneticTree();\n phylogeneticTree.parseTree(\"testGenomeNwk\",\n new ArrayList<>(genomeGraph.getGenomes().keySet()));\n return phylogeneticTree;\n } else {\n return phylogeneticTree;\n }\n }", "public java.lang.String getPhy() {\n java.lang.Object ref = phy_;\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 phy_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public RandomForestClassificationModel getClassificationModel() {\n\t\treturn classificationModel;\n\t}", "public Class getModelClass() {\n return m_Classifier.getClass();\n }", "java.lang.String getPhy();", "public Model getModel() {\n return petal_model;\n }", "TypedModel getModel();", "public com.google.protobuf.ByteString\n getPhyBytes() {\n java.lang.Object ref = phy_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n phy_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\r\n\tpublic T getModel() {\n\t\treturn model;\r\n\t}", "public com.google.protobuf.ByteString\n getPhyBytes() {\n java.lang.Object ref = phy_;\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 phy_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public T getCoTU() {\r\n return tree[0];\r\n }", "public Modello getModello() {\r\n\t\treturn mod;\r\n\t}", "@Override\r\n\tpublic Model getModel() {\n\t\treturn this.model;\r\n\t}", "ModelData getModel();", "public String getModel() {\n\t\treturn model; \n\t}", "public String getModel() {\n return this.model;\r\n }", "public HDPModel getModel() {\n HDPModelBuilder builder = new HDPModelBuilder(numberOfTopics, totalNumberOfWords);\n for (int k = 0; k < numberOfTopics; k++) {\n for (int w = 0; w < sizeOfVocabulary; w++) {\n builder.addTopicWordCount(k, w, wordCountByTopicAndTerm[k][w]);\n }\n }\n return builder.build();\n }", "public GraphModel getGraphModel() {\n return getGraphPane().getGraphModel();\n }", "public String getModel()\n {\n return model;\n }", "public String getModel() {\n return model;\n }", "public String getModel() {\n return model;\n }", "com.google.protobuf.ByteString\n getPhyBytes();", "public MyTree getTree() {\r\n\t\treturn tree;\r\n\t}", "public String getModel() {\r\n return model;\r\n }", "public String getTreeType();", "public String getModel()\n\t{\n\t\treturn model;\n\t}", "Model getModel();", "Model getModel();", "Model getModel();", "public abstract M getModel();", "TreeNode getTreeNode();", "@Override\n\t\t\t\tpublic TableModel getModel() {\n\t\t\t\t\treturn model;\n\t\t\t\t}", "public TreeNode getTreeNode() {\n return treeNode;\n }", "public String getModel() {\r\n return (String) store.get(Names.model);\r\n }", "com.google.ortools.linearsolver.MPModelProto getModel();", "@Override\n\tpublic Classes getModel() {\n\t\treturn model;\n\t}", "public Tree getHuffmanTree() {\n return huffmanTree;\n }", "private DefaultTreeModel createTreeModel() {\n\t\t// create the root USA\n\t\tDefaultMutableTreeNode root = new DefaultMutableTreeNode(\"USA\");\n\n\t\t// First child is IOWA!\n\t\troot.add(new DefaultMutableTreeNode(\"Iowa\"));\n\n\t\t// other way to create a DefaultMutableTreeNode:\n\t\t// create an empty node and then add the user object\n\t\tDefaultMutableTreeNode newNode = new DefaultMutableTreeNode();\n\t\tnewNode.setUserObject(\"California\");\n\n\t\t// add a child to newNode\n\t\tnewNode.add(new DefaultMutableTreeNode(\"Sacramento\"));\n\n\t\t// add a sibling to Iowa (i.e. California)\n\t\troot.add(newNode);\n\n\t\t// create the model using the root of the tree\n\t\tDefaultTreeModel treeModel = new DefaultTreeModel(root);\n\n\t\t// ADD MODEL LISTENERS (changes/insertion/deletion of nodes)\n\t\ttreeModel.addTreeModelListener(createTreeModelListener());\n\t\treturn treeModel;\n\n\t}", "@Override\n\tpublic String getModel() {\n\t\treturn model;\n\t}", "public Object getModel();", "@Override\n\tpublic String getModel() {\n\t\treturn \"medium model\";\n\t}", "public Model getModel()\n\t{\n\t\treturn this.model;\n\t}", "public Model getModel() {\n\t\treturn model;\n\t}", "public Model getModel() {\n\t\treturn model;\n\t}", "public Model getModel() {\n\t\treturn model;\n\t}", "@Override\r\n\tpublic TeacherDomain getModel() {\n\t\treturn teacherDomain;\r\n\t}", "public Object getModel() {\n\t\treturn bm;\r\n\t}", "public static String getDeviceModel() {\n String deviceName = SystemProperties.get(\"prize.system.boot.rsc\");\n // prize modify for bug66476 by houjian end\n deviceName = !TextUtils.isEmpty(deviceName) ? deviceName : Build.MODEL + DeviceInfoUtils.getMsvSuffix();\n //prize modified by xiekui, fix bug 74122, 20190408-start\n return UtilsExt.useDeviceInfoSettingsExt() == null ? deviceName : UtilsExt.useDeviceInfoSettingsExt().customeModelInfo(deviceName);\n //prize modified by xiekui, fix bug 74122, 20190408-end\n }", "private NodesTableModel getNodesTableModel() {\n\t\treturn (NodesTableModel)getNodesTable().getModel();\n\t}", "public String getModel();", "public Model getModel () { return _model; }", "public String getModel()\n\t{\n\t\treturn null;\n\t}", "public javax.swing.table.TableModel getIntermediateNodeModel()\n\t{\n\t\tObject[][] cells = new Object[1 + children.length + BlockContext.common_fields.length][];\n\n\t\tint level = context.dc.getUInt8(context.nm_cLevel);\n\t\tint i = 0;\n\t\tcells[i++] = new Object[]{\"Block type\", level == 0 ? \"SLENTRY\" : \"SIENTRY\"};\n\t\tcells[i++] = new Object[]{context.nm_bType, context.dc.getUInt8(context.nm_bType)};\n\t\tcells[i++] = new Object[]{context.nm_cLevel, level};\n\t\tcells[i++] = new Object[]{context.nm_cEnt, (Short)context.dc.get(context.nm_cEnt)};\n\n\t\tfor (int j = 0; j < children.length; ++j)\n\t\t\tcells[i++] = new Object[]{String.format(\"rgentries %d\", j), children[j].toString()};\n\n\t\treturn new ReadOnlyTableModel(cells, new Object[]{\"\", \"\"});\n\t}", "protected E getModel ()\n\t{\n\t\treturn model;\n\t}", "public String getDeviceModel() {\n return deviceModel;\n }", "public TableModel getModel() {\n return model;\n }", "ListValueModel<TreeNodeValueModel<T>> childrenModel();", "public TreeTableCellRenderer getRenderer() {\n return treeTableCellRenderer;\n }", "public Class getModelClass() {\r\n\t\treturn model;\r\n\t}", "public DeviceModel getDeviceModel()\r\n\t{\r\n\t\treturn deviceModel;\r\n\t}", "public ContainmentModel getModel()\n {\n return m_model;\n }", "@Override\r\n\tpublic JTree getJTree() {\r\n\t\tif (jTree == null) {\r\n\t\t\tjTree = new JLagerTree();\r\n\t\t\tjTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION );\r\n\t\t\tGenericNode root = new GenericNode(null);\r\n\t\t\tjTree.setModel(getTreeModel(root));\r\n\t\t\tjTree.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n//\t\t\tjTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {\r\n//\t\t\t\tpublic void valueChanged(javax.swing.event.TreeSelectionEvent e) {\r\n//\t\t\t\t\ttreeValueChanged(e,BaugruppeTreePaneView.this.getJTree());\r\n////\t\t\t\t\tSystem.out.println(\"valueChanged()\"); // TODO Auto-generated Event stub valueChanged()\r\n//\t\t\t\t}\r\n//\t\t\t});\r\n//\t\t\tjTree.addTreeSelectionListener(getTreeSelectionListner());\r\n\t\t\t//Aussehen von JTree\r\n\t\t\tjTree.setCellRenderer(new AnfoderungTreeRenderer());\r\n\t\t\tjTree.setToolTipText(\"\");\r\n\t\t\t\r\n\t\t}\r\n\t\treturn jTree;\r\n\t}", "@Override\n\tpublic MenuModel getModel() {\n\t\treturn mm;\n\t}", "A getModel();", "@Override\n public Graph getGraphModel() {\n return this.graph;\n }", "public String treeType();", "public Object getModel() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Teacher getModel() {\n\t\treturn teacher;\r\n\t}", "public AbstractModel getModel() {\n return model;\n }", "public Model getModel(){\r\n return model;\r\n }", "public PetriNetModel getSubNet() {\n subNetOk = false;\n String fileName = getProperty(PROP_SUBNET);\n if (fileName == null) \n return null;\n if (fileName.length() == 0) \n return null;\n // Create initial ProcessModel\n ProcessModel model = null;\n\n // Try to open the model\n try {\n FileInputStream in = new FileInputStream(fileName);\n model = ProcessUtils.parseProcessModelSerialization(in);\n } catch (Exception ex) {\n return null;\n }\n\n // Return model if type is PetriNetModel\n if (model instanceof PetriNetModel) {\n subNetOk = true;\n return (PetriNetModel) model;\n }\n\n // Return null otherwise\n return null;\n }", "public Class<T> getModelClass() {\n\t\treturn modelClass;\n\t}", "@Override\n\t\tpublic int getModel() {\n\t\t\treturn 0;\n\t\t}", "public TreeModel(String appname, int nGRAM_SIZE, double tHRESHOLD_MODEL) {\r\n\t\tsuper(appname, ModelManager.TREE_MODEL, nGRAM_SIZE,0.1,tHRESHOLD_MODEL);\r\n\t\tif (setters== null){\r\n\t\t\tsetters = new ArrayList<AnomalyRate>();\t\r\n\t\t\tsetters.add(new LogAnomaly());\r\n\t\t}\r\n\t\ttreeDepth = nGRAM_SIZE;//10\r\n\t\tthis.threshold=tHRESHOLD_MODEL;\r\n\t}", "public String getTree ( ) {\n\n String tree;\n StringWriter s = new StringWriter();\n PrintWriter out = null;\n\n try {\n out = new PrintWriter(s);\n } catch ( Exception ex ) {};\n\n program.printIndividual(param.Parameters.STATE, out);\n\n tree = s.toString();\n String list2[] = tree.split(\"\\n\");\n\n out.close();\n try { s.close(); } catch ( Exception e ) {};\n\n return list2[list2.length - 1];\n\n }", "public String getVehicleModel() {\n return vehicleModel;\n }", "public JTree getTree(){\n return tree;\n }", "@Override\n\tpublic Person getModel() {\n\t\treturn person;\n\t}", "public Object getModel()\n {\n AttributeDescriptor.ComponentType compType = _attrDef.getComponentType();\n return getModel(compType);\n }", "public SimModel getSimModel() {\n return simModel;\n }", "@Override\n\tpublic VehicleModel getModel(){\n\t\treturn null;\n\t}", "public ModelType getModelType() {\n\t\treturn mtype;\n\t}", "public Class<M> getModelClass();", "public Behavior getModel(){\n\t\treturn (this.model);\n\t}", "public DataModel getModel() {\n return model;\n }", "public BaseSlingModel getGenericModel() {\n return model;\n }" ]
[ "0.7016141", "0.6788483", "0.6744391", "0.6454292", "0.62415165", "0.6231961", "0.6196564", "0.60635954", "0.59578794", "0.5909536", "0.5895233", "0.5889358", "0.582551", "0.5791267", "0.5718211", "0.57138926", "0.5712324", "0.562077", "0.5616828", "0.561121", "0.5597767", "0.55676836", "0.5550025", "0.5523856", "0.5515998", "0.5483462", "0.547882", "0.5478132", "0.54518706", "0.54481626", "0.54481244", "0.54481244", "0.54475707", "0.54438466", "0.54368466", "0.5412374", "0.5408683", "0.54033047", "0.54033047", "0.54033047", "0.53963315", "0.53956765", "0.5394839", "0.5379041", "0.5372652", "0.5367962", "0.53662306", "0.5356993", "0.53519344", "0.5345402", "0.5337804", "0.53349006", "0.5331837", "0.53296506", "0.53296506", "0.53296506", "0.53284216", "0.52942497", "0.5290586", "0.5277824", "0.5274307", "0.5269091", "0.52635676", "0.5260744", "0.5244832", "0.52447885", "0.5236833", "0.5231988", "0.5231129", "0.5229604", "0.5222773", "0.52212495", "0.5218898", "0.5211696", "0.52110666", "0.519769", "0.51903117", "0.5179614", "0.517502", "0.5157005", "0.5156232", "0.51552325", "0.5154294", "0.5148577", "0.5142746", "0.5135534", "0.51295", "0.5119981", "0.5114352", "0.51118946", "0.510913", "0.5103428", "0.5098669", "0.50920904", "0.5086514", "0.50856626", "0.50845796" ]
0.52432287
68
Set the model of the PhylogeneticTree.
public void setModel(Model model) { this.model = model; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PhylogeneticTree(Model model) {\n this.model = model;\n }", "public void setTreeModel(HierarchicalConfiguration treeModel)\n {\n this.treeModel = treeModel;\n }", "public void setModel(IHierarchicalNodeModel model);", "public void setModel(DefaultTreeModel model)\n {\n if (model != null)\n {\n setRoot((DefaultMutableTreeNode)\n model.getRoot());\n }\n else\n {\n setRoot(null);\n }\n }", "void setModel(Model m);", "public void setSubNet(PetriNetModel m) {\n //subModel = m;\n }", "public void setModel(OntModel model) {\n\t\tthis.model = model;\n\t}", "void setModel(Model model);", "public void _setModel(T model) {\n _model = model;\n }", "public Builder setPhy(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n phy_ = value;\n onChanged();\n return this;\n }", "public void setModel(Model m){\r\n model = m;\r\n }", "public <T extends BaseSlingModel> void setModel(final T model) {\n this.model = model;\n }", "public void setup(Tree tree) {\n model.setTree(tree);\n\n for (TreeNode node : tree.nodes) {\n if (node.isLeaf()) {\n model.addCell(node.getKey(), node.getName(), 0, CellType.TREELEAF);\n } else {\n model.addCell(node.getKey(), node.getName(), 0, CellType.TREEMIDDLE);\n }\n }\n }", "@Override\r\n\tpublic void setModel() {\n\t}", "private void setTreePresenter() {\n this.tree.setIconProvider(new ModelIconProvider<GPBeanTreeModel>() {\n \n @Override\n public AbstractImagePrototype getIcon(GPBeanTreeModel model) {\n return model.getIcon();\n }\n });\n \n this.tree.setLabelProvider(new ModelStringProvider<GPBeanTreeModel>() {\n \n @Override\n public String getStringValue(GPBeanTreeModel model, String property) {\n return model.getLabel();\n }\n });\n \n this.tree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);\n \n this.tree.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<GPBeanTreeModel>() {\n \n @Override\n public void selectionChanged(\n SelectionChangedEvent<GPBeanTreeModel> se) {\n if (se.getSelectedItem() != null) {\n MediatorToolbarTreeAction.getInstance().elementChanged(se.getSelectedItem());\n } else {\n MediatorToolbarTreeAction.getInstance().disableAllActions();\n }\n \n }\n });\n this.setCheckable(true);\n this.setCheckStyle(CheckCascade.NONE);\n this.tree.setAutoHeight(true);\n }", "public void setModel(Model model) {\n petal_model = model;\n }", "public TreeModel(String appname, int nGRAM_SIZE, double tHRESHOLD_MODEL) {\r\n\t\tsuper(appname, ModelManager.TREE_MODEL, nGRAM_SIZE,0.1,tHRESHOLD_MODEL);\r\n\t\tif (setters== null){\r\n\t\t\tsetters = new ArrayList<AnomalyRate>();\t\r\n\t\t\tsetters.add(new LogAnomaly());\r\n\t\t}\r\n\t\ttreeDepth = nGRAM_SIZE;//10\r\n\t\tthis.threshold=tHRESHOLD_MODEL;\r\n\t}", "private void initTreeModel() throws JellyTagException\n {\n if (getTreeModel() == null)\n {\n if (getModel() == null)\n {\n throw new MissingAttributeException(\"model\");\n }\n\n setTreeModel((HierarchicalConfiguration) getBuilderData()\n .getBeanContext().getBean(getModel()));\n }\n }", "public void setTree(Tree tree) {\n this.tree = tree;\n }", "@Override\r\n public void setModel(String model) {\n }", "public void setTree(MyTree t) {\r\n\t\ttree = t;\r\n\t}", "public QuestionPoolDataModel(Tree tree, DataModel model)\n {\n this.model = model;\n this.tree=tree;\n //buildTree();\n }", "@Override\n\t\tpublic void setModel(int model) {\n\t\t\t\n\t\t}", "public HtmlTree(DefaultTreeModel model)\n {\n setModel(model);\n }", "public void setGraphModel(GraphModel m)\n {\n getGraphPane().setGraphModel(m);\n }", "public void initTreeModel() {\n\t\t\n\t}", "public void initTreeModel() {\n\t\t\n\t}", "private void setDeviceModel() {\n addToMobileContext(Parameters.DEVICE_MODEL, android.os.Build.MODEL);\n }", "public void setModel(String model)\n {\n this.model = model;\n }", "public void setModel(AbstractModel model) {\n this.model = model;\n }", "public void setModel(@Nonnull ListModel model) {\n throw new UnsupportedOperationException(\"TreeList accepts only TreeModel as a model\");\n }", "public void setModel(String model){\n String validModel = model.toLowerCase();\n if(validModel.equals(\"Model S\") || validModel.equals(\"Enzo\")){\n this.model = model;\n }else{\n this.model = \"Unknown\";\n }\n\n }", "public static void setModel(ClassifierModel model) {\n\t\tif(model.isIJUsed()) {\r\n\t\t\tpreprocess.setIJModel(model.getPreprocessModel());\r\n\t\t\tsvm.setIJModel(model.getSvmmodel());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpreprocess.setJFModel(model.getPreprocessModel());\r\n\t\t\tsvm.setJFModel(model.getSvmmodel());\r\n\t\t}\r\n\t}", "public void setModel(String model) {\r\n this.model = model;\r\n }", "public void setModel(GraphModel inputModel){\n\t\t// DO NOTHING IF THE MODEL IS ALREADY SET.\n\t\tif(inputModel == theModel)\n\t\t\treturn;\n\t\t\n\t\ttheModel = inputModel;\n\t\ttheModel.addObserver(this);\n\t}", "@Override\n\tpublic void setModel(String model) {\n\t\tthis.model = model;\n\t}", "public void setIndexModel(TreeModel m) {\n if (editor != null)\n editor.setIndexModel(m);\n if (indexTree != null)\n indexTree.setModel(m);\n }", "void set(Model model);", "public void setModel(String model) {\n this.model = model;\n }", "public void setDeviceModel(DeviceModel deviceModel)\r\n\t{\r\n\t\tthis.deviceModel = deviceModel;\r\n\t}", "public void setComponentModel( ComponentModel componentModel )\n {\n unregisterListeners();\n\n if ( componentModel == null )\n {\n return;\n }\n\n this.componentModel = componentModel;\n\n treeTable = new JTreeTable(\n new PropertyInspectorTreeTableModel( componentModel, propertyShowMode ) )\n {\n @Override\n public String getToolTipText( MouseEvent event )\n {\n String tip = showToolTip ? getToolTip( event ) : null;\n return tip;\n }\n };\n treeTable.getColumnModel().getColumn(1).setResizable( false );\n\n treeTable.getTableHeader().setReorderingAllowed( false );\n treeTable.getTree().setCellRenderer( new NameRenderer() );\n\n\n treeTable.setDefaultRenderer( Object.class, valueRenderer);\n treeTable.setDefaultEditor( Object.class, new ValueEditor(this) );\n treeTable.setIntercellSpacing( new Dimension( 2, 2 ) );\n treeTable.setShowGrid( showGrid );\n treeTable.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );\n treeTable.setRowSelectionAllowed( false );\n treeTable.setColumnSelectionAllowed( false );\n treeTable.setCellSelectionEnabled( true );\n\ntreeTable.setFocusTraversalPolicy(new java.awt.DefaultFocusTraversalPolicy());\n\n treeListener = new PropertyTreeListenerAdapter();\n\n treePane = new JScrollPane(treeTable); \n\n splitPane.setTopComponent(treePane);\n validate();\n\n selectCell( 0, 0 );\n\n if ( componentModel.isExpanded() )\n {\n restoreCollapsingState();\n }\n else\n {\n treeTable.getTree().collapseRow( 0 );\n }\n\n registerListeners();\n updateToolTipPane(componentModel);\n }", "private void setModel(IAnnotationModel model) {\n \t\tif (fModel != model) {\n \t\t\tif (fModel != null)\n \t\t\t\tfModel.removeAnnotationModelListener(this);\n \t\t\tfModel= model;\n \t\t\tif (fModel != null) {\n \t\t\t\ttry {\n \t\t\t\t\tfIsSettingModel= true;\n \t\t\t\t\tfModel.addAnnotationModelListener(this);\n \t\t\t\t} finally {\n \t\t\t\t\tfIsSettingModel= false;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public void setModelClass(Class model) {\r\n\t\tthis.model=model;\r\n\t}", "public void setModel(String model) {\r\n this.model = Objects.requireNonNull(model);\r\n }", "public void setModel(Model model) {\n\t\tthis.model.copy(model);\r\n\t}", "@Override\n\tpublic void setModel(Object o) {\n\t\t\n\t}", "public void setModel(String model) {\r\n if (model != null) {\r\n store.put(Names.model, model);\r\n } else {\r\n \tstore.remove(Names.model);\r\n }\r\n }", "public HttpBuilder<E,T> setModel (E model)\n\t{\n\t\tthis.model = model;\n\t\treturn this;\n\t}", "public static void setModel(SnagliModel model1) {\n\t\tmodel = model1;\n\t}", "@Override\n\tpublic void setModel(TenantsEntity model) {\n\t\t\n\t}", "public Builder setPhyBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n phy_ = value;\n onChanged();\n return this;\n }", "public void setModello(Modello m) {\r\n\t\t//PRECONDIZIONE\r\n\t\tassert m!=null : \"Chiamato setModello con m null\";\r\n\t\tmod = m;\r\n\t}", "public JdbNavTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public JTreeAdvanced(TreeModel model) {\r\n super(model);\r\n }", "public void setTreeNode(TreeNode treeNode) {\n this.treeNode = treeNode;\n }", "public void setModel(Board b) { model = b; repaint(); }", "public void setModel(String model) { // we've just created a SETTER\r\n String validModel = model.toLowerCase();\r\n if (validModel.equals(\"carrera\") || validModel.equals(\"commodore\")) {\r\n this.model = model;\r\n } else {\r\n this.model = \"Unknown\";\r\n }\r\n }", "public void setAnimalModel(AnimalModel[] param) {\n validateAnimalModel(param);\n\n localAnimalModelTracker = true;\n\n this.localAnimalModel = param;\n }", "private void setupModel() {\n\n //Chooses which model gets prepared\n switch (id) {\n case 2:\n singlePackage = new Node();\n activeNode = singlePackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_solo)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 3:\n multiPackage = new Node();\n activeNode = multiPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_multi_new)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 4:\n wagonPackage = new Node();\n activeNode = wagonPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_car_new)\n .build().thenAccept(a -> activeRenderable = a)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n default:\n mailbox = new Node();\n activeNode = mailbox;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.mailbox)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n }\n }", "private void initModel() {\t\n \t\t// build default tree structure\n \t\tif(treeMode == MODE_DEPENDENCY) {\n \t\t\t// don't re-init anything\n \t\t\tif(rootDependency == null) {\n \t\t\t\trootDependency = new DefaultMutableTreeNode();\n \t\t\t\tdepNode = new DefaultMutableTreeNode(); // dependent objects\n \t\t\t\tindNode = new DefaultMutableTreeNode();\n \t\t\t\tauxiliaryNode = new DefaultMutableTreeNode();\n \t\t\t\t\n \t\t\t\t// independent objects \n \t\t\t\trootDependency.add(indNode);\n \t\t\t\trootDependency.add(depNode);\n \t\t\t}\n \t\t\t\n \t\t\t// set the root\n \t\t\tmodel.setRoot(rootDependency);\n \n \t\t\t// add auxiliary node if neccessary\n \t\t\tif(showAuxiliaryObjects) {\n \t\t\t\tif(!auxiliaryNode.isNodeChild(rootDependency)) {\n \t\t\t\t\tmodel.insertNodeInto(auxiliaryNode, rootDependency, rootDependency.getChildCount());\n \t\t\t\t}\n \t\t\t}\n \t\t} else {\n \t\t\t// don't re-init anything\n \t\t\tif(rootType == null) {\n \t\t\t\trootType = new DefaultMutableTreeNode();\n \t\t\t\ttypeNodesMap = new HashMap<String, DefaultMutableTreeNode>(5);\n \t\t\t}\n \t\t\t\n \t\t\t// always try to remove the auxiliary node\n \t\t\tif(showAuxiliaryObjects && auxiliaryNode != null) {\n \t\t\t\tmodel.removeNodeFromParent(auxiliaryNode);\n \t\t\t}\n \n \t\t\t// set the root\n \t\t\tmodel.setRoot(rootType);\n \t\t}\n \t}", "public HierarchicalConfiguration getTreeModel()\n {\n return treeModel;\n }", "public JdbTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public void setAnimalModel(AnimalModel param) {\n this.localAnimalModel = param;\n }", "public void setJTree(javax.swing.JTree tree) {\n this.remove(getJTree());\n jTree = tree;\n getJScrollPane().setViewportView(jTree);\n }", "public void setModel(EPStatementObjectModel model) {\n this.model = model;\n }", "public void setOntModel(String fileName)\n\t{\n\t\tthis.ontModel = getModel(fileName);\n\t}", "public PhylogeneticTree loadPhylogeneticTree(int treeId) {\n if (treeId == 0) {\n phylogeneticTree = new PhylogeneticTree();\n phylogeneticTree.parseTree(\"testGenomeNwk\",\n new ArrayList<>(genomeGraph.getGenomes().keySet()));\n return phylogeneticTree;\n } else {\n return phylogeneticTree;\n }\n }", "public void setModel(String modelName)\n\t{\n\t\tmyModel = modelName;\n\t}", "public DefaultTreeModel getModel()\n {\n return new DefaultTreeModel(root);\n }", "public TreeModel getTreeModel() {\r\n return ModelBuilder.getSingleton().buildTreeModelAsync(this);\r\n }", "public AbstractJMFXModel(M model) {\n\t\tthis.model = model;\n\t}", "public abstract void setTurtleRecursive(TurtleModel value);", "public void setPetModel(PetModel[] param) {\n validatePetModel(param);\n\n localPetModelTracker = true;\n\n this.localPetModel = param;\n }", "public void setModel (final Boolean parg) throws CGException {\n ivModel = (Boolean) UTIL.clone(parg);\n }", "public void setDBModel(DBModel m)\n {\n\tthis.model = m;\n\n }", "NCModel getModel();", "public void setModel(RegionModel newModel) {\n\t\tmodel = newModel;\n\t}", "public void setModel(String model) {\n this.model = model == null ? null : model.trim();\n }", "private void setControlModel(String setting, Object value) {\n\t\tHub.dataModel.put(setting, value);\n\t\tLog.d(TAG, \"Control model updated.\");\n\t}", "private void setNumTalentosToModel(int numTalentos)\n {\n if (controlador != null)\n { controlador.setTalentos(skill.getID(), stat.getID(), numTalentos); }\n }", "public void setModel(MediaModel m)\n\t{\n\t\tthis.model = m;\n\t}", "public void setBaseModel(BaseModel param) {\n this.localBaseModel = param;\n }", "public void setPetModel(PetModel param) {\n this.localPetModel = param;\n }", "public void setTreeSize(Double newtreesize)\n {\n treesize = newtreesize; \n }", "M getModel();", "@Override\n\tpublic void setModel(PaintModel model) {\n\t\t\n\t}", "public void setModelManager( ModelManager modelManager ) {\n this.modelManager = modelManager;\n }", "public void setUserModel(UserModel param) {\n this.localUserModel = param;\n }", "public Hierarchy() {\n treeModel = new DefaultTreeModel(topNode);\n treeModel.addTreeModelListener(new MyTreeModelListener());\n initComponents ();\n }", "@Override\n\tpublic KnowLedgeTreeVo getModel() {\n\t\treturn ktvo;\n\t}", "@Override\r\n public final void modelChanged() {\r\n DefaultMutableTreeNode root = null;\r\n if (getNodeModel() == null) { // do we even have a NodeModel?\r\n root = new DefaultMutableTreeNode(\"No Model\");\r\n } else { // check for empty cluster model before adding content to\r\n // tree\r\n ClusterViewData viewData = getNodeModel().getViewData();\r\n if (viewData == null) {\r\n root = new DefaultMutableTreeNode(\"Empty Model\");\r\n } else { // put cluster info into the tree\r\n root = new DefaultMutableTreeNode(viewData.getNrOfClusters() + \" Clusters\");\r\n DefaultMutableTreeNode clusterParent; // TreeNode for cluster\r\n // c\r\n for (int c = 0; c < viewData.getNrOfClusters(); c++) {\r\n // add information about coverage and center vector\r\n clusterParent = new ClusterMutableTreeNode(KMeansWSSNodeModel.CLUSTER + c + \" (coverage: \"\r\n + viewData.getClusterCoverage(c) + \")\", new RowKey(KMeansWSSNodeModel.CLUSTER + c));\r\n for (int i = 0; i < viewData.getNrOfUsedColumns(); i++) {\r\n clusterParent.add(new DefaultMutableTreeNode(\r\n viewData.getFeatureName(i) + \" = \" + viewData.getClusterCenter(c)[i]));\r\n }\r\n root.add(clusterParent);\r\n }\r\n }\r\n }\r\n // set new JTreeModel\r\n m_jtree.setModel(new DefaultTreeModel(root));\r\n }", "protected CreateMachineNodeModel() {\r\n super(0,1);\r\n }", "public void setLabels() {\n \t\tif(getTreeMode() == MODE_DEPENDENCY) {\n \t\t\tindNode.setUserObject(app.getPlain(\"FreeObjects\"));\n \t\t\tmodel.nodeChanged(indNode);\n \t\t\t\n \t\t\tdepNode.setUserObject(app.getPlain(\"DependentObjects\"));\n \t\t\tmodel.nodeChanged(depNode);\n \t\t\t\n \t\t\tauxiliaryNode.setUserObject(app.getPlain(\"AuxiliaryObjects\"));\n \t\t\tmodel.nodeChanged(auxiliaryNode);\n \t\t} else {\n \t\t\tDefaultMutableTreeNode node;\n \t\t\tfor (String key : typeNodesMap.keySet()) {\n \t\t\t\tnode = typeNodesMap.get(key);\n \t\t\t\tnode.setUserObject(app.getPlain(key));\n \t\t\t\tmodel.nodeChanged(node);\n \t\t\t}\n \t\t}\n \t\t\n \t\tif(helperBar != null) {\n \t\t\thelperBar.updateLabels();\n \t\t}\n \t}", "public void setModelNo(Integer modelNo) {\n this.modelNo = modelNo;\n }", "public ShowTree(GUIMain guiMn) throws HeadlessException {\n setSize(200, 400);\n\n guiMn.simMain.rootNode = new DefaultMutableTreeNode(\"Physiology systems\");\n guiMn.simMain.treeModel = new DefaultTreeModel(guiMn.simMain.rootNode);\n guiMn.simMain.treeModel.addTreeModelListener(new WBodyTreeModelListener());\n\n guiMn.myTree = new ConnectionJTree(guiMn.simMain.treeModel);\n\n guiMn.myTree.setEditable(true);\n guiMn.myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);\n\n guiMn.myTree.setCellRenderer(new CountryTreeCellRenderer());\n\n // even rootNode could be foldable\n guiMn.myTree.setShowsRootHandles(true);\n\n // make it possible to select a insideLeaf\n JLabel selectedLabel = new JLabel();\n add(selectedLabel, BorderLayout.SOUTH);\n\n /*\n * this call the routine managing clicks on tree's elements\n */\n guiMn.myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {\n @Override\n public void valueChanged(TreeSelectionEvent e) {\n DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) guiMn.myTree.getLastSelectedPathComponent();\n if (selectedNode != null) {\n // A button has been clicked\n WBodyTreeEvent wbte = new WBodyTreeEvent(guiMn);\n wbte.buttonClicked(selectedLabel, selectedNode);\n }\n }\n\n });\n\n }", "public void setManager(OtmModelManager modelManager) {\n this.modelManager = modelManager;\n }", "abstract public void setTurtle(TurtleModel t);", "public DefaultMutableTreeNode getModel(){\n return addToModel(parent);\n }" ]
[ "0.77336407", "0.7206536", "0.6797748", "0.6203033", "0.6127028", "0.60679364", "0.6011769", "0.59651214", "0.5909038", "0.5840707", "0.58222806", "0.5750137", "0.57248247", "0.5715777", "0.5709225", "0.5689538", "0.56736344", "0.56696314", "0.5665214", "0.56615597", "0.5626407", "0.5616286", "0.5596891", "0.5556083", "0.5555016", "0.5533605", "0.5533605", "0.5480149", "0.54796904", "0.5477111", "0.54755294", "0.54598194", "0.54566926", "0.54512006", "0.54384434", "0.5438335", "0.54260427", "0.5423905", "0.541071", "0.53686136", "0.53642845", "0.5357269", "0.5344127", "0.53334475", "0.5329485", "0.532933", "0.53285974", "0.5328279", "0.5319914", "0.5316541", "0.52974457", "0.52973306", "0.5291095", "0.5254714", "0.5249545", "0.52465165", "0.52121025", "0.51987785", "0.51754034", "0.51676464", "0.51630414", "0.5162488", "0.51588637", "0.51207954", "0.5120606", "0.5099095", "0.50943553", "0.508115", "0.5078012", "0.5062938", "0.5050804", "0.50444996", "0.50436634", "0.50424796", "0.5007138", "0.50055546", "0.50014615", "0.49786648", "0.4978601", "0.49783206", "0.49772272", "0.49566686", "0.4940202", "0.49335366", "0.49239752", "0.4917193", "0.4915452", "0.4907962", "0.49078682", "0.49009445", "0.48988357", "0.4873297", "0.48590368", "0.4859014", "0.4822747", "0.4817305", "0.4813622", "0.48112166" ]
0.5579001
24
Setup the tree model from a Newick data file.
@SuppressFBWarnings({"NP_NULL_PARAM_DEREF", "DM_DEFAULT_ENCODING", "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"}) public Tree getTreeFromFile(String path) { FileInputStream fileInputStream = null; try { fileInputStream = new FileInputStream(path); } catch (FileNotFoundException e) { } BufferedReader r = new BufferedReader(new InputStreamReader(fileInputStream)); TreeParser tp = new TreeParser(r); String f = Paths.get(path).getFileName().toString(); return tp.tokenize(f); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initTreeModel() {\n\t\t\n\t}", "public void initTreeModel() {\n\t\t\n\t}", "protected void init(String tree){\n\t\tJSONObject tree_model = null;\n\t\ttry {\n\t\t\ttree_model = (JSONObject)new JSONParser().parse(tree);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t\tJSONArray phys_tree = (JSONArray)tree_model.get(\"tree_diagram\");\n\t\troot_scheme = new TreeNode();\n\t\tbuildTree(phys_tree,root_scheme);\n\t}", "private void initTreeModel() throws JellyTagException\n {\n if (getTreeModel() == null)\n {\n if (getModel() == null)\n {\n throw new MissingAttributeException(\"model\");\n }\n\n setTreeModel((HierarchicalConfiguration) getBuilderData()\n .getBeanContext().getBean(getModel()));\n }\n }", "public void setup(Tree tree) {\n model.setTree(tree);\n\n for (TreeNode node : tree.nodes) {\n if (node.isLeaf()) {\n model.addCell(node.getKey(), node.getName(), 0, CellType.TREELEAF);\n } else {\n model.addCell(node.getKey(), node.getName(), 0, CellType.TREEMIDDLE);\n }\n }\n }", "private void setup(){\n buildTree(2);\n }", "public TreeNode readTrainingFile() {\n\t\t// first, read the training data into some storage location\n\t\ttry {\n\t\t\tScanner s = new Scanner(new File(trainingFile));\n\t\t\t// took these lines from helper-code\n\t\t classifierNames = new ArrayList<String>();\n\t\t for (Scanner l = new Scanner(s.nextLine()); l.hasNext();) {\n\t\t \tclassifierNames.add(l.next());\n\t\t }\n\t\t\tif (attributeNames.size() == 0) {\n\t\t\t\tScanner line = new Scanner(s.nextLine());\n\t\t\t\twhile (line.hasNext()) {\n\t\t\t\t\tattributeNames.add(line.next());\n\t\t\t\t}\n\t\t\t\tline.close();\n\t\t\t}\n\t\t\treadFile(s,instances);\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.err.println(\"Training file not found, you should have put tests for this in main.\");\n\t\t\tSystem.err.println(\"Attempted to read \"+trainingFile+\".\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\tsetDefaultNode();\n\t\tArrayList<Boolean> ar = new ArrayList<Boolean>();\n\t\tfor (int i = 0; i < attributeNames.size(); i++) {\n\t\t\tar.add(false);\n\t\t}\n\t\treturn BuildTree(instances, ar);\n\t}", "private void initTrees() {\n // My machine tree init code\n myMachineTree = new FileTree(fileDomainModel);\n myMachineScrollPane.add(myMachineTree);\n // Connected machine tree init code\n connectedMachineTree = new FileTree(fileDomainModel);\n connectedMachineScrollPane.add(connectedMachineTree);\n }", "private void initModel() {\t\n \t\t// build default tree structure\n \t\tif(treeMode == MODE_DEPENDENCY) {\n \t\t\t// don't re-init anything\n \t\t\tif(rootDependency == null) {\n \t\t\t\trootDependency = new DefaultMutableTreeNode();\n \t\t\t\tdepNode = new DefaultMutableTreeNode(); // dependent objects\n \t\t\t\tindNode = new DefaultMutableTreeNode();\n \t\t\t\tauxiliaryNode = new DefaultMutableTreeNode();\n \t\t\t\t\n \t\t\t\t// independent objects \n \t\t\t\trootDependency.add(indNode);\n \t\t\t\trootDependency.add(depNode);\n \t\t\t}\n \t\t\t\n \t\t\t// set the root\n \t\t\tmodel.setRoot(rootDependency);\n \n \t\t\t// add auxiliary node if neccessary\n \t\t\tif(showAuxiliaryObjects) {\n \t\t\t\tif(!auxiliaryNode.isNodeChild(rootDependency)) {\n \t\t\t\t\tmodel.insertNodeInto(auxiliaryNode, rootDependency, rootDependency.getChildCount());\n \t\t\t\t}\n \t\t\t}\n \t\t} else {\n \t\t\t// don't re-init anything\n \t\t\tif(rootType == null) {\n \t\t\t\trootType = new DefaultMutableTreeNode();\n \t\t\t\ttypeNodesMap = new HashMap<String, DefaultMutableTreeNode>(5);\n \t\t\t}\n \t\t\t\n \t\t\t// always try to remove the auxiliary node\n \t\t\tif(showAuxiliaryObjects && auxiliaryNode != null) {\n \t\t\t\tmodel.removeNodeFromParent(auxiliaryNode);\n \t\t\t}\n \n \t\t\t// set the root\n \t\t\tmodel.setRoot(rootType);\n \t\t}\n \t}", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "public JdbTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public JdbNavTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public TreeNode readDataFile() {\n\t\tdata = new ArrayList<Instance>();\n\t\ttry {\n\t\t\tScanner s = new Scanner(new File(testFile));\n\t\t\t// took these lines from helper-code\n\t\t\tScanner l = new Scanner(s.nextLine());\n\t\t\tfor (int i = 0; l.hasNext(); i++) {\n\t\t\t\tif (!l.next().equals(classifierNames.get(i))) {\n\t\t\t\t\tSystem.err.println(\"This data file does not use the same category names as the training file.\");\n\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tl.close();\n\t\t\tl = new Scanner(s.nextLine());\n\t\t\tfor (int i = 0; l.hasNext(); i++) {\n\t\t\t\tif (!l.next().equals(attributeNames.get(i))) {\n\t\t\t\t\tSystem.err.println(\"This data file does not match the attributes of the training file.\");\n\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tl.close();\n\t\t\tSystem.out.println(\"Read attributes \"+attributeNames.toString()+\".\");\n\t\t\treadFile(s,data);\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.err.println(\"Training file not found, you should have put tests for this in main.\");\n\t\t\tSystem.err.println(\"Attempted to read \"+testFile+\".\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\tArrayList<Boolean> attrs = new ArrayList<Boolean>();\n\t\tfor (int i = 0; i < attributeNames.size(); i++) {\n\t\t\tattrs.add(false);\n\t\t}\n\t\tTreeNode root = BuildTree(instances, attrs);\n\t\treturn root;\n\t}", "public Hierarchy() {\n treeModel = new DefaultTreeModel(topNode);\n treeModel.addTreeModelListener(new MyTreeModelListener());\n initComponents ();\n }", "public PhylogeneticTree(Model model) {\n this.model = model;\n }", "public QuestionPoolDataModel(Tree tree, DataModel model)\n {\n this.model = model;\n this.tree=tree;\n //buildTree();\n }", "public void setTreeModel(HierarchicalConfiguration treeModel)\n {\n this.treeModel = treeModel;\n }", "private static DecisionTree loadTree(File file) throws FileNotFoundException {\r\n\t\tScanner scan = new Scanner(file); // Read from file\r\n\t\t// First line of file is question at root node\r\n\t\tDecisionTree dt = new DecisionTree(scan.nextLine());\r\n\t\tBinaryNode<String> root = dt.getRootNode();\r\n\t\tfillTree(Branch.LEFT, scan, root); // Fill left subtree using Scanner\r\n\t\tfillTree(Branch.RIGHT, scan, root); // Fill right subtree using Scanner\r\n\t\tscan.close(); // Close the file loaded from\r\n\t\treturn dt;\r\n\t}", "@Before\n public void prepareTree() {\n tree = new TreeNode();\n nodeOne = new TreeNode();\n nodeTwo = new TreeNode();\n nodeThree = new TreeNode();\n }", "private void createTree() {\n\n // custom brown color\n Color brown = new Color(149, 99, 57);\n\n // trunk\n NscComponent trunk = new NscRectangle(49, 164, 13, 51);\n createShape(trunk, brown, true);\n\n // branches\n drawLine(50, 125, 50, 165, 10, brown);\n drawLine(25, 125, 50, 165, 10, brown);\n drawLine(75, 125, 50, 165, 10, brown);\n\n // branch outlines\n drawLine(49, 125, 49, 150, 1, Color.black);\n drawLine(60, 125, 60, 150, 1, Color.black);\n drawLine(24, 125, 49, 165, 1, Color.black);\n drawLine(35, 125, 50, 150, 1, Color.black);\n drawLine(85, 125, 60, 165, 1, Color.black);\n drawLine(74, 125, 60, 150, 1, Color.black);\n\n // leafs\n NscEllipse leafs2 = new NscEllipse(0, 5, 60, 122);\n NscEllipse leafs3 = new NscEllipse(50, 5, 60, 122);\n NscEllipse leafs = new NscEllipse(25, 0, 60, 127);\n NscEllipse leafs4 = new NscEllipse(25, 1, 60, 124);\n createShape(leafs2, treeColor, true);\n createShape(leafs3, treeColor, true);\n createShape(leafs, treeColor, true);\n createShape(leafs4, treeColor, false);\n\n repaint();\n }", "private void openTreeML()\r\n {\r\n// // Create the file filter.\r\n// SimpleFileFilter[] filters = new SimpleFileFilter[] {\r\n// new SimpleFileFilter(\"xml\", \"Tree ML (*.xml)\")\r\n// };\r\n// \r\n// // Open the file.\r\n// String file = openFileChooser(true, filters);\r\n// \r\n// // Process the file. \r\n// if (file != null)\r\n// {\r\n// m_gtree = Loader.loadTreeML(file);\r\n// TreeDisplay disp = new TreeDisplay(m_gtree,0);\r\n// TreePanel panel = new TreePanel(disp, LEGEND, ORIENTATION_CONTROL_WIDGET);\r\n// m_tabbedPane.setComponentAt(1, panel);\r\n// }\r\n }", "public void setUp() {\r\n tree = new Lab14BinarySearchTree<String>();\r\n }", "protected void makeTreeDatasetAndRenderer() throws ModelException {\n TreePopulation oPop = m_oDisturbanceBehaviors.getGUIManager().getTreePopulation();\n Plot oPlot = m_oDisturbanceBehaviors.getGUIManager().getPlot();\n float fXPlotLength = oPlot.getPlotXLength(),\n fYPlotLength = oPlot.getPlotYLength();\n int i,j;\n\n m_oTreeRenderer = new XYTreeRenderer(fXPlotLength, fYPlotLength, \n fXPlotLength, fYPlotLength);\n\n //Split out the trees by species, creating XYZDataItems for each\n ArrayList<ArrayList<XYZDataItem>> p_oTreesBySpecies = new ArrayList<ArrayList<XYZDataItem>>(oPop.getNumberOfSpecies());\n for (i = 0; i < oPop.getNumberOfSpecies(); i++) {\n p_oTreesBySpecies.add(i, new ArrayList<XYZDataItem>(0));\n }\n ArrayList<Tree> p_oTrees = oPop.getTrees();\n Tree oTree;\n for (i = 0; i < p_oTrees.size(); i++) {\n oTree = p_oTrees.get(i);\n int iXCode = oPop.getFloatDataCode(\"X\", oTree.getSpecies(), oTree.getType()),\n iYCode = oPop.getFloatDataCode(\"Y\", oTree.getSpecies(), oTree.getType()),\n iDiamCode = -1;\n if (oTree.getType() > TreePopulation.SEEDLING) {\n iDiamCode = oPop.getFloatDataCode(\"DBH\", oTree.getSpecies(),\n oTree.getType());\n }\n if (iXCode > -1 && iYCode > -1 && iDiamCode > -1) {\n p_oTreesBySpecies.get(oTree.getSpecies()).add(new XYZDataItem(\n oTree.getFloat(iXCode).floatValue(),\n oTree.getFloat(iYCode).floatValue(),\n oTree.getFloat(iDiamCode).floatValue()/100.0)); //in m \n }\n }\n\n //Now add these as series to the dataset - empty series OK because they\n //act as placeholders\n XYZDataItem oItem;\n for (i = 0; i < p_oTreesBySpecies.size(); i++) {\n double[][] p_oSeries = new double[3][p_oTreesBySpecies.get(i).size()];\n for (j = 0; j < p_oTreesBySpecies.get(i).size(); j++) {\n oItem = (XYZDataItem) p_oTreesBySpecies.get(i).get(j);\n p_oSeries[0][j] = oItem.fX;\n p_oSeries[1][j] = oItem.fY;\n p_oSeries[2][j] = oItem.fZ;\n }\n m_oTreeDataset.addSeries(oPop.getSpeciesNameFromCode(i), p_oSeries);\n }\n }", "protected void readOntology() {\r\n\t\ttry \r\n\t\t{\r\n\t\t\troot.removeAllChildren();\r\n\t\t\tIterator<String> rc = ob.listRootClasses();\r\n\t\t\twhile(rc.hasNext())\r\n\t\t\t{\r\n\t\t\t\tDefaultMutableTreeNode node = createNode(rc.next(), ob, 0);\r\n\t\t\t\troot.add(node);\r\n\t\t\t}\r\n\t\t\tontologyTree.setModel(new DefaultTreeModel(root));\r\n\t ontologyTree.expandRow(0);\r\n\t \r\n\t\t} catch (Exception e) {\r\n\t\t\torg.apache.commons.logging.LogFactory.getLog(this.getClass()).error(e);\r\n\t\t}\r\n\t}", "void createTree() throws IOException {\n\n // create root\n rootTreeItem = createTreeRoot();\n\n // create tree structure recursively\n createTree(rootTreeItem);\n\n // sort tree structure by name\n rootTreeItem.getChildren()\n .sort(Comparator.comparing(new Function<TreeItem<FilePath>, String>() {\n @Override\n public String apply(TreeItem<FilePath> t) {\n return t.getValue().toString().toLowerCase();\n }\n }));\n\n }", "public static DecisionTree loadTree(String filename) throws FileNotFoundException {\r\n\r\n\t\treturn loadTree(new File(filename));\r\n\t}", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "public void setup(){\n CassandraDriver driver = CassandraDriver.getInstance();\n ArrayList<byte[]> arr = driver.queryData(\"Forest\", \"tree\");\n\n ArrayList<RealDecisionTree> trees = new ArrayList<RealDecisionTree>();\n for (byte[] b : arr){\n trees.add(deserialize(b));\n }\n RandomForest forest = new RandomForest(trees, \"test\", new String[]{\"min, mav, avg, label\"});\n forest.TestForest(trees, forest.testdata);\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 }", "private void initialize() {\r\n\r\n\t\tserverNode = new TreeParent(\"Servers\", \"Servers\", \"AA\", this);\r\n\t\tserverNode.setImageKey(\"System.gif\");\r\n\r\n\t\tnewServerNode = new TreeParent(\"NewServerWizard\", \"New Server\", \"AA\", this);\r\n\t\tnewServerNode.setImageKey(\"ApplicationFilter.gif\");\r\n\t\tnewServerNode.setExpandable(false);\r\n\t\tserverNode.addChild(newServerNode);\r\n\t\tnewServerNode.addChild(new TreeObject(\"Dummy\"));\r\n\t\r\n\t\tloadServers(serverNode);\r\n\r\n\t\tpreferenceNode = new TreeParent(\"Systems\", \"Preferences\", \"BB\", this);\r\n\t\tpreferenceNode.setImageKey(\"preference_page.gif\");\r\n\t\tpreferenceNode.addChild(new TreeObject(\"Dummy\"));\r\n\r\n\t\tinvisibleRoot = new TreeParent(\"\", \"InvisibleRoot\", \"AA\", this);\r\n\t\tinvisibleRoot.addChild(serverNode);\r\n\t\tinvisibleRoot.addChild(preferenceNode);\r\n\r\n\t}", "private Model initTreeNode(String refDatasourceName, String refModelName){\r\n\t\tLOG.info(\"initTreeNode\");\r\n\t\t\r\n\t\tModel refModel = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t//TODO: source datasource w/o model displayed too?\r\n\t\t\t//1. obtain all model(s) order by datasource name, model name\r\n\t\t\tList<Model> allModels = modelService.findAllOrderByDatasourceName();\r\n\r\n\t\t\t//2. sort by datasource name\r\n\t\t\tCollections.sort(allModels, new ModelComparator());\r\n\t\t\t\r\n\t\t\trefAllModels.clear();\r\n\t\t\trefAllModels.addAll(allModels);\r\n\t\t\t\r\n\t\t\trefModel = rebuildTreeNode(refDatasourceName, refModelName, null);\r\n\t\t}\r\n\t\tcatch (ModelServiceException e) {\r\n\t\t\tLOG.error(\"Failed to load all existing Models.\", e);\r\n\t\t}\r\n\t\t\r\n\t\treturn refModel;\r\n\t}", "public Tree(String label) {\n treeName = label;\n root = null;\n }", "public Tree() {\n super.springPictureName = \"tree2.png\";\n super.summerPictureName = \"tree4.png\";\n super.autumnPictureName = \"tree5.png\";\n super.winterPictureName = \"tree7.png\";\n super.eachElementCapacity = 3;\n\n }", "public TreeNode deserialize(String data) {\n return build(new Scanner(data));\n }", "public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}", "public void makeTree(String xmlFileName) throws Exception {\n\t\tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n\t\tDocumentBuilder db = dbf.newDocumentBuilder();\n\t\tDocument doc = db.parse(new FileInputStream(xmlFileName));;\n\t\tElement xmlRoot = doc.getDocumentElement();\n\n\t\troot = new Node();\n\t\twalk(xmlRoot, root);\n\t}", "public TreeItem(String file) throws DataFormatException, FileNotFoundException, IOException {\n\t\tsuper(file);\n\t}", "public DecisionLearningTree(String training, String test) {\n\t\ttrainingFile = training;\n\t\ttestFile = test;\n\t\treadTrainingFile();\n\t\troot = readDataFile();\n\t}", "public static Tree loadTree(String inFile) {\n\t\tif (inFile == null) throw new NullPointerException(\"inFile: null\");\n\t\tTreeBuilder tb = TreeBuilder.loadTree(inFile);\n\t\treturn tb == null ? null : new Tree(tb);\n\t}", "public HtmlTree(DefaultTreeModel model)\n {\n setModel(model);\n }", "public void setModel(IHierarchicalNodeModel model);", "private void initialize() {\n frame = new JFrame();\n trSource = new JTree();\n DefaultTreeModel treeModel = (DefaultTreeModel) trSource.getModel();\n treeModel.setRoot(new DefaultMutableTreeNode(\"Nothing\"));\n treeModel.reload();\n\n // ((DefaultTreeModel)trSource.getModel().getRoot())\n frame.setBounds(100, 100, 700, 600);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n JMenuBar menuBar = new JMenuBar();\n frame.setJMenuBar(menuBar);\n\n frame.addWindowListener(new WindowAdapter() {\n public void windowClosing(WindowEvent e) {\n System.exit(0);\n }\n });\n\n mnFile = new JMenu(\"File\");\n menuBar.add(mnFile);\n\n mntmOpen = new JMenuItem(\"Open\");\n mntmOpen.addActionListener((ActionEvent e) -> {\n chooser = new JFileChooser();\n chooser.setCurrentDirectory(new java.io.File(\".\"));\n chooser.setDialogTitle(\"Select a File\");\n chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\n FileNameExtensionFilter wRebecaFilter = new FileNameExtensionFilter(\n \"wireless Rebeca for dynamic topology(.wRebeca)\", \"wRebeca\");\n FileNameExtensionFilter bRebecaFilter = new FileNameExtensionFilter(\n \"broadcasting Rebeca for static topology(.bRebeca)\", \"bRebeca\");\n chooser.addChoosableFileFilter(bRebecaFilter);\n chooser.addChoosableFileFilter(wRebecaFilter);\n if (chooser.showOpenDialog(mntmOpen) == JFileChooser.APPROVE_OPTION) {\n System.out.println(\"CurrentDirectory: \" + chooser.getCurrentDirectory());\n System.out.println(\"SelectedFile: \" + chooser.getSelectedFile());\n filePath = chooser.getSelectedFile().getPath();\n inputFile = chooser.getSelectedFile();\n try {\n FileReader inputReader = new FileReader(filePath);\n textArea.read(inputReader, null);\n List<String> codeLines = Files.readAllLines(inputFile.toPath());\n if (inputFile.toString().matches(\".*.rebeca\")) {\n compileInfo.getInstance().setClassic(true);\n } else if (inputFile.toString().matches(\".*.wrebeca\")) {\n compileInfo.getInstance().setDynamic(true);\n } else {\n compileInfo.getInstance().setDynamic(false);\n }\n DefaultMutableTreeNode r = createCodeTree(codeLines);\n DefaultTreeModel treeModel1 = (DefaultTreeModel) trSource.getModel();\n treeModel1.setRoot(r);\n treeModel1.reload();\n mnVerification.setEnabled(false);\n mntmCompile.setEnabled(true);\n mntmCreateStateSpace.setEnabled(false);\n }catch (FileNotFoundException e1) {\n }catch (IOException e1) {\n // TODO Auto-generated catch block\n }\n }\n });\n mntmOpen.addMouseListener(new MouseAdapter() {\n @Override\n public void mouseClicked(MouseEvent e) {\n\n }\n });\n\n JMenuItem mntmNew = new JMenuItem(\"New\");\n mntmNew.addActionListener((ActionEvent e) -> {\n if (filePath != null) {\n // save\n saveFile();\n // new\n inputFile = null;\n filePath = null;\n try {\n File file = new File(\"newFile.txt\");\n if (!Files.exists(file.toPath())) {\n file.createNewFile();\n }\n textArea.read(new FileReader(\"newFile.txt\"), null);\n treeModel.setRoot(new DefaultMutableTreeNode(\"Nothing\"));\n treeModel.reload();\n } catch (IOException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }\n });\n mnFile.add(mntmNew);\n mnFile.add(mntmOpen);\n\n mntmSave = new JMenuItem(\"Save\");\n mntmSave.addActionListener((ActionEvent e) -> {\n saveFile();\n });\n mnFile.add(mntmSave);\n\n JMenuItem mntmExit = new JMenuItem(\"Exit\");\n mntmExit.addActionListener((ActionEvent e) -> {\n System.exit(0);\n });\n mnFile.add(mntmExit);\n\n mnSource = new JMenu(\"Run\");\n menuBar.add(mnSource);\n\n mntmCompile = new JMenuItem(\"Compile\");\n mntmCompile.setEnabled(false);\n mntmCompile.addActionListener((ActionEvent e) -> {\n if (inputFile == null) {\n saveFile();\n }\n if (inputFile != null) {\n compile = new frmCompile(errorList, frame);\n System.out.println(\"configure compiling options\");\n compile.showFrm(filePath);\n }\n // compile.showFrm();\n });\n mnSource.add(mntmCompile);\n\n mntmCreateStateSpace = new JMenuItem(\"Create State Space\");\n mntmCreateStateSpace.setEnabled(false);\n mntmCreateStateSpace.addActionListener((ActionEvent e) -> {\n if (compileInfo.getInstance().isMcrl()) {\n if (!compileInfo.getInstance().isClts()) {\n compileInfo.getInstance().setLts(true);\n }\n compileInfo.getInstance().setMcrl(false);\n }\n create_stateSpace();\n });\n mnSource.add(mntmCreateStateSpace);\n mnVerification = new JMenu(\"Verification\");\n mnVerification.setEnabled(false);\n mnSource.add(mnVerification);\n\n JMenuItem mntmInvariant = new JMenuItem(\"Invariant\");\n mntmInvariant.addActionListener((ActionEvent e) -> {\n load_invariant();\n compileInfo.getInstance().setMcrl(false);\n compileInfo.getInstance().setLts(true);\n //create_stateSpace();\n });\n mnVerification.add(mntmInvariant);\n\n JMenuItem mntmMcrl = new JMenuItem(\"mcrl\");\n mntmMcrl.addActionListener((ActionEvent e) -> {\n compileInfo.getInstance().setMcrl(true);\n compileInfo.getInstance().setLts(false);\n String pkgName = inputFile.getName().toString().split(\"\\\\.\")[0];\n String inputDirctory = inputFile.getParentFile().toString();\n \n chooser = new JFileChooser();\n chooser.setCurrentDirectory(new java.io.File(\".\"));\n chooser.setDialogTitle(\"Select a File\");\n chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\n FileNameExtensionFilter formulaFilter = new FileNameExtensionFilter(\"textual\tµ-Calculus(.mcf)\",\n \"mcf\");\n chooser.setFileFilter(formulaFilter);\n if (chooser.showOpenDialog(mntmOpen) == JFileChooser.APPROVE_OPTION) {\n System.out.println(\"getSelectedFile() : \" + chooser.getSelectedFile());\n try {\n Files.deleteIfExists(Paths.get(inputDirctory + \"/\" + pkgName + \"/Output/stateSpaceMcrl.aut\"));\n } catch (IOException e2) {\n // TODO Auto-generated catch block\n e2.printStackTrace();\n }\n if (create_stateSpace()) {\n new Thread(new Runnable() {\n public void run() {\n while (!Files.exists(\n Paths.get(inputDirctory + \"/\" + pkgName + \"/Output/stateSpaceMcrl.aut\"))) {\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }\n try {\n String command = \"\";\n if (Files.exists(\n Paths.get(inputDirctory + \"/\" + pkgName + \"/Output/stateSpaceMcrl.aut\"))) {\n command = \"lts2pbes \\\"\" + inputDirctory + \"/\" + pkgName\n + \"/Output/stateSpaceMcrl.aut\" + \"\\\" \\\"\" + inputDirctory + \"/\" + pkgName\n + \"/Output/stateSpaceMcrl.pbes\" + \"\\\" --data=\\\"\" + inputDirctory + \"/\"\n + pkgName + \"/Output/state_space.mcrl2\" + \"\\\" --formula=\\\"\"\n + chooser.getSelectedFile().getPath() + \"\\\"\";\n System.out.println(command);\n runProcess(command);\n if (Files.exists(Paths\n .get(inputDirctory + \"/\" + pkgName + \"/Output/stateSpaceMcrl.pbes\"))) {\n command = \"pbes2bool \\\"\" + inputDirctory + \"/\" + pkgName\n + \"/Output/stateSpaceMcrl.pbes\"\n + \"\\\" --erase=none --rewriter=jitty --search=breadth-first --strategy=0 --verbose\";\n System.out.println(command);\n runProcess(command);\n }\n }\n } catch (Exception e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }\n }).start();\n }\n }\n });\n mnVerification.add(mntmMcrl);\n\n JMenu mnHelp = new JMenu(\"Help\");\n menuBar.add(mnHelp);\n\n JMenuItem mntmUserManual = new JMenuItem(\"User Manual\");\n mnHelp.add(mntmUserManual);\n mntmUserManual.addActionListener((ActionEvent e) -> { \n \n if (Desktop.isDesktopSupported()) {\n // File in user working directory, System.getProperty(\"user.dir\");\n File file = new File(\"UserManual.pdf\");\n if (!file.exists()) {\n // In JAR\n InputStream inputStream = ClassLoader.getSystemClassLoader()\n .getResourceAsStream(\"UserManual.pdf\");\n // Copy file\n OutputStream outputStream;\n try { \n outputStream = new FileOutputStream(file);\n byte[] buffer = new byte[1024];\n int length;\n while ((length = inputStream.read(buffer)) > 0) {\n outputStream.write(buffer, 0, length);\n }\n outputStream.flush();\n outputStream.close();\n inputStream.close();\n } catch (FileNotFoundException ex) {\n Logger.getLogger(wRebeca.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(wRebeca.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n try {\n java.awt.Desktop.getDesktop().open(file);\n } catch (IOException ex) {\n Logger.getLogger(wRebeca.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n// try { \n// File file = new File(getClass().getClassLoader().getResource(\"UserManual.pdf\").getFile());\n// java.awt.Desktop.getDesktop().open(file);\n// } catch (IOException ex) {\n// Logger.getLogger(wRebeca.class.getName()).log(Level.SEVERE, null, ex);\n// }\n });\n \n JMenuItem mntmAbout = new JMenuItem(\"About\");\n mnHelp.add(mntmAbout);\n mntmAbout.addActionListener((ActionEvent e) -> { \n JOptionPane.showMessageDialog(frame, \"https://github.com/b-yousefi/wRebeca\",\"About\", 1);\n });\n \n JPanel cpCenter = new JPanel(new BorderLayout());\n frame.setContentPane(cpCenter);\n JPanel cp = new JPanel(new BorderLayout());\n textArea = new RSyntaxTextArea(20, 60);\n textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);\n textArea.setCodeFoldingEnabled(true);\n sp = new RTextScrollPane(textArea);\n // cp.add(sp);\n JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);\n cp.add(splitPane, BorderLayout.CENTER);\n splitPane.setLeftComponent(sp);\n\n JSplitPane splitPaneV = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, trSource, cp);\n\n cpCenter.add(splitPaneV);\n\n JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);\n tabbedPane.setPreferredSize(new Dimension(tabbedPane.getSize().width, (int) (frame.getHeight() * 0.3)));\n splitPane.setRightComponent(tabbedPane);\n\n JTextArea txtrOutput = new JTextArea();\n PrintStream printStream = new PrintStream(new CustomOutputStream(txtrOutput));\n System.setOut(printStream);\n System.setErr(printStream);\n JScrollPane scrollPaneOut = new JScrollPane();\n tabbedPane.addTab(\"Output\", null, scrollPaneOut, null);\n scrollPaneOut.setViewportView(txtrOutput);\n\n JScrollPane scrollPane = new JScrollPane();\n\n tabbedPane.addTab(\"Errors\", null, scrollPane, null);\n errorList = new JTable();\n scrollPane.setViewportView(errorList);\n errorList.setModel(new DefaultTableModel(new Object[][]{}, new String[]{\"Line\", \"Description\"}));\n\n errorList.getColumnModel().getColumn(1).setPreferredWidth(548);\n\n trSource.addTreeSelectionListener((TreeSelectionEvent e) -> {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) trSource.getLastSelectedPathComponent();\n \n /* if nothing is selected */\n if (node == null) {\n return;\n }\n \n /* retrieve the node that was selected */\n // Object nodeInfo = node.getUserObject();\n // textArea.setCaret(new Caret());\n System.out.println(textArea.getCaretLineNumber());\n \n // .setActiveLineRange(20, 25);\n // .setSelectedOccurrenceText(\"Node\");\n // .setSelectionStart(25);\n try {\n textArea.addLineHighlight(25, Color.CYAN);\n } catch (BadLocationException e1) {\n // TODO Auto-generated catch block\n }\n // getui\n });\n\n }", "public TreeNode(String name) {\r\n setName(name);\r\n }", "private void setUpDefaultTree() {\n\t\tTreeItem<String> tempTreeItem = new TreeItem<String>(\"Floor 1\");\n\t\tFloor tempFloor = new Floor(new Image(\"scheduleyTest/floorplan1.jpg\"));\n\t\tfloorHashMap.put(tempTreeItem, tempFloor);\n\t\ttree.getRoot().getChildren().add(tempTreeItem);\n\t\ttempFloor.addMeetingSpace(new MeetingSpace(new Rectangle(88,40,213,113)));\n\t\ttempFloor.addMeetingSpace(new MeetingSpace(new Rectangle(88,153,139,119)));\n\t\ttempTreeItem.getChildren().addAll(new TreeItem<String>(\"Room 1\"), new TreeItem<String>(\"Room 2\"));\n\t}", "public void loadNodes() {\n\t\tif (taxonomyMap.size() == 0) this.loadNames();\n\n\t\tBufferedReader nodesRdr = null;\n\t\ttry {\n\t\t\tnodesRdr = new BufferedReader(new InputStreamReader(nodesUrl.openStream()));\n\n\t\t\tString line;\n\t\t\twhile ((line = nodesRdr.readLine()) != null) {\n\t\t\t\tString[] parts = line.split(\"\\\\|\");\n\t\t\t\tInteger taxonId = Integer.valueOf(parts[0].trim());\n\t\t\t\tString pti = parts[1].trim();\n\t\t\t\tInteger parentTaxonId = (pti.length() > 0 && !(pti.equals(\"all\"))) ? new Integer(pti) : null;\n\n\t\t\t\t// Get our Taxon object\n\t\t\t\tTaxon t = taxonomyMap.get(taxonId);\n\n\t\t\t\t// Get our parent Taxon\n\t\t\t\tTaxon p = taxonomyMap.get(parentTaxonId);\n\n\t\t\t\t// Set the parent\n\t\t\t\tt.setParent(p);\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\n\t\t} finally {\n\t\t\tthis.close(nodesRdr);\n\t\t}\n\t}", "private void initializeModel() {\n\t\tmodel = new Model();\n\n\t\t// load up playersave\n\t\ttry {\n\t\t\tFileInputStream save = new FileInputStream(\"playersave.ser\");\n\t\t\tObjectInputStream in = new ObjectInputStream(save);\n\t\t\tmodel = ((Model) in.readObject());\n\t\t\tin.close();\n\t\t\tsave.close();\n\t\t\tSystem.out.println(\"playersave found. Loading file...\");\n\t\t}catch(IOException i) {\n\t\t\t//i.printStackTrace();\n\t\t\tSystem.out.println(\"playersave file not found, starting new game\");\n\t\t}catch(ClassNotFoundException c) {\n\t\t\tSystem.out.println(\"playersave not found\");\n\t\t\tc.printStackTrace();\n\t\t}\n\t\t\n\t\t// load up customlevels\n\t\ttry {\n\t\t\tFileInputStream fileIn = new FileInputStream(\"buildersave.ser\");\n\t\t\tObjectInputStream in = new ObjectInputStream(fileIn);\n\t\t\tmodel.importCustomLevels(((ArrayList<LevelModel>) in.readObject()));\n\t\t\tin.close();\n\t\t\tfileIn.close();\n\t\t\tSystem.out.println(\"Builder ArrayList<LevelModel> found. Loading file...\");\n\t\t}catch(IOException i) {\n\t\t\t//i.printStackTrace();\n\t\t\tSystem.out.println(\"Builder ArrayList<LevelModel> file not found, starting new game\");\n\t\t\treturn;\n\t\t}catch(ClassNotFoundException c) {\n\t\t\tSystem.out.println(\"Builder ArrayList<LevelModel> not found\");\n\t\t\tc.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t}", "public void init() {\n\t\t// Read the data text file and load up the local database\n\t\tinitData();\n\n\t\t// Create the labels and the textbox\n\t\taddNameLabel();\n\t\taddNameBox();\n\t\taddGraphButton();\n\t\taddClearButton();\n\n\t\t// Set up the graph object\n\t\tgraph = new NameSurferGraph();\n\t\tadd(graph);\n\n\t}", "@SuppressWarnings(\"unchecked\")\n public Model(File file) throws IOException {\n this.root = file;\n existingTags = new ExistingTags();\n imageFiles = new ArrayList<>();\n File imageData = new File(IMAGE_DATA_PATH);\n if (imageData.exists()) {\n try {\n imageFiles = (ArrayList<ImageFile>) readObject(IMAGE_DATA_PATH);\n } catch (ClassNotFoundException | IOException |\n ClassCastException e) {\n // imageData.ser was corrupted\n Files.delete(imageData.toPath());\n }\n }\n File tagData = new File(EXISTING_TAGS_PATH);\n if (tagData.exists()) {\n try {\n existingTags = (ExistingTags) readObject(EXISTING_TAGS_PATH);\n } catch (ClassNotFoundException | IOException |\n ClassCastException e) {\n // existingTags.ser was corrupted\n Files.delete(tagData.toPath());\n }\n }\n // The FileVisitor to be used in Files.walkFileTree.\n FileVisitor<Path> fv = new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file,\n BasicFileAttributes attrs)\n throws IOException {\n if (attrs.isRegularFile()) {\n String fileExtension = file.toString().substring(\n file.toString().lastIndexOf('.') + 1).toLowerCase();\n // Check if the file is a image by checking its extension.\n if (EXTENSIONS.contains(fileExtension)) {\n if (getImageFile(file.toFile()) == null) {\n imageFiles.add(new ImageFile(file.toFile()));\n } else {\n // Check imageFile for tags not in ExistingTags, and add them\n ImageFile im = getImageFile(file.toFile());\n if (!existingTags.getExistingTags().containsAll(\n im.getCurrentTags())) {\n for (Tag tag : im.getCurrentTags()) {\n existingTags.addTag(tag);\n }\n }\n }\n }\n }\n return FileVisitResult.CONTINUE;\n }\n };\n Files.walkFileTree(file.toPath(), fv);\n }", "public HIRTree(){\r\n\t\t\r\n\t}", "public TreeModel(String appname, int nGRAM_SIZE, double tHRESHOLD_MODEL) {\r\n\t\tsuper(appname, ModelManager.TREE_MODEL, nGRAM_SIZE,0.1,tHRESHOLD_MODEL);\r\n\t\tif (setters== null){\r\n\t\t\tsetters = new ArrayList<AnomalyRate>();\t\r\n\t\t\tsetters.add(new LogAnomaly());\r\n\t\t}\r\n\t\ttreeDepth = nGRAM_SIZE;//10\r\n\t\tthis.threshold=tHRESHOLD_MODEL;\r\n\t}", "public TwoFourTree()\r\n\t{\r\n\t\troot = new TreeNode(); //assign the root to a new tree node\r\n\t}", "private void construct(){\n TriangleMesh mesh;\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/bunny.obj\");\n mesh.setMaterial(new MaterialNode(0.1f, 0.1f, .5f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/cube.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 0, 0));\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/teddy.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 0, 1, 0));\n mesh.setMaterial(new MaterialNode(0.1f, .5f, 0.1f, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n mesh = ObjImporter.loadMesh(\"data/aufgabe3/sphere.obj\");\n mesh.addTransformation(new TransformationNode(TransformationType.TRANSLATE, 1, 1, 0));\n mesh.setMaterial(new MaterialNode(1, 0, 0, 1));\n mesh.getRenderer().setShadingType(ShadingType.GOURAUD);\n scene.addNode(mesh);\n\n scene.calculateNormals();\n scene.setupRendering();\n }", "public static void main(String [] args)\n\t{\n\t\tString newickStr=\"(Selaginella_uncinata:0.1,((Panax_ginseng:0.1,Daucus_carota:0.1):0.1,Liriodendron_tulipifera:0.1):0.1,Coffea_arabica:0.1);\";\n//\t\tString newickStr=\"((Liriodendron_tulipifera:0.100000,(Selaginella_uncinata:0.100000,Panax_ginseng:0.100000):0.100000):0.100000,Daucus_carota:0.100000,Coffea_arabica:0.100000);\";\n\t\tRootedTree rt=RootedTree.Util.fromNewickString(newickStr);\n\t System.out.println(rt);\n\t\t\n\t\t/*\n\t\t// debug:\n\t\tFile mrBayesTrees = new File(\"/Users/bouchard/w/ptychodus/data/mrBayesOnWalsIE/nAryCharacters-1m-iters/inMrBayesFolder/test.nex.run1.t\");\n\t\t// for (String line : i(mrBayesTrees))\n\t\t// System.out.println(line);\n\t\tprocessMrBayesTrees(mrBayesTrees, new RootedTreeProcessor() {\n\n\t\t\t@Override\n\t\t\tpublic void process(RootedTree rt)\n\t\t\t{\n\t\t\t\tSystem.out.println(rt);\n\t\t\t}\n\t\t});\n\t\t*/\n\t}", "public TreeImpl(T dato) {\r\n\t\traiz = new NodeImpl<T>(dato, null);// El null dice que es raiz\r\n\t}", "public void createTree() {\n Node<String> nodeB = new Node<String>(\"B\", null, null);\n Node<String> nodeC = new Node<String>(\"C\", null, null);\n Node<String> nodeD = new Node<String>(\"D\", null, null);\n Node<String> nodeE = new Node<String>(\"E\", null, null);\n Node<String> nodeF = new Node<String>(\"F\", null, null);\n Node<String> nodeG = new Node<String>(\"G\", null, null);\n root.leftChild = nodeB;\n root.rightChild = nodeC;\n nodeB.leftChild = nodeD;\n nodeB.rightChild = nodeE;\n nodeC.leftChild = nodeF;\n nodeC.rightChild = nodeG;\n\n }", "private void parseTree(BufferedReader in, VssProject vssProject) {\r\n try {\r\n String line;\r\n boolean start = false;\r\n while ((line = in.readLine()) != null) {\r\n if (!start) {\r\n if (line.startsWith(\"$\") && line.endsWith(\":\")) {\r\n start = true;\r\n continue;\r\n }\r\n } else {\r\n if (line.length() == 0)\r\n break;\r\n if (line.startsWith(\"$\")) {\r\n \t\r\n String projectName = line.substring(1);\r\n if ( config.getProjectsToIgnore().contains( projectName ) )\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\t// Ignore list!\r\n \t\t\t\t\t\tLOG.warn( \"Ignore project \" + projectName + \" found in : \" + vssProject.getVssPath() );\r\n \t\t\t\t\t\tcontinue;\r\n \t\t\t\t\t}\r\n \r\n VssProject newProject = new VssProject();\r\n newProject.setName(projectName);\r\n newProject.setParent(vssProject);\r\n vssProject.addSubproject(newProject);\r\n \r\n } else \r\n {\r\n if (line.startsWith(\"No items found under $\")) {\r\n continue;\r\n } \r\n String filename = line;\r\n String parent = vssProject.getVssPath().substring(config.getProject().length());\r\n if (parent.length() > 0) {\r\n if (parent.startsWith(\"/\"))\r\n parent = parent.substring(1);\r\n if (!parent.endsWith(\"/\"))\r\n parent += \"/\";\r\n }\r\n String path = parent + filename;\r\n VssFile newFile = new VssFile(path, filename);\r\n newFile.setParent(vssProject);\r\n vssProject.addFile(newFile);\r\n }\r\n }\r\n }\r\n } catch (IOException e) {\r\n throw new VssException(\"readLine\", e);\r\n }\r\n }", "private static TreeNode parseTreeNode(Scanner in)\n {\n int numberOfChildren = in.nextInt();\n int numberOfMetadata = in.nextInt();\n TreeNode newNode = new TreeNode(numberOfChildren, numberOfMetadata);\n\n // Recursively resolve children\n for (int i = 0; i < numberOfChildren; i++)\n {\n newNode.mChildren[i] = parseTreeNode(in);\n }\n\n // Now resolve the metadata by consuming tokens\n for (int i = 0; i < numberOfMetadata; i++)\n {\n newNode.mMetadata[i] = in.nextInt();\n }\n\n return newNode;\n }", "private void setupModel() {\n\n //Chooses which model gets prepared\n switch (id) {\n case 2:\n singlePackage = new Node();\n activeNode = singlePackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_solo)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 3:\n multiPackage = new Node();\n activeNode = multiPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_multi_new)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 4:\n wagonPackage = new Node();\n activeNode = wagonPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_car_new)\n .build().thenAccept(a -> activeRenderable = a)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n default:\n mailbox = new Node();\n activeNode = mailbox;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.mailbox)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n }\n }", "void create(Node node) {\n if (node.table.negatives() == 0) {\r\n node.atribute = 1;\r\n return;\r\n }\r\n if (node.table.positives() == 0) {\r\n node.atribute = 0;\r\n return;\r\n }\r\n\r\n //If no test split the data, make it a leaf with the majoriti of the target atribute\r\n int atr;\r\n //Choose the best atribute\r\n atr = this.chooseBestAtrib(node);\r\n node.atribute = atr;\r\n\r\n //No atribute split the data, so make the node a leaf with the majoriti of the class (either positive or negative)\r\n if (node.atribute == -1) {\r\n //System.out.println(\"Atribute is -1 in TeeBuidler.create\");\r\n if (node.table.negatives() > node.table.positives()) {\r\n node.atribute = 0;\r\n return;\r\n }\r\n if (node.table.positives() >= node.table.negatives()) {\r\n node.atribute = 1;\r\n return;\r\n }\r\n }\r\n\r\n Table table_left = new Table(), table_right = new Table();\r\n node.table.splitByAtrib(node.atribute, table_left, table_right);\r\n\r\n //Create two children for the current node //parameters: identifier,parent_result,atribute of split,id_child1, id_child2, table\r\n node.child_left = new Node(node.id + node.id, \"1\", -1, -1, -1, table_left);\r\n node.child_right = new Node(node.id + node.id+1, \"0\", -1, -1, -1, table_right);\r\n node.id_child_left = node.id + node.id;\r\n node.id_child_right = node.id + node.id+1;\r\n\r\n\r\n TreeBuilder builder = new TreeBuilder();\r\n builder.create(node.child_left);\r\n builder.create(node.child_right);\r\n\r\n }", "@Before\r\n public void setUp() throws Exception {\r\n Node childTwo = new Node(5, new Node(2), null);\r\n Node childOne = new Node(3, new Node(9), new Node(12));\r\n Node rootNode = new Node(1, childOne, childTwo);\r\n tree = new Tree();\r\n tree.root = rootNode;\r\n }", "private void buildTree(int random_attr){\n String[] schema = new String[]{\"min, max, avg, label\"};\n CassandraDriver driver = CassandraDriver.getInstance();\n ArrayList<int[]> train = driver.queryData(\"data\", schema);\n RandomForest forest = new RandomForest();\n forest.numAttr = RandomForestTrainingMapReduce.N;\n forest.numAttrRandom = random_attr;\n RealDecisionTree tree = new RealDecisionTree(train, forest, RandomForestTrainingMapReduce.N);\n\n // serialize this tree and write to Cassandra.\n byte[] t = serialize(tree);\n try {\n driver.insertData(t, \"Forest\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public TreeNode() { \n this.name = \"\"; \n this.rule = new ArrayList<String>(); \n this.child = new ArrayList<TreeNode>(); \n this.datas = null; \n this.candAttr = null; \n }", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "public abstract void initGrid(String filename)\r\n throws NumberFormatException, FileNotFoundException, IOException;", "public PhylogeneticTree loadPhylogeneticTree(int treeId) {\n if (treeId == 0) {\n phylogeneticTree = new PhylogeneticTree();\n phylogeneticTree.parseTree(\"testGenomeNwk\",\n new ArrayList<>(genomeGraph.getGenomes().keySet()));\n return phylogeneticTree;\n } else {\n return phylogeneticTree;\n }\n }", "private void initialize() {\r\n\t\tGridBagConstraints gridBagConstraints = new GridBagConstraints();\r\n\t\tgridBagConstraints.anchor = GridBagConstraints.NORTHWEST;\r\n\t\tgridBagConstraints.weightx = 1.0D;\r\n\t\tgridBagConstraints.weighty = 1.0D;\r\n\t\tgridBagConstraints.fill = GridBagConstraints.BOTH;\r\n\t\tthis.setLayout(new GridBagLayout());\r\n\t\tthis.setBorder(BorderFactory.createLineBorder(Color.gray, 1));\r\n\t\tthis.add(getJTree(), gridBagConstraints);\r\n\t}", "public TreeItem(BufferedReader br) throws DataFormatException, IOException {\n\t\tsuper(br);\n\t}", "public static void main(String[] args) {\n\t\tif (args.length == 0) {\n\t\t\t System.err.println(\"Usage Error: the program expects a file name as an argument\");\n\t\t\t System.exit(-1);\n\t\t}\n\t\t\n\t\t// create a file with the entered file name\n\t\tFile file= new File(args[0]);\n\t\t\n\t\t// if the file does not exist inform the user and terminate the program\n\t\tif(file.exists()!=true){\n\t\t\t\tSystem.err.println(\"Usage Error: the file \"+args[0]+\" cannot be opened.\");\n\t\t\t\tSystem.exit(-1);\n\t\t}\n\t\t// if the file cannot be read inform the user and terminate the program\n\t\telse if(file.canRead()!=true){\n\t\t\t\t\tSystem.err.println(\"Usage Error: the file \"+args[0]+\" cannot be opened.\");\n\t\t\t\t\tSystem.exit(-1);\n\t\t}\n\t\t// if the file is not a file inform the user and terminate the program\n\t\telse if(file.isFile()!=true){\n\t\t\t\t\tSystem.err.println(\"Usage Error: the file \"+args[0]+\" cannot be opened.\");\n\t\t\t\t\tSystem.exit(-1);\n\t\t}\n\t\t\t\n\t\t// create a list of type TreeList that will contain all the tree objects \n\t\tTreeList list= new TreeList();\n\t\t\t\n\t\ttry{\n\t\t\t// send the file to the scanner\n\t\t\tScanner inputFile = new Scanner(file);\n\t\t\t\n\t\t\t// create a boolean variable that is initially equal to true. \n\t\t\t// Since the first line does not contain info that can be parsed use the \n\t\t\t// variable to ensure the first line is skipped\n\t\t\tboolean firstLine=true;\n\t\t\t\n\t\t\t// while there is another line in the file continue the loop\n\t\t\twhile (inputFile.hasNextLine())\t{\n\t\t\t\t\n\t\t\t\t// create a string that represents a single line from the file\n\t\t\t\tString line= inputFile.nextLine();\n\t\t\t\t\n\t\t\t\t// send the line to have its information separated and entered into an\n\t\t\t\t// arrayList of strings\n\t\t\t\tArrayList<String> splitLine= splitCSVLine(line);\n\t\t\t\t\n\t\t\t\t\t// ensure the splitLine contains 41 elements, if not, skip it\n\t\t\t\t\tif (splitLine.size()==41){\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t// parse the information according to the needed information\n\t\t\t\t\t\t\t// about a tree that is sent to the tree class\n\t\t\t\t\t\t\tint id= Integer.parseInt(splitLine.get(0));\n\t\t\t\t\t\t\tint diam= Integer.parseInt(splitLine.get(3));\n\t\t\t\t\t\t\tString status= splitLine.get(6);\n\t\t\t\t\t\t\tString health= splitLine.get(7);\n\t\t\t\t\t\t\tString spc= splitLine.get(9);\n\t\t\t\t\t\t\tint zip= Integer.parseInt(splitLine.get(25));\n\t\t\t\t\t\t\tString boro= splitLine.get(29);\n\t\t\t\t\t\t\tdouble x= Double.parseDouble(splitLine.get(39));\n\t\t\t\t\t\t\tdouble y= Double.parseDouble(splitLine.get(40));\n\t\t\t\t\t\t\t// once information is parsed, use its information to create a \n\t\t\t\t\t\t\t// new tree\n\t\t\t\t\t\t\tTree tree= new Tree(id,diam,status,health,spc,zip,boro,x,y);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// ensure that the new tree does not have the same\n\t\t\t\t\t\t\t// ID, but a different species name from the other trees\n\t\t\t\t\t\t\t// in treeList\n\t\t\t\t\t\t\tfor (int i=0; i<list.size();i++){\n\t\t\t\t\t\t\t\ttree.equals(list.get(i));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// if the tree object is valid, add it to treeList list\n\t\t\t\t\t\t\tlist.add(tree);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// catch any invalid values sent to the constructor of the tree class\n\t\t\t\t\t\tcatch (IllegalArgumentException e){\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// throw a general exception in the case there is a parsing error\n\t\t\t\t\t\t// therefore the line will be ignored\n\t\t\t\t\t\tcatch (Exception e){\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t//}\n\t\t\t\t// after the first line passes through the loop set it equal\n\t\t\t\t// to false so the following information can be parsed and \n\t\t\t\t// sent to the tree class\n\t\t\t\tfirstLine=false;\n\t\t\t\n\t\t\t}\n\t\t\t// close the scanner\n\t\t\tinputFile.close();\n\t\t }\n\t\t\n\t\t// catch if the file cannot be found and send a message describing what happened\n\t\t// to the user. Exit the program.\n\t\tcatch (FileNotFoundException e){\n\t\t\tSystem.err.println(\"Usage Error: the file \"+args[0]+\" does not exist.\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\t\n\t\t// create an if statement to terminate the program if the file is empty or contains\n\t\t// no usable information\n\t\tif (list.size()==0){\n\t\t\tSystem.err.println(\"Usage Error: the file \"+args[0]+\" contains no usable information.\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\t\n\t\t// this portion of the program will handle user input and print the correct\n\t\t// tree information according to the tree species the user enters \n\t\t\n\t \t// create an exit word that will terminate the loop\n\t\tString exitWord=\"quit\";\n\t\t\n\t\t// create a string variable that represents the user's answer\n\t\tString answer;\n\t\t \n\t\t// open the scanner \n\t\tScanner input= new Scanner(System.in);\n\t\t// print a statement informing the user what to do\n\t\tSystem.out.println(\"Enter the tree species to learn more about it ('quit' to stop):\");\n\t\t// set the answer equal to the user's response\n answer= input.nextLine();\n \n // while the answer is not quit, keep prompting the user for a tree species\n\t\twhile (!(answer.equalsIgnoreCase(exitWord))){\n\t\t\t// if the tree species exists within the list of trees, print its matching species\n\t\t\t// and how many of that species exists within NYC and its boroughs\n\t\t\tif ((list.getCountByTreeSpecies(answer))>0){\n\t\t\t\tSystem.out.println(getMatchingSpecies(list,answer)+\"\\n\");\n\t\t\t\tSystem.out.println(getSpeciesInfo(list,answer));\n\t\t\t}\n\t\t\t\n\t\t\t// if the tree species is not within the list of trees, print a statement to \n\t\t\t// the user explaining it does not exist in NYC\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tSystem.out.println(\"There are no records of \"+answer+\" on NYC streets\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\t\t\n\t\t// re-prompt the user to enter a tree species\n\t\t System.out.println(\"Enter the tree species to learn more about it ('quit' to stop):\");\n\t\t answer= input.nextLine();\n\t\t}\n\t\t\n\t\t//close the scanner\n\t\t input.close();\n\t\t \n\t\t \n\t}", "private void setTreePresenter() {\n this.tree.setIconProvider(new ModelIconProvider<GPBeanTreeModel>() {\n \n @Override\n public AbstractImagePrototype getIcon(GPBeanTreeModel model) {\n return model.getIcon();\n }\n });\n \n this.tree.setLabelProvider(new ModelStringProvider<GPBeanTreeModel>() {\n \n @Override\n public String getStringValue(GPBeanTreeModel model, String property) {\n return model.getLabel();\n }\n });\n \n this.tree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);\n \n this.tree.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<GPBeanTreeModel>() {\n \n @Override\n public void selectionChanged(\n SelectionChangedEvent<GPBeanTreeModel> se) {\n if (se.getSelectedItem() != null) {\n MediatorToolbarTreeAction.getInstance().elementChanged(se.getSelectedItem());\n } else {\n MediatorToolbarTreeAction.getInstance().disableAllActions();\n }\n \n }\n });\n this.setCheckable(true);\n this.setCheckStyle(CheckCascade.NONE);\n this.tree.setAutoHeight(true);\n }", "public Arvore() {\n initComponents();\n\n DefaultMutableTreeNode raiz = new DefaultMutableTreeNode(\"Raiz\");\n\n DefaultMutableTreeNode filho1 = new DefaultMutableTreeNode(\"Filho 1\");\n DefaultMutableTreeNode filho2 = new DefaultMutableTreeNode(\"Filho 2\");\n\n raiz.add(filho1);\n raiz.add(filho2);\n\n DefaultMutableTreeNode neto1 = new DefaultMutableTreeNode(\"Neto 1\");\n DefaultMutableTreeNode neto2 = new DefaultMutableTreeNode(\"Neto 2\");\n \n filho1.add(neto1);\n filho1.add(neto2);\n\n DefaultMutableTreeNode neto3 = new DefaultMutableTreeNode(\"Neto 3\");\n filho2.add(neto3);\n\n jTree1.setModel(new DefaultTreeModel(raiz));\n }", "@Override\n public void buildClassifier(Instances trainingData) throws Exception {\n // can classifier handle the data?\n getCapabilities().testWithFail(trainingData);\n\n tree = new MultiInstanceDecisionTree(trainingData);\n }", "@Override\r\n\tpublic void buildTree() {\r\n\t\t\r\n\t\t// root level \r\n\t\trootNode = new TreeNode<String>(\"\");\r\n\t\t\r\n\t\t//first level\r\n\t\tinsert(\".\", \"e\");\r\n\t\tinsert(\"-\", \"t\");\r\n\t\t\r\n\t\t//second level\r\n\t\t\r\n\t\tinsert(\". .\", \"i\");\r\n\t\tinsert(\".-\", \"a\");\r\n\t\tinsert(\"-.\", \"n\"); \r\n\t\tinsert(\"--\", \"m\");\r\n\t\t\r\n\t\t//third level\r\n\t\tinsert(\"...\", \"s\");\r\n\t\tinsert(\"..-\", \"u\");\r\n\t\tinsert(\".-.\", \"r\");\r\n\t\tinsert(\".--\", \"w\");\r\n\t\tinsert(\"-..\", \"d\");\r\n\t\tinsert(\"-.-\", \"k\");\r\n\t\tinsert(\"--.\", \"g\");\r\n\t\tinsert(\"---\", \"o\");\r\n\t\t\r\n\t\t//fourth level\r\n\t\tinsert(\"....\", \"h\");\r\n\t\tinsert(\"...-\", \"v\");\r\n\t\tinsert(\"..-.\", \"f\");\r\n\t\tinsert(\".-..\", \"l\");\r\n\t\tinsert(\".--.\", \"p\");\r\n\t\tinsert(\".---\", \"j\");\r\n\t\tinsert(\"-...\", \"b\");\r\n\t\tinsert(\"-..-\", \"x\");\r\n\t\tinsert(\"-.-.\", \"c\");\r\n\t\tinsert(\"-.--\", \"y\");\r\n\t\tinsert(\"--..\", \"z\");\r\n\t\tinsert(\"--.-\", \"q\");\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n KdTree tree = new KdTree();\n String filename = args[0];\n In in = new In(filename);\n while (!in.isEmpty()) {\n double x = in.readDouble();\n double y = in.readDouble();\n Point2D p = new Point2D(x, y);\n tree.insert(p);\n }\n tree.draw();\n // tree.info();\n // RectHV rect = new RectHV(0.793893, 0.345492, 1.0, 0.654508);\n // rect.draw();\n // Point2D point = new Point2D(0.5, 0.5);\n // point.draw();\n // StdDraw.show();\n // StdDraw.pause(40);\n // StdDraw.text(0.5, 0.5, \"ksdjlfjasdlfkjsadkflasdjfdaslkjfas\");\n // StdDraw.show();\n // while (true) {\n // System.out.println(StdDraw.mouseX());\n // StdDraw.show();\n // }\n // // Point2D point = new Point2D(0.5, 0.5);\n // // Point2D point2 = new Point2D(0.25, 0.25);\n // // Point2D point3 = new Point2D(0.75, 0.75);\n // // RectHV rect = new RectHV(0.0, 0.0, 0.3, 0.3);\n // // RectHV rect2 = new RectHV(0.0, 0.0, 0.3, 0.3);\n // tree.insert(new Point2D(0.5, 0.5));\n // tree.insert(new Point2D(0.0, 0.0));\n // tree.insert(new Point2D(0.75, 1.0));\n // tree.insert(new Point2D(0.75, 0.0));\n // tree.insert(new Point2D(1.0, 1.0));\n // tree.insert(new Point2D(0.25, 1.0));\n // tree.insert(new Point2D(0.75, 0.75));\n // tree.insert(new Point2D(1.0, 0.5));\n // tree.insert(new Point2D(1.0, 0.0));\n // tree.insert(new Point2D(1.0, 0.75));\n // // tree.insert(new Point2D(0.375, 1.0));\n // // Point2D point = new Point2D(0.375, 1.0);\n // // System.out.println(tree.get(point));\n // // A 0.5 0.5\n // // B 0.0 0.0\n // // C 0.75 1.0\n // // D 0.75 0.0\n // // E 1.0 1.0\n // // F 0.25 1.0\n // // G 0.75 0.75\n // // H 1.0 0.5\n // // I 1.0 0.0\n // // J 1.0 0.75\n // // System.out.println(tree.isEmpty());\n // // tree.insert(point);\n // // tree.insert(point2);\n // // tree.insert(point3);\n // // tree.insert(point);\n // // tree.insert(point);\n // // tree.insert(point);\n // // System.out.println(tree.isEmpty());\n // System.out.println(tree.size());\n // // System.out.println(tree.get(new Point2D(0.375, 1.0)));\n // System.out.println(tree.contains(new Point2D(1.0, 0.0)));\n // // System.out.println(tree.contains(new Point2D(0.5, 0.5)));\n // // tree.draw();\n // // for (Point2D points : tree.range(rect)) System.out.println(points);\n // // System.out.println();\n // // for (Point2D points : tree.range(rect2)) System.out.println(points);\n }", "public KdTree() \n\t {\n\t\t \n\t }", "public Tree()\n\t{\n\t\tsuper(\"Tree\", \"tree\", 0);\n\t}", "public TreeNode() {\n }", "private void initialize() {\n\t\t\ttry {\n\t\t\t\tFMAOBO fmaobo = new FMAOBO();\n\t\t\t\tTA ta = new TA (fmaobo);\n\t\t\t\tBp3d bp3d = new Bp3d();\n\t\t\t\t\t\t\t\t\n\t\t\t\tMap<String, TreeParent> treeParents = \n\t\t\t\t\tnew TreeMap<String, TreeParent>();\n\t\t\t\tMap<String, TreeObject> treeObjects = \n\t\t\t\t\tnew TreeMap<String, TreeObject>();\n\t\t\t\t\t\t\t\t\n\t\t\t\t/** TreeParent/TreeObject作成**/\n\t\t\t\tfor(String id : bp3d.getAllIds()){\t\t\t\t\n\t\t\t\t\tString label = \"\";\n\n\t\t\t\t\tif(ta.contains(id)){\n\t\t\t\t\t\tSet<String> taIds = new TreeSet<String>();\n\t\t\t\t\t\tSet<String> taKanjis = new TreeSet<String>();\n\t\t\t\t\t\tfor(TAEntry taEnt : ta.getTAByFmaId(id)){\n\t\t\t\t\t\t\ttaIds.add(taEnt.getTaId());\n\t\t\t\t\t\t\ttaKanjis.add(taEnt.getTaKanji());\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tlabel = Bp3dUtility.join(taIds, \"/\") + \":\" + bp3d.getEntry(id).getEn() \n\t\t\t\t\t\t\t+ \":\" + Bp3dUtility.join(taKanjis, \"/\");\n\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\tlabel = id + \":\" + bp3d.getEntry(id).getEn();\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(bp3d.hasChild(id)){\n\t\t\t\t\t\ttreeParents.put(id, new TreeParent(label));\n\t\t\t\t\t}else{\n\t\t\t\t\t\ttreeObjects.put(id, new TreeObject(label));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/** addChild **/\n\t\t\t\tfor(String pid : bp3d.getReverseMemberOfs().keySet()){\n\t\t\t\t\tTreeParent parent = treeParents.get(pid);\n\t\t\t\t\tfor(String cid : bp3d.getChildren(pid)){\n\t\t\t\t\t\tif(bp3d.hasChild(cid)){\n\t\t\t\t\t\t\tparent.addChild(treeParents.get(cid));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(parent == null){\n\t\t\t\t\t\t\t\tSystem.out.println(\"parent pid=null:\" + pid + \":\" + bp3d.getEntry(pid).getEn());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tparent.addChild(treeObjects.get(cid));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/** parentのないノードをrootにぶら下げる**/\n\t\t\t\tinvisibleRoot = new TreeParent(\"\");\n\t\t\t\t\n\t\t\t\tfor(String id : bp3d.getAllIds()){\n\t\t\t\t\tif(!bp3d.hasParent(id)){\n//\t\t\t\t\t\tSystem.out.println(id + \" has no parent.\");\n\t\t\t\t\t\tif(bp3d.hasChild(id)){\n\t\t\t\t\t\t\tinvisibleRoot.addChild((TreeParent)(treeParents.get(id)));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tinvisibleRoot.addChild((TreeObject)(treeObjects.get(id)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\t\n\t\t}", "@Before\n public void setUp() {\n this.tree = new SimpleBinarySearchTree<>();\n }", "public Tree(E[] arr, String label) {\n root = null;\n treeName = label;\n for (int i = 0; i < arr.length; i++) {\n bstInsert(arr[i]);\n }\n }", "@Override\r\n public final void modelChanged() {\r\n DefaultMutableTreeNode root = null;\r\n if (getNodeModel() == null) { // do we even have a NodeModel?\r\n root = new DefaultMutableTreeNode(\"No Model\");\r\n } else { // check for empty cluster model before adding content to\r\n // tree\r\n ClusterViewData viewData = getNodeModel().getViewData();\r\n if (viewData == null) {\r\n root = new DefaultMutableTreeNode(\"Empty Model\");\r\n } else { // put cluster info into the tree\r\n root = new DefaultMutableTreeNode(viewData.getNrOfClusters() + \" Clusters\");\r\n DefaultMutableTreeNode clusterParent; // TreeNode for cluster\r\n // c\r\n for (int c = 0; c < viewData.getNrOfClusters(); c++) {\r\n // add information about coverage and center vector\r\n clusterParent = new ClusterMutableTreeNode(KMeansWSSNodeModel.CLUSTER + c + \" (coverage: \"\r\n + viewData.getClusterCoverage(c) + \")\", new RowKey(KMeansWSSNodeModel.CLUSTER + c));\r\n for (int i = 0; i < viewData.getNrOfUsedColumns(); i++) {\r\n clusterParent.add(new DefaultMutableTreeNode(\r\n viewData.getFeatureName(i) + \" = \" + viewData.getClusterCenter(c)[i]));\r\n }\r\n root.add(clusterParent);\r\n }\r\n }\r\n }\r\n // set new JTreeModel\r\n m_jtree.setModel(new DefaultTreeModel(root));\r\n }", "private DefaultTreeModel createTreeModel() {\n\t\t// create the root USA\n\t\tDefaultMutableTreeNode root = new DefaultMutableTreeNode(\"USA\");\n\n\t\t// First child is IOWA!\n\t\troot.add(new DefaultMutableTreeNode(\"Iowa\"));\n\n\t\t// other way to create a DefaultMutableTreeNode:\n\t\t// create an empty node and then add the user object\n\t\tDefaultMutableTreeNode newNode = new DefaultMutableTreeNode();\n\t\tnewNode.setUserObject(\"California\");\n\n\t\t// add a child to newNode\n\t\tnewNode.add(new DefaultMutableTreeNode(\"Sacramento\"));\n\n\t\t// add a sibling to Iowa (i.e. California)\n\t\troot.add(newNode);\n\n\t\t// create the model using the root of the tree\n\t\tDefaultTreeModel treeModel = new DefaultTreeModel(root);\n\n\t\t// ADD MODEL LISTENERS (changes/insertion/deletion of nodes)\n\t\ttreeModel.addTreeModelListener(createTreeModelListener());\n\t\treturn treeModel;\n\n\t}", "public void readIn() throws FileNotFoundException{\n\t\tScanner sc;\n\t\tif (species.equals(\"Human\")){\n\t\t\tsc= new Scanner(PhenoGeneNetwork.class.getResourceAsStream(\"/GenePhenoEdgeList\"));\t\n\t\t}\t\t\n\t\telse{\n\t\t\tsc= new Scanner(PhenoGeneNetwork.class.getResourceAsStream(\"/GenePhenoEdgeListMouse\"));\t\n\t\t}\n\t\tnodeNameMap = new HashMap<String, CyNode>();\n\t\tproteinNameMap = new HashMap<String, CyNode>();\n\t\tphenotypeNameMap = new HashMap<String, CyNode>();\n\t\twhile (sc.hasNextLine()){\n\t\t\tString line = sc.nextLine();\n\t\t\tString [] nodes = line.split(\"\\t\");\n\t\t\tCyNode node1 = null;\n\t\t\tCyNode node2 = null;\n\t\t\t// for Node1\n\t\t\tif (nodeNameMap.containsKey(nodes[0])){\n\t\t\t\t\n\t\t\t\tnode1 = (CyNode) nodeNameMap.get(nodes[0]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tnode1 = network.addNode();\n\t\t\t\tCyRow attributes = network.getRow(node1);\n\t\t\t\tattributes.set(\"name\", nodes[0]);\n\t\t\t\tnodeNameMap.put(nodes[0], node1);\n\t\t\t\tphenotypeNameMap.put(nodes[0], node1);\t\t\t\t\n\t\t\t}\n\t\t\tif (nodeNameMap.containsKey(nodes[1])){\n\t\t\t\t\n\t\t\t\tnode2 = (CyNode) nodeNameMap.get(nodes[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tnode2 = network.addNode();\n\t\t\t\tCyRow attributes = network.getRow(node2);\n\t\t\t\tattributes.set(\"name\", nodes[1]);\n\t\t\t\tnodeNameMap.put(nodes[1], node2);\n\t\t\t\tproteinNameMap.put(nodes[1], node2);\n\t\t\t}\n\t\t\tif (!network.containsEdge(node1, node2)){\n\t\t\t\t\n\t\t\t\tCyEdge myEdge =network.addEdge(node1, node2, true);\n\t\t\t\tnetwork.getRow(myEdge).set(\"interaction\", \"phenotype\");\n\t\t\t\tnetwork.getRow(myEdge).set(\"name\", nodes[0]+ \" (phenotype) \" +nodes[1]);\n\t\t\t}\n\t\t\t\n\n\n\t\t}\n\n\t\tsc.close();\n\n\t}", "public Tree(PApplet t, PImage tree) {\n\t\tthis.t = t;\n\t\tthis.tree = tree;\n\t}", "public KdTree() \r\n\t{\r\n\t}", "protected void loadDataNode(Map eomodelIndex) {\n\n String adapter = (String) eomodelIndex.get(\"adaptorName\");\n Map connection = (Map) eomodelIndex.get(\"connectionDictionary\");\n\n if (adapter != null && connection != null) {\n CreateNodeAction nodeBuilder = getApplication().getActionManager().getAction(CreateNodeAction.class);\n\n // this should make created node current, resulting in the new map being added\n // to the node automatically once it is loaded\n DataNodeDescriptor node = nodeBuilder.buildDataNode();\n\n // configure node...\n if (\"JNDI\".equalsIgnoreCase(adapter)) {\n node.setDataSourceFactoryType(JNDIDataSourceFactory.class.getName());\n node.setParameters((String) connection.get(\"serverUrl\"));\n } else {\n // guess adapter from plugin or driver\n AdapterMapping adapterDefaults = getApplication().getAdapterMapping();\n String cayenneAdapter = adapterDefaults.adapterForEOFPluginOrDriver(\n (String) connection.get(\"plugin\"),\n (String) connection.get(\"driver\"));\n if (cayenneAdapter != null) {\n try {\n Class<DbAdapter> adapterClass = getApplication()\n .getClassLoadingService()\n .loadClass(DbAdapter.class, cayenneAdapter);\n node.setAdapterType(adapterClass.toString());\n } catch (Throwable ex) {\n // ignore...\n }\n }\n\n node.setDataSourceFactoryType(XMLPoolingDataSourceFactory.class.getName());\n\n DataSourceDescriptor dsi = node.getDataSourceDescriptor();\n dsi.setDataSourceUrl(keyAsString(connection, \"URL\"));\n dsi.setJdbcDriver(keyAsString(connection, \"driver\"));\n dsi.setPassword(keyAsString(connection, \"password\"));\n dsi.setUserName(keyAsString(connection, \"username\"));\n }\n\n DataChannelDescriptor domain = (DataChannelDescriptor) getProjectController()\n .getProject()\n .getRootNode();\n domain.getNodeDescriptors().add(node);\n\n // send events after the node creation is complete\n getProjectController().fireDataNodeEvent(\n new DataNodeEvent(this, node, MapEvent.ADD));\n getProjectController().fireDataNodeDisplayEvent(\n new DataNodeDisplayEvent(\n this,\n (DataChannelDescriptor) getProjectController()\n .getProject()\n .getRootNode(),\n node));\n }\n }", "public NetworkNode(Node treeNode) {\n height = treeNode.getHeight();\n label = treeNode.getID();\n metaDataString = treeNode.metaDataString;\n for (String metaDataKey: treeNode.getMetaDataNames()) {\n Object metaDataValue = treeNode.getMetaData(metaDataKey);\n metaData.put(metaDataKey, metaDataValue);\n }\n }", "public void initialize() {\n\n\t\tthis.subNetGenes = getSubNetGenes(species, xmlFile);\n\t\tthis.subNetwork = getSubNetwork(subNetGenes, oriGraphFile);\n\t\tHPNUlilities.dumpLocalGraph(subNetwork, subNetFile);\n\t\t/* Create level file for the original graph */\n\t\tHPNUlilities.createLevelFile(codePath, oriGraphFile, oriLevel,\n\t\t\t\tglobalLevelFile, penaltyType, partitionSize);\n\n\t}", "public static void main(String[] args) {\n\t\tif (args.length != 2) {\n\t\t\tSystem.err.println(\"This program requires two parameters, not \"+args.length+\". The first is a training file and the second is a data file.\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\tDecisionLearningTree dt = new DecisionLearningTree(args[0],args[1]);\n\t\tList<String> rs = dt.useBaselineClassifierOnData(); //dt.useTreeOnData();\n\t\tfor (String r : rs) {\n\t\t\tSystem.out.println(r);\n\t\t}\n\t\tSystem.out.println(\"==========================================================\");\n\t\tSystem.out.println(\"Reporting tree:\");\n\t\tdt.report();\t\t\n\t}", "public TtreeNode() {\n\t numberOfNodes++;\n\t }", "public MorseCodeTree()\r\n\t{\r\n\t\tbuildTree();\r\n\t}", "public static void main(String[] args) {\n\t\tCreateClassificationData test = new CreateClassificationData(\"originalData/Data.txt\");\n\t}", "public void loadDefault() {\n\t\tthis.loadJTree(\"{\\\"id\\\":\\\"1\\\", \\\"name\\\":\\\"Core\\\", \\\"children\\\":[\" +\r\n\t\t\t\t\"{\\\"id\\\":\\\"2\\\", \\\"name\\\":\\\"Leaf1\\\", \\\"data\\\":[], \\\"children\\\":[]}, \" +\r\n\t\t\t\t\"{\\\"id\\\":\\\"3\\\", \\\"name\\\":\\\"Leaf2\\\", \\\"data\\\":[], \\\"children\\\":[]}\" +\r\n\t \t\t\"], \\\"data\\\":[]}\");\r\n\t\tthis.resizeTree();\r\n\t\t\r\n }", "public TreeNode deserialize(String data) {\n return preOrderFromString(data);\n }", "protected ClassifierTree getNewTree(Instances data) throws Exception {\n\n myC45PruneableClassifierTree newTree =\n new myC45PruneableClassifierTree(m_toSelectModel, m_pruneTheTree, m_CF,\n m_subtreeRaising, m_cleanup);\n newTree.buildTree((Instances) data, m_subtreeRaising || !m_cleanup);\n\n return newTree;\n }", "public RBTree() {\r\n\t\t// well its supposed just create a new Red Black Tree\r\n\t\t// Maybe create a new one that does a array of Objects\r\n\t}", "private void updateTree(String st, int lineno, double bl, PrintWriter missing){\n\t\t String[] str = st.split(\"\\\\s+\");\n\t\t String specName = str[0];\n\t\t if(str[0].indexOf(\"GRCh38\")>=0){\n\t\t\t specName= \"Homo_sapiens\";\n\t\t\t str[0] = specName;\n\t\t }\n\t\t String alias1 = collapse(str, 2, str.length, \" \");\n\t\t Node n = getSlug(specName, alias1);\n\t\t if(n==null) n = this.unclassified;\n\t\t Node newnode = this.createFromSpeciesFile(str,alias1, n, lineno, bl);\n\t\t this.putSlug(newnode);\n\t\t\t \n\t\t\n\t\t \n\t }", "public BpmnModelReader(String filePath) {\n\t\tloadedFile = new File(filePath);\n\t}", "public void createGraphFromFile(String newDataFileName) throws IOException {\n\n File inFile = new File(newDataFileName); /* XML */\n\n Scanner sc = new Scanner(inFile);\n String line = sc.nextLine();/*Pass the first line */\n\n /* Until Start of the Edges */\n while (line.compareTo(\" <Edges>\") != 0) {\n /* Take the next line */\n line = sc.nextLine();\n }\n\n /* Take the next line */\n line = sc.nextLine();\n\n /* Until End of the Edges */\n while (line.compareTo(\" </Edges>\") != 0) {\n\n /* Add element in the Linked List */\n insert(loadEdgesFromString(line));\n\n /* Take the next line */\n line = sc.nextLine();\n }\n\n /* Close the file */\n sc.close();\n }", "private void initialize() {\r\n\t\t//For the library model\r\n\t\tEObject eObject=ModelPersisterHelper.modelLoader();\r\n\t\tLibrary library=null;\r\n\t\tif(eObject instanceof Library){\r\n\t\t\tlibrary=(Library)eObject;\r\n\t\t}\r\n\t\tinvisibleRoot = new TreeParent(\"\");\r\n\t\tinvisibleRoot.addChild(library);\r\n\t}", "public KdTree() {\n }", "@Before\n\tpublic void buildCategories()\n\t{\n\t\t// make a root node for the tree (i.e. like a franchise in the CR data set\n\t\tCategoryNode rootParent = null;\n\t\taRootCategory = new CategoryNode(\"rootCategoryId\", \"rootCategoryName\", rootParent);\n\t\t\n\t\t// Add a subtree containing a singleton. The singleton should get removed\n\t\tCategoryNode singleton = new CategoryNode(\"singletonId\", \"singletonName\", aRootCategory);\n\t\taRootCategory.addSubcategory(singleton);\n\t\tCategoryNode childOfSingleton = new CategoryNode(\"childOfSingletonId\", \"childOfSingletonName\", singleton);\n\t\tsingleton.addSubcategory(childOfSingleton);\n\t\tCategoryNode leaf0 = new CategoryNode(\"leaf0Id\", \"leaf0Name\", childOfSingleton);\n\t\tchildOfSingleton.addSubcategory(leaf0);\n\t\tCategoryNode leaf1 = new CategoryNode(\"leaf1Id\", \"leaf1Name\", childOfSingleton);\n\t\tchildOfSingleton.addSubcategory(leaf1);\n\t\t\n\t\t// Add a subtree will have similar leaves, so the subtree should be turned into an equivalence class\n\t\tCategoryNode equivalenceClass = new CategoryNode(\"equivalenceClassId\", \"equivalenceClassName\", aRootCategory);\n\t\taRootCategory.addSubcategory(equivalenceClass);\n\t\tCategoryNode similarNode0 = new CategoryNode(\"similarNode0Id\", \"similarNode0Name\", equivalenceClass);\n\t\tequivalenceClass.addSubcategory(similarNode0);\n\t\tCategoryNode similarNode1 = new CategoryNode(\"similarNode1Id\", \"similarNode1Name\", equivalenceClass);\n\t\tequivalenceClass.addSubcategory(similarNode1);\n\t\t\n\t\t// This subtree has dissimilar leaves, so the subtree shouldn't be turned into an equivalence class\n\t\tCategoryNode nonEquivalenceClass = new CategoryNode(\"nonEquivalenceClassId\", \"nonEquivalenceClassName\", aRootCategory);\n\t\taRootCategory.addSubcategory(nonEquivalenceClass);\n\t\tCategoryNode dissimilarNode0 = new CategoryNode(\"dissimilarNode0Id\", \"dissimilarNode0Name\", nonEquivalenceClass);\n\t\tnonEquivalenceClass.addSubcategory(dissimilarNode0);\n\t\tCategoryNode dissimilarNode1 = new CategoryNode(\"dissimilarNode1Id\", \"dissimilarNode1Name\", nonEquivalenceClass);\n\t\tnonEquivalenceClass.addSubcategory(dissimilarNode1);\n\t}" ]
[ "0.66340894", "0.66340894", "0.6432409", "0.6406519", "0.63159615", "0.6245657", "0.6243463", "0.6200291", "0.6194229", "0.61410856", "0.61403704", "0.6063433", "0.6012876", "0.59709966", "0.5966856", "0.5962827", "0.59376675", "0.5882467", "0.5812864", "0.5794129", "0.57728314", "0.57484823", "0.56703585", "0.56683886", "0.56615084", "0.562324", "0.5608905", "0.5585122", "0.55661386", "0.5558935", "0.5549894", "0.55447507", "0.55357814", "0.55259436", "0.54998845", "0.5488198", "0.54627216", "0.5457668", "0.5453454", "0.5451554", "0.54174805", "0.54100305", "0.54049665", "0.53986853", "0.53948176", "0.5388782", "0.53636616", "0.5354772", "0.53495157", "0.5348652", "0.53445077", "0.5343411", "0.53428924", "0.5337629", "0.53355986", "0.5329305", "0.5321058", "0.5314947", "0.5310756", "0.53101456", "0.5296722", "0.529333", "0.5287192", "0.5267782", "0.5266165", "0.52629876", "0.526087", "0.5251923", "0.52489454", "0.52447313", "0.52416193", "0.5233921", "0.52318394", "0.5231019", "0.5225841", "0.522106", "0.5220836", "0.5206963", "0.5204327", "0.52022576", "0.51966816", "0.5195553", "0.5192077", "0.51885927", "0.5187859", "0.51749086", "0.5172005", "0.5165025", "0.5152671", "0.51459026", "0.51420105", "0.5141991", "0.5139756", "0.5139278", "0.51366746", "0.51351553", "0.5132711", "0.51292014", "0.5122445", "0.51207495", "0.51063186" ]
0.0
-1
Add TreeNodes to the model.
public void setup(Tree tree) { model.setTree(tree); for (TreeNode node : tree.nodes) { if (node.isLeaf()) { model.addCell(node.getKey(), node.getName(), 0, CellType.TREELEAF); } else { model.addCell(node.getKey(), node.getName(), 0, CellType.TREEMIDDLE); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addNode(Node node){subNodes.add(node);}", "void addNodes(List<CyNode> nodes);", "public void addToRootNode(PluginDataModel pluginDataModel){\r\n\t\trootNode.add(new DefaultMutableTreeNode(pluginDataModel));\r\n\t\ttreeModel.reload();\r\n\t}", "public TreeList(TreeModel treeModel) {\n super.setModel(myListModel);\n myTreeModel = treeModel;\n myTreeModel.addTreeModelListener(this);\n Object root = myTreeModel.getRoot();\n if (root instanceof TreeNode) {\n TreeNode node = (TreeNode) root;\n myListModel.addElement(node);\n if (myTreeModel instanceof DefaultTreeModel && ((DefaultTreeModel)myTreeModel).asksAllowsChildren() && node.getAllowsChildren()) {\n Enumeration enumeration = node.children();\n while (enumeration.hasMoreElements()) {\n Object object = enumeration.nextElement();\n myListModel.addElement(object);\n }\n }\n }\n }", "void addNode()\n {\n Node newNode = new Node(this.numNodes);\n this.nodeList.add(newNode);\n this.numNodes = this.numNodes + 1;\n }", "@Override\n public void visit(Node node) {\n nodes.add(node);\n }", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "TreeNode addChild(TreeNode node);", "public void treeNodesInserted(TreeModelEvent e) {\n //To change body of implemented methods use Options | File Templates.\n }", "public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}", "public void addNode(String name, int index) {\n\t\tDefaultTreeModel model = (DefaultTreeModel) getModel();\n\t\tTreeNode root = (TreeNode) model.getRoot();\n\t\tif (index > root.getChildCount() || index < 0){\n\t\t\tindex = root.getChildCount();\n\t\t}\n\n\t\tmodel.insertNodeInto(new TreeNode(name, root.getNodeOption(), index, false), root, index);\n\t\tmodel.reload();\n\n\t\tscrollRowToVisible(index + 1);\n\n\t}", "void addNode(Node n) {\n nodes.put(n.id, n);\n }", "@Override\n\tpublic void addModel(Object o) {\n\t\ttreeModel.insertNodeInto(createNode(o), root, root.getChildCount()); \t\n\t\ttreeTable.setRowSelectionInterval(treeTable.getRowCount()-1, treeTable.getRowCount()-1);\n\t}", "public void placeTreeNodes() {\n int width;\n float rad;\n\n // Stores width and rad for convenience.\n width = MainActivity.getCanvas().getWidth();\n rad = AnimationParameters.NODE_RADIUS;\n\n // Places the Nodes.\n placeTreeNodes((int) (width / 2 + rad * 1.5), (int) (rad * 2),\n (int) (width - rad * 5), (int) AnimationParameters.depthLen);\n\n }", "public void addNode() {\r\n \r\n Nod nod = new Nod(capacitate_noduri);\r\n numar_noduri++;\r\n noduri.add(nod);\r\n }", "@Override\n\tpublic void addModel(ODocument o) {\n\t\ttreeModel.insertNodeInto(createNode(o), root, root.getChildCount()); \t\n\t\ttreeTable.setRowSelectionInterval(treeTable.getRowCount()-1, treeTable.getRowCount()-1);\n\t}", "public void addNodes(final Nodes nodes) {\n if (this.nodes == null) {\n this.nodes = new ArrayList<Nodes>();\n }\n this.findUpdateNode(nodes);\n }", "public void addChildNode(TreeNode treeNode) {\n initChildList();\n childList.add(treeNode);\n }", "public void initTreeModel() {\n\t\t\n\t}", "public void initTreeModel() {\n\t\t\n\t}", "public TtreeNode() {\n\t numberOfNodes++;\n\t }", "private void addNode(NeuralNode node) {\r\n\t\tinnerNodes.add(node);\r\n\t}", "public void add(T value) {\n final Node node = new Node(value);\n if (root != null) {\n root.add(node);\n } else {\n root = node;\n }\n }", "public void addNode() {\n if (nodeCount + 1 > xs.length)\n resize();\n nodeCount++;\n }", "private void addNode() {\n // Add GUI node\n int nodeCount = mGraph.getNodeCount();\n Node node = mGraph.addNode(String.valueOf(nodeCount));\n node.addAttribute(\"ui.label\", nodeCount);\n\n // Add Node_GUI node for algorithm to read from\n Node_GUI listNode = new Node_GUI();\n mNodeList.add(listNode);\n }", "private JPanel createControllerButtonsPanel() {\n\t\tJPanel buttonPanel = new JPanel();\n\t\tJButton addSib = new JButton(\"Add Sibling\");\n\t\tJButton addChld = new JButton(\"Add Child\");\n\t\tJButton remNode = new JButton(\"Remove\");\n\t\tJButton remRoot = new JButton(\"Remove Root\");\n\t\tbuttonPanel.add(addSib);\n\t\tbuttonPanel.add(addChld);\n\t\tbuttonPanel.add(remNode);\n\n\t\t// adding a sibling action!\n\t\taddSib.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\t// Identify the node that has been selected\n\t\t\t\tDefaultMutableTreeNode selected = (DefaultMutableTreeNode) tree\n\t\t\t\t\t\t.getLastSelectedPathComponent();\n\t\t\t\tif (selected == null) return;\n\n\t\t\t\t// get the parent of the selected node\n\t\t\t\tDefaultMutableTreeNode parent = (DefaultMutableTreeNode) selected\n\t\t\t\t\t\t.getParent();\n\t\t\t\tif (parent == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t// add a new node after the selected node as a child of the\n\t\t\t\t// selected node's parent\n\t\t\t\t// We add item to the MODEL! The view automatically updates.\n\t\t\t\ttModel.insertNodeInto(new DefaultMutableTreeNode(\"New Node\"),\n\t\t\t\t\t\tparent, parent.getIndex(selected) + 1);\n\n\t\t\t\t/*\n\t\t\t\t * Note: additions are done to the model, not the view. See\n\t\t\t\t * below for the treeModelListener methods.\n\t\t\t\t */\n\t\t\t}\n\t\t});\n\n\t\t// similar method for adding a child node of a selected node: note the\n\t\t// usage the getChildCount()\n\t\taddChld.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\t// Identify the node that has been selected\n\t\t\t\tDefaultMutableTreeNode selected = (DefaultMutableTreeNode) tree\n\t\t\t\t\t\t.getLastSelectedPathComponent();\n\t\t\t\tif (selected == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t// add a new node as the last child of the selected node\n\t\t\t\ttModel.insertNodeInto(new DefaultMutableTreeNode(\"New Node\"),\n\t\t\t\t\t\tselected, selected.getChildCount());\n\n\t\t\t\t// Lets also expand the tree to show the new node\n\t\t\t\t// Find the array of nodes that make up the path from the root\n\t\t\t\t// to the newly added node\n\t\t\t\tTreeNode[] nodes = tModel.getPathToRoot(selected\n\t\t\t\t\t\t.getChildAt(selected.getChildCount() - 1));\n\n\t\t\t\t// Create a tree path with these nodes\n\t\t\t\tTreePath path = new TreePath(nodes);\n\t\t\t\t// Make the entire path visible and make the scroller to move to\n\t\t\t\t// the last path component\n\t\t\t\ttree.scrollPathToVisible(path);\n\t\t\t}\n\t\t});\n\n\t\t// remove some selected node: you cannot remove the root node\n\t\tremNode.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\t// Identify the node that has been selected\n\t\t\t\tDefaultMutableTreeNode selected = (DefaultMutableTreeNode) tree\n\t\t\t\t\t\t.getLastSelectedPathComponent();\n\t\t\t\tif (selected == null) return;\n\t\t\t\t\n\t\t\t\t// Identify the parent of the selected node; we are not allowing\n\t\t\t\t// the root node to be removed\n\t\t\t\tif (selected.getParent() == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t// User the models remove method to remove the selected node\n\t\t\t\ttModel.removeNodeFromParent(selected);\n\t\t\t}\n\t\t});\n\n\t\treturn buttonPanel;\n\n\t}", "protected void addingNode( SearchNode n ) { }", "public void addNode(NodeImpl node) {\n supervisedNodes.add(node);\n \n colorNodes();\n shortenNodeLabels();\n colorNodeLabels();\n colorNodeLabelBorders();\n }", "public Builder addNodes(entities.Torrent.NodeId value) {\n if (nodesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureNodesIsMutable();\n nodes_.add(value);\n onChanged();\n } else {\n nodesBuilder_.addMessage(value);\n }\n return this;\n }", "public void addNode(Node node) {\n\t\tnodes.add(node);\n\t}", "public void addNodeToTheObjects(Node theNode) {\r\n getTheObjects().add(theNode);\r\n }", "public void addChild(TreeNode toAdd) {\n\t\t\tthis.children.add(toAdd);\n\t\t}", "private void addNodes(Node node) {\n\t\tif (node == null)\n\t\t\treturn;\n\n\t\taddNodes(node.left); // walk trough left sub-tree\n\t\tthis.child.add(node);\n\t\taddNodes(node.right); // walk trough right sub-tree\n\t}", "void addNode(int weight) \n {\n Node newNode = new Node(this.numNodes, weight);\n this.nodeList.add(newNode);\n this.numNodes = this.numNodes + 1;\n \n }", "private void initModel() {\t\n \t\t// build default tree structure\n \t\tif(treeMode == MODE_DEPENDENCY) {\n \t\t\t// don't re-init anything\n \t\t\tif(rootDependency == null) {\n \t\t\t\trootDependency = new DefaultMutableTreeNode();\n \t\t\t\tdepNode = new DefaultMutableTreeNode(); // dependent objects\n \t\t\t\tindNode = new DefaultMutableTreeNode();\n \t\t\t\tauxiliaryNode = new DefaultMutableTreeNode();\n \t\t\t\t\n \t\t\t\t// independent objects \n \t\t\t\trootDependency.add(indNode);\n \t\t\t\trootDependency.add(depNode);\n \t\t\t}\n \t\t\t\n \t\t\t// set the root\n \t\t\tmodel.setRoot(rootDependency);\n \n \t\t\t// add auxiliary node if neccessary\n \t\t\tif(showAuxiliaryObjects) {\n \t\t\t\tif(!auxiliaryNode.isNodeChild(rootDependency)) {\n \t\t\t\t\tmodel.insertNodeInto(auxiliaryNode, rootDependency, rootDependency.getChildCount());\n \t\t\t\t}\n \t\t\t}\n \t\t} else {\n \t\t\t// don't re-init anything\n \t\t\tif(rootType == null) {\n \t\t\t\trootType = new DefaultMutableTreeNode();\n \t\t\t\ttypeNodesMap = new HashMap<String, DefaultMutableTreeNode>(5);\n \t\t\t}\n \t\t\t\n \t\t\t// always try to remove the auxiliary node\n \t\t\tif(showAuxiliaryObjects && auxiliaryNode != null) {\n \t\t\t\tmodel.removeNodeFromParent(auxiliaryNode);\n \t\t\t}\n \n \t\t\t// set the root\n \t\t\tmodel.setRoot(rootType);\n \t\t}\n \t}", "private void addNewNode(Node newNode) {\r\n\t\tNode[] temp = new Node[this.treeNodes.length -1];\r\n\t\ttemp[0] = newNode;\r\n\r\n\t\tfor(int tempIndex = 1, i=2; i < this.treeNodes.length; i++, tempIndex++) {\r\n\t\t\ttemp[tempIndex] = this.treeNodes[i];\r\n\t\t}\r\n\t\tthis.treeNodes = temp;\r\n\t\tsortLeaves();\r\n\t}", "public void add(GeoElement geo) {\t\n \t\tcancelEditing();\t\n \t\t\n \t\tif (geo.isLabelSet() && geo.showInAlgebraView() && geo.isSetAlgebraVisible()) {\n \t\t\t// don't add auxiliary objects if the tree is categorized by type\n \t\t\tif(getTreeMode() == MODE_TYPE && !showAuxiliaryObjects() && geo.isAuxiliaryObject()) {\n \t\t\t\treturn;\n \t\t\t}\n \t\t\t\n \t\t\tDefaultMutableTreeNode parent, node;\n \t\t\tnode = new DefaultMutableTreeNode(geo);\n \t\t\t\n \t\t\tif(treeMode == MODE_DEPENDENCY) {\t\t\t\t\n \t\t\t\tif (geo.isAuxiliaryObject()) {\n \t\t\t\t\tparent = auxiliaryNode;\n \t\t\t\t}\t\t\t\t\n \t\t\t\telse if (geo.isIndependent()) {\t\t\t\n \t\t\t\t\tparent = indNode;\t\t\t\t\n \t\t\t\t} \n \t\t\t\telse {\t\t\t\t\n \t\t\t\t\tparent = depNode;\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\t// get type node\n \t\t\t\tString typeString = geo.getObjectType();\n \t\t\t\tparent = (DefaultMutableTreeNode) typeNodesMap.get(typeString);\n \t\t\t\t\n \t\t\t\t// do we have to create the parent node?\n \t\t\t\tif (parent == null) {\n \t\t\t\t\tString transTypeString = geo.translatedTypeString();\n \t\t\t\t\tparent = new DefaultMutableTreeNode(transTypeString);\t\t\t\t\t\t\t\t\t\n \t\t\t\t\ttypeNodesMap.put(typeString, parent);\n \t\t\t\t\t\n \t\t\t\t\t// find insert pos\n \t\t\t\t\tint pos = rootType.getChildCount();\n \t\t\t\t\tfor (int i=0; i < pos; i++) {\n \t\t\t\t\t\tDefaultMutableTreeNode child = (DefaultMutableTreeNode) rootType.getChildAt(i);\n \t\t\t\t\t\tif (transTypeString.compareTo(child.toString()) < 0) {\n \t\t\t\t\t\t\tpos = i;\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\t\n \t\t\t\t\tmodel.insertNodeInto(parent, rootType, pos);\t\t\t\t\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t// add node to model (alphabetically ordered)\n \t\t\tint pos = getInsertPosition(parent, geo);\n \t\t\t\n \t\t\tmodel.insertNodeInto(node, parent, pos);\n \t\t\tnodeTable.put(geo, node);\n \t\t\t\n \t\t\t// ensure that the leaf with the new obect is visible\n \t\t\texpandPath(new TreePath(new Object[] { model.getRoot(), parent }));\n \t\t}\n \t}", "public Builder addNodes(\n int index, entities.Torrent.NodeId value) {\n if (nodesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureNodesIsMutable();\n nodes_.add(index, value);\n onChanged();\n } else {\n nodesBuilder_.addMessage(index, value);\n }\n return this;\n }", "public void addNode(Node node) {\n\t\tthis.nodes.add(node);\n\t}", "@Override\r\n public final void modelChanged() {\r\n DefaultMutableTreeNode root = null;\r\n if (getNodeModel() == null) { // do we even have a NodeModel?\r\n root = new DefaultMutableTreeNode(\"No Model\");\r\n } else { // check for empty cluster model before adding content to\r\n // tree\r\n ClusterViewData viewData = getNodeModel().getViewData();\r\n if (viewData == null) {\r\n root = new DefaultMutableTreeNode(\"Empty Model\");\r\n } else { // put cluster info into the tree\r\n root = new DefaultMutableTreeNode(viewData.getNrOfClusters() + \" Clusters\");\r\n DefaultMutableTreeNode clusterParent; // TreeNode for cluster\r\n // c\r\n for (int c = 0; c < viewData.getNrOfClusters(); c++) {\r\n // add information about coverage and center vector\r\n clusterParent = new ClusterMutableTreeNode(KMeansWSSNodeModel.CLUSTER + c + \" (coverage: \"\r\n + viewData.getClusterCoverage(c) + \")\", new RowKey(KMeansWSSNodeModel.CLUSTER + c));\r\n for (int i = 0; i < viewData.getNrOfUsedColumns(); i++) {\r\n clusterParent.add(new DefaultMutableTreeNode(\r\n viewData.getFeatureName(i) + \" = \" + viewData.getClusterCenter(c)[i]));\r\n }\r\n root.add(clusterParent);\r\n }\r\n }\r\n }\r\n // set new JTreeModel\r\n m_jtree.setModel(new DefaultTreeModel(root));\r\n }", "public void add(NODE node) {\n root = root == null ? node : root.add(node);\n }", "private void createNodes( DefaultMutableTreeNode top ) {\n DefaultMutableTreeNode leaf = null;\n \n leaf = new DefaultMutableTreeNode( new treeInfo(\"Insert Transaction\") );\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Item\") );\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Report\") );\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Employee\") );\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Suplier\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Salesman\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Customer\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Commisioner\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Edit Transaction\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Producer\"));\n top.add(leaf);\n }", "public Node appendNode(Node node);", "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 }", "@Override\n\tpublic void insert(Node node) {\n\t\tchildren.add(node);\n\t}", "private DefaultMutableTreeNode addToModel(Component comp){\n \n // LOG ONLY -/\n if(debugLog) System.err.println(LOG_CAPTION+\" - <addToModel(Component)> ++++ Component=\"+comp);\n \n DefaultMutableTreeNode treeNode;\n \n AccComponent acc_comp = new AccComponent(comp);\n treeNode = new DefaultMutableTreeNode(acc_comp);\n \n if(comp instanceof Container){\n Container container = (Container)comp;\n \n // LOG ONLY -/\n if(debugLog) System.err.println(LOG_CAPTION+\" - <addToModel(Component)> - Container=\"+container);\n \n Component[] children = container.getComponents();\n \n for (int c = 0; c < children.length; c++){\n treeNode.add(addToModel(children[c]));\n \n // LOG ONLY -/\n if(debugLog) System.err.println(LOG_CAPTION+\" - <addToModel(Component)> - added [\"+c+\"] child => \"+children[c].getClass().getName()+\"/\"+container);\n \n }\n }\n \n return treeNode;\n }", "private void mountTree() {\n if (tree != null) {\n treePane.getChildren().addAll(tree);\n }\n }", "private void addNode(Node<E> node, E value) {\n if (node.children == null) {\n node.children = new ArrayList<>();\n }\n node.children.add(new Node<>(value));\n }", "public JdbNavTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public abstract void addChild(Node node);", "public void addChild(Node node){\n children.add(node);\n \n }", "public void actionPerformed(ActionEvent evt) {\n\t\t\t\tDefaultMutableTreeNode selected = (DefaultMutableTreeNode) tree\n\t\t\t\t\t\t.getLastSelectedPathComponent();\n\t\t\t\tif (selected == null) return;\n\n\t\t\t\t// get the parent of the selected node\n\t\t\t\tDefaultMutableTreeNode parent = (DefaultMutableTreeNode) selected\n\t\t\t\t\t\t.getParent();\n\t\t\t\tif (parent == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t// add a new node after the selected node as a child of the\n\t\t\t\t// selected node's parent\n\t\t\t\t// We add item to the MODEL! The view automatically updates.\n\t\t\t\ttModel.insertNodeInto(new DefaultMutableTreeNode(\"New Node\"),\n\t\t\t\t\t\tparent, parent.getIndex(selected) + 1);\n\n\t\t\t\t/*\n\t\t\t\t * Note: additions are done to the model, not the view. See\n\t\t\t\t * below for the treeModelListener methods.\n\t\t\t\t */\n\t\t\t}", "public void addChild(TreeItem t) {\n\t\tleaves = null;\n\t\ttreeLeaves = null;\n\t\tdecideNorm = false;\n\t\tItem newKids[] = new Item[numChildren+1];\n\t\tfor (int i = 0; i < numChildren; i++)\n\t\t\tnewKids[i] = children[i];\n\t\tnewKids[numChildren] = t;\n\t\tchildren = newKids;\n\t\tnumChildren++;\n\t\tsetHashCode();\n\t\tsetNumNodes();\n\t}", "public void addNode(Node p_node) {\n\t\tnodes.add(p_node);\n\t}", "public JdbTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public void addToPlugsNode(PluginDataModel pluginDataModel){\r\n\t\tplugsNode.add(new DefaultMutableTreeNode(pluginDataModel));\r\n\t}", "public entities.Torrent.NodeId.Builder addNodesBuilder() {\n return getNodesFieldBuilder().addBuilder(\n entities.Torrent.NodeId.getDefaultInstance());\n }", "private void addNodes() {\n\t\t\n\t\t// first line of controls\n\t\tHBox hbox1 = new HBox(10);\n\t\thbox1.setAlignment(Pos.CENTER_RIGHT);\n\t\t\n\t\tresetButton = new Button (\"Reset\");\n\t\t\n\t\thbox1.getChildren().add(resetButton);\n\t\t\n\t\t// second line of controls\n\t\tHBox hbox2 = new HBox(30);\n\t\t\n\t\tLabel filterBy = new Label(\"Filter by:\");\n\t\t\n\t\trbCourse.setUserData(\"Course\");\n\t\trbCourse.setToggleGroup(toggleGroup);\n\t\t\n\t\trbAuthor.setUserData(\"Author\");\n\t\trbAuthor.setToggleGroup(toggleGroup);\n\t\t\n\t\trbNone.setUserData(\"None\");\n\t\trbNone.setToggleGroup(toggleGroup);\n\t\trbNone.setSelected(true);\n\t\t\n\t\thbox2.getChildren().addAll(filterBy, rbCourse, rbAuthor, rbNone);\n\t\t\n\t\t// third line of controls\n\t\thbox3.getChildren().addAll(CourseSelectionBox.instance(), applyButton);\n\t\thbox3.setDisable(true);\n\t\t\n\t\t// fourth line of controls\n\t\tHBox hbox4 = new HBox(30);\n\t\t\n\t\tquizIDField.setPromptText(\"Enter quiz ID\");\n\t\t\n\t\thbox4.getChildren().addAll(quizIDField, searchButton);\n\t\t\n\t\t// add all nodes\n\t\tthis.getChildren().addAll(hbox1, hbox2, hbox3, hbox4);\n\t\t\n\t}", "private void fireTreeNodesInserted(TreeModelEvent event) {\n\t\tfor(TreeModelListener listener : _listeners) {\n\t\t\tlistener.treeNodesInserted(event);\n\t\t}\n\t}", "public void addNode (NodeState node) throws RepositoryException, IOException\n\t{\n\t}", "public void createTree() {\n Node<String> nodeB = new Node<String>(\"B\", null, null);\n Node<String> nodeC = new Node<String>(\"C\", null, null);\n Node<String> nodeD = new Node<String>(\"D\", null, null);\n Node<String> nodeE = new Node<String>(\"E\", null, null);\n Node<String> nodeF = new Node<String>(\"F\", null, null);\n Node<String> nodeG = new Node<String>(\"G\", null, null);\n root.leftChild = nodeB;\n root.rightChild = nodeC;\n nodeB.leftChild = nodeD;\n nodeB.rightChild = nodeE;\n nodeC.leftChild = nodeF;\n nodeC.rightChild = nodeG;\n\n }", "public void add(Node<T> n){\n\t\tconnect.add(n);\n\t}", "@Override\n\tprotected void nodesInserted ( TreeModelEvent event ) {\n\t\tif ( this.jumpNode != null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tObject[] children = event.getChildren ( );\n\n\t\tif ( children != null ) {\n\n\t\t\t// only problem with this could occure when\n\t\t\t// then children[0] element isn't the topmost element\n\t\t\t// in the tree that has been inserted. at this condition \n\t\t\t// that behaviour is undefined\n\t\t\tthis.jumpNode = ( ProofNode ) children[0];\n\t\t} else {\n\t\t\tthis.jumpNode = null;\n\t\t}\n\t}", "private void addNodes(DefaultMutableTreeNode root)\r\n {\r\n // 2A. Create nodes for the three colleges\r\n\r\n // 2B. Add colleges to the root\r\n \r\n // 2C. Add two divisions to OCC\r\n\r\n // Add some departments to busdiv\r\n// busdiv.add(new DefaultMutableTreeNode(\"Accounting\"));\r\n// busdiv.add(new DefaultMutableTreeNode(\"Business\"));\r\n// busdiv.add(new DefaultMutableTreeNode(\"Computer Information Systems\"));\r\n// busdiv.add(new DefaultMutableTreeNode(\"Computer Science\"));\r\n// busdiv.add(new DefaultMutableTreeNode(\"Computerized Office Technology\"));\r\n// busdiv.add(new DefaultMutableTreeNode(\"Management\"));\r\n// busdiv.add(new DefaultMutableTreeNode(\"Marketing\"));\r\n// busdiv.add(new DefaultMutableTreeNode(\"Real Estate\"));\r\n }", "private DefaultTreeModel createTreeModel() {\n\t\t// create the root USA\n\t\tDefaultMutableTreeNode root = new DefaultMutableTreeNode(\"USA\");\n\n\t\t// First child is IOWA!\n\t\troot.add(new DefaultMutableTreeNode(\"Iowa\"));\n\n\t\t// other way to create a DefaultMutableTreeNode:\n\t\t// create an empty node and then add the user object\n\t\tDefaultMutableTreeNode newNode = new DefaultMutableTreeNode();\n\t\tnewNode.setUserObject(\"California\");\n\n\t\t// add a child to newNode\n\t\tnewNode.add(new DefaultMutableTreeNode(\"Sacramento\"));\n\n\t\t// add a sibling to Iowa (i.e. California)\n\t\troot.add(newNode);\n\n\t\t// create the model using the root of the tree\n\t\tDefaultTreeModel treeModel = new DefaultTreeModel(root);\n\n\t\t// ADD MODEL LISTENERS (changes/insertion/deletion of nodes)\n\t\ttreeModel.addTreeModelListener(createTreeModelListener());\n\t\treturn treeModel;\n\n\t}", "public void addNode(INode node) {\r\n\t\tnodeList.add(node);\r\n\t}", "public void addInTree(ArrayList<String> ngram, TreeNode root){\r\n\t\tTreeNode parentNode = root;\r\n\t\tTreeNode childNode = null;\r\n\t\tfor(int i = 0; i < ngram.size(); i++){\r\n\t\t\tchildNode = find(parentNode, ngram.get(i));\r\n\t\t\tif(childNode == null){\r\n\t\t\t\t// If node does not exist, create it and add it in the tree.\r\n\t\t\t\tchildNode = new TreeNode(ngram.get(i));\r\n\t\t\t\tparentNode.add(childNode);\r\n\t\t\t\tnGramDistinct ++;\r\n\t\t\t\tnGramPerLen[i] ++;\r\n\t\t\t}\r\n\t\t\tchildNode.incFreq(); // Increment apparition counter\r\n\t\t\tparentNode = childNode; // One step deeper in the tree\r\n\t\t}\r\n\t}", "public void addNodeToParentNode(Node node) throws NoParentNodeException, NoSelectedNodeException {\n\n\t\t//Update the swing view first because it will send the needed exceptions\n\t\tesv.addNodeToParentNode(node);\n\n\t\t//Update internal representation of tree\n\t\tFolder parent = (Folder)this.selectedNode.getParent();\n\t\tparent.addChild(node);\n\t\tnode.setParent(parent);\n\n\t\t//Update lastInserted HashMap\n\t\tthis.lastInsertedNodes.clear();\n\t\tthis.lastInsertedNodes.put(0, node);\n\t}", "@PostMapping(path = \"/\")\n public @ResponseBody String addNode(@RequestBody Node node){\n\n return nodeService.addNode(node);\n }", "public void mergeClassesIntoTree(DefaultTreeModel model, boolean reset);", "public HtmlTree(DefaultTreeModel model)\n {\n setModel(model);\n }", "void addNode(String node);", "public void addNode(GraphNode<T> node) {\n\tmRoot.addNode(node);\n\tmNodesCount++;\n }", "public void add(String nodeName, rcNode farm) {\n\n for (int i = 0; i < treeModel.getChildCount(root); i++) {\n DefaultMutableTreeNode n = (DefaultMutableTreeNode) treeModel.getChild(root, i);\n if (nodeName.equals(n.getUserObject().toString())) {\n boolean found = false;\n for (int j = 0; j < treeModel.getChildCount(n); j++) {\n DefaultMutableTreeNode nn = (DefaultMutableTreeNode) treeModel.getChild(n, j);\n if (farm.equals(nn.getUserObject())) {\n found = true;\n break;\n }\n }\n if (found) {\n return;\n }\n DefaultMutableTreeNode node = addFarm(n, farm);\n if (!groupFarms.containsKey(nodeName)) {\n Vector vv = new Vector();\n vv.add(farm);\n groupFarms.put(nodeName, vv);\n } else {\n Vector vv = (Vector) groupFarms.get(nodeName);\n for (int k = 0; k < vv.size(); k++) {\n if (farm.equals(vv.get(k))) {\n vv.remove(k);\n }\n }\n vv.add(farm);\n }\n modifiedNodes.add(n);\n modifiedNodes.add(node);\n if (selectedGroups.contains(n.getUserObject())) {\n TreePath path = new TreePath(node.getPath());\n tree.addSelectionPath(path);\n }\n return;\n }\n }\n DefaultMutableTreeNode n = addGroup(nodeName);\n modifiedNodes.add(root);\n modifiedNodes.add(n);\n DefaultMutableTreeNode node = addFarm(n, farm);\n Vector vv = new Vector();\n vv.add(farm);\n groupFarms.put(nodeName, vv);\n modifiedNodes.add(node);\n }", "public Builder addAllNodes(\n java.lang.Iterable<? extends entities.Torrent.NodeId> values) {\n if (nodesBuilder_ == null) {\n ensureNodesIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, nodes_);\n onChanged();\n } else {\n nodesBuilder_.addAllMessages(values);\n }\n return this;\n }", "public void add(E val){\n if(mData.compareTo(val) > 0){\n if(mLeft == null){\n mLeft = new BSTNode(val);\n mLeft.mParent = this;\n }//End if null\n else if(mRight == null){\n mRight = new BSTNode(val);\n mRight.mParent = this;\n }//End Else\n }//End if\n else{\n mLeft.add(val);\n mLeft.mParent = this;\n }//End Else\n }", "private void initTrees() {\n // My machine tree init code\n myMachineTree = new FileTree(fileDomainModel);\n myMachineScrollPane.add(myMachineTree);\n // Connected machine tree init code\n connectedMachineTree = new FileTree(fileDomainModel);\n connectedMachineScrollPane.add(connectedMachineTree);\n }", "private void CreateJTree(List<MainCategoryDTO> allTree) {\n \n \n DefaultMutableTreeNode root = new DefaultMutableTreeNode(\"Listem\");\n for (int i = 0; i < allTree.size(); i++) {\n MainCategoryDTO mainCategory = allTree.get(i);\n DefaultMutableTreeNode mainCategoryTree = new DefaultMutableTreeNode(mainCategory.getName());\n CreatSubCategory(mainCategory.getList(),mainCategoryTree);\n root.add(mainCategoryTree);\n } \n \n \n DefaultTreeModel model = new DefaultTreeModel(root); \n jTree1.setModel(model); \n jTree1.setRootVisible(false);\n jTree1.addTreeSelectionListener((javax.swing.event.TreeSelectionEvent evt) -> {\n JTree1ValueChanged(evt);\n });\n \n }", "void addNode(int node);", "public Builder addNodes(\n entities.Torrent.NodeId.Builder builderForValue) {\n if (nodesBuilder_ == null) {\n ensureNodesIsMutable();\n nodes_.add(builderForValue.build());\n onChanged();\n } else {\n nodesBuilder_.addMessage(builderForValue.build());\n }\n return this;\n }", "@Test\n public void whenAddNodesOnOneLevelThenResultThreeNodesInLine() {\n tree.addChild(nodeOne, \"1\");\n tree.addChild(nodeTwo, \"2\");\n tree.addChild(nodeThree, \"3\");\n assertThat(tree.getChildren().toString(), is(\"[1, 2, 3]\"));\n }", "@Test\n public void whenAddNodesOnDifferentLevelsThenResultThreeNodeFromBottomToTop() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n nodeTwo.addChild(nodeThree, \"3\");\n assertThat(tree.getChildren().toString(), is(\"[3, 2, 1]\"));\n }", "List<TreeNodeDTO> genTree(boolean addNodeSize, boolean addRootNode, List<Long> disabledKeys);", "boolean addNode(long idNum, String label);", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "protected void addNode( String workspaceName,\n NodeKey key,\n Path path,\n Name primaryType,\n Set<Name> mixinTypes,\n Properties properties ) {\n }", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "private void insertNodeIntoTree(Node node) {\n\t\troot = insert(root,node);\t\n\t}", "void addNode(Entity entity) {\n\t\tProcessing.nodeSet.add(entity);\n\t\tSystem.out.println(\"the entity was successfully added to the network.\");\n\t}", "public Hierarchy() {\n treeModel = new DefaultTreeModel(topNode);\n treeModel.addTreeModelListener(new MyTreeModelListener());\n initComponents ();\n }", "public void addToList(Node newChildren) {\n \tthis.children.add(newChildren);\n }", "public PhylogeneticTree(Model model) {\n this.model = model;\n }", "@Override\n\tpublic void setNodes(int nodes) {\n\t\tmodel.setNodes(nodes);\n\t}", "private void addNode(Node node)\n\t{\n\t\tif (node == null)\n\t\t\treturn;\n\t\tthis.nodes[node.getRowIndex()][node.getColumnIndex()] = node;\n\t}", "public synchronized void addChild (TreeNode node)\r\n {\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\"addChild node=\" + node + \" for \" + this);\r\n }\r\n\r\n children.add(node);\r\n node.setParent(this);\r\n }", "protected void newNode (ManagedConfig config)\n {\n // presently we must clear the filter\n _filterPanel.clearFilter();\n\n // find the parent under which we want to add the node\n ConfigTreeNode snode = _tree.getSelectedNode();\n ConfigTreeNode parent = (ConfigTreeNode)(snode == null ?\n _tree.getModel().getRoot() : snode.getParent());\n\n // create a node with a unique name and start editing it\n String name = parent.findNameForChild(\n _msgs.get(config == null ? \"m.new_folder\" : \"m.new_config\"));\n ConfigTreeNode child = new ConfigTreeNode(name, config);\n ((DefaultTreeModel)_tree.getModel()).insertNodeInto(\n child, parent, parent.getInsertionIndex(child));\n _tree.startEditingAtPath(new TreePath(child.getPath()));\n DirtyGroupManager.setDirty(group, true);\n }", "public void add(T v) {\n add(new Node(v));\n }", "public void addNodeToSelectedNode(Node node) throws NoSelectedNodeException {\n\t\tif (!(this.selectedNode instanceof Folder)){\n\t\t\tesv.showPopupError(\"Can only add a folder to another folder\");\n\t\t\treturn;\n\t\t}\n\n\t\t//Update the swing view first because it will send the needed exceptions\n\t\tesv.addNodeToSelectedNode(node);\n\n\t\t//Update internal representation of tree\n\t\tFolder parent = (Folder)this.selectedNode;\n\t\tparent.addChild(node);\n\t\tnode.setParent(parent);\n\n\t\t//Update lastInserted HashMap\n\t\tthis.lastInsertedNodes.clear();\n\t\tthis.lastInsertedNodes.put(0, node);\n\t}", "public void add( T obj )\n {\n // Any distinct object causes creation of a new tree-set.\n // We count any such sets as we go.\n if (!contains( obj ))\n {\n nodes.put(obj, new Node(obj));\n numSets++;\n }\n }", "public void add(String data) {\r\n\t\t// System.out.println(\"Starting Add\");\r\n\t\tif (root == null) {\r\n\t\t\t// First item in tree\r\n\t\t\tNode ng = new Node();\r\n\t\t\tng.setData(data);\r\n\t\t\t// System.out.println(\"Ng data: \" + ng.getData());\r\n\r\n\t\t\troot = ng;\r\n\t\t\t// System.out.print(\"Root added : \" + root.getData());\r\n\t\t\tcount = 1;\r\n\r\n\t\t} else {\r\n\t\t\trecAdd(data, root);\r\n\t\t}\r\n\t}" ]
[ "0.65699726", "0.6383006", "0.6377069", "0.63301295", "0.6259097", "0.623127", "0.6133392", "0.6088292", "0.6056342", "0.60489887", "0.604494", "0.6022868", "0.6006494", "0.59609026", "0.59193206", "0.59016013", "0.58872944", "0.58640486", "0.58442223", "0.58442223", "0.5841849", "0.5815233", "0.5804625", "0.5776849", "0.57652557", "0.5756558", "0.57475466", "0.5740952", "0.57204294", "0.56731707", "0.56642056", "0.5654479", "0.55983114", "0.55826044", "0.55799395", "0.55734736", "0.5570417", "0.5569419", "0.5548767", "0.55384225", "0.55223835", "0.5509373", "0.55062175", "0.54819244", "0.5481709", "0.5471024", "0.54687893", "0.54652584", "0.5461625", "0.54614943", "0.54563993", "0.5454511", "0.5451387", "0.5442014", "0.54413444", "0.5440641", "0.54223216", "0.54193574", "0.5417313", "0.5413956", "0.54075444", "0.5393401", "0.53909314", "0.5382862", "0.5370834", "0.536403", "0.5363555", "0.53611016", "0.534875", "0.5325989", "0.53249174", "0.5316072", "0.53150827", "0.530302", "0.5297238", "0.5296281", "0.5294738", "0.5287375", "0.52849746", "0.52824765", "0.52784", "0.52765536", "0.52602875", "0.5258667", "0.5258599", "0.524398", "0.52400076", "0.5238018", "0.5223479", "0.52189624", "0.5213907", "0.52130425", "0.5204048", "0.5201528", "0.5197729", "0.5196137", "0.51898086", "0.518373", "0.5183024", "0.51816255" ]
0.5540006
39
Searching for Right OR Left foot site amputations should return ALL foot amputations: left, right and bilateral
@Test void attributeGroupDisjunction2() { assertEquals( "Match procedure with left OR right foot (grouped)", Sets.newHashSet(AMPUTATION_FOOT_LEFT, AMPUTATION_FOOT_RIGHT, AMPUTATION_FOOT_BILATERAL), strings(selectConceptIds("< 71388002 |Procedure|: { 363704007 |Procedure site| = 22335008 |Left Foot| } OR { 363704007 |Procedure site| = 7769000 |Right Foot| }"))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testCombineRankHighPageRankWeight() {\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(Arrays.asList(\"anteater\"),\n 10, 1000000000.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n Assert.assertEquals(10, resultList.size());\n Assert.assertTrue(resultList.stream().limit(3).map(p -> p.getLeft())\n .anyMatch(doc -> doc.getText().contains(\"wics.ics.uci.edu\")));\n }", "public int right_of(Halfedge el, Point p) {\r\n\t\tEdge e;\r\n\t\tSite topsite;\r\n\t\tint right_of_site, above, fast;\r\n\t\tfloat dxp, dyp, dxs, t1, t2, t3, yl;\r\n\r\n\t\te = el.ELedge;\r\n\t\ttopsite = e.reg[1];\r\n\t\tright_of_site = p.x > topsite.coord.x ? 1 : 0;\r\n\t\tif (right_of_site == 1 && el.ELpm == le)\r\n\t\t\treturn (1);\r\n\t\tif (right_of_site == 0 && el.ELpm == re)\r\n\t\t\treturn (0);\r\n\r\n\t\tif (e.a == 1.0) {\r\n\t\t\tdyp = p.y - topsite.coord.y;\r\n\t\t\tdxp = p.x - topsite.coord.x;\r\n\t\t\tfast = 0;\r\n\t\t\tif ((right_of_site == 0 & e.b < 0.0)\r\n\t\t\t\t\t| (right_of_site == 1 & e.b >= 0.0)) {\r\n\t\t\t\tabove = dyp >= e.b * dxp ? 1 : 0;\r\n\t\t\t\tfast = above;\r\n\t\t\t} else {\r\n\t\t\t\tabove = p.x + p.y * e.b > e.c ? 1 : 0;\r\n\t\t\t\tif (e.b < 0.0)\r\n\t\t\t\t\tabove = (above == 1 ? 0 : 1);\r\n\t\t\t\tif (above == 0)\r\n\t\t\t\t\tfast = 1;\r\n\t\t\t}\r\n\t\t\tif (fast == 0) {\r\n\t\t\t\tdxs = topsite.coord.x - (e.reg[0]).coord.x;\r\n\t\t\t\tabove = e.b * (dxp * dxp - dyp * dyp) < dxs * dyp\r\n\t\t\t\t\t\t* (1.0 + 2.0 * dxp / dxs + e.b * e.b) ? 1 : 0;\r\n\t\t\t\tif (e.b < 0.0)\r\n\t\t\t\t\tabove = (above == 1 ? 0 : 1);\r\n\t\t\t}\r\n\t\t} else { // e.b==1.0\r\n\t\t\tyl = e.c - e.a * p.x;\r\n\t\t\tt1 = p.y - yl;\r\n\t\t\tt2 = p.x - topsite.coord.x;\r\n\t\t\tt3 = yl - topsite.coord.y;\r\n\t\t\tabove = (t1 * t1 > (t2 * t2 + t3 * t3) ? 1 : 0);\r\n\t\t}\r\n\r\n\t\treturn (el.ELpm == le ? above : (above == 1 ? 0 : 1));\r\n\t}", "@Test\n public void ORSearch_CareQualityCommision() throws Exception {\n\n final Set<String> searchResults = newsLineSearch.search(TEST_FILE, \"Care Quality Commission\", SearchType.OR);\n\n assertThat(searchResults).hasSize(7).contains(allLines.get(0), allLines.get(1), allLines.get(2),\n allLines.get(3), allLines.get(4), allLines.get(5), allLines.get(6));\n }", "@Test\n public void ORSearch_GeneralPopulationGenerally() throws Exception {\n\n final Set<String> searchResults = newsLineSearch.search(TEST_FILE, \"general population generally\",\n SearchType.OR);\n\n assertThat(searchResults).hasSize(2).contains(allLines.get(6), allLines.get(8));\n }", "@Test\n public void ANDSearch_GeneralPopulationAlzheimer() throws Exception {\n\n final Set<String> searchResults = newsLineSearch.search(TEST_FILE, \"general population Alzheimer\",\n SearchType.AND);\n\n assertThat(searchResults).hasSize(1).contains(allLines.get(6));\n }", "private void and() {\n // PROGRAM 1: Student must complete this method\n //loop through the output array\n for (int i = 0; i < output.length; i++) {\n //take the and of index i of inputA and inputB and place result in output[i]\n output[i] = inputA[i] & inputB[i];\n }\n }", "public void execFuzzySearchVariationFunc(){\n\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(this.searchParam );\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true) {\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if (this.searchParam.indexOf(\":\") > -1) {\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0, idex );\n System.out.println(\"chrom=\" + chrom);\n map.put(\"chrom\", chrom);\n if (this.searchParam.indexOf(\"-\") > -1) {\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, idex1 ));\n pend = Integer.parseInt(this.searchParam.substring(idex1 + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n map.put(\"endpos\", pend);\n } else {\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n }\n\n } else if (this.searchParam.startsWith(\"chr\") == true) {\n map.put(\"chrom\", this.searchParam);\n }\n }\n\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"null\") ==false && this.searchSpecies.equals(\"all\") == false){\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\") ==false && this.searchTrait.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\") ==false && this.pvalue.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n //here, parse search param and get genotype information\n genotypeBeanList = (List<GenotypeBean>) baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",map);\n if(genotypeBeanList != null && genotypeBeanList.size() > 0 ){\n for(GenotypeBean tbean :genotypeBeanList ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n\n }\n\n StringBuffer sb = new StringBuffer() ;\n\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "default Stream<Triple> witnesses(Triple... elements) {\n Set<Triple> toBeMatched = new HashSet<>(Arrays.asList(elements));\n return apex().carrier().elements().filter(witnes -> {\n return toBeMatched.stream().allMatch(target -> {\n return projections().anyMatch(morphism -> morphism.apply(witnes).map(target::equals).orElse(false));\n });\n });\n }", "@Test\n\tpublic void testSearchIteratorDenormalizedFilter(){\n\t\t\n\t\tRegionQueryPart regionQueryPart = new RegionQueryPart();\n\t\tregionQueryPart.setRegion(new String[]{\"AB\",\"bc\"});\n\t\t//allof should be read : give me all the native and ephemere of AB and BC\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ALL_OF);\n\t\t\n\t\tIterator<Map<String,Object>> taxonIt = taxonDAO.searchIteratorDenormalized(-1, null, null, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tassertTrue(taxonIt.hasNext());\n\t\t\n\t\tList<String> mockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK1_AUTHOR,MOCK3_AUTHOR})));\n\t\tassertFalse(mockTaxonNameList.contains(MOCK2_AUTHOR));\n\t\t\n\t\t//anyof should be read : give me any of the native and ephemere of AB or BC\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ANY_OF);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tassertTrue(extractMockTaxonNameFromMap(taxonIt).containsAll(Arrays.asList(new String[]{MOCK1_AUTHOR,MOCK2_AUTHOR,MOCK3_AUTHOR})));\n\t\t\n\t\t//only_in should be read : give me the native and ephemere that are only native or ephemere in AB or BC\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ONLY_IN);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK3_AUTHOR, MOCK5_AUTHOR})));\n\t\tassertEquals(2, mockTaxonNameList.size());\n\t\t\n\t\t//only_in and setSearchOnlyInCanada should be read : give me the native and ephemere that are only native or ephemere in AB or BC (ignoring Greenland and St-Pierre)\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ONLY_IN);\n\t\tregionQueryPart.setSearchOnlyInCanada(true);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK3_AUTHOR, MOCK4_AUTHOR, MOCK5_AUTHOR, MOCK6_AUTHOR, MOCK7_AUTHOR})));\n\t\tassertEquals(5, mockTaxonNameList.size());\n\t\t\n\t\t//all of, only in and setSearchOnlyInCanada should be read : give me the native,ephemere that are only native or ephemere in AB and BC (ignoring Greenland and St-Pierre status)\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ALL_OF_ONLY_IN);\n\t\tregionQueryPart.setSearchOnlyInCanada(true);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK3_AUTHOR, MOCK4_AUTHOR, MOCK5_AUTHOR})));\n\t\tassertEquals(3, mockTaxonNameList.size());\n\t\t\n\t\t//all of, only in should be read : give me the native,ephemere that are only native or ephemere in AB and BC (including Greenland and St-Pierre status)\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ALL_OF_ONLY_IN);\n\t\tregionQueryPart.setSearchOnlyInCanada(false);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK3_AUTHOR, MOCK5_AUTHOR})));\n\t\tassertEquals(2, mockTaxonNameList.size());\n\t\t\n\t\t//test taxonid filter\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ALL_OF);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, 1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK1_AUTHOR})));\n\t}", "public void execFuzzySearchRangeFunc(){\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true){\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if(this.searchParam.indexOf(\":\") > -1 ){\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0,idex );\n System.out.println(\"chrom=\"+chrom);\n map.put(\"chrom\",chrom);\n if(this.searchParam.indexOf(\"-\") > -1 ){\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex+1, idex1));\n pend = Integer.parseInt(this.searchParam.substring(idex1+1, this.searchParam.length()));\n map.put(\"startpos\",pstart);\n map.put(\"endpos\",pend);\n }else {\n pstart = Integer.parseInt(this.searchParam.substring(idex+1, this.searchParam.length()));\n map.put(\"startpos\",pstart);\n }\n\n }else if(this.searchParam.startsWith(\"chr\") == true){\n map.put(\"chrom\",this.searchParam);\n\n\n }\n }\n }\n\n int idenfilter = 0;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\")==false && this.searchTrait.length()>0){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\")==false && this.pvalue.length()>0){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n List<SearchItemBean> searchlist = (List<SearchItemBean>) baseService.findResultList(\"cn.big.gvk.dm.Search.selectRangeBySearch\",map);\n if( searchlist != null ){\n genotypeBeanList = new ArrayList<GenotypeBean>();\n mapGeneBeanList = new ArrayList<MapGeneBean>();\n for(SearchItemBean tmpbean : searchlist){\n if(tmpbean.getItemType() == 1){ //variant\n Map cmp = new HashMap();\n cmp.put(\"genotypeid\",tmpbean.getItemId());\n GenotypeBean tbean = (GenotypeBean) baseService.findObjectByObject(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",cmp);\n if(tbean != null ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n genotypeBeanList.add(tbean) ;\n }\n\n\n\n\n }else if(tmpbean.getItemType() == 2){//gene\n\n Map cmp = new HashMap();\n cmp.put(\"gid\",tmpbean.getItemId()) ;\n MapGeneBean mgb = (MapGeneBean) baseService.findObjectByObject(\"cn.big.gvk.dm.MapGene.selectMapGeneCount\",cmp);\n if(mgb != null ){\n Map t = new HashMap();\n t.put(\"gId\",mgb.getGid()) ;\n t.put(\"count\",\"count\");\n\n //trait count\n GwasAssociationView gwas = (GwasAssociationView) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectGwasViewByGeneInfo\",t);\n if(gwas != null){\n mgb.setTraitCount(gwas.getTraitCount());\n }\n\n //study count\n StudyBean study = (StudyBean) baseService.findObjectByObject(\"cn.big.gvk.dm.study.selectStudyByMapGeneId\",t);\n if(study != null ){\n mgb.setStudyCount(study.getStudyCount());\n }\n\n //publication count\n PublicationBean publication = (PublicationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.publication.selectPubByGeneId\",t);\n if (publication != null ){\n mgb.setPublicationCount(publication.getPublicationCount());\n }\n mapGeneBeanList.add(mgb) ;\n\n }\n\n\n }\n }\n }\n StringBuffer sb = new StringBuffer();\n //generate hidden html table and then use tableExport.js export\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(mapGeneBeanList != null && mapGeneBeanList.size()>0){\n for(MapGeneBean mapgene: mapGeneBeanList){\n sb.append(mapgene.getMapGeneId()).append(\"\\t\").append(mapgene.getMapGeneChrom()).append(\":\")\n .append(mapgene.getMapGeneStart()).append(\"-\").append(mapgene.getMapGeneEnd()).append(\"\\t\").append(mapgene.getTraitCount()).append(\"\\t\")\n .append(mapgene.getStudyCount()).append(\"\\n\");\n }\n }\n\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "@Test\n public void test_shortcut_needed_bidirectional() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(5, 4, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, 10);\n graph.addEdge(1, 2, edge++, 10, 10);\n graph.addEdge(2, 3, edge++, 10, 10);\n graph.addEdge(3, 4, edge++, 10, 10);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 20.0, 100);\n assertTrue(Double.isInfinite(weight));\n }", "@Test\n public void testCombinePageRankTfIdf() {\n\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(\n Arrays.asList(\"ISG\", \"Bren\", \"School\", \"UCI\"),\n 100, 100.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n\n // first result should be \"isg.ics.uci.edu\"\n Assert.assertEquals(\"isg.ics.uci.edu\", getDocumentUrl(resultList.get(0).getLeft().getText()));\n\n // top 10 should have URLs starting \"hobbes.ics.uci.edu\"\n Assert.assertTrue(resultList.stream().limit(10).map(p -> getDocumentUrl(p.getLeft().getText()))\n .anyMatch(p -> p.contains(\"hobbes.ics.uci.edu\")));\n\n // top 50 should have URL \"ipubmed2.ics.uci.edu\"\n Assert.assertTrue(resultList.stream().limit(50).map(p -> getDocumentUrl(p.getLeft().getText()))\n .anyMatch(p -> p.equals(\"ipubmed2.ics.uci.edu\")));\n\n }", "void findMatchings(boolean isProtein) {\n\n GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();\n HashSet<String > searchSpaceList = new HashSet<>();\n GraphDatabaseService databaseService = dbFactory.newEmbeddedDatabase(graphFile);\n for (int id: queryGraphNodes.keySet()) {\n if(isProtein)\n searchSpaceList.add(queryGraphNodes.get(id).label);\n else\n searchSpaceList.add(String.valueOf(queryGraphNodes.get(id).labels.get(0)));\n }\n for(String x: searchSpaceList) {\n ResourceIterator<Node> xNodes;\n try(Transaction tx = databaseService.beginTx()) {\n xNodes = databaseService.findNodes(Label.label(x));\n tx.success();\n }\n\n while (xNodes.hasNext()) {\n Node node = xNodes.next();\n if (searchSpaceProtein.containsKey(x))\n searchSpaceProtein.get(x).add(node.getId());\n else {\n HashSet<Long> set = new HashSet<>();\n set.add(node.getId());\n searchSpaceProtein.put(x, set);\n }\n }\n\n }\n\n if(isProtein)\n search(0, databaseService, true);\n else\n search(0, databaseService, false);\n databaseService.shutdown();\n }", "public void execFuzzySearchCustomWordFunc(){\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n map.put(\"searchParam\",this.searchParam);\n }\n\n int idenfilter = 0 ;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n idenfilter = 1;\n map.put(\"species\",this.searchSpecies.trim());\n }\n\n\n if(this.searchTrait != null && this.searchTrait.equals(\"null\")==false && this.searchTrait.length()>0){\n idenfilter =1;\n List traitlist = new ArrayList();\n if(this.searchTrait.indexOf(\",\")>-1){\n String [] traits = this.searchTrait.split(\",\");\n if(traits != null && traits.length>0){\n for(String tr:traits){\n traitlist.add(tr);\n }\n }\n }else{\n traitlist.add(this.searchTrait);\n }\n map.put(\"traitlist\", traitlist) ;\n }\n\n if(this.pvalue != null && this.pvalue.equals(\"null\")==false && this.pvalue.length()>0 ){\n idenfilter =1;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n //this is search customword\n List<SearchItemBean> searchlist = (List<SearchItemBean>) baseService.findResultList(\"cn.big.gvk.dm.Search.selectCustomWordBySearch\",map);\n if( searchlist != null ){\n gwasAssociationList = new ArrayList<GwasAssociationBean>() ;\n mapGeneBeanList = new ArrayList<MapGeneBean>();\n for(SearchItemBean tmpbean : searchlist){\n if(tmpbean != null ){\n if(tmpbean.getItemType() == 1){\n //selecTraitByFuzzySearch\n Map cmp = new HashMap();\n cmp.put(\"traitId\", tmpbean.getItemId());\n GwasAssociationBean tmpgwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selecTraitByFuzzySearch\",cmp);\n if(tmpgwas != null ){\n //trait count\n Map cmap = new HashMap();\n cmap.put(\"traitId\",tmpgwas.getTraitId()) ;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n\n }\n GwasAssociationBean tg_bean = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByTraitId\",cmap);\n if(tg_bean != null ){\n tmpgwas.setTraitCount(tg_bean.getGwasCount());\n }\n\n List<TermInformationBean> tilist = (List<TermInformationBean>)baseService.findResultList(\"cn.big.gvk.dm.Term.selectTermDefinition\",tmpgwas.getTraitId());\n String s=\"\";\n if(tilist != null && tilist.size()>0 ){\n for(TermInformationBean tb:tilist ){\n if(tb!= null && tb.getTermDefinition() != null ){\n s+= tb.getTermDefinition() +\";\";\n }\n\n }\n }\n if(s.length()>0){\n s= s.substring(0, s.length()-1) ;\n }\n tmpgwas.setTermDefinition(s);\n\n //study count\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByTraitid\",cmap);\n if(tg_bean1 != null ){\n tmpgwas.setGwasCount(tg_bean1.getGwasCount());\n }\n gwasAssociationList.add(tmpgwas) ;\n }\n }else if(tmpbean.getItemType() == 2){\n Map cmp = new HashMap();\n cmp.put(\"gid\",tmpbean.getItemId()) ;\n MapGeneBean mgb = (MapGeneBean) baseService.findObjectByObject(\"cn.big.gvk.dm.MapGene.selectMapGeneCount\",cmp);\n if(mgb != null ){\n Map t = new HashMap();\n t.put(\"gId\",mgb.getGid()) ;\n t.put(\"count\",\"count\");\n\n //trait count\n GwasAssociationView gwas = (GwasAssociationView) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectGwasViewByGeneInfo\",t);\n if(gwas != null){\n mgb.setTraitCount(gwas.getTraitCount());\n }\n\n //study count\n StudyBean study = (StudyBean) baseService.findObjectByObject(\"cn.big.gvk.dm.study.selectStudyByMapGeneId\",t);\n if(study != null ){\n mgb.setStudyCount(study.getStudyCount());\n }\n\n //publication count\n PublicationBean publication = (PublicationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.publication.selectPubByGeneId\",t);\n if (publication != null ){\n mgb.setPublicationCount(publication.getPublicationCount());\n }\n mapGeneBeanList.add(mgb) ;\n\n }\n\n }\n }\n }\n }\n\n StringBuffer sb = new StringBuffer();\n //generate hidden html table and then use tableExport.js export\n if(gwasAssociationList != null && gwasAssociationList.size()>0){\n for(GwasAssociationBean gwas : gwasAssociationList){\n sb.append(gwas.getTraitName()).append(\"\\t\").append(gwas.getTermDefinition()).append(\"\\t\").append(gwas.getTraitCount()).append(\"\\t\").append(gwas.getGwasCount()).append(\"\\n\");\n }\n }\n\n if(mapGeneBeanList != null && mapGeneBeanList.size()>0){\n for(MapGeneBean mapgene: mapGeneBeanList){\n sb.append(mapgene.getMapGeneId()).append(\"\\t\").append(mapgene.getMapGeneChrom()).append(\":\")\n .append(mapgene.getMapGeneStart()).append(\"-\").append(mapgene.getMapGeneEnd()).append(\"\\t\").append(mapgene.getTraitCount()).append(\"\\t\")\n .append(mapgene.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n\n\n }", "private static RecAnchorIndex getAnchorIndex(String szcolfields, boolean busestrand, boolean busesignal)\n {\n\tint nchromindex=0;\n int npositionindex=1;\n int nstrandindex=2;\n int nsignalindex=3;\n\n\tif (busestrand && busesignal)\n {\n\t if (szcolfields != null)\n {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t nchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t npositionindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t nstrandindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t nsignalindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t}\n else if (busestrand && !busesignal)\n {\n\t if (szcolfields != null)\n {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t nchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t npositionindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t nstrandindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t}\n else if (!busestrand && busesignal)\n {\n\t if (szcolfields != null)\n\t {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t nchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t npositionindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t nsignalindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t else //if (szcolfields == null)\n {\n\t nsignalindex = 2;\n\t }\n\t}\n else //both are off\n\t{\n\t if (szcolfields != null)\n\t {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t nchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t npositionindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t}\n\n\treturn new RecAnchorIndex(nchromindex, npositionindex, nstrandindex, nsignalindex);\n }", "@Test\n\tpublic void explicitANDTest() {\n\t\tString query = \"hello goodbye\";\n\t\tString query2 = \"hello goodbye hello\";\n\t\tString query3 = \"( hello ( goodbye | hello bye ) )\";\n\t\t\n\t\tString queryResults = \"hello & goodbye\";\n\t\tString query2Results = \"hello & goodbye & hello\";\n\t\tString query3Results = \"( hello & ( goodbye | hello & bye ) )\";\n\n\t\tassertEquals(queryResults, String.join(\" \", queryTest.addExplicitAND(query.split(\" \"))));\n\t\tassertEquals(query2Results, String.join(\" \", queryTest.addExplicitAND(query2.split(\" \"))));\n\t\tassertEquals(query3Results, String.join(\" \", queryTest.addExplicitAND(query3.split(\" \"))));\n\t}", "AndExp getRight();", "public static void main (String[] args) {\n EntityQuery query = new EntityQuery();\n Harvestable res = new OaiPmhResource();\n query.setFilter(\"test\", res);\n query.setAcl(\"diku\");\n query.setStartsWith(\"cf\",\"name\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"a\"));\n query.setQuery(\"(usedBy=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"x\"));\n\n query = new EntityQuery();\n query.setQuery(\"(usedBy=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"b\"));\n query.setQuery(\"usedBy=*library\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"c\"));\n query.setQuery(\"(=library\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"d\"));\n query.setQuery(\"usedBy=\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"e\"));\n query.setQuery(\"(usedBy!=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"f\"));\n query.setQuery(\"(usedBy==library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"g\"));\n query.setQuery(\"(usedBy===library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"h\"));\n }", "public static void caso12(){\n\n FilterManager fm= new FilterManager(\"resources/stopWordsList.txt\",\"resources/useCaseWeight.properties\");\n\t\tQualityAttributeBelongable qualityAttributeBelongable = new OntologyManager(\"file:resources/caso1.owl\",\"file:resources/caso1.repository\",fm);\n\t\tMap<QualityAttributeInterface,Double> map = qualityAttributeBelongable.getWordPertenence(\"pan\");\n\t\tif(map==null){\n\t\t\tSystem.out.println(\"El map es null\");\n\t\t}\n\t}", "private void findORF( int p, boolean check){\n \tString seq = this.sequentie1;\n \t\n\t if (check){\n\t seq =new StringBuilder(this.sequentie1).reverse().toString();\n\t }\n\t ArrayList<ORF> ORFS = new ArrayList<ORF>();\n\t for (int y=p; y+3<sequentie1.length();y+=3){\n\t \t if (seq.substring(y, y+3).equals(\"ATG\")){\n\t \tint end = findStopCodon(seq, y);\n\t \tif(end != -1){\n\t \t\tORFS.add(new ORF(seq.substring(y,end),y,end));\n\t \ty = end;\n\t \t}\n\t \t }\n\t }\n\t orflijst.add(ORFS);\n }", "private ArrayList<String> findChampions() {\n\t\tString searchContents = search.getText();\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (String c : CHAMPIONLIST) {\n\t\t\tif (c.toLowerCase().contains(searchContents.toLowerCase())) {\n\t\t\t\tresult.add(c);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "ANDDecomposition createANDDecomposition();", "@Test\n\tpublic void orGrepTest() throws Exception {\n\t\t// | for 'insane' and 'mistress'\n\t\tHashSet<String> grep1 = loadGrepResults(\"mistress\");\n\t\tHashSet<String> grepFound = loadGrepResults(\"insane\");\n\t\tgrepFound.addAll(grep1);\n\n\t\tCollection<Page> index = queryTest.query(\"mistress | insane\");\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\n\t\tassertEquals(indexFound, grepFound);\n\n\t}", "@Test\n public void test_witness_bidirectional() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(6, 6, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, 10);\n graph.addEdge(1, 2, edge++, 10, 10);\n graph.addEdge(2, 3, edge++, 20, 20);\n graph.addEdge(3, 4, edge++, 10, 10);\n graph.addEdge(1, 5, edge++, 10, 10);\n graph.addEdge(5, 3, edge++, 10, 10);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 30.0, 100);\n assertEquals(20, weight, 1.e-6);\n }", "Page<MLPSolution> findSolutions(Map<String, ? extends Object> queryParameters, boolean isOr, Pageable pageable);", "private void buildQueryFilterSite(TermsList termsList) {\n\t\tString attributeValue = \"\";\n\t\tString siteQuery = \"scope:(\";\n\n\t\tif (this.siteValues != null) {\n\t\t\tfor (int i = 0; i < siteValues.length; i++) {\n\t\t\t\tString site = siteValues[i];\n\t\t\t\tLTERSite lterSite = new LTERSite(site);\n\t\t\t\tif (lterSite.isValidSite()) {\n\t\t\t\t\tattributeValue = lterSite.getPackageId();\n\t\t\t\t\tString siteName = lterSite.getSiteName();\n\t\t\t\t\tif ((siteName != null) && (!siteName.equals(\"\"))) {\n\t\t\t\t\t\ttermsList.addTerm(siteName);\n\t\t\t\t\t}\n\t\t\t\t String plusSign = (i > 0) ? \"+\" : \"\";\n\t\t\t\t\tsiteQuery = String.format(\"%s%s%s\", siteQuery, plusSign, attributeValue);\n\t\t\t\t\tif ((i + 1) == siteValues.length) { // tack on the closing parenthesis\n\t\t\t\t\t\tsiteQuery = String.format(\"%s)\", siteQuery); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tupdateFQString(siteQuery);\n\t\t}\n\t}", "private double logicalAnd() {\n\t\tdouble q = p<=0.5?p:1-p;\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('t') + q * configMap.get('m') + p * configMap.get('a');\n\t}", "@Test\n public void testCombineRankZeroPageRankWeight() {\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(Arrays.asList(\"anteater\"),\n 100, 0.0);\n ImmutableList<Pair<Document, Double>> resultListCombined = ImmutableList.copyOf(resultIterator);\n\n Iterator<Pair<Document, Double>> resultIteratorTfIdf = invertedIndexManager.searchTfIdf(Arrays.asList(\"anteater\"), 100);\n ImmutableList<Pair<Document, Double>> resultListTfIdf = ImmutableList.copyOf(resultIteratorTfIdf);\n\n Assert.assertEquals(resultListTfIdf, resultListCombined);\n }", "@Test\n public void ANDSearch_CareQualityComissionAdmission() throws Exception {\n\n final Set<String> searchResults = newsLineSearch.search(TEST_FILE, \"Care Quality Commission admission\",\n SearchType.AND);\n\n assertThat(searchResults).hasSize(1).contains(allLines.get(1));\n }", "public void initPeriodsSearch() {\n\n\t\t//init fundamentalFreq\n\t\tcalculatefundamentalFreq();\n\n\t\t//set the first search area\n\t\tfinal double confidenceLevel = 5 / 100.;\n\t\tnextPeriodSearchingAreaEnd = (int) Math.floor( hzToPeriod( fundamentalFreq ) * ( 1 + confidenceLevel ) );\n\t}", "private static Query computeBooleanQueryNP(String textQuery){\n\t\tBooleanQuery query = new BooleanQuery();\n\n\t\tHmmDecoder mPosTagger = null;\n\t\tTokenizerFactory mTokenizerFactory = null;\n\t\tPhraseChunker pChunker = new PhraseChunker(mPosTagger,mTokenizerFactory);\n\t\tArrayList<String> pchuncker = new ArrayList<String>();\n\n\t\tpchuncker = pChunker.getCHunkNounPhrases(textQuery.toLowerCase());\n\n\t\tfor (int k = 0; k<= pchuncker.size()-1;k++ ){\n\t\t\tString wordInList = ((String) pchuncker.get(k));\n\t\t\twordInList = wordInList.toLowerCase().replaceAll(\"-\",\" \");\n\t\t\tString [] wordInListSplit = wordInList.split(\" \");\n\t\t\tfor (String word: wordInListSplit){\n\n\t\t\t\tquery.add(new TermQuery(new Term(\"content\", word)), Occur.SHOULD );\n\t\t\t}\n\n\t\t}\n\n\t\t/* String[] tQuery = textQuery.split(\" \");\n\t\t for(String s: tQuery )\n\t\t\t query.add(new TermQuery(new Term(\"text\", s)), Occur.SHOULD);*/\n\n\t\treturn query;\n\t}", "private void SearchCtes(){\n double d1=0.0;\n boolean elev=false;\n boolean c1=true;\n boolean c2=false;\n boolean c3=false;\n String A=\"\";\n String B=\"\";\n String C=\"\";\n int i=0;\n int j=0;\n while(this.Eq.charAt(i)!='=') {\n //j=i;\n if(this.Eq.charAt(i)=='+'||this.Eq.charAt(i)=='D'){\n i++;\n }\n if(this.Eq.charAt(i)=='^'){\n elev=true;\n i++;\n }\n if(this.Eq.charAt(i)=='2'&&elev) {//final do D^2\n if(A==\"\"){\n this.a=0.0;\n }else{\n this.a=Integer.parseInt(A);\n } \n elev=false; \n c1=false;\n c2=true;\n i++;\n }\n if(this.Eq.charAt(i)=='1'&&elev) {//final do D^1\n if(B==\"\"){\n this.b=0.0;\n }else{\n this.b=Integer.parseInt(B);\n } \n elev=false; \n c2=false;\n c3=true;\n i++;\n }\n if(c1&&!elev){\n A+=this.Eq.charAt(i);\n }\n if(c2&&!elev){\n B+=this.Eq.charAt(i);\n }\n if(c3&&!elev){\n C+=this.Eq.charAt(i);\n }\n i++;\n } \n if(C==\"\"){\n this.c=0.0;\n }else{\n this.c=Integer.parseInt(C);\n } \n }", "public HashMap<String, Double> search(String query) {\n // ===================================================\n // 1. Fetch all inverted lists corresponding to terms\n // in the query.\n // ===================================================\n String[] terms = query.split(\" \");\n HashMap<String, Integer> qf = new HashMap<String, Integer>();\n // Calculate term frequencies in the query\n for (String term : terms) {\n if (qf.containsKey(term))\n qf.put(term, qf.get(term) + 1);\n else\n qf.put(term, 1);\n }\n HashMap<String, Double> docScore = new HashMap<String, Double>();\n for (Entry<String, Integer> termEntry : qf.entrySet()) {\n String term = termEntry.getKey();\n int qfi = termEntry.getValue();\n\n // ===================================================\n // 2. Compute BM25 scores for documents in the lists.\n // Make a score list for documents in the inverted\n // lists. Assume that no relevance information is \n // available. For parameters, use k1=1.2, b=0.75, \n // k2=100.\n // ===================================================\n double k1 = 1.2;\n double b = 0.75;\n double k2 = 100;\n int ni = invIndex.get(term).size();\n\n\n for (Entry<String, IndexEntry> invListEntry : invIndex.get(term).entrySet()) {\n String docID = invListEntry.getKey();\n double bm25Score;\n if (docScore.containsKey(docID))\n bm25Score = docScore.get(docID);\n else\n bm25Score = 0;\n\n // length of the document\n int dl = docStat.get(docID);\n // frequency of the term in the document\n int fi = invListEntry.getValue().getTf();\n double K = k1 * ((1 - b) + b * ((double) dl / avdl));\n\n // ===================================================\n // 3. Accumulate scores for each term in a query\n // on the score list.\n // ===================================================\n bm25Score += Math.log((N - ni + 0.5) / (ni + 0.5))\n * (((k1 + 1) * fi * (k2 + 1) * qfi) / ((K + fi) * (k2 + qfi)));\n docScore.put(docID, bm25Score);\n }\n }\n\n return docScore;\n }", "@Test\n \tpublic void whereClauseForNodeRightAlignment() {\n \t\tnode23.addJoin(new RightAlignment(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "public /*TreeMap<String, Float>*/void getTopnTermsOverlapWithQuery() throws IOException, ParseException{\n\t\tString outputfile = \"./output/score/test3.txt\";\n\n\t\tFileOutputStream out = new FileOutputStream(outputfile);\n\t\tPrintStream ps = new PrintStream(out);\n\t\t/*-------------------------------------------------------------------------------*/\n\n\t\tTreeMap<String,Float> termsscoressorted = null;\n\t\tCollectionReader reader = new CollectionReader(indexDir); \n\t\tIndexReader ir = reader.getIndexReader();\t\t\n\n\t\tTopicsInMemory topics = new TopicsInMemory(\"data/CLEF-IP-2010/PAC_test/topics/PAC_topics-test2.xml\"/*omit-PAC-1094.xml\"*/);\n\t\tfor(Map.Entry<String, PatentDocument> topic : topics.getTopics().entrySet()){\n\t\t\tString qUcid = topic.getValue().getUcid();\n\t\t\tString queryid = topic.getKey();\n\t\t\tString queryName = topic.getKey() + \"_\" + topic.getValue().getUcid();\n\t\t\tString queryfile = topic.getKey() + \"_\" + topic.getValue().getUcid() + \".xml\";\n\n\t\t\t/*System.out.println(\"=========================================\");\n\t\t\tSystem.out.println(queryName);\n\t\t\tSystem.out.println(\"=========================================\");*/\n\t\t\t/*int docid = reader.getDocId(\"UN-EP-0663270\", PatentDocument.FileName);\n\t\t\tir.getTermVector(docid, field) getTermVectors(b);*/\n\n\t\t\tEvaluateResults er = new EvaluateResults();\n\t\t\tArrayList<String> tps = er.evaluatePatents(queryid, \"TP\");\n\t\t\tArrayList<String> fps = er.evaluatePatents(queryid, \"FP\");\n\t\t\tHashMap<String, Float> /*TFreqs*/ termsscores = new HashMap<>();\n\n\n\t\t\t/*--------------------------------- Query Words -------------------------------*/\n\t\t\t//\t\t\tHashMap<String, Integer> query_termsfreqspair = reader.gettermfreqpair(qUcid, PatentDocument.Description);\n\t\t\tHashSet<String> query_terms = reader.getDocTerms(qUcid, PatentDocument.Description);\n\t\t\t//\t\t\tSystem.out.println(query_termsfreqspair.size() +\"\\t\"+ query_termsfreqspair);\n//\t\t\tSystem.out.println(query_terms.size() + \"\\t\" + query_terms);\n\t\t\t/*-----------------------------------------------------------------------------*/\t\t\t\n\n\n\t\t\t//\t\t\tSystem.out.println(\"-----TPs----\");\n\t\t\tfor (String tp : tps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(tp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsTP = reader.gettermfreqpairAllsecs(\"UN-\" + tp);\n\n\t\t\t\tfor(Entry<String, Integer> tfTP:termsfreqsTP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(tfTP.getKey())){\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), termsscores.get(tfTP.getKey()) + (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\t\t\t\t\t\tfloat test = (float)t.getValue()/tps.size();\n\t\t\t\t\t\t//\t\t\t\t\t\tSystem.out.println(test);\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\t\t\t\t\t\n\t\t\t}\n\n\t\t\t/*System.out.println();\n\t\t\tSystem.out.println(\"-----FNs----\");*/\n\t\t\tfor (String fp : fps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(fp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsFP = reader.gettermfreqpairAllsecs(\"UN-\" + fp);\n\n\t\t\t\tfor(Entry<String, Integer> t:termsfreqsFP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(t.getKey())){\n\t\t\t\t\t\ttermsscores.put(t.getKey(), termsscores.get(t.getKey()) - (float)t.getValue()/fps.size());\n\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\ttermsscores.put(t.getKey(), -(float)t.getValue()/fps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(TFreqs.size() + \" \" + TFreqs);\n\t\t\t}\n\t\t\t//\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\n\t\t\tValueComparator bvc = new ValueComparator(termsscores);\n\t\t\ttermsscoressorted = new TreeMap<String,Float>(bvc);\t\t\t\n\t\t\ttermsscoressorted.putAll(termsscores);\n\t\t\tSystem.out.println(queryid + \"\\t\"+ termsscoressorted.size() + \"\\t\" + termsscoressorted/*.keySet()*/);\n\t\t\tint overlap = 0;\n\t\t\tint i = 0;\n\t\t\tfor(Entry<String, Float> scoresorted:termsscoressorted.entrySet()){\n\t\t\t\ti++;\n\t\t\t\tif(i<=100){\n\t\t\t\t\tif(query_terms.contains(scoresorted.getKey())){\n\t\t\t\t\t\toverlap++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tSystem.out.println(queryName + \"\\t\"+overlap);\n//\t\t\tps.println(queryName + \"\\t\"+overlap);\n\t\t}\n\t}", "public void checkNLFOJoin() {\n\n String extractedVar = \"\";\n String currQuery = \"\";\n List<Integer> sourceQueries = null;\n List<String> tmpTP = null;\n List<String> extractedVals = null;\n\n for (List<String> key : mapCTPtoQuerySrc.keySet()) {\n\n sourceQueries = mapCTPtoQuerySrc.get(key);\n\n for (int i = 0; i < sourceQueries.size(); i++) {\n\n currQuery = queries.get(sourceQueries.get(i));\n\n //Buuuuuuuuuuuuuug\n if (currQuery.contains(\"mass\")) {\n continue;\n }\n\n if (currQuery.contains(\"filter\") || currQuery.contains(\"FILTER\")) {\n\n extractedVals = myBasUtils.getFILTERvals(currQuery);\n extractedVar = myBasUtils.getFILTERvar(currQuery);\n\n if (extractedVals.size() >= 1) {\n\n if (key.get(0).equalsIgnoreCase(extractedVar) || key.get(2).equalsIgnoreCase(extractedVar)) {\n\n tmpTP = myDedUtils.getCleanTP(key);\n tmpTP.add(extractedVar);\n myBasUtils.insertToMap4(mapDTPtoAnsInverseMap, tmpTP, extractedVals);\n }\n }\n\n }\n\n }\n }\n\n }", "protected Query analyzeMultiBoolean(\n String field, TokenStream stream, BooleanClause.Occur operator) throws IOException {\n BooleanQuery.Builder q = newBooleanQuery();\n List<TermAndBoost> currentQuery = new ArrayList<>();\n\n TermToBytesRefAttribute termAtt = stream.getAttribute(TermToBytesRefAttribute.class);\n PositionIncrementAttribute posIncrAtt = stream.getAttribute(PositionIncrementAttribute.class);\n BoostAttribute boostAtt = stream.addAttribute(BoostAttribute.class);\n\n stream.reset();\n while (stream.incrementToken()) {\n if (posIncrAtt.getPositionIncrement() != 0) {\n add(field, q, currentQuery, operator);\n currentQuery.clear();\n }\n currentQuery.add(new TermAndBoost(termAtt.getBytesRef(), boostAtt.getBoost()));\n }\n add(field, q, currentQuery, operator);\n\n return q.build();\n }", "@Override\n public final ArrayList<Spell> getSpells(final float amp) {\n float newamp = amp;\n if (TerrainMap.getInstance().getTerrain(x, y) == TerrainTypes.Land) {\n newamp += SpellConstants.KNIGHTLANDBONUS;\n }\n return super.getSpells(newamp);\n }", "public String getAndOr();", "private static void methodThree(Data data) {\n\t\tboolean notFound = true;\n\t\tMap<String, Integer> timesToFreq = null;\n\t\tString phrase = null;\n\t\twhile (notFound) {\n\t\t\tphrase = getPhraseInput();\n\t\t\ttimesToFreq = data.getMentionsPerTimeStamp(phrase);\n\t\t\tif (timesToFreq != null && phrase != null) {\n\t\t\t\tnotFound = false;\n\t\t\t}\n\t\t}\n\t\tif (timesToFreq.isEmpty()) System.out.println(\"No results found\");\n\t\telse {\n\t\t\tfor (Map.Entry<String, Integer> e : timesToFreq.entrySet()) {\n\t\t\t\tSystem.out.println(e.getKey() + \":00 \" + e.getValue() + \" times\");\n\t\t\t}\n\t\t}\n\t\taddToLog(\"user searched for \" + phrase);\n\t}", "@Test\n\tpublic void integrationTest2() throws Exception {\n\t\tHashSet<String> mistress = loadGrepResults(\"mistress\");\n\t\tHashSet<String> undocumented = loadGrepResults(\"undocumented\");\n\t\tHashSet<String> insane = loadGrepResults(\"insane\");\n\t\tHashSet<String> crazy = loadGrepResults(\"crazy\");\n\t\tHashSet<String> forced = loadGrepResults(\"!i+am+forced\");\n\t\t\n\t\tHashSet<String> grepFound = new HashSet<String>(mistress);\n\t\tgrepFound.retainAll(undocumented);\n\t\tHashSet<String> temp = new HashSet<String>(crazy);\n\t\ttemp.retainAll(forced);\n\t\tgrepFound.addAll(temp);\n\t\tgrepFound.addAll(insane);\n\t\t\n\t\tCollection<Page> index = queryTest.query(\"insane | crazy & !\\\"I am forced\\\" | mistress & undocumented\");\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\tassertEquals(indexFound, grepFound);\n\t}", "private Expr or() { // This uses the same recursive matching structure as other binary operators.\n Expr expr = and(); // OR takes precedence over AND.\n while(match(OR)) {\n Token operator = previous();\n Expr right = and();\n expr = new Expr.Logical(expr, operator, right);\n }\n return expr;\n }", "public static ArrayList<Result> search(HashMap<String,ArrayList<String>> map) {\n result = new ArrayList<>();\n finalResult = new ArrayList<>();\n \n String input = map.get(\"search\").get(0);\n searchByName(input);\n \n ArrayList<String> type = map.get(\"type\");\n if(type.isEmpty());\n else for(String t:type){\n searchByType(t);\n result = finalResult;\n }\n \n //<editor-fold defaultstate=\"collapsed\" desc=\"FILTERS\">\n ArrayList<ArrayList<String>> filters = new ArrayList<>();\n filters.add(map.get(\"brand\"));\n filters.add(map.get(\"price\"));\n filters.add(map.get(\"os\"));\n filters.add(map.get(\"memory\"));\n filters.add(map.get(\"storage\"));\n filters.add(map.get(\"numberOfSimSlots\"));\n filters.add(map.get(\"f_camera\"));\n filters.add(map.get(\"b_camera\"));\n /**\n * ArrayList of filters from Mobile Phone\n * 0 = Brand | brand\n * 1 = Price | price\n * 2 = OS | os\n * 3 = Memory | memory\n * 4 = Storage | storage\n * 5 = SIM slots | numberOfSimSlots\n * 6 = Camera front | f_camera\n * 7 = Camera back | b_camera\n */\n int filterMode = 0;\n while(filterMode<filters.size()){\n// for(Result r:result){\n// System.out.println(r.getMP().getFullName());\n// }\n// System.out.println(\"filtermode: \"+filterMode);\n finalResult = new ArrayList<>();\n if(filters.get(filterMode).isEmpty()||filters.get(filterMode).get(0).equals(\"\")){\n filterMode++;\n continue;\n }\n filter(filterMode,filters.get(filterMode++));\n result = finalResult;\n }\n //</editor-fold>\n return result;\n }", "public static void main(String[] args) throws IOException {\n\t\tRange<Double> vs30Range = Range.closed(800d, 1000d);\n\t\tRange<Double> willsRange = Range.closed(600d, 1200d);\n\t\tString outPrefix = \"cs_vs30_sites_800\";\n\t\t\n\t\tFile outputDir = new File(\"/home/kevin/CyberShake/sites/site_search\");\n\t\t\n\t\t// study from which we are selecting sites\n\t\tCyberShakeStudy siteStudy = CyberShakeStudy.STUDY_15_4;\n\t\t\n\t\tList<CyberShakeSiteRun> sites = CyberShakeSiteBuilder.buildSites(siteStudy, Vs30_Source.Simulation, siteStudy.runFetcher().fetch());\n\t\tList<CyberShakeSiteRun> matches = new ArrayList<>();\n\t\tList<String> bbStations = new ArrayList<>();\n\t\t\n\t\tWillsMap2015 wills = new WillsMap2015();\n\t\t\n\t\tfor (CyberShakeSiteRun site : sites) {\n\t\t\tdouble vs30 = site.getParameter(Double.class, Vs30_Param.NAME).getValue();\n\t\t\tdouble willsVal = wills.getValue(site.getLocation());\n\t\t\tif (vs30Range.contains(vs30) && (willsRange == null || willsRange.contains(willsVal))) {\n\t\t\t\tSystem.out.println(\"Site: \"+site.getName()+\"\\tVs30: \"+vs30+\"\\tWills: \"+willsVal);\n\t\t\t\tmatches.add(site);\n\t\t\t\tif (site.getCS_Site().type_id == CybershakeSite.TYPE_BROADBAND_STATION)\n\t\t\t\t\tbbStations.add(site.getName());\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Found \"+matches.size()+\" matching sites\");\n\t\tSystem.out.println(\"BroadBand stations: \"+Joiner.on(\",\").join(bbStations));\n\t\t\n\t\tsiteStudy.getDB().destroy();\n\t\t\n\t\tFile outputFile = new File(outputDir, outPrefix+\".kml\");\n\t\tSystem.out.println(\"Writing KML to \"+outputFile.getAbsolutePath());\n\t\t\n\t\tFile csvOutFile = new File(outputDir, outPrefix+\"csv\");\n\t\tCSVFile<String> csv = new CSVFile<>(true);\n\t\tcsv.addLine(\"Name\", \"CS Vs30 (m/s)\", \"Wills Vs30 (m/s)\", \"Z1.0 (m)\", \"Z2.5 (km)\", \"Latitude\", \"Longitude\");\n\t\t\n\t\tFileWriter fw = new FileWriter(outputFile);\n\t\t\n\t\tfw.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" + \"\\n\");\n\t\tfw.write(\"<kml xmlns=\\\"http://earth.google.com/kml/2.2\\\">\" + \"\\n\");\n\t\tfw.write(\" <Folder>\" + \"\\n\");\n\t\tfw.write(\" <name>CyberShake sites with Vs30=[\"+vs30Range.lowerEndpoint().floatValue()+\" \"\n\t\t\t\t+vs30Range.upperEndpoint().floatValue()+\"]</name>\" + \"\\n\");\n//\t\tfw.write(\" <description>Open Seismic Hazard Analysis Evenly Gridded Region</description>\" + \"\\n\");\n\t\t\n\t\tfor (Site site : matches) {\n\t\t\tLocation loc = site.getLocation();\n\t\t\t\n\t\t\tfw.write(\" <Placemark>\" + \"\\n\");\n\t\t\tfw.write(\" <name>\"+site.getName()+\"</name>\" + \"\\n\");\n\t\t\tfw.write(\" <Point id=\\\"\"+site.getName()+\"\\\">\" + \"\\n\");\n\t\t\tfw.write(\" <coordinates>\" + loc.getLongitude() + \",\" + loc.getLatitude() + \",\" + (-loc.getDepth()) + \"</coordinates>\" + \"\\n\");\n//\t\t\tfw.write(\" <latitude>\" + loc.getLatitude() + \"</latitude>\" + \"\\n\");\n//\t\t\tfw.write(\" <altitude>\" + (-loc.getDepth()) + \"</altitude>\" + \"\\n\");\n\t\t\tfw.write(\" </Point>\" + \"\\n\");\n\t\t\t\n\t\t\tfw.write(\" </Placemark>\" + \"\\n\");\n\n\t\t\tdouble vs30 = site.getParameter(Double.class, Vs30_Param.NAME).getValue();\n\t\t\tdouble willsVs30 = wills.getValue(loc);\n\t\t\tdouble z10 = site.getParameter(Double.class, DepthTo1pt0kmPerSecParam.NAME).getValue();\n\t\t\tdouble z25 = site.getParameter(Double.class, DepthTo2pt5kmPerSecParam.NAME).getValue();\n\t\t\t\n\t\t\tcsv.addLine(site.getName(), (float)vs30+\"\", (float)willsVs30+\"\", (float)z10+\"\", (float)z25+\"\",\n\t\t\t\t\t(float)loc.getLatitude()+\"\", (float)loc.getLongitude()+\"\");\n\t\t}\n\t\t\n\t\tcsv.writeToFile(csvOutFile);\n\t\t\n\t\tfw.write(\" </Folder>\" + \"\\n\");\n\t\tfw.write(\"</kml>\" + \"\\n\");\n\t\tfw.flush();\n\t\tfw.close();\n\t}", "@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 }", "public static void findByAND_OR() {\n\t\tFindIterable<Document> findIterable = collection.find(\r\n\t\t and(eq(\"status\", \"A\"),\r\n\t\t or(lt(\"qty\", 30), regex(\"item\", \"^p\")))\r\n\t\t);\r\n\t\tprint(findIterable);\r\n\t}", "public void and (int dirOp1, int dirOp2, int dirRes) {\n //traduce casos de direccionamiento indirecto\n dirOp1 = traduceDirIndirecto(dirOp1);\n dirOp2 = traduceDirIndirecto(dirOp2);\n if (ManejadorMemoria.isConstante(dirOp1)){ // OPERANDO 1 CTE\n String valor1 = this.directorioProcedimientos.getConstantes().get(dirOp1).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirOp2)){ // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes,auxOperacion(dirOp1,dirOp2,valor1,valor2,Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)){ // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes,auxOperacion(dirOp1,dirOp2,valor1,valor2,Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 =this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { //RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n }\n } else if (ManejadorMemoria.isGlobal(dirOp1)){ // OPERANDO 1 GLOBAL\n String valor1 = this.registroGlobal.getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)){ // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)){ // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n }\n } else { // OPERANDO 1 LOCAL\n String valor1 = this.pilaRegistros.peek().getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)){ // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES 2 LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)){ // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else { //OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n }\n }\n }", "public void execFuzzySearchTraitFunc(){\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(\"=============search param\"+this.searchParam );\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n map.put(\"species\",this.searchSpecies);\n System.out.println(\"species=\"+this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\")==false && this.searchTrait.length()>0){\n\n\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null && this.pvalue.equals(\"null\")==false&& this.pvalue.length()>0){\n\n\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n\n gwasAssociationList =(List<GwasAssociationBean>) baseService.findResultList(\"cn.big.gvk.dm.GwasAssociation.selecTraitByFuzzySearch\",map);\n\n if(gwasAssociationList != null && gwasAssociationList.size()>0){\n\n for(GwasAssociationBean gwas: gwasAssociationList){\n\n //trait count\n Map cmap = new HashMap();\n cmap.put(\"traitId\",gwas.getTraitId()) ;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n\n }\n GwasAssociationBean tg_bean = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByTraitId\",cmap);\n if(tg_bean != null ){\n gwas.setTraitCount(tg_bean.getGwasCount());\n }\n\n List<TermInformationBean> tilist = (List<TermInformationBean>)baseService.findResultList(\"cn.big.gvk.dm.Term.selectTermDefinition\",gwas.getTraitId());\n String s=\"\";\n if(tilist != null && tilist.size()>0 ){\n for(TermInformationBean tb:tilist ){\n if(tb!= null && tb.getTermDefinition() != null ){\n s+= tb.getTermDefinition() +\";\";\n }\n\n }\n }\n if(s.length()>0){\n s= s.substring(0, s.length()-1) ;\n }\n gwas.setTermDefinition(s);\n\n //study count\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByTraitid\",cmap);\n if(tg_bean1 != null ){\n gwas.setGwasCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n }\n\n StringBuffer sb = new StringBuffer();\n if(this.gwasAssociationList != null && this.gwasAssociationList.size()>0){\n for(GwasAssociationBean gwas: gwasAssociationList){\n sb.append(gwas.getTraitName()).append(\"\\t\").append(gwas.getTermDefinition()).append(\"\\t\")\n .append(gwas.getTraitCount()).append(\"\\t\").append(gwas.getGwasCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n\n }", "@Override\n protected QueryProcessor computeResult(ResultComputingContext<? extends TermsIndexingEquipment> context) {\n final TermWeight idf = context.preliminaryResult(CalculatingInvertedTermFrequency.getInstance());\n final TermDocumentWeight tf = context.preliminaryResult(context.equipment().termFrequencyCalculation());\n //for obtaining set of terms in each document.\n final EachDocumentTermsExtraction documentsTerms = context.preliminaryResult(ExtractingEachDocumentTerms.getInstance());\n //for obtaining document length\n final Map<Document, TermsOccurences> termsOccurences = context.preliminaryResult(CountingTermsOccurencesInEachDocument.getInstance());\n final double averageDocLength = context.preliminaryResult(ComputingAverageDocumentLength.getInstance());\n\n QueryProcessor res = new QueryProcessor() {\n @Override\n public DocumentRanker rankForQuery(final Collection<String> query) {\n return new DocumentRanker() {\n @Override\n public double score(Document document) {\n /*\n * BM25 score is calculated here\n */\n\n //obtaining the set of terms in the document\n Set<String> allDocTerms = documentsTerms.termsExtractedFromDocument(document).allTerms();\n\n //keeping only the query terms that are in the document\n Collection<String> relevantTerms = new LinkedHashSet<>(query);\n relevantTerms.retainAll(allDocTerms);\n\n //compute score using a sum formula on each query term\n int docLength = termsOccurences.get(document).totalNumberOfOccurences();\n double score = 0.0;\n for (String term : relevantTerms) {\n double termIDF = idf.weight(term);\n double termTF = tf.weight(term, document);\n\n score += termIDF * (termTF * (k1 + 1)) / (termTF + k1 * (1 - b + b * (docLength / averageDocLength)));\n }\n\n return score;\n }\n };\n\n }\n };\n\n logger.log(Level.INFO, \"Just created a BM25 query processor with parameters : \" + \"k1={0}, b={1}\", new Object[]{k1, b});\n\n return res;\n }", "static QueryVariant getTermsQuery(Map<String, ?> terms, boolean mustMatchAll) {\n\t\tBoolQuery.Builder fb = QueryBuilders.bool();\n\t\tint addedTerms = 0;\n\t\tboolean noop = true;\n\t\tQueryVariant bfb = null;\n\n\t\tfor (Map.Entry<String, ?> term : terms.entrySet()) {\n\t\t\tObject val = term.getValue();\n\t\t\tif (!StringUtils.isBlank(term.getKey()) && val != null && Utils.isBasicType(val.getClass())) {\n\t\t\t\tString stringValue = val.toString();\n\t\t\t\tif (StringUtils.isBlank(stringValue)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tMatcher matcher = Pattern.compile(\".*(<|>|<=|>=)$\").matcher(term.getKey().trim());\n\t\t\t\tif (matcher.matches()) {\n\t\t\t\t\tbfb = range(matcher.group(1), term.getKey(), stringValue);\n\t\t\t\t} else {\n\t\t\t\t\tif (nestedMode()) {\n\t\t\t\t\t\tbfb = (QueryVariant) term(new org.apache.lucene.search.\n\t\t\t\t\t\t\t\tTermQuery(new Term(term.getKey(), stringValue))).build();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbfb = QueryBuilders.term().field(term.getKey()).value(v -> v.stringValue(stringValue)).build();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (mustMatchAll) {\n\t\t\t\t\tfb.must(bfb._toQuery());\n\t\t\t\t} else {\n\t\t\t\t\tfb.should(bfb._toQuery());\n\t\t\t\t}\n\t\t\t\taddedTerms++;\n\t\t\t\tnoop = false;\n\t\t\t}\n\t\t}\n\t\tif (addedTerms == 1 && bfb != null) {\n\t\t\treturn bfb;\n\t\t}\n\t\treturn noop ? null : fb.build();\n\t}", "private static String PubmedQueryToLucene(String PubmedQuery) {\r\n String luceneQuery = \"\";\r\n //remove hasabstract components\r\n PubmedQuery = PubmedQuery.replaceAll(\"(NOT|AND|OR) hasabstract\\\\[text\\\\]\", \"\");\r\n PubmedQuery = PubmedQuery.replaceAll(\"hasabstract\\\\[text\\\\] (NOT|AND|OR)\", \"\");\r\n PubmedQuery = PubmedQuery.replaceAll(\"hasabstract\\\\[text\\\\]\", \"\");\r\n PubmedQuery = PubmedQuery.replaceAll(\"(NOT|AND|OR) hasabstract\", \"\");\r\n PubmedQuery = PubmedQuery.replaceAll(\"hasabstract (NOT|AND|OR)\", \"\");\r\n PubmedQuery = PubmedQuery.replaceAll(\"hasabstract\", \"\");\r\n\r\n //replace date component\r\n String dateRangeRestriction = \"\";\r\n // e.g. (\\\"0001/01/01\\\"[PDAT] : \\\"2013/03/14\\\"[PDAT])\r\n String dateRange = \"\\\\(\\\"(\\\\d+/\\\\d+/\\\\d+)\\\"\\\\[PDAT\\\\]\\\\s*:\\\\s*\\\"(\\\\d+/\\\\d+/\\\\d+)\\\"\\\\[PDAT\\\\]\\\\)\";\r\n Pattern dateRangePattern = Pattern.compile(dateRange);\r\n Matcher matcher = dateRangePattern.matcher(PubmedQuery);\r\n if(matcher.find()){\r\n String startDate = matcher.group(1);\r\n String endDate = matcher.group(2);\r\n// System.out.println(\" > \" + startDate + \" \" + endDate );\r\n dateRangeRestriction = dateRangeRestriction(startDate, endDate);\r\n PubmedQuery = PubmedQuery.replaceAll(dateRange, \"CustomDateRangeRestriction\");\r\n }\r\n\r\n \r\n// System.out.println(\">>>\" + PubmedQuery );\r\n //Special Case, when query is just a number, consider it as a PMID\r\n // TO DO : add extra cases for more than one PMIDs too \r\n if(PubmedQuery.trim().matches(\"\\\\d+\")){\r\n luceneQuery = \"PMID:\" + PubmedQuery.trim();\r\n } else { //General case of query, not just a number \r\n ArrayList <String> parts = new <String> ArrayList();\r\n //Find parts [between parentheses]\r\n if(PubmedQuery.contains(\"(\") & PubmedQuery.contains(\")\"))//parentheses in the string\r\n {\r\n String tmpStr = \"\";\r\n String indexField =\"\";\r\n boolean insideIndexField = false;\r\n\r\n for(int i = 0; i < PubmedQuery.length() ; i++ ){\r\n if(PubmedQuery.charAt(i) == '(' | PubmedQuery.charAt(i) == ')') { // new part start\r\n tmpStr = tmpStr.trim();\r\n if(!tmpStr.equals(\"\")){\r\n parts.add(handlePhrases(tmpStr));\r\n tmpStr = \"\";\r\n }\r\n parts.add(\" \" + PubmedQuery.charAt(i) + \" \");\r\n } else if(PubmedQuery.charAt(i) == '[' & tmpStr.trim().equals(\"\")) { // index field opening a part, refers to previus part (i.e. ( ... ...)[...] case)\r\n //handle index field here because the previus part will be not available to handlePhrases\r\n insideIndexField = true;\r\n } else if(insideIndexField) { \r\n if(PubmedQuery.charAt(i) == ']'){// end of index field (opening a part)\r\n tmpStr = tmpStr.trim();\r\n if( !tmpStr.equals(\"\")){ // add this index field to previus element\r\n String luceneField = supportedIndexFields.get(tmpStr);\r\n if(luceneField != null){ // field supported\r\n boolean previusPartFound = false;\r\n boolean previusIsParenthesis = false;\r\n int j = parts.size()-1;\r\n while(j >= 0 & !previusPartFound){ \r\n String prevPart = parts.get(j).trim();\r\n if(prevPart.equals(\")\")){\r\n previusIsParenthesis = true;\r\n } else if(prevPart.equals(\"(\") & previusIsParenthesis){ //beginig of previus paretheses reached\r\n String prevClause = \"\";\r\n for(int k = parts.size()-1; k >= j ; k--){\r\n prevClause = parts.get(k) + prevClause;\r\n parts.remove(k);\r\n }\r\n parts.add(luceneField + \":\" + prevClause);\r\n previusPartFound = true;\r\n } else if(!previusIsParenthesis){ // not parentheses, it's a single term\r\n parts.remove(j);// remove part without index field\r\n parts.add( luceneField + \":\" + prevPart);// add again with index field\r\n previusPartFound = true;\r\n }\r\n j--;\r\n }\r\n }\r\n tmpStr = \"\";\r\n }\r\n insideIndexField = false;\r\n } else {\r\n tmpStr += PubmedQuery.charAt(i);\r\n }\r\n } else { // continue existing part\r\n tmpStr += PubmedQuery.charAt(i);\r\n }\r\n }\r\n tmpStr = tmpStr.trim();\r\n if(!tmpStr.equals(\"\")){\r\n parts.add(handlePhrases(tmpStr));\r\n }\r\n } else { // no paretheses, do further handling\r\n luceneQuery = handlePhrases(PubmedQuery); \r\n }\r\n\r\n //handle boolean operators\r\n boolean fisrtPhrase = true;\r\n for(int i = 0 ; i < parts.size() ; i ++){\r\n String currentPart = parts.get(i);\r\n if(!currentPart.startsWith(\" OR \") & !currentPart.startsWith(\" -\") & !currentPart.startsWith(\" +\") & !currentPart.equals(\" ) \")){\r\n if(fisrtPhrase){\r\n luceneQuery += \" +\";\r\n fisrtPhrase = false;\r\n } else {\r\n if(!parts.get(i-1).endsWith(\" OR \") & !parts.get(i-1).endsWith(\" -\") & !parts.get(i-1).endsWith(\" +\")){\r\n luceneQuery += \" +\";\r\n }\r\n } \r\n } // add default operator + when required (no OR or - is present for that term)\r\n luceneQuery += parts.get(i);\r\n }\r\n }\r\n // replace \"CustomDateRangeRestriction\" with real restriction\r\n// System.out.println(\" *>>>\" + luceneQuery );\r\n if(luceneQuery.contains(\"CustomDateRangeRestriction\")){\r\n luceneQuery = luceneQuery.replaceAll(\"CustomDateRangeRestriction\", dateRangeRestriction);\r\n }\r\n // replace \" + (\" with \" +(\"\r\n if(luceneQuery.contains(\" + (\")){\r\n luceneQuery = luceneQuery.replaceAll(\" \\\\+ \\\\(\", \" +(\");\r\n }\r\n // replace \" - (\" with \" -(\"\r\n if(luceneQuery.contains(\" - (\")){\r\n luceneQuery = luceneQuery.replaceAll(\" \\\\- \\\\(\", \" -(\");\r\n } \r\n// System.out.println(\" *>>>\" + luceneQuery );\r\n\r\n return luceneQuery;\r\n }", "public static Boolean getAppositivePrs(PairInstance inst) {\n if (inst.getAnaphor().getSentId()!=inst.getAntecedent().getSentId()) \n return false;\n\n// exclude pairs where anaphor is an NE -- this might be a bad idea though..\n if (inst.getAnaphor().isEnamex()) \n return false;\n\n\n if (inst.getAntecedent().isEnamex() &&\n inst.getAnaphor().isEnamex()) {\n\n// exclude pairs of NE that have different type\n\n if (!(inst.getAntecedent().getEnamexType().equals(\n inst.getAnaphor().getEnamexType())))\n return false;\n\n// exclude pairs of LOC-ne\n if (inst.getAntecedent().getEnamexType().toLowerCase().startsWith(\"gpe\"))\n return false;\n if (inst.getAntecedent().getEnamexType().toLowerCase().startsWith(\"loc\"))\n return false;\n }\n\n// should have not-null maxnp-trees (otherwise -- problematic mentions)\n\nTree sentenceTree=inst.getAnaphor().getSentenceTree();\nTree AnaTree=inst.getAnaphor().getMaxNPParseTree();\nTree AnteTree=inst.getAntecedent().getMaxNPParseTree();\nif (sentenceTree==null) return false;\nif (AnaTree==null) return false;\nif (AnteTree==null) return false;\n\n\n// the structure should be ( * (,) (ANA)) or ( * (,) (ANTE)) -- depends on the ordering, annotation, mention extraction etc\n\n if (AnteTree.parent(sentenceTree)==AnaTree) {\n Tree[] chlds=AnaTree.children();\n Boolean lastcomma=false;\n for (int i=0; i<chlds.length && chlds[i]!=AnteTree; i++) {\n lastcomma=false;\n if (chlds[i].value().equalsIgnoreCase(\",\")) lastcomma=true;\n }\n return lastcomma;\n }\n if (AnaTree.parent(sentenceTree)==AnteTree) {\n\n Tree[] chlds=AnteTree.children();\n Boolean lastcomma=false;\n for (int i=0; i<chlds.length && chlds[i]!=AnaTree; i++) {\n lastcomma=false;\n if (chlds[i].value().equalsIgnoreCase(\",\")) lastcomma=true;\n }\n return lastcomma;\n\n }\n\n return false;\n\n }", "@Test\n \tpublic void whereClauseForNodeRightOverlap() {\n \t\tnode23.addJoin(new RightOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\"),\n \t\t\t\tjoin(\">=\", \"_node42.right\", \"_node23.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.left\", \"_node42.left\")\n \t\t);\n \t}", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "@Test\n void testAndFilter() {\n Query q = newQueryFromEncoded(\"?query=trump\" +\n \"&model.type=all\" +\n \"&model.defaultIndex=text\" +\n \"&filter=%2B%28filterattribute%3Afrontpage_US_en-US%29\");\n assertEquals(\"AND text:trump |filterattribute:frontpage_US_en-US\",\n q.getModel().getQueryTree().toString());\n }", "private ArrayList<WordDocument> customDijkstrasTwoStack(String[] input){\n Stack<String> signs = new Stack<String>();\n Stack<ArrayList<WordDocument>> values = new Stack<ArrayList<WordDocument>>();\n String tempWord0 = null;\n String tempWord1 = null;\n\n for(int i = 0; i < input.length; i++) {\n String t = input[i];\n\n if (t.equals(\"(\") || t.equals(\"\")) ;\n else if (isSignOperator(t)) {\n signs.push(t);\n }else if (t.equals(\")\")) {\n ArrayList<WordDocument> value = new ArrayList<WordDocument>();\n String sign = signs.pop();\n String subQuery = tempWord0 + \" \" + sign + \" \" + tempWord1;\n\n if(tempWord0 != null && tempWord1 != null && cache.isCached(subQuery)) {\n value = cache.getCachedResult(subQuery);\n\n tempWord0 = null;\n tempWord1 = null;\n }else{\n ArrayList<WordDocument> documentsOfWord0;\n ArrayList<WordDocument> documentsOfWord1;\n\n if(tempWord0 != null && tempWord1 != null){\n documentsOfWord0 = getDocumentsWhereWordExists(tempWord0);\n documentsOfWord1 = getDocumentsWhereWordExists(tempWord1);\n }else{\n documentsOfWord1 = values.pop();\n documentsOfWord0 = values.pop();\n }\n\n if (sign.equals(\"+\")) {\n value = intersection(documentsOfWord0, documentsOfWord1);\n } else if (sign.equals(\"-\"))\n value = difference(documentsOfWord0, documentsOfWord1);\n else if (sign.equals(\"|\"))\n value = union(documentsOfWord0, documentsOfWord1);\n\n\n if(tempWord0 != null && tempWord1 != null)\n cache.addToCache(subQuery, value);\n\n tempWord0 = null;\n tempWord1 = null;\n }\n\n values.push(value);\n }else if(t.toLowerCase().equals(\"orderby\")){\n break;\n }else{\n if(tempWord0 == null)\n tempWord0 = t;\n else\n tempWord1 = t;\n }\n }\n\n return values.pop();\n }", "public static void main(String args[])\n {\n // Let the given dictionary be following\n String dictionary[] = {\"hit\", \"hits\", \"kilts\", \"pEg\",\"peN\",\"pentAgon\",\"slit\",\"slits\",\"sTilts\"};\n\n\n\n char boggle[][] = {{'P','W','Y','R'},\n {'E','N','T','H'},\n {'G','S','I','Q'},\n {'O','L','S','A'}\n };\n\n String[] val=findWords(boggle,dictionary);\n\n System.out.println(Arrays.toString(val));\n\n\n }", "boolean filter(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);", "public void strafeRightEnc()\r\n\t{\r\n//\t\tdrive.setPos(0, 0, Config.Auto.encStrafeDistance, Config.Auto.encStrafeDistance);\r\n//\t\tif(Math.abs(drive.getFrontEncDist() - Config.Auto.encStrafeDistance) < Config.Auto.encTolerance && Math.abs(drive.getBackEncDist() - Config.Auto.encStrafeDistance) < Config.Auto.encTolerance)\r\n//\t\t{\r\n//\t\t\tdrive.setPos(Config.Auto.encDistanceBetweenTotes, Config.Auto.encDistanceBetweenTotes, Config.Auto.encStrafeDistance, Config.Auto.encStrafeDistance);\r\n//\t\t\t\r\n//\t\t\tif(Math.abs(drive.getLeftEncDist() - Config.Auto.encDistanceBetweenTotes) < Config.Auto.encTolerance && Math.abs(drive.getRightEncDist() - Config.Auto.encDistanceBetweenTotes) < Config.Auto.encTolerance)\r\n//\t\t\t{\r\n//\t\t\t\tdrive.setPos(Config.Auto.encDistanceBetweenTotes, Config.Auto.encDistanceBetweenTotes, 0, 0);\r\n//\t\t\t\t\r\n//\t\t\t\tif((Math.abs(drive.getFrontEncDist()) < Config.Auto.encTolerance && Math.abs(drive.getBackEncDist()) < Config.Auto.encTolerance))\r\n//\t\t\t\t\tendRoutine();\t\t\t\t\r\n//\t\t\t}\r\n//\t\t}\r\n\t}", "@Test\n \tpublic void whereClauseForNodeIndirectDominance() {\n \t\tnode23.addJoin(new Dominance(node42));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\")\n \t\t);\n \t}", "private void searchGuide(EditText searchBar, boolean forward)\n \t{\t\n \t\t//private ArrayList<View> guideTextViews;\n \t\t//private int guideIndex;\n \t\t//private int textBlockIndex;\n \t\t\n \t\tString query = searchBar.getText().toString().toLowerCase(AlgorithmContainer.CURRENT_LOCALE);\n \t\tScrollView scrollBar = (ScrollView) findViewById(R.id.scroll_bar);\n \t\t\n \t\twhile(guideIndex >= 0 && guideIndex < guideTextViews.size())\n \t\t{\n \t\t\tView view = guideTextViews.get(guideIndex);\n \t\t\tTextView block = null;\n \t\t\tString textBlock = null;\n \t\t\t\n \t\t\tif(view instanceof TextView)\n \t\t\t{\n \t\t\t\tblock = (TextView) view;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tsearchBar.setHint(\"An error has occurred\");\n \t\t\t\treturn;\n \t\t\t}\n \t\t\t\n \t\t\ttextBlock = (String) block.getText().toString().toLowerCase(AlgorithmContainer.CURRENT_LOCALE);\n \t\t\t\n \t\t\t\n \t\t\t//Search the given block of text\n \t\t\twhile(textBlockIndex < textBlock.length())\n \t\t\t{\n \t\t\t\ttextBlockIndex = textBlock.indexOf(query,textBlockIndex);\n \t\t\t\tif(textBlockIndex == -1)\n \t\t\t\t{\n \t\t\t\t\ttextBlockIndex = 0;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tint loc[] = {0,1};\n \t\t\t\t\tblock.getLocationInWindow(loc);\n \t\t\t\t\tscrollBar.scrollTo(loc[0],loc[1]);\n \t\t\t\t\tif(forward)\n \t\t\t\t\t{\tsearchBar.clearFocus();\n \t\t\t\t\t\tblock.requestFocus(View.FOCUS_DOWN);\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tsearchBar.clearFocus();\n \t\t\t\t\t\tblock.requestFocus(View.FOCUS_UP);\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t}\n \t\t\ttextBlockIndex = 0;\n \t\t\tif(forward)\n \t\t\t{\n \t\t\t\t++guideIndex;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t--guideIndex;\n \t\t\t}\n \t\t}\n \t\tif(guideIndex >= guideTextViews.size() || guideIndex < 0)\n \t\t{\n \t\t\tsearchBar.setText(\"Reached end for \\\"\" + query + \"\\\"\");\n \t\t\tif(forward)\n \t\t\t{\n \t\t\t\tguideIndex = 0;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tguideIndex = guideTextViews.size() - 1;\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn;\n \t}", "public String getSearchString() {\r\n return super.getSearchString();\r\n \r\n// String searchStr = \"\";\r\n// //put exact phrase at the very beginning\r\n// if(exactphrase != null && exactphrase.length() > 0)\r\n// {\r\n// searchStr += \"\\\"\" + exactphrase + \"\\\"\";\r\n// }\r\n//\r\n// String allwordsSearchStr = \"\";\r\n// if(allwords != null && allwords.length() > 0)\r\n// {\r\n// String [] words = allwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// allwordsSearchStr += \"+\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// String withoutwordsSearchStr = \"\";\r\n// if(withoutwords != null && withoutwords.length() > 0)\r\n// {\r\n// String [] words = withoutwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// withoutwordsSearchStr += \"+-\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// searchStr += allwordsSearchStr + withoutwordsSearchStr; //need to add other string\r\n// \r\n// String oneofwordsSearchStr = \"\";\r\n// if(oneofwords != null && oneofwords.length() > 0)\r\n// {\r\n// String [] words = oneofwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// oneofwordsSearchStr = \"(\";\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// oneofwordsSearchStr += words[i] + \" \";\r\n// }\r\n// oneofwordsSearchStr = oneofwordsSearchStr.trim();\r\n// oneofwordsSearchStr += \")\";\r\n// }\r\n// }\r\n// if(oneofwordsSearchStr.length() > 0)\r\n// {\r\n// searchStr += \"+\" + oneofwordsSearchStr;\r\n// }\r\n//\r\n// return searchStr;\r\n }", "public String getAND_COND_RHS(int fiIndex)\n {\n switch (fiIndex)\n {\n case 1 :\n return getAND_COND_RHS_1();\n case 2 :\n return getAND_COND_RHS_2();\n case 3 :\n return getAND_COND_RHS_3();\n case 4 :\n return getAND_COND_RHS_4();\n case 5 :\n return getAND_COND_RHS_5();\n default :\n return null ;\n\n } /* end switch ( fiIndex ) */\n }", "private void compute() {\n try {\n sc = new InputReader(new FileInputStream(\"./resources/trainandpeter\"));\n } catch (FileNotFoundException ex) {\n throw new IllegalArgumentException(ex);\n }\n text = sc.readNext().toCharArray();\n n = text.length;\n pattern1 = sc.readNext();\n pattern2 = sc.readNext();\n buildDfa(pattern1.toCharArray());\n int patpos1 = search(0, n, true);\n int patpos2 = search(n - 1, -1, false);\n if (patpos1 == -1 && patpos2 == -1) {\n System.out.println(\"fantasy\");\n System.exit(0);\n }\n buildDfa(pattern2.toCharArray());\n int patpos3 = -1;\n if (patpos1 > -1) {\n patpos3 = search(patpos1 + pattern1.length(), n, true);\n }\n int patpos4 = -1;\n if (patpos2 > -1) {\n patpos4 = search(patpos2 - pattern1.length(), -1, false);\n }\n if (patpos3 == -1 && patpos4 == -1) {\n System.out.println(\"fantasy\");\n System.exit(0);\n }\n if (patpos1 > -1 && patpos2 > -1 && patpos3 > -1 && patpos4 > -1) {\n System.out.println(\"both\");\n System.exit(0);\n }\n if (patpos1 > -1 && patpos3 > -1) {\n System.out.println(\"forward\");\n System.exit(0);\n }\n if (patpos2 > -1 && patpos4 > -1) {\n System.out.println(\"backward\");\n System.exit(0);\n }\n }", "public String getReferenceCondition()\n\t\t\tthrows ReadWriteException\n\t{\n\t\tStringBuffer stbf = new StringBuffer(512) ;\n\t\tboolean existFlg = false ;\n\t\tint s_cond = 0 ; // AND 又は OR条件\n\t\tint st_Parenthesis = 0 ; // ’(’文字数\n\t\tint en_Parenthesis = 0 ; // ’)’文字数\n\t\tint total_stparen = 0 ; // ’(’トータル文字数\n\t\tint total_enparen = 0 ; // ’)’トータル文字数\n\n\t\tfor (int i = 0; i < _searchKeyList.size(); i++)\n\t\t{\n\t\t\tKey ky = (Key)_searchKeyList.get(i) ;\n\t\t\tif (ky.getTableValue() != null)\n\t\t\t{\n\t\t\t\ts_cond = ky.getTableCondtion() % 10 ;\n\t\t\t\tst_Parenthesis = ky.getTableCondtion() / 100 ;\n\t\t\t\ten_Parenthesis = (ky.getTableCondtion() / 10) % 10 ;\n\n\t\t\t\ttotal_stparen += st_Parenthesis ;\n\t\t\t\ttotal_enparen += en_Parenthesis ;\n\n\t\t\t\t//#CM708950\n\t\t\t\t// set the '(' character for necessary part. \n\t\t\t\tfor (int lp = 0; lp < st_Parenthesis; lp++)\n\t\t\t\t\tstbf.append(\"(\") ;\n\n\t\t\t\t//#CM708951\n\t\t\t\t// Use the LIKE retrieval when whether the pattern collation is included when the character value is verified, and it exists. \n\t\t\t\tif (ky.getTableValue() instanceof String)\n\t\t\t\t{\n\t\t\t\t\tif (DBFormat.isPatternMatching((String)ky.getTableValue()))\n\t\t\t\t\t{\n\t\t\t\t\t\tstbf.append(ky.getTableColumn()) ;\n\t\t\t\t\t\tstbf.append(\" LIKE \") ;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tstbf.append(ky.getTableColumn()) ;\n\t\t\t\t\t\tstbf.append(\" \") ;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//#CM708952\n\t\t\t\t\t\t// Replace it with IS NULL. \n\t\t\t\t\t\tif(((String)ky.getTableValue()).trim().equals(\"\") && \n\t\t\t\t\t\t!ky.getTableCompCode().equals(\"IS NOT NULL\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstbf.append(\"IS NULL\") ;\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\tstbf.append(ky.getTableCompCode()) ;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstbf.append(\" \") ;\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\tstbf.append(ky.getTableColumn()) ;\n\t\t\t\t\tstbf.append(\" \") ;\n\t\t\t\t\tstbf.append(ky.getTableCompCode()) ;\n\t\t\t\t\tstbf.append(\" \") ;\n\t\t\t\t}\n\t\t\t\tif (ky.getTableValue() instanceof String\n\t\t\t\t\t\t&& !((String)ky.getTableValue()).trim().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tstbf.append(DBFormat.format(((String)ky.getTableValue())).replaceAll(\n\t\t\t\t\t\t\t\"[\" + WmsParam.PATTERNMATCHING + \"]\", \"%\")) ;\n\t\t\t\t}\n\t\t\t\telse if (ky.getTableValue() instanceof Date)\n\t\t\t\t{\n\t\t\t\t\tstbf.append(DBFormat.format((Date)ky.getTableValue())) ;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstbf.append(ky.getTableValue()) ;\n\t\t\t\t}\n\n\t\t\t\t//#CM708953\n\t\t\t\t// set the ')' character for necessary part. \n\t\t\t\tfor (int lp = 0; lp < en_Parenthesis; lp++)\n\t\t\t\t\tstbf.append(\")\") ;\n\n\t\t\t\tif (s_cond == 0)\n\t\t\t\t{\n\t\t\t\t\tstbf.append(\" AND \") ;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstbf.append(\" OR \") ;\n\t\t\t\t}\n\n\t\t\t\tif (existFlg == false)\n\t\t\t\t\texistFlg = true ;\n\t\t\t}\n\t\t}\n\t\t//#CM708954\n\t\t// Return null when data is not set in the key value. \n\t\tif (existFlg == false)\n\t\t\treturn null ;\n\n\t\t//#CM708955\n\t\t// It returns ReadWriteException when Condition () is not corresponding. \n\t\tif (total_stparen != total_enparen)\n\t\t{\n\t\t\tRmiMsgLogClient.write(6006010, LogMessage.F_ERROR, \"SQLSearchKey\", null) ;\n\t\t\tthrow (new ReadWriteException(\"6006002\" + wDelim + \"SQLSearchKey\")) ;\n\t\t}\n\t\t//#CM708956\n\t\t// The last \"AND\" is removed because it is extra. \n\t\tint ep = 0 ;\n\t\tif (s_cond == 0)\n\t\t{\n\t\t\tep = stbf.toString().lastIndexOf(\"AND\") ;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tep = stbf.toString().lastIndexOf(\"OR\") ;\n\t\t}\n\t\treturn stbf.toString().substring(0, ep) ;\n\t}", "private boolean match(String set, String type, int[] sublist, int[] mask, PointBreakdownObject points, int windoftheround, int playerwind)\n\t{\t\n\t\t// because faces can overlap, we need to check whether conditional[1] matches the face definiton before we shortcut\n\t\tif (type.equals(\"simple\") || type.equals(\"terminal\")) {\n\t\t\tboolean chow = set.equals(\"chow\")||set.equals(\"set\");\n\t\t\tboolean connected = set.equals(\"connectedpair\");\n\t\t\tif (type.equals(\"simple\")) {\n\t\t\t\tif(connected && (!TilePattern.isSimple(sublist[TILE]) || !TilePattern.isSimple(sublist[TILE+1]))) { return false; }\n\t\t\t\telse if(chow && (!TilePattern.isSimple(sublist[TILE]) || !TilePattern.isSimple(sublist[TILE+2]))) { return false; }\n\t\t\t\telse if(!TilePattern.isSimple(sublist[TILE])) { return false; }}\n\t\t\telse if (type.equals(\"terminal\")) {\n\t\t\t\tif(connected && !TilePattern.isTerminal(sublist[TILE]) && !TilePattern.isTerminal(sublist[TILE+1])) { return false; }\n\t\t\t\telse if(chow && !TilePattern.isTerminal(sublist[TILE]) && !TilePattern.isTerminal(sublist[TILE+2])) { return false; }\n\t\t\t\telse if(!TilePattern.isTerminal(sublist[TILE])) { return false; }}}\n\t\telse if (type.equals(\"numeral\")){ if(!TilePattern.isNumeral(sublist[TILE])) { return false; }}\n\t\t/**\n\t\t * TODO: add equality checks for \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\" and \"nine\"\n\t\t **/\n\t\telse if (type.equals(\"wind\"))\t{ if(!TilePattern.isWind(sublist[TILE])) { return false; }}\n\t\t/**\n\t\t * TODO: add equality checks for \"east\", \"south\", \"west\" and \"north\"\n\t\t **/\n\t\telse if (type.equals(\"dragon\")) { if(!TilePattern.isDragon(sublist[TILE])) { return false; }}\n\t\t/**\n\t\t * TODO: add equality checks for \"red\", \"green\" and \"white\"\n\t\t **/\n\t\telse if (type.equals(\"honour\")) { if(!TilePattern.isHonour(sublist[TILE])) { return false; }}\n\t\telse if (type.equals(\"flower\")) { if(!TilePattern.isFlower(sublist[TILE])) { return false; }}\n\t\telse if (type.equals(\"season\")) { if(!TilePattern.isSeason(sublist[TILE])) { return false; }}\n\n\t\t// now for the shortcut\n\t\tif(conditional.length==2) {\n\t\t\tif (conditional[1]==ROUNDWIND && sublist[TILE]!=windoftheround) { return false; }\t\t// safety check\n\t\t\telse if (conditional[1]==OWNWIND && sublist[TILE]!=playerwind) { return false; }\t\t// safety check\n\t\t\telse {\t\t\t\n\t\t\t\tif (getValue(sublist[MARKER])>0) {\n\t\t\t\t\tpoints.addLine(getValue(sublist[MARKER]) +\" for\"+getTileOriententation(sublist[MARKER])+\" \"+set+\"/\"+type+\" (\"+ArrayUtilities.arrayToString(sublist)+\")\"); }\n\t\t\t\treturn true; }}\n\t\t\n\t\t// send on for suit matching\n\t\telse if(conditional.length>2){\n\t\t\tmask = ArrayUtilities.add(mask, conditional[2]);\n\t\t\tif(matchConditionalPath(sublist,mask,windoftheround,playerwind)) { return match(set,types[conditional[1]],suits[conditional[2]],sublist,mask,points,windoftheround,playerwind); }\n\t\t\t// if nothing matched, false\n\t\t\treturn false; }\n\n\t\t// we shouldn't really get here\n\t\telse { return false; }\n\t}", "public static int[] isMonsterInSight(Player curr) {\n int[] ans = {-1, -1};\n ArrayList<Integer> dirs = new ArrayList();\n int bodyDir = curr.getBodyDirection();\n String name = curr.getName();\n if (bodyDir == UP) {\n dirs.add(UP);\n if (!name.endsWith(\"fighter\")) //figher planes can only see what is in front of them\n {\n if (!name.equals(\"AIR bomber\"))//bombers only see what is in front and behind them for their bombing run\n {\n dirs.add(RIGHT);\n dirs.add(LEFT);\n }\n if (name.startsWith(\"TANK\") || name.endsWith(\"jeep\") || name.endsWith(\"destroyer\") || name.endsWith(\"coastguard\") || name.equals(\"AIR bomber\"))\n dirs.add(DOWN);\n }\n } else if (bodyDir == RIGHT) {\n dirs.add(RIGHT);\n if (!name.endsWith(\"fighter\")) //figher planes can only see what is in front of them\n {\n if (!name.equals(\"AIR bomber\"))//bombers only see what is in front and behind them for their bombing run\n {\n dirs.add(UP);\n dirs.add(DOWN);\n }\n if (name.startsWith(\"TANK\") || name.endsWith(\"jeep\") || name.endsWith(\"destroyer\") || name.endsWith(\"coastguard\") || name.equals(\"AIR bomber\"))\n dirs.add(LEFT);\n }\n } else if (bodyDir == DOWN) {\n dirs.add(DOWN);\n if (!name.endsWith(\"fighter\")) //figher planes can only see what is in front of them\n {\n if (!name.equals(\"AIR bomber\"))//bombers only see what is in front and behind them for their bombing run\n {\n dirs.add(RIGHT);\n dirs.add(LEFT);\n }\n if (name.startsWith(\"TANK\") || name.endsWith(\"jeep\") || name.endsWith(\"destroyer\") || name.endsWith(\"coastguard\") || name.equals(\"AIR bomber\"))\n dirs.add(UP);\n }\n } else //if(curr.getBodyDirection()==LEFT)\n {\n dirs.add(LEFT);\n if (!name.endsWith(\"fighter\")) //figher planes can only see what is in front of them\n {\n if (!name.equals(\"AIR bomber\"))//bombers only see what is in front and behind them for their bombing run\n {\n dirs.add(UP);\n dirs.add(DOWN);\n }\n if (name.startsWith(\"TANK\") || name.endsWith(\"jeep\") || name.endsWith(\"destroyer\") || name.endsWith(\"coastguard\") || name.equals(\"AIR bomber\"))\n dirs.add(RIGHT);\n }\n }\n\n if (dirs == null || dirs.size() == 0)\n return ans; //{-1,-1}\n for (int m = 0; m < players.length; m++) { //skip player if Vehicle is not mind controlled and the player is not a monster\n //skip player if Vehicle is mind controlled and the player is a monster\n if (players[m] == null || players[m].getName().equals(\"NONE\") || curr == players[m] ||\n ((curr instanceof Vehicle && !((Vehicle) (curr)).isMindControlled()) && !(players[m] instanceof Monster)) ||\n ((curr instanceof Vehicle && ((Vehicle) (curr)).isMindControlled()) && (players[m] instanceof Monster)))\n continue;\n int mR = players[m].getRow();\n int mC = players[m].getCol();\n\n for (int i = 0; i < dirs.size(); i++) {\n int dir = dirs.get(i);\n boolean skip = false;\n if (dir == UP) {\n for (int r = curr.getRow(); r >= 0; r--) { //coastguard, destroyer, fighter planes and artillery have the monsters position known - the monster is not hidden by structures\n if (!MapBuilder.noStructure(r, curr.getCol(), panel) && !name.endsWith(\"coastguard\") && !name.endsWith(\"destroyer\") && !name.endsWith(\"fighter\") && !name.endsWith(\"artillery\") && !name.endsWith(\"missile\") && !name.equals(\"AIR bomber\") && !players[m].isFlying()) {\n skip = true;\n break;\n }\n if (r == mR && curr.getCol() == mC) {\n ans[0] = dir;\n ans[1] = m;\n return ans;\n }\n }\n } else if (dir == DOWN) {\n for (int r = curr.getRow(); r < board.length - 1; r++) {\n if (!MapBuilder.noStructure(r, curr.getCol(), panel) && !name.endsWith(\"coastguard\") && !name.endsWith(\"destroyer\") && !name.endsWith(\"fighter\") && !name.endsWith(\"artillery\") && !name.endsWith(\"missile\") && !name.equals(\"AIR bomber\") && !players[m].isFlying()) {\n skip = true;\n break;\n }\n if (r == mR && curr.getCol() == mC) {\n ans[0] = dir;\n ans[1] = m;\n return ans;\n }\n\n }\n } else if (dir == RIGHT) {\n for (int c = curr.getCol(); c < board[0].length; c++) {\n if (!MapBuilder.noStructure(curr.getRow(), c, panel) && !name.endsWith(\"coastguard\") && !name.endsWith(\"destroyer\") && !name.endsWith(\"fighter\") && !name.endsWith(\"artillery\") && !name.endsWith(\"missile\") && !name.equals(\"AIR bomber\") && !players[m].isFlying()) {\n skip = true;\n break;\n }\n if (curr.getRow() == mR && c == mC) {\n ans[0] = dir;\n ans[1] = m;\n return ans;\n }\n }\n } else if (dir == LEFT) {\n for (int c = curr.getCol(); c >= 0; c--) {\n if (!MapBuilder.noStructure(curr.getRow(), c, panel) && !name.endsWith(\"coastguard\") && !name.endsWith(\"destroyer\") && !name.endsWith(\"fighter\") && !name.endsWith(\"artillery\") && !name.endsWith(\"missile\") && !name.equals(\"AIR bomber\") && !players[m].isFlying()) {\n skip = true;\n break;\n }\n if (curr.getRow() == mR && c == mC) {\n ans[0] = dir;\n ans[1] = m;\n return ans;\n }\n }\n }\n if (skip)\n continue;\n }\n }\n return ans;\n }", "public static void main(String[] args) {\n\t\t\tString str=\"Four score and seven years ago\";\n\t\t\tSystem.out.println(\"The letter r appears at the following locations: \");\n\t\t\tint position = str.indexOf('r');\n\t\t\twhile (position!= -1) {\n\t\t\t\tSystem.out.print(position + \" \");\n\t\t\t\tposition = str.indexOf('r',position+1);\n\t\t\t}\n\t\t\t\n\t\t\tString str2 = \"and a one and two and a three\";\n\t\t\tSystem.out.println(\"The word \\\" and\\\" appears at the following location: \");\n\t\t\tint positionAnd = str2.indexOf(\"and\");\n\t\t\twhile(positionAnd != -1) {\n\t\t\t\tSystem.out.print(positionAnd + \" \");;\n\t\t\t\tpositionAnd = str2.indexOf(\"and\", positionAnd+1);\n\t\t\t}\n}", "public void strafeRight()\r\n\t{\r\n\t\t//Following the camera:\r\n\t\tif(loc[1] > 1)\r\n\t\t{\r\n\t\t\tthis.loc[0] += Math.sin(Math.toRadians(heading))*distance; \r\n\t\t\tthis.loc[2] += Math.cos(Math.toRadians(heading))*distance;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void NenHithoelStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {\n\t\tGenericCardTestHelper scn = GetScenario();\n\n\t\tPhysicalCardImpl site8 = scn.GetFreepsSite(8);\n\n\t\tassertFalse(site8.getBlueprint().isUnique());\n\t\t//assertEquals(Side.FREE_PEOPLE, site8.getBlueprint().getSide());\n\t\t//assertEquals(Culture., card.getBlueprint().getCulture());\n\t\tassertEquals(CardType.SITE, site8.getBlueprint().getCardType());\n\t\t//assertEquals(Race.CREATURE, card.getBlueprint().getRace());\n\t\tassertTrue(scn.HasKeyword(site8, Keyword.RIVER)); // test for keywords as needed\n\t\tassertEquals(7, site8.getBlueprint().getTwilightCost());\n\t\t//assertEquals(, card.getBlueprint().getStrength());\n\t\t//assertEquals(, card.getBlueprint().getVitality());\n\t\t//assertEquals(, card.getBlueprint().getResistance());\n\t\t//assertEquals(Signet., card.getBlueprint().getSignet()); \n\t\tassertEquals(8, site8.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies\n\n\t}", "public final void mAMPERSAND() throws RecognitionException {\n try {\n int _type = AMPERSAND;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:19:11: ( '&' )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:19:13: '&'\n {\n match('&'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Override\n protected void query(CompletionResultSet completionRS, Document doc, int caretOffset) {\n // First, we retrieve the filters defined for the hAtom microformat completion\n String strFilter = Filter.EMPRTY_STRING;\n Filter filter = Filter.getFilter();\n \n try {\n StyledDocument styledDoc = (StyledDocument) doc; \n // Get the filter's text based on actual carte position.\n strFilter = filter.getText(styledDoc, caretOffset);\n \n } catch (Exception ex) {\n ex.printStackTrace();\n // if an error occurs, an empty filter is set, so that the completion popup \n // will be filled with all the hAtom keywords.\n strFilter = Filter.EMPRTY_STRING;\n }\n\n // Lista completa dei tag/parole chiave hAtom\n List<String> hatomTags = TagCache.getCache().getTagList();\n\n // Gets the hAtom keywords that match the given filter value.\n for (String tag : hatomTags) {\n boolean startWithFilter = tag.startsWith(strFilter); \n if (!tag.equals(Filter.EMPRTY_STRING) && startWithFilter) {\n completionRS.addItem(new HatomCompletionItem(tag, filter.getFilterOffset(), caretOffset));\n }\n }\n\n // This is required by the Netbeans API docs.\n // After finish() is invoked, no further modifications to the result set are allowed.\n completionRS.finish();\n\n }", "public org.apache.xmlbeans.XmlAnySimpleType getSearchTerms()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlAnySimpleType target = null;\n target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_attribute_user(SEARCHTERMS$6);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "protected ICompilerBooleanValue bTerm() throws InvalidConditionantException,\r\n\t\t\t\t\t\t\t TableFunctionMalformedException{\r\n\t\t\r\n\t\tICompilerBooleanValue val1 = notFactor();\r\n\r\n\t\t// LOOK FOR AND (OPTIONAL)\r\n\t\t// scan();\r\n\t\tif (look == '&') {\r\n\t\t\tmatch('&');\r\n\t\t\tICompilerBooleanValue val2 = notFactor();\r\n\t\t\tif (look == '&') {\r\n\t\t\t\tmatch('&');\r\n\t\t\t\treturn new CompilerAndValue(val1, new CompilerAndValue(val2,bTerm()));\r\n\t\t\t} else {\r\n\t\t\t\treturn new CompilerAndValue(val1, val2);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn val1;\r\n\t\t}\r\n\t}", "private List<Clause> termSearch(Clause cl\n\t\t\t, List<Clause> aA, List<Clause> aO\n\t\t\t, List<Clause> oA, List<Clause> oO) {\n\t\tif ((cl.getStartOP() == null)\n\t\t\t\t|| cl.getStartOP().equals(Operator.AND)) {\n\t\t\tif (cl.getDefaultOP().equals(Operator.AND)) {\n\t\t\t\taA.add(cl);\n\t\t\t\treturn getFilledList(aO, oA, oO);\n\t\t\t} else {\n\t\t\t\taO.add(cl);\n\t\t\t\treturn getFilledList(oA, oO, aA);\n\t\t\t}\n\t\t} else if (cl.getStartOP().equals(Operator.OR)) {\n\t\t\tif (cl.getDefaultOP().equals(Operator.AND)) {\n\t\t\t\toA.add(cl);\n\t\t\t\treturn getFilledList(oO, aA, aO);\n\t\t\t} else {\n\t\t\t\toO.add(cl);\n\t\t\t\treturn getFilledList(aA, aO, oA);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private String keywordFound(){\r\n\t\tString rtn = \"\";\r\n\t\tString tmp = \"\";\r\n\t\tint carr_pos = getCaretPosition();\r\n\t\t//estract part of text for keyword search\r\n\t\ttry { \r\n\t\tif(carr_pos>50)\r\n\t\t\ttmp = doc.getText(carr_pos-50,50);\r\n\t\telse\r\n\t\t\ttmp = doc.getText(0,carr_pos);\r\n\t\t}catch(BadLocationException a){\r\n\t\t\tSystem.out.println(\"exception\");\r\n\t\t\treturn rtn;\r\n\t\t};\r\n\t\t//Start check\r\n\t\tint i = 0;\r\n\t\tif(tmp.length() >= 2)i = tmp.length()-2;\t\r\n\t\twhile(checkOperator(tmp.charAt(i)) && i > 0){\r\n\t\t\trtn += tmp.charAt(i);\r\n\t\t\ti--;\r\n\t\t}\r\n\t\tif(i == 0)rtn += tmp.charAt(i);\t\t\r\n\t\treturn mirrorString(rtn);\r\n\t}", "public void search() {\r\n\t\tfloat dist = getDistance(permutationPrev);\r\n\t\tfloat delta = 0;\r\n\t\tfloat prob = 0;\r\n\r\n\t\tboolean accept = false;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\twhile ((temperature > minTemperature) || (nIter > 0)) {\r\n\t\t\tdisturbPermut(permutationPrev);\r\n\t\t\tdelta = getDistance(permutation) - dist;\r\n\r\n\t\t\tprob = (float) Math.exp(-delta / temperature);\r\n\t\t\taccept = ((delta < 0) || (delta * (prob - rand.nextFloat()) >= 0));\r\n\r\n\t\t\tif (accept) {\r\n\t\t\t\tacceptPermution(permutation);\r\n\t\t\t\tdist = delta + dist;\r\n\t\t\t}\r\n\r\n\t\t\ttemperature *= cBoltzman;\r\n\t\t\tnIter--;\r\n\r\n\t\t\ttrace.add(dist);\r\n\t\t}\r\n\t\tshortestDist = dist;\r\n\t}", "public final void mAMPERSAND() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = AMPERSAND;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:429:10: ( '&' )\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:429:16: '&'\n\t\t\t{\n\t\t\tmatch('&'); \n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}", "@Test\n public void test_shortcut_needed_basic() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(5, 4, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(1, 2, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(2, 3, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(3, 4, edge++, 10, Double.POSITIVE_INFINITY);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 20.0, 100);\n assertTrue(Double.isInfinite(weight));\n }", "@Test\n public void ORSearch_September2004() throws Exception {\n\n final Set<String> searchResults = newsLineSearch.search(TEST_FILE, \"September 2004\", SearchType.OR);\n\n assertThat(searchResults).hasSize(1).contains(allLines.get(9));\n }", "public void relevanceFeedback(PostingsList results, boolean[] docIsRelevant, Indexer indexer ) {\r\n// results contain the ranked list from the current search\r\n// docIsRelevant contains the users feedback on which of the 10 first hits are relevant\r\n\tdouble gamma = 0.0; // används ej, de orelevanta dokumenterna. städa upp queryn. Vad innehller de orelevanta dokumenterna för termer\r\n// dess termer tar vi bort från den relebanta.)\r\n\r\n\tdouble alfa = 0.8; // hur mycket litar på det gamla sökning innan feedback\r\n\tdouble beta = 0.6; // hur mycket hänsyn du ska ta till nya sökningen efter feedback \r\n\r\n\r\n\t/* \r\n\r\n\tAlgorithm: \r\n\tThe Rocchio algorithm is based on a method of relevance \r\n\tfeedback found in information retrieval systems\r\n\tThe algorithm is based on the assumption that most users \r\n\thave a general conception of which documents should be denoted \r\n\tas relevant or non-relevant.[1] Therefore, the user's search \r\n\tquery is revised to include an arbitrary percentage of relevant \r\n\tand non-relevant documents as a means of increasing the search \r\n\tengine's recall, and possibly the precision as well. The number \r\n\tof relevant and non-relevant documents allowed to enter a query \r\n\tis dictated by the weights of the a, b.\r\n\tthe associated weights (a, b) are responsible for shaping the \r\n\tmodified vector in a direction closer, or farther away, from the \r\n\toriginal query, related documents, and non-related documents.\r\n\r\n\r\n\r\n\tLimitations of rocchio:\r\n\t\tTherefore the two queries of \"Burma\" and \"Myanmar\" will \r\n\t\tappear much farther apart in the vector space model, \r\n\t\tthough they both contain similar origins\r\n\tWhy not use non-relevant documents:\r\n\t\tThough there are benefits to ranking documents as not-relevant, \r\n\t\ta relevant document ranking will result in more precise documents \r\n\t\tbeing made available to the user. \r\n\t\r\n\r\n\r\n\tRoccio algoritmen: \r\n\t\talfa = Original query weight \r\n\t\tbeta = related document weight\r\n\t\t\r\n\t\thigher alpha means that we give more focus to the original query terms\r\n\t\thigher beta means that we give more focus to the new search feedback. i.e new terms.\r\n\r\n\t\tTar en org query\r\n\t\tTar den gamla gånnger en viss vikt \r\n\t\tvikt är alfa + beta (entill vektor) plus att den kollar på original vektor, q0 \r\n\t\t\thögre alfa mer fokus på original queryn \r\n\t\t\thögra beta skiftar till mer fokus på de nya termerna. \r\n\t\tdvs utökas med ord/termer från dokument vektorerna som var relevanta. \r\n\r\n\tVanligtvis har man väldigt häg alfa och beta lite under för att det är standard. man tycker att den \r\n\tförsta queryn är väldigt bra.\r\n\r\n\t\r\n\t*/\r\n\r\n\tPostingsList related_doc_vector = new PostingsList();\r\n\tHashMap<String, Double> qm = new HashMap<String, Double>(); // spara termer och weights.\r\n\t// normalize weights\r\n\tfor(Double w : weights){\r\n\t\tw = w/weights.size();\r\n\t}\r\n\r\n\tIterator<PostingsEntry> it = results.iterator();\r\n\tfor(int i = 0; i < docIsRelevant.length; i++){\r\n\t\tif(docIsRelevant[i] == true){\r\n\t\t\trelated_doc_vector.list.add(results.get(i));\r\n\t\t} \r\n\t}\r\n\r\n\t// apply Rocchio algorithm.\r\n\tfor(int i = 0; i < terms.size(); i++){\r\n\t\tdouble new_weigt = weights.get(i) * alfa;\r\n\t\tqm.put(terms.get(i), new_weigt);\r\n\t}\r\n\r\n\tfor(int i = 0; i < related_doc_vector.size(); i++){\r\n\t\tIterator<PostingsEntry> ite = related_doc_vector.iterator();\r\n\t\twhile(ite.hasNext()){\r\n\t\t\tPostingsEntry postingsentry = ite.next();\r\n\t\t\tint docID = postingsentry.docID;\r\n\t\t\tString filename = indexer.index.docIDs.get(Integer.toString(docID)); // hämtar filnamnet\r\n\t\t\tString path = \"/Users/monadadoun/Desktop/ir/lab/davisWiki/\" + filename; \r\n\t\t\tFile file = new File(path);\r\n\t\t\tHashSet<String> hs = new HashSet<>();\r\n\t\t\t// lägger till alla ord som finns till mitt hashet\r\n\t\t\ttry (Reader reader = new InputStreamReader( new FileInputStream(file), StandardCharsets.UTF_8 )){\r\n\t\t\t\tTokenizer tok = new Tokenizer( reader, true, false, true, indexer.patterns_file );\r\n\t\t\t\twhile (tok.hasMoreTokens()) {\r\n\t\t\t\t\ths.add(tok.nextToken());\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tIterator<String> iter = hs.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tString s = iter.next();\r\n\t\t\t\tif(qm.containsKey(s)){\r\n\t\t\t\t\tDouble tmp = qm.get(s);\r\n\t\t\t\t\tqm.put(s, tmp + beta * postingsentry.score);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tqm.put(s, beta * postingsentry.score);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tLinkedList<String> term = new LinkedList<>();\r\n\tLinkedList<Double> weight = new LinkedList<>();\r\n\tList<Map.Entry<String,Double>> answer = new ArrayList<Map.Entry<String,Double>>(qm.entrySet());\r\n\tanswer.sort((e1,e2) -> e2.getValue().compareTo(e1.getValue())); // sorterar efter värde så att orden med högst score ligger först\r\n\tfor (int i = 0; i < answer.size(); i++) {\r\n\t\tterm.add(answer.get(i).getKey());\r\n\t\tweight.add(answer.get(i).getValue()/answer.size());\r\n\t}\r\n\r\n\tterms = term;\r\n\tweights = weight;\r\n\t}", "public static void caso32(){\n\t FilterManager fm= new FilterManager(\"resources/stopWordsList.txt\",\"resources/useCaseWeight.properties\");\n\t\t\tQualityAttributeBelongable qualityAttributeBelongable = new OntologyManager(\"file:resources/caso3.owl\",\"file:resources/caso3.repository\",fm);\n\t\t\tMap<QualityAttributeInterface,Double> map = qualityAttributeBelongable.getWordPertenence(\"response2\");\n\t\t\tif(map==null){\n\t\t\t\tSystem.out.println(\"El map es null\");\n\t\t\t}else{\n\t\t\t\tMapUtils.imprimirMap(map);\n\t\t\t}\n\t}", "public Boolean FilterMatch(BoulderProblem bp, ArrayList<Integer> filters)\n {\n //intially set boolean to true\n Boolean allMatches = true;\n //if filters list is not empty then do the check\n if(filters.size() > 0)\n {\n //get the list of holds in the bp route\n ArrayList<Hold> bpRoute = bp.route;\n //create an array of booleans for each filter. intially set all booleans to false\n Boolean[] filterMatches = new Boolean[filters.size()];\n for(int i = 0; i < filterMatches.length; i++)\n {\n filterMatches[i] = false;\n }\n //loop through all the holds and check if they match a selected filter.\n //if so then set the respective boolean to true\n for(int i = 0; i < filters.size(); i++)\n {\n for(Hold hold : bpRoute)\n {\n if(Integer.parseInt(hold.GetType()) == filters.get(i))\n {\n filterMatches[i] = true;\n break;\n }\n }\n }\n //check if all the booleans are true (all filters are satisfied)\n for(boolean match : filterMatches)\n {\n if(!match)\n {\n //if not then set the match to false\n allMatches = false;\n break;\n }\n }\n }\n return allMatches;\n }", "@Test\n\tpublic void integrationTest1() throws Exception {\n\t\tHashSet<String> mistress = loadGrepResults(\"mistress\");\n\t\tHashSet<String> undocumented = loadGrepResults(\"undocumented\");\n\t\tHashSet<String> forced = loadGrepResults(\"!i+am+forced\");\n\t\t\n\t\tHashSet<String> grepFound = new HashSet<String>(mistress);\n\t\tgrepFound.retainAll(undocumented);\n\t\tgrepFound.addAll(forced);\n\t\t\n\t\tCollection<Page> index = queryTest.query(\"mistress & undocumented | (!\\\"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\tassertEquals(indexFound, grepFound);\n\t}", "public void rasterScanning(){\r\n ReadParameter embedPara = new ReadParameter();\r\n QuantisationEmbedding subband = new QuantisationEmbedding();\r\n int i,j,k,p;\r\n double[] coeffStream, modCoeffStream;\r\n //Modification in selected subband only\r\n if(embedPara.getSubbandChoice().compareTo(\"LF\") == 0){\r\n //Embed in low low subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n }\r\n }\r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n // Write it back in proper order\r\n k = 0; // Reset k value\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"HF\") == 0){\r\n //Embed in high frequency subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 3];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<3; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==1){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==2){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n // Write it back in proper order\r\n k=0; // Reset k value\r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"AF\") == 0){\r\n //Embed in all subbands\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 4];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<4; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LL Subband values\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n \r\n } else if(p==1){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==2){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==3){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n \r\n // Write it back in proper order\r\n k = 0; //Reset k value\r\n //Write back LL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n } // End subband choice if-else condition\r\n \r\n }", "protected static void searchByKeysHashYear(String keys, int lowerYear, int upperYear) {\n System.out.println(\"searching in hasher using search terms and year\");\n System.out.println(\"lowerYear: \" + lowerYear);\n System.out.println(\"upperYear: \" + upperYear);\n String[] splitWords = new String[keys.split(\"[ ]+\").length];\n splitWords = keys.split(\"[ ]+\");\n System.out.println(splitWords[0]);\n for (String keyWord : splitWords) {\n keyWord = keyWord.toLowerCase();\n if (map.get(keyWord) != null) {\n ArrayList<Integer> allInstancesofWord = (ArrayList<Integer>) map.get(keyWord);\n {\n for (int i = 0; i < allInstancesofWord.size(); i++) {\n\n Product e = productList.get(allInstancesofWord.get(i));\n if (e.productYearMatch(lowerYear, upperYear)) // if an element is between range of the years. and it has the correct key terms. it is printed.\n {\n \n System.out.println(productList.get(allInstancesofWord.get(i)));\n ProductGUI.Display(e.toString() + \"\\n\");\n }\n else\n System.out.println(\"not in the year \"+ keys + \" \"+lowerYear+ \" \"+ upperYear);\n }\n }\n }\n if (map.get(keyWord) == null) {\n System.out.println(\"The products you are searching for were not found\");\n }\n }\n\n }", "public void testConjunctionResolves() throws Exception\n {\n resolveAndAssertSolutions(\"[[g, h, (f :- g, h)], (?- f), [[]]]\");\n }", "public static void main(String[] args) throws IOException {\n BruteForce bruteForce = new BruteForce();\n bruteForce.setKeyword(\"robot\");\n bruteForce.searchKeyword();\n LuceneSearch luceneSearch = new LuceneSearch(\"robot\");\n luceneSearch.luceneSearch();\n HuffmanSearch huffmanSearch = new HuffmanSearch(\"robot\");\n huffmanSearch.huffmanSearch();\n\n // This creates chart for brute force algorithm with robot as the search keyword.\n BruteForceChart bruteForceChart =\n new BruteForceChart(\n \"Time vs Number of records Brute Force for Keyword robot\",\n \"Time vs Number of records Brute Force for Keyword robot\");\n\n bruteForceChart.pack();\n bruteForceChart.setLocation(0, 0);\n // This to display the chart.\n bruteForceChart.setVisible(true);\n\n // This creates chart for lucene algorithm with robot as the search keyword.\n LuceneChart luceneChart =\n new LuceneChart(\n \"Time vs Number of records Lucene for Keyword robot\",\n \"Time vs Number of records Lucene for Keyword robot\");\n luceneChart.pack();\n luceneChart.setLocation(600,0);\n // This to display the chart.\n luceneChart.setVisible(true);\n\n // This creates chart for Huffman algorithm with robot as the search keyword.\n HuffmanChart huffmanChartRobot =\n new HuffmanChart(\n \"Time vs Number of records Huffman for Keyword Wearable\",\n \"Time vs Number of records Huffman for Keyword Robot\");\n huffmanChartRobot.pack();\n huffmanChartRobot.setLocation(1200,0);\n huffmanChartRobot.setVisible(true);\n\n // These are the objects for searching the wearable keyword.\n BruteForce bruteForceWearable = new BruteForce();\n bruteForceWearable.setKeyword(\"wearables\");\n bruteForceWearable.searchKeyword();\n\n LuceneSearch luceneSearchWearable = new LuceneSearch(\"wearables\");\n luceneSearchWearable.luceneSearch();\n\n HuffmanSearch huffmanSearchWearable = new HuffmanSearch(\"wearables\");\n huffmanSearchWearable.huffmanSearch();\n\n\n // This creates chart for brute force algorithm with wearable as the search keyword.\n BruteForceChart bruteForceChartWearable =\n new BruteForceChart(\n \"Time vs Number of records Brute Force for Keyword Wearable\",\n \"Time vs Number of records Brute Force for Keyword Wearable\");\n bruteForceChartWearable.pack();\n bruteForceChartWearable.setLocation(0,500);\n // This to display the chart.\n bruteForceChartWearable.setVisible(true);\n\n\n\n // This creates chart for lucene algorithm with wearable as the search keyword.\n LuceneChart luceneChartWearable =\n new LuceneChart(\n \"Time vs Number of records Lucene for Keyword Wearable\",\n \"Time vs Number of records Lucene for Keyword Wearable\");\n luceneChartWearable.pack();\n luceneChartWearable.setLocation(600,500);\n // This to display the chart.\n luceneChartWearable.setVisible(true);\n\n\n // This creates chart for Huffman algorithm with wearable as the search keyword.\n HuffmanChart huffmanChartWearable =\n new HuffmanChart(\n \"Time vs Number of records Huffman for Keyword Wearable\",\n \"Time vs Number of records Huffman for Keyword Wearable\");\n huffmanChartWearable.pack();\n huffmanChartWearable.setLocation(1200, 500);\n huffmanChartWearable.setVisible(true);\n }", "public static void testPhilosophy(String start, String end) {\n\t\t\t\t\t\t String test = start;\n\t\t\t\t\t\t\t\t for(int count = 0; i<50; i++)\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t if(done.contains(test)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t return; //duplicate links (loops)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t else\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 {\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 done.add(test);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Element link = getGoodLink(start);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(link == null) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t return; //no links on page\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if (link.attr(\"abs:href\").equals(end)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t break; //matches philosophy page\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }", "private void filterResults(String medium) {\r\n\t\tnew HomePageAdverteerder(driver).openExchangePage()\r\n\t\t\t.selectFilterOptions(Filter.MEDIUM, new String[] {medium})\r\n\t\t\t.selectFilterOptions(Filter.FORMAAT_CODE, new String[] {FULL_PAGE})\r\n\t\t\t.applyFilters();\r\n\t}", "private void searchFunction() {\n\t\t\r\n\t}", "public HashMap<Type, Double> getInversePossibilities() {\r\n\t\tHashMap<Type, Double> ret = new HashMap<Type, Double>();\r\n\t\tfor (Type t : Type.values()) ret.put(t, 0.0);\r\n\t\tfor (Type t : types) {\r\n\t\t\t//??? IS THIS CORRECT ??? --> Seems correct\r\n\t\t\t//get inverse of each relation that is 1.0 \r\n\t\t\tType inverseRelation = FuzzyAllenIntervalConstraint.getInverseRelation(t);\r\n\t\t\t\r\n\t\t\tHashMap<FuzzyAllenIntervalConstraint.Type, Double> possibilities = this.getPossibilities();\r\n\t\t\t\r\n\t\t\t//set poss of each inverse relation to 1.0\r\n\t\t\tret.put(inverseRelation, possibilities.get(t));\r\n\t\t\t\r\n\t\t\t//calculate the Freksa N of each inverse relation\r\n\t\t\tHashMap<FuzzyAllenIntervalConstraint.Type, Double> fr = new HashMap<FuzzyAllenIntervalConstraint.Type, Double>();\r\n\t\t\tfor(int i = 0; i < FuzzyAllenIntervalConstraint.freksa_neighbor[inverseRelation.ordinal()].length; i++)\r\n\t\t\t\tfr.put(FuzzyAllenIntervalConstraint.lookupTypeByInt(i), FuzzyAllenIntervalConstraint.getPossibilityDegree(FuzzyAllenIntervalConstraint.freksa_neighbor[inverseRelation.ordinal()][i]));\r\n\t\t\t\r\n\t\t\t//take the maximum between calculated Freksa N and previously added possibilities\r\n\t\t\t//(because this is an OR)\r\n\t\t\tfor(FuzzyAllenIntervalConstraint.Type t1: fr.keySet())\r\n\t\t\t\tret.put(t1, Math.max(ret.get(t1), fr.get(t1)));\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\tSystem.out.println(\"=====================================\");\r\n\t\tSystem.out.println(\"DIRECT \" + this + \":\\n\" + this.possibilities);\r\n\t\tSystem.out.println(\"INVERSE:\\n\" + ret);\r\n\t\tSystem.out.println(\"=====================================\");\r\n\t\t*/\r\n\t\t\r\n\t\treturn ret;\r\n\t}", "public static void main(String[] args) {\n\t \n\t System.out.println(\"Q3) a) The pattern 'BCD' found in text 'ABCADCBABABCDABCD' on index : \"+ search2(\"BCD\".toCharArray(),\"ABCADCBABABCDABCD\".toCharArray()));\n\t \n\t }", "protected void requestedAndOrData(JTable jt,String searchTerm1, String searchTerm2, String searchTerm3, boolean soundex) throws SQLException\r\n\t{\r\n\t\tif(!soundex)\r\n\t\t{\r\n\t\t\tString query2 = \"select docID from inverted_file where word='\"+searchTerm2+\"' group by docID\";\r\n\t\t\tPreparedStatement pstmt2 = con.prepareStatement(query2);\r\n\t\t\tResultSet rs1 = pstmt2.executeQuery();//then execute the statement\r\n\t\t\tif (!rs1.next()) {\r\n\t\t\t\tString query = \"select file_name as File, docID as Document_ID from inverted_file where word='\"+searchTerm3+\"' AND visible=1 group by file_name\";\r\n\t\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\t\r\n\t\t\t\tif (!rs2.next()) {\r\n\t\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t rs2.beforeFirst();\r\n\t\t\t\t pstmt.close();\r\n\t\t\t\t return;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\trs2.beforeFirst();\r\n\t\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\t\tpstmt.close();\r\n\t\t\t rs1.beforeFirst();\r\n\t\t\t pstmt2.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tString query = \"select file_name as File, docID as Document_ID from inverted_file where (word='\"+searchTerm1+\"' AND docID=\"+rs1.getInt(1)+\" AND visible=1) OR word='\"+searchTerm3+\"' AND visible=1 group by file_name\";\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\r\n\r\n\t\t\t//Checking if the term found in the database\r\n\t\t\tif (!rs2.next()) {\r\n\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t rs2.beforeFirst();\r\n\t\t\t pstmt.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\trs2.beforeFirst();\r\n\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\tpstmt.close();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tString query2 = \"select docID from soundex_table where soundex = ? group by docID\";\r\n\t\t\tPreparedStatement pstmt2 = con.prepareStatement(query2);\r\n\t\t\tpstmt2.setString(1, sndx.encode(searchTerm2));\r\n\t\t\tResultSet rs1 = pstmt2.executeQuery();//then execute the statement\r\n\t\t\tif (!rs1.next()) {\r\n\t\t\t\tString query = \"select file_name as File, docID as Document_ID from soundex_table where soundex= ? AND visible=1 group by file_name\";\r\n\t\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\t\tpstmt.setString(1, sndx.encode(searchTerm3));\r\n\t\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\t\r\n\t\t\t\tif (!rs2.next()) {\r\n\t\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t rs2.beforeFirst();\r\n\t\t\t\t pstmt.close();\r\n\t\t\t\t return;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\trs2.beforeFirst();\r\n\t\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\t\tpstmt.close();\r\n\t\t\t rs1.beforeFirst();\r\n\t\t\t pstmt2.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tString query = \"select file_name as File, docID as Document_ID from soundex_table where (soundex= ? AND docID=\"+rs1.getInt(1)+\" AND visible=1) OR soundex= ? AND visible=1 group by file_name\";\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\tpstmt.setString(1, sndx.encode(searchTerm1));\r\n\t\t\tpstmt.setString(2, sndx.encode(searchTerm3));\r\n\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\r\n\t\t\t//Checking if the term found in the database\r\n\t\t\tif (!rs2.next()) {\r\n\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t rs2.beforeFirst();\r\n\t\t\t pstmt.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\trs2.beforeFirst();\r\n\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\tpstmt.close();\r\n\t\t}\r\n\t}", "private void or() {\n // PROGRAM 1: Student must complete this method\n //loop through output array\n for (int i = 0; i < output.length; i++) {\n //take the or of index i of inputA and inputB and place result in output[i]\n output[i] = (inputA[i] | inputB[i]);\n }\n }", "public static void searchSimillar(String keyword,int numberofResults,PreSearch ps) {\t\t\r\n\t\tHashMap<String,Integer> sortedDistance = sortByEditDistance(keyword,ps);\r\n\t\tIterator<Entry<String, Integer>> iterator2 = sortedDistance.entrySet().iterator(); \r\n\t\twhile(iterator2.hasNext()) \r\n\t\t{ \t\t\t\r\n\t\t\tMap.Entry<String, Integer> me = (Map.Entry<String, Integer>)iterator2.next();\r\n\t\t\tString word = me.getKey().toString();\t\t\t\r\n\t\t\tSystem.out.println(\"Instead showing results for : \"+word);\r\n\t\t\t\r\n\t\t\t//Searching for the word with lowest distance.\r\n\t\t\tMap<String,Integer> sortedMap;\r\n\t\t\tArrayList<String> as = ps.find(word);\r\n\t\t\tString phrase = word.toLowerCase();\r\n\t\t\t\r\n\t\t\tsortedMap = SortResultsByRank.sortByRank(as, phrase);\t\t\t\r\n\t\t\tSearch.printResult(sortedMap,numberofResults);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t}", "public void searchEither(String search)\n {\n // Sets the input to be all lower case\n search = search.toLowerCase();\n r.searchEither(search);\n }", "public String searchLCSPal(int left, int right) {\n List<Integer> key = new ArrayList<Integer>(2);\n key.add(left);\n key.add(right);\n // check for exit conditions\n // left and right cross each other or are equal\n if (left > right || right < left) {\n return \"\";\n }\n // if not, we compute its result\n if (!this.Memoize.containsKey(key)) {\n // assume the substring is a palindrome until proven other wise\n // it uses the endIndex as a countable int - strange but ok (e.g. why i use right + 1)\n String result = this.String.substring(left, right + 1);\n // check if the left and right substring is a palindrome\n // we don't need to compare the size because we know that anything\n // below in the rescursed calls will have smaller ranges\n if (!this.isPalindrome(result)) {\n // recurse into the 2 options of incrementing left\n // or decrementing right and pick witch one to select\n if (this.searchLCSPal(left + 1, right).length() > this.searchLCSPal(left, right - 1).length()) {\n result = this.searchLCSPal(left + 1, right);\n } else {\n result = this.searchLCSPal(left, right - 1);\n }\n }\n // cache the value\n this.Memoize.put(key, result);\n }\n // return the cached entry\n return this.Memoize.get(key);\n }", "public String getANDClause()\n {\n StringBuilder builder = new StringBuilder();\n\n String colName;\n String term;\n\n for (int i = 0; i < columnNames.length; i++)\n {\n colName = columnNames[i];\n\n String[] terms = Spans.prepareStrings(keywords);\n\n builder.append(\"(\");\n for(int j = 0; j < terms.length; j++)\n {\n term = terms[j];\n builder.append(colName + \" LIKE '%\"+ term + \"%'\" );\n\n if (j != terms.length - 1)\n {\n builder.append(\" AND \");\n }\n }\n builder.append(\")\");\n\n if (i != columnNames.length - 1)\n {\n builder.append(\" OR \");\n }\n }\n\n return builder.toString();\n }", "public static void main(String[] args) {\n SwingUtilities.invokeLater(new Runnable() {\n\n @Override\n public void run() {\n String conjunctionString = \"and\";\n String prependString = \"ConceptPhrase\\t10_location_liver\\t\";\n String appendString = \"\\tFALSE\\tFALSE\\tTRUE\";\n String titleString = \"LexicalType\\tConceptPhrase\\tRequiresConceptPhrase/ForwardWindow\"\n + \"\\tBlockable/BackwardWindow\\tOverridesRaptat\";\n LiverSegmentConjunctionProcessor conjunctionProcessor =\n new LiverSegmentConjunctionProcessor(conjunctionString);\n String pathToPrintFile =\n \"H:\\\\AllFolders\\\\ResAppProjects\\\\ORD_Matheny_201406009D_Cirrhosis\\\\Glenn\"\n + \"\\\\CrossValidation\\\\LiverLocations_v07_180610.txt\";\n PrintWriter pw = null;\n try {\n pw = new PrintWriter(pathToPrintFile);\n pw.println(titleString);\n pw.flush();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n System.exit(-1);\n }\n\n PhraseVariantBuilder builder = new PhraseVariantBuilder();\n\n String[] phraseVariantDescriptors = getPhraseVariantDescriptors();\n\n boolean useThesaurus = false;\n List<List<String>> phraseVariantList =\n builder.getVariantsAsList(phraseVariantDescriptors, useThesaurus);\n int i = 1;\n for (List<String> phraseList : phraseVariantList) {\n Iterator<String> stringIterator = phraseList.iterator();\n\n if (stringIterator.hasNext()) {\n StringBuilder resultPhrase = new StringBuilder(stringIterator.next());\n\n while (stringIterator.hasNext()) {\n resultPhrase.append(\" \").append(stringIterator.next());\n }\n String resultString = resultPhrase.toString();\n resultString = resultString.toLowerCase().trim();\n\n /*\n * If the resultString does NOT have the conjunctionString, just print it out.\n * Otherwise, make sure the segments are valid, and only print it out if they are. Also\n * replace conjunction string with ampersand and divisor string\n */\n if (resultString.contains(conjunctionString)) {\n if (conjunctionProcessor.validSegments(resultString)) {\n String resultStringAmpersand = resultString.replace(conjunctionString, \"&\");\n if (i % 10000 == 0) {\n System.out.println(i + \") \" + resultStringAmpersand);\n }\n i++;\n pw.println(prependString + resultStringAmpersand + appendString);\n pw.flush();\n\n String resultStringSlash = resultString.replace(conjunctionString, \"/\");\n if (i % 10000 == 0) {\n System.out.println(i++ + \") \" + resultStringSlash);\n }\n i++;\n pw.println(prependString + resultStringSlash + appendString);\n pw.flush();\n\n if (i % 10000 == 0) {\n System.out.println(i++ + \") \" + resultString);\n }\n i++;\n pw.println(prependString + resultString + appendString);\n pw.flush();\n }\n } else {\n if (i % 10000 == 0) {\n System.out.println(i++ + \") \" + resultString);\n }\n i++;\n pw.println(prependString + resultString + appendString);\n pw.flush();\n }\n }\n }\n pw.close();\n System.out.println(\"Done\");\n\n System.exit(0);\n }\n\n\n private String[] getPhraseVariantDescriptors() {\n String[] variantDescriptors = new String[8];\n\n variantDescriptors[0] =\n \"(1 4 5) (1 4 6 7) (1 4 8 9) (1 5) (1 6 7) (1 8 9) (2 3 4 5) (2 3 4 6 7) (2 3 4 8 9) (2 3 5) (2 3 6 7) (2 3 8 9)\"\n + \"(1: adjacent near neighboring adjoining neighbouring along around within inside on)\"\n + \"(2: close adjacent rostral caudal superficial deep)\" + \"(3: to)\" + \"(4: the)\"\n + \"(5: gallbladder) (6: falciform) (7: ligament) (8: ligamentis) (9: falciformis)\";\n\n variantDescriptors[1] = \"(1) (1: dome subcapsular surface)\";\n\n variantDescriptors[2] =\n \"(1 2 3 4 5 6 7) (1 3 4 5 6 7) (3 4 5 6 7) (3 4 6 7) (4 5 6 7) (4 6 7) (3 4) (6 7)\"\n + \"(1: adjacent near neighboring adjoining neighbouring along around within inside on over under above below)\"\n + \" (2: the)\"\n + \" (3: superior inferior upper lower medial superolateral superomedial inferolateral inferomedial anterior posterior anterolateral anteromedial peripheral interior exterior central subcapsular)\"\n + \" (4: edge edges margin margins border borders boundary boundaries perimeter perimeters aspect part portion region aspects parts portions regions division divisions segment segments)\"\n + \" (5: of) (6: segment )\"\n + \" (7: 1 2 3 4 5 6 7 8 one two three four five six seven eight i ii iii iv v vi vii viii ia iia iiia iva va via viia viiia)\";\n\n variantDescriptors[3] = \" (1 2 3 4 5 6 7 8) (1 2 4 5 6 7 8) (1 2 7 8) (1 2 5 7 8)\"\n + \" (1: close adjacent rostral caudal superficial deep)\" + \" (2: to)\" + \" (3: the)\"\n + \" (4: superior inferior upper lower medial superolateral superomedial inferolateral inferomedial anterior posterior anterolateral anteromedial peripheral interior exterior central subcapsular)\"\n + \" (5: edge edges margin margins border borders boundary boundaries perimeter perimeters aspect part portion region aspects parts portions regions division divisions segment segments)\"\n + \" (6: of) (7: segment )\"\n + \" (8: 1 2 3 4 5 6 7 8 one two three four five six seven eight i ii iii iv v vi vii viii ia iia iiia iva va via viia viiia)\";\n\n variantDescriptors[4] =\n \" (1 2 3 4 5 6 7 8) (1 2 4 5 6 7 8) (1: continguous) (2: with) (3: the)\"\n + \" (4: superior inferior upper lower medial superolateral superomedial inferolateral inferomedial anterior posterior anterolateral anteromedial peripheral interior exterior central subcapsular)\"\n + \" (5: edge edges margin margins border borders boundary boundaries perimeter perimeters aspect part portion region aspects parts portions regions division divisions segment segments)\"\n + \" (6: of) (7: segment )\"\n + \" (8: 1 2 3 4 5 6 7 8 one two three four five six seven eight i ii iii iv v vi vii viii ia iia iiia iva va via viia viiia)\";\n\n variantDescriptors[5] =\n \" (1 2 3 4 5 6 7 10 7) (1 3 4 5 6 7 10 7) (1 2 3 4 5 6 8 10 8) (1 2 3 4 5 6 8 10 8) (1 3 4 5 6 9 10 9) (1 3 4 5 6 9 10 9)\"\n + \" (3 4 5 6 7 10 7) (3 4 5 6 7 10 7) (3 4 5 6 8 10 8) (3 4 5 6 8 10 8) (3 4 5 6 9 10 9) (3 4 5 6 9 10 9)\"\n + \" (1 2 3 4 5 6 7 10 7) (1 3 4 5 6 7 10 7) (1 2 3 4 5 6 8 10 8) (1 2 3 4 5 6 8 10 8) (1 3 4 5 6 9 10 9) (1 3 4 5 6 9 10 9)\"\n + \" (1 2 3 4 6 7 10 7) (1 3 4 6 7 10 7) (1 2 3 4 6 8 10 8) (1 2 3 4 6 8 10 8) (1 3 4 6 9 10 9) (1 3 4 6 9 10 9)\"\n + \" (3 4 6 7 10 7) (3 4 6 7 10 7) (3 4 6 8 10 8) (3 4 6 8 10 8) (3 4 6 9 10 9) (3 4 6 9 10 9)\"\n + \" (1 2 3 4 6 7 10 7) (1 3 4 6 7 10 7) (1 2 3 4 6 8 10 8) (1 2 3 4 6 8 10 8) (1 3 4 6 9 10 9) (1 3 4 6 9 10 9)\"\n + \" (6 7) ( 6 8) ( 6 9) (6 7 10 7) (6 8 10 8) (6 9 10 9)\"\n + \" (1: adjacent near neighboring adjoining neighbouring along around within inside on over under above below)\"\n + \" (2: the)\"\n + \" (3: superior inferior upper lower medial superolateral superomedial inferolateral inferomedial anterior posterior anterolateral anteromedial peripheral interior exterior central subcapsular)\"\n + \" (4: edge edges margin margins border borders boundary boundaries perimeter perimeters aspect part portion region aspects parts portions regions division divisions segment segments junction)\"\n + \" (5: of) (6: segments ) (7: 1 2 3 4 5 6 7 8)\"\n + \" (8: one two three four five six seven eight)\"\n + \" (9: i ii iii iv v vi vii viii ia iia iiia iva va via viia viiia) (10: and)\";\n\n variantDescriptors[6] =\n \" (1 2 3 4 5 6 7 8 11 8) (1 2 4 5 6 7 8 11 8) (1 2 3 4 5 6 7 9 11 9) (1 2 4 5 6 7 9 11 9) (1 2 3 4 5 6 7 10 11 10) (1 2 4 5 6 7 10 11 10)\"\n + \" (1 2 7 8 11 8) (1 2 7 9 11 9) (1 2 7 10 11 10) (1: close adjacent rostral caudal superficial deep)\"\n + \" (2: to) (3: the)\"\n + \" (4: superior inferior upper lower medial superolateral superomedial inferolateral inferomedial anterior posterior anterolateral anteromedial peripheral interior exterior central subcapsular)\"\n + \" (5: edge edges margin margins border borders boundary boundaries perimeter perimeters aspect part portion region aspects parts portions regions division divisions segment segments junction)\"\n + \" (6: of) (7: segments ) (8: 1 2 3 4 5 6 7 8)\"\n + \" (9: one two three four five six seven eight)\"\n + \" (10: i ii iii iv v vi vii viii ia iia iiia iva va via viia viiia) (11: and)\";\n\n variantDescriptors[7] =\n \" (1 2 3 4 5 6 7 8 11 8) (1 2 4 5 6 7 8 11 8) (1 2 3 4 5 6 7 9 11 9) (1 2 4 5 6 7 9 11 9) (1 2 3 4 5 6 7 10 11 10) (1 2 4 5 6 7 10 11 10) \"\n + \" (1: continguous continuous) (2: with) (3: the)\"\n + \" (4: superior inferior upper lower medial superolateral superomedial inferolateral inferomedial anterior posterior anterolateral anteromedial peripheral interior exterior central subcapsular)\"\n + \" (5: edge edges margin margins border borders boundary boundaries perimeter perimeters aspect part portion region aspects parts portions regions division divisions segment segments junction)\"\n + \" (6: of) (7: segments ) (8: 1 2 3 4 5 6 7 8)\"\n + \" (9: one two three four five six seven eight)\"\n + \" (10: i ii iii iv v vi vii viii ia iia iiia iva va via viia viiia) (11: and)\";\n\n return variantDescriptors;\n }\n });\n }" ]
[ "0.51294136", "0.49892834", "0.48928124", "0.48460805", "0.4818341", "0.47320816", "0.47126582", "0.47104996", "0.47078425", "0.46156403", "0.46097267", "0.45959595", "0.45537883", "0.45313257", "0.4531203", "0.45246187", "0.4490014", "0.44821486", "0.44680652", "0.44674093", "0.44648352", "0.44523036", "0.44510144", "0.44370666", "0.44150308", "0.44146267", "0.4407496", "0.43824902", "0.4369466", "0.4355698", "0.4351061", "0.43455252", "0.43443134", "0.43368354", "0.4327675", "0.43270817", "0.4316095", "0.4308087", "0.43058294", "0.43003288", "0.42968288", "0.42937472", "0.42872697", "0.42740634", "0.42635947", "0.42553875", "0.42536938", "0.42445984", "0.42426375", "0.42403805", "0.4239913", "0.42393422", "0.42385307", "0.42366233", "0.42304957", "0.42303303", "0.42281055", "0.42233598", "0.4216847", "0.42165712", "0.42107508", "0.42070147", "0.42014217", "0.4193316", "0.4182485", "0.41770357", "0.4166938", "0.41655445", "0.41617718", "0.41589075", "0.41550276", "0.41542757", "0.41530457", "0.41491017", "0.4148855", "0.41483188", "0.4143429", "0.41368452", "0.41350028", "0.41312242", "0.4129888", "0.4129364", "0.41217905", "0.41215938", "0.4120186", "0.41197032", "0.4117645", "0.41103044", "0.4109898", "0.41095158", "0.41067988", "0.41064787", "0.41061896", "0.4092576", "0.408792", "0.40874875", "0.40844524", "0.40824336", "0.40793225", "0.40783772" ]
0.4418326
24
Select the Finding sites of descendants of Disorder Using Reverse Flag
@Test void reverseFlagAttributes() { assertEquals( Sets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE), strings(selectConceptIds("*:R " + FINDING_SITE + " = <" + DISORDER))); // Using Dot notation assertEquals( Sets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE), strings(selectConceptIds("<" + DISORDER + "." + FINDING_SITE))); // Dot notation against empty set of concepts assertEquals( Sets.newHashSet(), strings(selectConceptIds("<" + RIGHT_VENTRICULAR_STRUCTURE + "." + LATERALITY))); // Select the Finding sites of descendants of Clinical finding assertEquals( Sets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE, SKIN_STRUCTURE), strings(selectConceptIds("<" + CLINICAL_FINDING + "." + FINDING_SITE))); // Select the just the first two Finding sites of descendants of Clinical finding PageRequest pageRequest = PageRequest.of(0, 2); assertEquals( Sets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, SKIN_STRUCTURE), strings(selectConceptIds("<" + CLINICAL_FINDING + "." + FINDING_SITE, pageRequest))); // Select the second page of Finding sites of descendants of Clinical finding pageRequest = PageRequest.of(1, 2); assertEquals( Sets.newHashSet(PULMONARY_VALVE_STRUCTURE), strings(selectConceptIds("<" + CLINICAL_FINDING + "." + FINDING_SITE, pageRequest))); // Select the Laterality of Finding sites of descendants of Clinical finding assertEquals( Sets.newHashSet(RIGHT), strings(selectConceptIds("<" + CLINICAL_FINDING + "." + FINDING_SITE + "." + LATERALITY))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\nDGraph g=new DGraph();\r\nDirectedDFS d=new DirectedDFS(g);\r\nfor(Iterator<Integer> i=d.preorder.iterator();i.hasNext();)\r\n{\r\n\tSystem.out.print(i.next()+\" \");\r\n}\r\nSystem.out.println();\r\nfor(Iterator<Integer> i=d.postorder.iterator();i.hasNext();)\r\n{\r\n\tSystem.out.print(i.next()+\" \");\r\n}\r\nSystem.out.println();\r\n\r\n/*for(Iterator i=d.topologicalorder.iterator();i.hasNext();)\r\n{\r\n\tSystem.out.print(i.next()+\" \");\r\n}\r\nSystem.out.println();*/\r\n\r\n\r\n\tfor(int w:d.reversepost())\r\n\t\tSystem.out.print(w+\" \");\r\n\t//System.out.println(d.topologicalorder.pop());\r\n\t}", "Set<Edge> getDownwardOutgoingNeighborEdges() {\n\t\t\tif(_bumpOnUpwardPass) {\n\t\t\t\tSystem.err.println(\"calling downward pass neighbor method on upward pass!\");\n\t\t\t}\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID < v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn _outgoingEdges;\n\t\t\t\tSystem.out.println(this.toString()+\"'s outgoing edges:\\n\"+ outgoingEdges);\n\t\t\t\treturn outgoingEdges;\n\t\t}", "private TreeSet<Integer> getNeightborSets(DisjointSets<Pixel> ds, int root)\n {\n return null; //TODO: remove and replace this line\n }", "public void postorderTraversal() \n { \n postorderTraversal(header.rightChild); \n }", "public SortedSet<WLightpathUnregenerated> getInOutOrTraversingLigtpaths () { return n.getAssociatedRoutes(getNet().getWdmLayer().getNe()).stream().map(ee->new WLightpathUnregenerated(ee)).collect(Collectors.toCollection(TreeSet::new)); }", "void findSearchOrder() {\n boolean filled = false;\n for(int node: queryGraphNodes.keySet()) {\n\n vertexClass vc = queryGraphNodes.get(node);\n searchOrderSeq.add(node);\n for(int edge: queryGraphNodes.get(node).edges.keySet()) {\n filled = calcOrdering(edge);\n if (filled)\n break;\n }\n if(searchOrderSeq.size() == queryGraphNodes.size())\n break;\n\n }\n\n }", "public ArrayList<E> postorderNoRecursion()\n {\n ArrayList<E> nonRecursivePostorder= new ArrayList<>();\n\n /**\n * TODO: INSERT YOUR CODE HERE\n * FIND THE POST ORDER TRAVERSAL OF THE TREE WITHOUT USING RECURSION AND RETURN THE RESULT TRAVEL SEQUENCE IN ARRAYLIST nonRecursivePostorder\n */\n\n return nonRecursivePostorder;\n }", "public List reverseTopologicalSort( ){\r\n return this.topologicalsorting.reverseTraverse();\r\n }", "Set<Edge> getUpwardOutgoingNeighborEdges() {\n\t\t\tif(!_bumpOnUpwardPass) {\n\t\t\t\tSystem.err.println(\"calling upward pass neighbor method on downward pass!\");\n\t\t\t}\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID > v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn outgoingEdges;\n\t\t\t\tSystem.out.println(this.toString()+\"'s outgoing edges:\\n\"+ outgoingEdges);\n\t\t\t\treturn outgoingEdges;\n\t\t}", "Set<Edge> getIncomingNeighborEdges(boolean onUpwardPass) {\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID < v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn _outgoingEdges;\n\t\t\t\treturn outgoingEdges;\n\t\t}", "public List<PlanNode> findAllAtOrBelow( Traversal order ) {\n assert order != null;\n LinkedList<PlanNode> results = new LinkedList<PlanNode>();\n LinkedList<PlanNode> queue = new LinkedList<PlanNode>();\n queue.add(this);\n while (!queue.isEmpty()) {\n PlanNode aNode = queue.poll();\n switch (order) {\n case LEVEL_ORDER:\n results.add(aNode);\n queue.addAll(aNode.getChildren());\n break;\n case PRE_ORDER:\n results.add(aNode);\n queue.addAll(0, aNode.getChildren());\n break;\n case POST_ORDER:\n queue.addAll(0, aNode.getChildren());\n results.addFirst(aNode);\n break;\n }\n }\n return results;\n }", "private void renderDownPaths(Node n)\n {\n\tif (n.siblings.size()==0) {\n\t renderPath(n);\n\t return;\n\t}\n\n\tVectorIterator vi = new VectorIterator(n.siblings);\n\twhile (vi.hasNext()) {\n\t Node s = (Node)(vi.next());\n\t renderDownPaths(s);\n\t}\n }", "public ArrayList<SearchNode> neighbors() {\n ArrayList<SearchNode> neighbors = new ArrayList<SearchNode>();\n // StdOut.println(\"before: \" + this.snBoard);\n Iterable<Board> boards = new ArrayList<Board>();\n boards = this.snBoard.neighbors();\n // StdOut.println(\"after: \" + this.snBoard);\n for (Board b: boards) {\n // StdOut.println(b);\n // StdOut.println(\"checking: \"+b);\n // StdOut.println(\"checking father: \"+this.getPredecessor());\n if (this.getPredecessor() == null) {\n SearchNode sn = new SearchNode(b,\n b.hamming(),\n this,\n b.manhattan(),\n this.moves+1);\n // StdOut.println(\"checking: \"+(this.priority - this.snBoard.hamming()));\n // StdOut.println(\"checking: \"+(this.priority - this.snBoard.hamming()));\n // sn.addMovesToPriority(this.priority - this.snBoard.hamming()+1);\n neighbors.add(sn);\n } else { \n if (!b.equals(this.getPredecessor().snBoard)) {\n SearchNode sn = new SearchNode(b,\n b.hamming(),\n this,\n b.manhattan(),\n this.moves+1);\n neighbors.add(sn);\n }\n }\n \n }\n return neighbors;\n }", "public static void main(String[] args) {\n\n BDNode a = new BDNode(\"A\");\n BDNode b = new BDNode(\"B\");\n BDNode c = new BDNode(\"C\");\n BDNode d = new BDNode(\"D\");\n BDNode e = new BDNode(\"E\");\n\n a.link(b);\n a.link(d);\n b.link(a);\n b.link(c);\n b.link(e);\n c.link(b);\n c.link(d);\n d.link(a);\n d.link(c);\n d.link(e);\n e.link(b);\n e.link(d);\n\n BDNode target = e;\n\n/*\n // BFS\n Queue<BDNode> queue = new LinkedList<>();\n queue.offer(a);\n\n while(!queue.isEmpty()) {\n BDNode n = queue.poll();\n n.visit();\n System.out.println(n); // 찾는 여정 출력\n\n if(n.equals(target)) {\n System.out.println(\"BFS Found! \" + n);\n break;\n }\n\n for (BDNode l : n.links) {\n if(l.isVisited()) continue;\n if (queue.contains(l)) continue;\n queue.offer(l);\n }\n\n // 위랑 같은 표현\n// n.links.stream()\n// .filter(l -> !queue.contains(l))\n// .forEach(queue::offer);\n }\n*/\n\n // DFS\n Stack<BDNode> stack = new Stack<>();\n stack.push(a);\n\n while(!stack.isEmpty()) {\n BDNode n = stack.pop();\n n.visit();\n System.out.println(n); // 찾는 여정 출력\n\n if (n.equals(target)) {\n System.out.println(\"DFS Found! \" + n);\n break;\n }\n\n for (BDNode l : n.links) {\n if (l.isVisited()) continue;\n if (stack.contains(l)) continue;\n\n stack.push(l);\n }\n }\n\n\n }", "private void GreedySearch(){\n\n Queue<Node> expanded = new LinkedList<>();\n ArrayList<Node> fringe = new ArrayList<>();\n ArrayList<Node> fringeTemp = new ArrayList<>();\n\n\n Node current = startNode;\n\n while(expanded.size() < 1000){\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal is reached.\n solutionPath(current);\n expanded.add(current);\n printExpanded(expanded);\n System.exit(0);\n }\n\n\n boolean b = cycleCheck(current,expanded);\n\n if(!b) {\n expanded.add(current);\n }\n\n if(!b){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n\n }\n }\n\n if(current.getDigit().last_changed != 1){\n\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n }\n\n\n\n for(Node n : fringe){\n heuristicSetter(n);\n\n }\n\n fringeTemp.addAll(fringe);\n //now all the nodes in fringe have the heuristic value.\n //We can get the last added minm\n Node minm;\n if(fringeTemp.size() != 0){\n minm = fringeTemp.get(0);\n }else{\n break;\n }\n for(int i = 1; i<fringeTemp.size(); i++){\n if(fringeTemp.get(i).getHeuristic() <= minm.getHeuristic()){\n minm = fringeTemp.get(i);\n }\n }\n\n //now we have the minm for the next stage.\n current = minm;\n fringeTemp.remove(minm);\n fringe.clear();\n }\n\n //While loop ends\n System.out.println(\"No solution found.\");\n printExpanded(expanded);\n\n\n\n }", "public List reverseTopologicalSort( Vertex startat ){\r\n return this.topologicalsorting.reverseTraverse( startat );\r\n }", "void DFSearch(BFSNode n){\n\t\tn.discovered=true;\r\n\t\tSystem.out.print(\" discovered\");\r\n\t\tn.preProcessNode();\r\n\t\tfor( Integer edg: n.edges){\r\n\t\t\tn.processEdge(edg);\r\n\t\t\tif(!nodes[edg].discovered){\r\n\t\t\t\tnodes[edg].parent = n; \r\n\t\t\t\tnodes[edg].depth = n.depth +1;\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.print(\"{new track with parent [\"+ nodes[edg].parent.value+\"] }\");\r\n\t\t\t\tDFSearch(nodes[edg]);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(nodes[edg] != n.parent){\r\n\t\t\t\t\tSystem.out.print(\"{LOOP}\");\r\n\t\t\t\t\tif(nodes[edg].depth < n.reachableLimit.depth){\r\n\t\t\t\t\t\tn.reachableLimit = nodes[edg];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.print(\"{second visit}\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"back from node [ \"+n.value +\" ]\");\r\n\t\tn.postProcessNode();\r\n\t\tn.processed = true;\r\n\t\t\r\n\t}", "Digraph reverse() {\n return null;\n }", "@Override\r\n\tpublic List<Node<T>> getPostOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// Lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\treturn auxiliarRecorridoPost(raiz, lista);\r\n\t}", "public void topologicalSort() {\n\t\t\n\t\tvisited = new boolean[n];\n reverseDfs = new Stack<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (!visited[i]) {\n\t\t\t\tdfs(i);\n\t\t\t}\n\t\t}\n\t}", "private List<Branch> findBranchs()\r\n\t{\t\r\n\t\tList<Branch> localBranchs = new ArrayList<>();\r\n\t\tHashMap<String, Node> destinationNodes = new HashMap<>();\r\n\t\t\r\n\t\t// Percorre todos os arcos da rede\r\n\t\tfor (Edge edge: this.getEdges())\r\n\t\t{\t\r\n\t\t\t// Se ha carga no no destino do arco, este no � uma folha da rede\r\n\t\t\tif (edge != null && edge.getDestinationNode().getLoads().size() > 0) \r\n\t\t\t{\t\r\n\t\t\t\t// Verifica se h� mais de um arco com a mesma carga\r\n\t\t\t\tif (!destinationNodes.containsKey(edge.getDestinationNode().getLabel()))\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\tBranch branch = new Branch(edge.getDestinationNode().getLabel());\r\n\t\t\t\t\tbranch.addEdges(edge);\r\n\t\t\t\t\tEdge newEdge = edge.getReference();\r\n\t\t\t\t\tdestinationNodes.put(edge.getDestinationNode().getLabel(), edge.getDestinationNode());\r\n\t\t\t\t\t\r\n\t\t\t\t\t// percorre os elementos amontantes do no e monta o laco\r\n\t\t\t\t\twhile (newEdge != null) \r\n\t\t\t\t\t{\t\t\r\n\t\t\t\t\t\tbranch.addEdges(newEdge.getReference());\r\n\t\t\t\t\t\tnewEdge = newEdge.getReference();\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tlocalBranchs.add(branch);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\r\n\t\treturn localBranchs; \r\n\t}", "public static void main(String[] args) {\n\t\tList<List<Integer>> res = new ArrayList<List<Integer>>();\n\t\t\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(2);\n\t\tlist.add(3);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(4);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(5);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(6);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(7);\n\t\tlist.add(8);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(9);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(10);\n\t\tlist.add(11);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tSystem.out.println(res);\n\t\tSystem.out.println(Inorder(res));\n\t\tList<Integer> queries = new ArrayList<>();\n\t\tqueries.add(2);\n\t\tqueries.add(4);\n\t\tswapNodes(res, queries);\n\n\t}", "public List<Node> getShortestPathToDestination(Node destination) {\n List<Node> path = new ArrayList<Node>();\n\n\n\n for (Node node = destination; node != null; node = node.previous){\n Log.i(\"bbb\", \"get path \"+node._waypointName);\n path.add(node);\n }\n\n // reverse path to get correct order\n Collections.reverse(path);\n return path;\n }", "public void filterToBidirectionalLinks() {\n RTGraphComponent.RenderContext myrc = (RTGraphComponent.RenderContext) getRTComponent().rc; if (myrc == null) return;\n\n // Get the visible links, extract the direction, create the reverse direction -- if that exists, add those records to keepers\n Iterator<String> it = myrc.graphedgeref_to_link.keySet().iterator(); Set<Bundle> to_keep = new HashSet<Bundle>();\n while (it.hasNext()) {\n String graph_edge_ref = it.next(); String line_ref = myrc.graphedgeref_to_link.get(graph_edge_ref);\n int fm_i = digraph.linkRefFm(graph_edge_ref);\n int to_i = digraph.linkRefTo(graph_edge_ref);\n String other_dir = digraph.getLinkRef(to_i,fm_i);\n if (myrc.graphedgeref_to_link.containsKey(other_dir)) { to_keep.addAll(myrc.link_counter_context.getBundles(line_ref)); }\n }\n\n // Add the no mapping set and push it to the RTParent\n to_keep.addAll(getRTComponent().getNoMappingSet()); getRTParent().push(getRTParent().getRootBundles().subset(to_keep));\n }", "public void inOrderTraverseRecursive();", "@Test\n public void testTraverseDescendants() {\n System.out.println(\"testTraverseDescendants\");\n List<Person> people = dao.listDescendants(\"KWCB-HZV\", 10, \"\");\n assertIdsEqual(descendants, people);\n }", "public SortedSet<WServiceChain> getInOutOrTraversingServiceChains () { return n.getAssociatedRoutes(getNet().getIpLayer().getNe()).stream().map(ee->new WServiceChain(ee)).collect(Collectors.toCollection(TreeSet::new)); }", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void inorderTraversal() \n { \n inorderTraversal(header.rightChild); \n }", "void removeNeighbor(IsisNeighbor isisNeighbor);", "@Override\r\n public Set<List<String>> findAllPaths(int sourceId, int targetId, int reachability) {\r\n //all paths found\r\n Set<List<String>> allPaths = new HashSet<List<String>>();\r\n //collects path in one iteration\r\n Set<List<String>> newPathsCollector = new HashSet<List<String>>();\r\n //same as the solution but with inverted edges\r\n Set<List<String>> tmpPathsToTarget = new HashSet<List<String>>();\r\n //final solution\r\n Set<List<String>> pathsToTarget = new HashSet<List<String>>();\r\n \r\n String[] statementTokens = null; \r\n Set<Integer> allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n List<String> statementsFound = new ArrayList<String>();\r\n \r\n for (int i = 0; i < reachability; i++) {\r\n if (i == 0) { \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(sourceId);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n //allProcessedNodes.add(inNodeId); \r\n //Incoming nodes are reversed\r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n allPaths.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(sourceId);\r\n \r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n statementsFound.add(outEdge);\r\n allPaths.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n } else {\r\n newPathsCollector = new HashSet<List<String>>();\r\n\r\n for (List<String> statements: allPaths) {\r\n allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n int lastNodeInPath = 0;\r\n \r\n for (String predicate: statements) {\r\n if (predicate.contains(\">-\")) {\r\n statementTokens = predicate.split(\">-\");\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[0]).reverse().toString()));\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString()));\r\n lastNodeInPath = Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString());\r\n } else {\r\n statementTokens = predicate.split(\"->\"); \r\n allProcessedNodes.add(Integer.parseInt(statementTokens[0]));\r\n allProcessedNodes.add(Integer.parseInt(statementTokens[2]));\r\n lastNodeInPath = Integer.parseInt(statementTokens[2]);\r\n }\r\n }\r\n \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(lastNodeInPath);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n if (allProcessedNodes.contains(inNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n newPathsCollector.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(lastNodeInPath);\r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n if (allProcessedNodes.contains(outNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(outEdge);\r\n newPathsCollector.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n }\r\n allPaths.addAll(newPathsCollector);\r\n }\r\n \r\n //System.out.println(\"*****End of iteration \" + i);\r\n //System.out.println(\"#SIZE OF allPaths: \" + allPaths.size());\r\n int numItems = 0;\r\n for (List<String> currList: allPaths) {\r\n numItems = numItems + currList.size();\r\n }\r\n //System.out.println(\"#NUMBER OF ELEMS OF ALL LISTS: \" + numItems);\r\n //System.out.println(\"#SIZE OF tmpPathsToTarget : \" + tmpPathsToTarget.size());\r\n }\r\n \r\n //We need to reverse back all the predicates\r\n for (List<String> statements: tmpPathsToTarget) { \r\n List<String> fixedStatements = new ArrayList<String>(); \r\n for (int i = 0; i < statements.size(); i++) { \r\n String statement = statements.get(i); \r\n if (statement.contains(\">-\")) {\r\n fixedStatements.add(new StringBuilder(statement).reverse().toString());\r\n } else {\r\n fixedStatements.add(statement);\r\n } \r\n }\r\n pathsToTarget.add(fixedStatements);\r\n }\r\n return pathsToTarget;\r\n }", "List<List<Node>> findUndirectedPaths(Node s, Node d) {\n\t\tList<List<Node>> paths = new ArrayList<>();\n\t\tpath(s, d, new HashSet<>(), new ArrayList<>(), paths);\n System.out.println(\"Computed paths: \" + paths);\n return paths;\n\t}", "public ArrayList<SearchNode> search(Problem p) {\n\tfrontier = new NodeQueue();\t// The frontier is a queue of expanded SearchNodes not processed yet\n\texplored = new HashSet<SearchNode>();\t/// The explored set is a set of nodes that have been processed \n\tGridPos startState = (GridPos) p.getInitialState();\t// The start state is given\n\tfrontier.addNodeToFront(new SearchNode(startState));\t// Initialize the frontier with the start state \n\n\t\n\tpath = new ArrayList<SearchNode>();\t// Path will be empty until we find the goal\n\t\t\n\n\n\twhile(!frontier.isEmpty()){\n\n\t SearchNode s = frontier.removeFirst(); \n\t GridPos g = s.getState(); \n\n\t if ( p.isGoalState(g) ) {\n\t\tpath = s.getPathFromRoot();\t\n\t\tbreak; \n\t }\n\t \n\t explored.add(s); \t \n\t ArrayList<GridPos> childStates = p.getReachableStatesFrom(g);\n\n\t while(!childStates.isEmpty()){\n\n\t\tSearchNode child = new SearchNode(childStates.get(0), s); \n\n\t\tif(!explored.contains(child) && !frontier.contains(child)){\n\n\t\t if ( p.isGoalState(child.getState()) ) {\n\t\t\n\t\t\tpath = child.getPathFromRoot();\t\n\t\t\treturn path; \n\t\t }\n\n\t\t if(insertFront) \n\t\t\tfrontier.addNodeToFront(child); \t\t \t\t\n\t\t else\t\n\t\t\tfrontier.addNodeToBack(child); \t \n\n\n\n\t\t}\n\n\t\tchildStates.remove(0);\n\t }\t \n\t}\n\n\n\treturn path;\n\n }", "private void findNeighbour(int offset) {\n TreeNodeImpl node = (TreeNodeImpl) projectTree.getLastSelectedPathComponent();\n TreePath parentPath = projectTree.getSelectionPath().getParentPath();\n NodeList list = (NodeList) node.getParent().children();\n\n for (int i = 0; i < list.size(); ++i) {\n if (list.get(i).equals(node)) {\n if (offset > 0 && i < list.size() - offset) {\n projectTree.setSelectionPath(parentPath.pathByAddingChild(list.get(i + offset)));\n break;\n }\n if (offset < 0 && i >= offset) {\n projectTree.setSelectionPath(parentPath.pathByAddingChild(list.get(i + offset)));\n break;\n }\n }\n }\n }", "public List <RMShape> getShapesToDescendant(RMShape aShape)\n{\n List list = aShape.getShapesToAncestor(this); Collections.reverse(list); return list;\n}", "public static Set<ARGState> getAllStatesOnPathsTo(ARGState pLastElement) {\n\n Set<ARGState> result = new HashSet<ARGState>();\n Deque<ARGState> waitList = new ArrayDeque<ARGState>();\n\n result.add(pLastElement);\n waitList.add(pLastElement);\n\n while (!waitList.isEmpty()) {\n ARGState currentElement = waitList.poll();\n for (ARGState parent : currentElement.getParents()) {\n if (result.add(parent)) {\n waitList.push(parent);\n }\n }\n }\n\n return result;\n }", "public SortedSet<WLightpathUnregenerated> getOutgoingLigtpaths () { return n.getOutgoingRoutes(getNet().getWdmLayer().getNe()).stream().map(ee->new WLightpathUnregenerated(ee)).collect(Collectors.toCollection(TreeSet::new)); }", "private List<Node> findBranchsMesh()\r\n\t{\t\r\n\t\t// Nos que fecham o laco\r\n\t\tList<Node> nodes = new ArrayList<>();\r\n\t\t\r\n\t\tfor (Entry<String, Integer> value : cacheDestinationNodes.entrySet())\r\n\t\t{\r\n\t\t\t// No possui mais de um arco chegando (ANEL!)\r\n\t\t\tif (value.getValue() > 1)\r\n\t\t\t{\r\n\t\t\t\tString label = value.getKey();\r\n\t\t\t\tNode node = cacheNodes.get(label);\r\n\t\t\t\tnodes.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// nodes > 1 indica que esta rede possui anel\r\n\t\treturn nodes; \r\n\t}", "private boolean doDownInternal(\n UiElementNode uiNode,\n ElementDescriptor[] descriptorFilters,\n Node[] outSelectXmlNode,\n UiElementNode[] outUiSearchRoot,\n boolean testOnly) {\n outUiSearchRoot[0] = uiNode.getUiParent();\n if (outUiSearchRoot[0] != null && outUiSearchRoot[0].getUiParent() != null) {\n outUiSearchRoot[0] = outUiSearchRoot[0].getUiParent();\n }\n\n Node xmlNode = uiNode.getXmlNode();\n ElementDescriptor nodeDesc = uiNode.getDescriptor();\n if (xmlNode == null || nodeDesc == null) {\n return false;\n }\n UiElementNode uiParentNode = uiNode.getUiParent();\n Node xmlParent = uiParentNode == null ? null : uiParentNode.getXmlNode();\n if (xmlParent == null) {\n return false;\n }\n\n UiElementNode uiNext = uiNode.getUiNextSibling();\n\n // Only accept a sibling that has an XML attached and\n // is part of the allowed descriptor filters.\n while (uiNext != null &&\n (uiNext.getXmlNode() == null || !matchDescFilter(descriptorFilters, uiNext))) {\n uiNext = uiNext.getUiNextSibling();\n }\n\n if (uiNext != null && uiNext.getXmlNode() != null) {\n // This node is not the last one of the parent.\n Node xmlNext = uiNext.getXmlNode();\n // If the next sibling is a node that can have children, though,\n // then the node is inserted as the first child.\n if (uiNext.getDescriptor().acceptChild(nodeDesc)) {\n if (testOnly) {\n return true;\n }\n // Note: insertBefore works as append if the ref node is\n // null, i.e. when the node doesn't have children yet.\n xmlNext.insertBefore(\n xmlParent.removeChild(xmlNode),\n xmlNext.getFirstChild());\n outSelectXmlNode[0] = xmlNode;\n } else {\n // This node is not the last one of the parent, so it can be\n // removed and then inserted after its next sibling.\n\n if (testOnly) {\n return true;\n }\n // Insert \"before after next\" ;-)\n xmlParent.insertBefore(\n xmlParent.removeChild(xmlNode),\n xmlNext.getNextSibling());\n outSelectXmlNode[0] = xmlNode;\n }\n } else if (uiParentNode != null && !(xmlParent instanceof Document)) {\n UiElementNode uiGrandParent = uiParentNode.getUiParent();\n Node xmlGrandParent = uiGrandParent == null ? null : uiGrandParent.getXmlNode();\n ElementDescriptor grandDesc =\n uiGrandParent == null ? null : uiGrandParent.getDescriptor();\n\n if (xmlGrandParent != null &&\n !(xmlGrandParent instanceof Document) &&\n grandDesc != null &&\n grandDesc.acceptChild(nodeDesc)) {\n // This node is the last node of its parent.\n // If neither the parent nor the grandparent is a document,\n // then the node can be inserted right after the parent.\n // The parent node must actually accept this kind of child.\n if (testOnly) {\n return true;\n }\n xmlGrandParent.insertBefore(\n xmlParent.removeChild(xmlNode),\n xmlParent.getNextSibling());\n outSelectXmlNode[0] = xmlNode;\n }\n }\n\n return false;\n }", "public void reverseDi() {\n int hi = size - 1;\n int lo = 0;\n\n while (lo < hi) {\n Node left = getNodeAt(lo);\n Node right = getNodeAt(hi);\n\n Object temp = left.data;\n left.data = right.data;\n right.data = temp;\n\n lo++;\n hi--;\n }\n }", "private void DFS() {\n\t\tfor(Node node: nodeList) {\r\n\t\t\tif(!node.isVisited())\r\n\t\t\t\tdfsVisit(node);\r\n\t\t}\r\n\t}", "public ArrayList<UUSearchNode> getSuccessors() {\n\n ArrayList<UUSearchNode> successors = new ArrayList<UUSearchNode>();//this will be returned\n ArrayList<CannibalNode> helper = new ArrayList<CannibalNode>();\n\n if (this.state[2]==1){ //if the boat is on the starting shore\n helper.add(new CannibalNode(this.state[0] - 2, this.state[1],\n this.state[2] - 1, this.depth + 1)); //subtracting <201>\n helper.add(new CannibalNode(this.state[0], this.state[1] - 2,\n this.state[2] - 1, this.depth + 1)); //subtracting <021>\n helper.add(new CannibalNode(this.state[0] - 1, this.state[1] - 1,\n this.state[2] - 1, this.depth + 1)); //subtracting <111>\n helper.add(new CannibalNode(this.state[0] - 1, this.state[1],\n this.state[2] - 1, this.depth + 1)); //subtracting <101>\n helper.add(new CannibalNode(this.state[0], this.state[1] - 1,\n this.state[2] - 1, this.depth + 1)); //subtracting <011>\n }else{ //if the boat is on the opposite shore\n helper.add(new CannibalNode(this.state[0] + 2, this.state[1],\n this.state[2] + 1, this.depth + 1)); //adding <201>\n helper.add(new CannibalNode(this.state[0], this.state[1] + 2,\n this.state[2] + 1, this.depth + 1)); //adding <021>\n helper.add(new CannibalNode(this.state[0] + 1, this.state[1] + 1,\n this.state[2] + 1, this.depth + 1)); //adding <111>\n helper.add(new CannibalNode(this.state[0] + 1, this.state[1],\n this.state[2] + 1, this.depth + 1)); //adding <101>\n helper.add(new CannibalNode(this.state[0], this.state[1] + 1,\n this.state[2] + 1, this.depth + 1)); //adding <011>\n }\n\n //now we check for feasibility and legality\n for(CannibalNode n : helper){\n if(isFeasibleState(n.state) && isLegalState(n.state)){\n successors.add(n);\n }\n }\n return successors;\n }", "public boolean reducible() {\n if (dfsTree.back.isEmpty()) {\n return true;\n }\n int size = controlFlow.transitions.length;\n boolean[] loopEnters = dfsTree.loopEnters;\n TIntHashSet[] cycleIncomings = new TIntHashSet[size];\n // really this may be array, since dfs already ensures no duplicates\n TIntArrayList[] nonCycleIncomings = new TIntArrayList[size];\n int[] collapsedTo = new int[size];\n int[] queue = new int[size];\n int top;\n for (int i = 0; i < size; i++) {\n if (loopEnters[i]) {\n cycleIncomings[i] = new TIntHashSet();\n }\n nonCycleIncomings[i] = new TIntArrayList();\n collapsedTo[i] = i;\n }\n\n // from whom back connections\n for (Edge edge : dfsTree.back) {\n cycleIncomings[edge.to].add(edge.from);\n }\n // from whom ordinary connections\n for (Edge edge : dfsTree.nonBack) {\n nonCycleIncomings[edge.to].add(edge.from);\n }\n\n for (int w = size - 1; w >= 0 ; w--) {\n top = 0;\n // NB - it is modified later!\n TIntHashSet p = cycleIncomings[w];\n if (p == null) {\n continue;\n }\n TIntIterator iter = p.iterator();\n while (iter.hasNext()) {\n queue[top++] = iter.next();\n }\n\n while (top > 0) {\n int x = queue[--top];\n TIntArrayList incoming = nonCycleIncomings[x];\n for (int i = 0; i < incoming.size(); i++) {\n int y1 = collapsedTo[incoming.getQuick(i)];\n if (!dfsTree.isDescendant(y1, w)) {\n return false;\n }\n if (y1 != w && p.add(y1)) {\n queue[top++] = y1;\n }\n }\n }\n\n iter = p.iterator();\n while (iter.hasNext()) {\n collapsedTo[iter.next()] = w;\n }\n }\n\n return true;\n }", "public void topologicalSort() {\n\t\tboolean[] visited = new boolean[edges.length];\n\n\t\tfor (int i = 0; i < visited.length; i++) {\n\t\t\tif (visited[i] == false) {\n\t\t\t\tdfs(i, visited);\n\t\t\t}\n\t\t}\n\n\t}", "public Set<Vertex> post(Vertex start){\n\t\tSet<Vertex> reach = new HashSet<Vertex>();\n\t\tif(this.edgesByStart.get(start) == null)\n\t\t\treturn reach;\n\t\tfor(LabeledEdge trans : this.edgesByStart.get(start)){\n\t\t\treach.add(trans.getEnd());\n\t\t}\n\t\treturn reach;\n\t\t\n\t}", "public List<PlanNode> findAllAtOrBelow( Traversal order,\n Set<Type> typesToFind ) {\n assert order != null;\n LinkedList<PlanNode> results = new LinkedList<PlanNode>();\n LinkedList<PlanNode> queue = new LinkedList<PlanNode>();\n queue.add(this);\n while (!queue.isEmpty()) {\n PlanNode aNode = queue.poll();\n switch (order) {\n case LEVEL_ORDER:\n if (typesToFind.contains(aNode.getType())) {\n results.add(aNode);\n }\n queue.addAll(aNode.getChildren());\n break;\n case PRE_ORDER:\n if (typesToFind.contains(aNode.getType())) {\n results.add(aNode);\n }\n queue.addAll(0, aNode.getChildren());\n break;\n case POST_ORDER:\n queue.addAll(0, aNode.getChildren());\n if (typesToFind.contains(aNode.getType())) {\n results.addFirst(aNode);\n }\n break;\n }\n }\n return results;\n }", "public void postorder()\r\n {\r\n postorder(root);\r\n }", "public String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "void findDown(Board board) {\n if (tile.getRowPos() != 6) {\n Tile downTile = board.getTileObjByPosition(tile.getRowPos() + 1, tile.getColPos());\n if (downTile != null) {\n if (RailroadInk.areConnectedNeighbours(tile.getPlacementStr(), downTile.getPlacementStr())) {\n Node downNode;\n if ((downTile.graphId > 0) || ((downTile.graphId == -1) && (downTile.downId == graphId))) {\n downNode = nodeMap.get(downTile.pos);\n } else {\n downNode = new Node(downTile);\n if (downTile.name.equals(\"B2\")) {\n downTile.upId = graphId;\n }\n nodeMap.put(downTile.pos, downNode);\n }\n\n // Update the connection relationship.\n this.down = downNode;\n downNode.up = this;\n if (this.tile.name.equals(\"B2\")) {\n this.tile.downId = graphId;\n }\n\n if ((!downTile.name.equals(\"B2\")) && (downNode.right == null)) {\n downNode.findRight(board);\n }\n if (downNode.down == null) {\n downNode.findDown(board);\n }\n if ((!downTile.name.equals(\"B2\")) && (downNode.left == null)) {\n downNode.findLeft(board);\n }\n\n }\n }\n }\n }", "static void iterativeDfs(Node startingNode) {\n Set<Node> markedAsVisited = new HashSet<>();\n\n // creates a stack for piling up the nodes to visit\n ArrayDeque<Node> toBeVisited = new ArrayDeque<>();\n\n // sets the starting node as to be visited\n toBeVisited.push(startingNode);\n\n // adds the starting node to the set of marked as visited nodes\n markedAsVisited.add(startingNode);\n\n // while there nodes to visit\n while (!toBeVisited.isEmpty()) {\n\n // gets the current node\n Node current = toBeVisited.pop();\n\n // processes the node\n System.out.print(\"Node \" + current.val + \", \");\n\n // loops over the neighbours of the current node\n for (Node neighbour: current.neighbours) {\n\n // if the neighbour has not been already visited\n if (! markedAsVisited.contains(neighbour)) {\n\n // adds the neighbour to the ones to be visited\n toBeVisited.push(neighbour);\n\n // adds the neighbour to the set of marked as visited nodes\n markedAsVisited.add(neighbour);\n }\n }\n }\n }", "public TreeNode DFS(int ps,int pe, int is, int ie, int[] postorder, int[] inorder){\n if(ps>pe || is>ie) return null;\n int numroot = postorder[pe];\n TreeNode root = new TreeNode(numroot);\n\n int index = is;\n for(int i=is;i<=ie;i++){\n if(inorder[i]==numroot){\n index = i;\n }\n }\n int rightlen = ie-index;\n root.left = DFS(ps,pe-rightlen-1,is,index-1,postorder,inorder);\n root.right = DFS(pe-rightlen,pe-1,index+1,ie,postorder,inorder);\n return root;\n\n }", "private static void DepthFirstSearch(int i, ArrayList<ArrayList<Integer>> nodes, boolean[] visited) {\n\t\tif(nodes == null) return;\n\t\tvisited[i] = true;\n\t\tSystem.out.println(i);\n\t\tfor(int p : nodes.get(i)) {\n\t\t\tif(!visited[p]) {\n\t\t\t\tDepthFirstSearch(p,nodes, visited);\n\t\t\t}\n\t\t}\n\t\t\t\n\t}", "private void awayFromAncestorCycle(Graph graph) {\n while (changeFlag) {\n changeFlag = false;\n List<Node> nodes = graph.getNodes();\n\n for (Node B : nodes) {\n List<Node> adj = graph.getAdjacentNodes(B);\n\n if (adj.size() < 2) {\n continue;\n }\n\n ChoiceGenerator cg = new ChoiceGenerator(adj.size(), 2);\n int[] combination;\n\n while ((combination = cg.next()) != null) {\n Node A = adj.get(combination[0]);\n Node C = adj.get(combination[1]);\n\n //choice gen doesnt do diff orders, so must switch A & C around.\n awayFromAncestor(graph, A, B, C);\n awayFromAncestor(graph, C, B, A);\n awayFromCycle(graph, A, B, C);\n awayFromCycle(graph, C, B, A);\n }\n }\n }\n changeFlag = true;\n }", "public boolean descendantIndirect(Element rep) {\r\n if (rep instanceof Repertoire) {\r\n List<Element> contenu = ((Repertoire) rep).element;\r\n\r\n for (Element item : contenu) {\r\n if (item.equals(this)) {\r\n return true;\r\n } else {\r\n if (item instanceof Repertoire) {\r\n descendantIndirect(item);\r\n }\r\n }\r\n }\r\n }\r\n return (false);\r\n }", "private void findDetectivePath() {\n Cell current, next;\n detectivePath = new ArrayDeque<>();\n clearVisitedMarks();\n current = detective;\n current.visited = true;\n\n while (true) {\n next = nextNotVisitedCell(current);\n if (next == killer) {\n detectivePath.addLast(current);\n detectivePath.addLast(next);\n break;\n } else if (next != null) {\n detectivePath.addLast(current);\n current = next;\n current.visited = true;\n } else {\n current = detectivePath.pollLast();\n }\n }\n detectivePath.pollFirst();\n }", "public void resetVisited() {\r\n\t\tvisited = false;\r\n\t\tfor (ASTNode child : getChildren()) {\r\n\t\t\tif (!visited)\r\n\t\t\t\tcontinue;\r\n\t\t\tchild.resetVisited();\r\n\t\t}\r\n\t}", "@SuppressWarnings( \"unchecked\" )\n public List<Node> getSecondChoices() {\n final List<Part> relatedParts = findRelatedParts();\n final Node node = getNode();\n final Node other = getOther();\n return (List<Node>) CollectionUtils.select(\n IteratorUtils.toList( node.getSegment().parts() ),\n new Predicate() {\n @Override\n public boolean evaluate( Object object ) {\n Part part = (Part) object;\n return !part.equals( node )\n && !part.equals( other )\n && !relatedParts.contains( part );\n }\n }\n );\n }", "public void setAdjacencySearch(boolean b) {\n adjacencySearch = b;\n }", "private void breadthFirstSearch (int start, int[] visited, int[] parent){\r\n Queue< Integer > theQueue = new LinkedList< Integer >();\r\n boolean[] identified = new boolean[getNumV()];\r\n identified[start] = true;\r\n theQueue.offer(start);\r\n while (!theQueue.isEmpty()) {\r\n int current = theQueue.remove();\r\n visited[current] = 1; //ziyaret edilmis vertexler queuedan cikarilan vertexlerdir\r\n Iterator < Edge > itr = edgeIterator(current);\r\n while (itr.hasNext()) {\r\n Edge edge = itr.next();\r\n int neighbor = edge.getDest();\r\n if (!identified[neighbor]) {\r\n identified[neighbor] = true;\r\n theQueue.offer(neighbor);\r\n parent[neighbor] = current;\r\n }\r\n }\r\n }\r\n }", "private BGPPath internalPathSelection(Collection<BGPPath> possList, boolean avoidDecoys) {\n BGPPath currentBest = null;\n int currentRel = -4;\n\n for (BGPPath tPath : possList) {\n\n /*\n * If we're doing avoidance based on ignoring local preference, then\n * for the first pass we're literally just going to throw out all\n * routes that are NOT clean, this is corrected in path selection if\n * this leaves us w/ no viable routes\n */\n if (avoidDecoys && (this.avoidMode == AS.AvoidMode.LOCALPREF || this.avoidMode == AS.AvoidMode.LEGACY)) {\n if (tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n }\n\n /*\n * If we have no best path currently selected, the first one is best\n * by default\n */\n if (currentBest == null) {\n currentBest = tPath;\n currentRel = this.getRel(currentBest.getNextHop());\n continue;\n }\n\n /*\n * Local pref based on relationship step\n */\n int newRel = this.getRel(tPath.getNextHop());\n if (newRel > currentRel) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n\n /*\n * If local pref is the same, move on to the next critera\n */\n if (newRel == currentRel) {\n /*\n * If we're inserting the decision to route around decoys after\n * local pref, but before path length, do so here\n */\n if (this.avoidMode == AS.AvoidMode.PATHLEN) {\n if (avoidDecoys && currentBest.containsAnyOf(this.botSet) && !tPath.containsAnyOf(this.botSet)) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n if (avoidDecoys && !currentBest.containsAnyOf(this.botSet) && tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n }\n\n if (currentBest.getPathLength() > tPath.getPathLength()) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n } else if (currentBest.getPathLength() == tPath.getPathLength()) {\n if (avoidDecoys && this.avoidMode == AS.AvoidMode.TIEBREAK\n && currentBest.containsAnyOf(this.botSet) && !tPath.containsAnyOf(this.botSet)) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n if (avoidDecoys && this.avoidMode == AS.AvoidMode.TIEBREAK\n && !currentBest.containsAnyOf(this.botSet) && tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n\n if (tPath.getNextHop() < currentBest.getNextHop()) {\n currentBest = tPath;\n currentRel = newRel;\n }\n }\n }\n }\n\n return currentBest;\n }", "public static void main(String[] args) {\n TreeNode n7 = new TreeNode(7);\n TreeNode n6 = new TreeNode(6);\n TreeNode n5 = new TreeNode(5);\n TreeNode n4 = new TreeNode(4);\n TreeNode n3 = new TreeNode(3);\n TreeNode n2 = new TreeNode(2);\n TreeNode n1 = new TreeNode(1);\n\n n4.left = n2;\n n4.right = n6;\n\n n2.left = n1;\n n2.right = n3;\n\n n6.left = n5;\n n6.right = n7;\n\n System.out.println(\"Cay n4\");\n List<Integer> resultPreOrder = preOrderTravel(n4);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n\n System.out.println(\"Cay n2\");\n resultPreOrder = preOrderTravel(n2);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n }", "private void findPrev() {\n \tthis.find(false);\n }", "@Test\n \tpublic void whereClauseForNodeIndirectDominance() {\n \t\tnode23.addJoin(new Dominance(node42));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\")\n \t\t);\n \t}", "public abstract List<ResolvedReferenceType> getDirectAncestors();", "public static void main(String[] args) {\nArrayList<String>names=new ArrayList<String>();\r\nnames.add(\"Volve\");\r\nnames.add(\"BMW\");\r\nnames.add(\"Audi\");\r\nnames.add(\"Benz\");\r\nSystem.out.println(names);\r\nCollections.sort(names);\r\nSystem.out.println(names);\r\nSystem.out.println(Collections.binarySearch(names,\"i10\"));\r\nCollections.reverse(names);\r\nSystem.out.println(names);\r\n\r\nTreeSet<String>ts=new TreeSet<String>();\r\nts.add(\"ram\");\r\nts.add(\"jai\");\r\nts.add(\"sandy\");\r\nts.add(\"jam\");\r\nts.add(\"sim\");\r\nSystem.out.println(ts);\r\nTreeSet<String>rev=(TreeSet<String>)ts.descendingSet();\r\nSystem.out.println(ts);\r\nSystem.out.println(ts.contains(\"santhosh\"));\r\n\r\n\r\n\t}", "public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void postOrderTraversal(){\n System.out.println(\"postOrderTraversal\");\n //TODO: incomplete\n\n }", "protected List topologicalSort() {\r\n LinkedList order = new LinkedList();\r\n HashSet knownNodes = new HashSet();\r\n LinkedList nextNodes = new LinkedList();\r\n\r\n for (Iterator i = graph.getNodes().iterator(); i.hasNext(); ) {\r\n BBNNode node = (BBNNode) i.next();\r\n if (node.getChildren().size() == 0) {\r\n nextNodes.addAll(node.getParents());\r\n knownNodes.add(node);\r\n order.addFirst(node);\r\n }\r\n }\r\n\r\n while (nextNodes.size() > 0) {\r\n BBNNode node = (BBNNode) nextNodes.removeFirst();\r\n if (knownNodes.contains(node)) continue;\r\n\r\n List children = node.getChildren();\r\n if (knownNodes.containsAll(children)) {\r\n order.addFirst(node);\r\n nextNodes.addAll(node.getParents());\r\n knownNodes.add(node);\r\n }\r\n }\r\n return order;\r\n }", "public static void findIndependent(GraphPattern graphPattern) {\n\t\tfor (DependencyNode dependency : graphPattern.getDependencyGraph().getNodes()) {\r\n\t\t\tif (dependency.getOutgoings().isEmpty()) {\r\n\t\t\t\tgraphPattern.getDependencyGraph().getIndependent().add(dependency);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void backToParent(){\n\t\tList<Node> tmp = new ArrayList<Node>();\n\t\t\n\t\tfor(int i = 0; i < r.size(); i++){\n\t\t\tif(r.get(i).getNodeType() == Node.ATTRIBUTE_NODE){\n\t\t\t\tNode localNode = ((Attr)r.get(i)).getOwnerElement();\n\t\t\t\tif(localNode != null)\n\t\t\t\t\ttmp.add(localNode);\n\t\t\t} else {\n\t\t\t\tNode localNode = r.get(i).getParentNode();\n\t\t\t\tif(localNode != null && localNode.getNodeType() != Node.DOCUMENT_NODE && !listContainsElement(tmp, localNode)){\n\t\t\t\t\ttmp.add(localNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tr = tmp;\n\t}", "public void setNodesToUnvisited(){\n for(GraphNode node: graphNode){\n if(node.visited){\n node.visited = false;\n }\n }\n }", "public LinkedList descendingOrder(){\r\n\t\t\r\n\t\tLinkedList treeAsList = new LinkedList();\r\n\t\treturn descending(this, treeAsList);\r\n\t}", "private void dijkstras() {\n LinkedList<Integer> openNodeList = new LinkedList<Integer>();\n openNodeList.add(grid.length - 1);\n Integer curGrid = -1;\n\n while ( openNodeList.size() > 0 ) {\n curGrid = getBestGrid(openNodeList,curGrid);\n\n for ( int i = 0; i < grid[curGrid].edges.size() - 1; i++ ) {\n Integer tmp = grid[curGrid].edges.get(i).arrayIndex;\n if ( !grid[tmp].bFinalized && !openNodeList.contains(tmp)) {\n //System.out.println(\"Adding:\\t\" + tmp + \":\\t\" + grid[tmp].cost);\n grid[tmp].setHead(curGrid);\n grid[tmp].cost = grid[curGrid].cost + grid[curGrid].edges.get(i).Exposure;\n openNodeList.add(tmp);\n }\n }\n\n grid[curGrid].bFinalized = true;\n openNodeList.removeFirstOccurrence(curGrid);\n }\n }", "public static void MakeDirectedNoCycle(graphUndir G) {\r\n\r\n\t\tfor (int i = 0; i < G.Adj.size(); i++) {\r\n\t\t\tG.Adj.elementAt(i).color = \"grey\";\r\n\t\t\tSystem.out.println(G.Adj.elementAt(i).name + \" is \"\r\n\t\t\t\t\t+ G.Adj.elementAt(i).color);\r\n\t\t\tfor (int j = 0; j < G.Adj.elementAt(i).next.size(); j++) {\r\n\t\t\t\tif (G.Adj.elementAt(i).next.elementAt(j).color == \"white\") {\r\n\t\t\t\t\tG.Adj.elementAt(i).next.elementAt(j).color = \"grey\";\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(G.Adj.elementAt(i).next.elementAt(j).name\r\n\t\t\t\t\t\t\t\t\t+ \" is \"\r\n\t\t\t\t\t\t\t\t\t+ G.Adj.elementAt(i).next.elementAt(j).color);\r\n\t\t\t\t} else if (G.Adj.elementAt(i).next.elementAt(j).color == \"black\") {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(G.Adj.elementAt(i).next.elementAt(j).name\r\n\t\t\t\t\t\t\t\t\t+ \" is rempved from \"\r\n\t\t\t\t\t\t\t\t\t+ G.Adj.elementAt(i).name);\r\n\t\t\t\t\tG.Adj.elementAt(i).next.remove(j);\r\n\t\t\t\t\tj--;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tG.Adj.elementAt(i).color = \"black\";\r\n\t\t\tSystem.out.println(G.Adj.elementAt(i).name + \" is \"\r\n\t\t\t\t\t+ G.Adj.elementAt(i).color);\r\n\r\n\t\t}\r\n\r\n\t}", "NodeSet<F> getLeaves(OWLClassExpression c, P p, R start, boolean direct);", "private final void relaxNeighbors(_Node unsettledNode)\r\n {\r\n for (_Edge destinationEdge : map.getDestinations(unsettledNode))\r\n {\r\n \tif (isSettled(destinationEdge.getEndNode())) continue;\r\n \tint shortDist = getShortestDistance(unsettledNode) + destinationEdge.getWeight();// map.getDistance(unsettledNode, destinationEdge.getEndNode());\r\n if (shortDist <= getShortestDistance(destinationEdge.getEndNode()))\r\n {\r\n setShortestDistance(destinationEdge.getEndNode(), shortDist);\r\n setPredecessor(destinationEdge.getEndNode(),unsettledNode);\r\n }\r\n } \r\n }", "List<State> findStatesAfterOrder( int nOrder, int nIdWorkflow );", "private void doDepthFirstTraverse(int start, boolean[] visited, List<Edge> path) {\n visited[start] = true;\n\n for (int i: this.heads[start]) {\n if (!visited[i]) {\n path.add(new Edge(start, i));\n doDepthFirstTraverse(i, visited, path);\n }\n }\n }", "public void setVisited(boolean value){this.visited = value;}", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "public void visiualizeLastSearch(){\r\n\t\tint number=0;\r\n\t\tNode dummy;\r\n\t\tNode next;\r\n\t\tfor(int i=sl.height(); i>=0; i--){\r\n\t\t\tdummy = sl.getFrom(0,0);\r\n\t\t\tnext = sl.getFrom(i,0);\r\n\t\t\tString seperator=\"-\";\r\n\t\t\tfor(int j=0; j<(sl.size()+2); j++){\r\n\r\n\t\t\t\tnumber = next.getKey();\r\n\t\t\t\t\r\n\t\t\t\tif(i<sl.height() && sl.getVisited()[i+1].getKey()!=sl.getVisited()[i].getKey() && number>sl.getVisited()[i+1].getKey() && number<=sl.getVisited()[i].getKey())\r\n\t\t\t\t\tseperator = \"*\";\r\n\t\t\t\telse\r\n\t\t\t\t\tseperator = \"-\";\r\n\r\n\t\t\t\tif(number==dummy.getKey()){\r\n\r\n\t\t\t\t\tif(number==minf)\r\n\t\t\t\t\t\tSystem.out.print(\"-inf\");\r\n\t\t\t\t\telse if(number==inf)\r\n\t\t\t\t\t\tSystem.out.print(repeatStr(seperator,3)+\"inf\");\r\n\t\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(repeatStr(seperator,2)+number);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(repeatStr(seperator,4));\r\n\t\t\t\t\r\n\t\t\t\tif(dummy.getKey()==number)\r\n\t\t\t\t\tnext = next.getRight();\r\n\t\t\t\t\r\n\t\t\t\tdummy = dummy.getRight();\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public ArrayList<Integer> depthSearch(int i, int j) {\n markedVerts = new ArrayList<Integer>();\n Stack<Integer> stack = new Stack<Integer>();\n stack.push(i);\n ArrayList<Integer> arry = new ArrayList(depthSearch(i, j, stack));\n Collections.reverse(arry);\n return arry;\n }", "public void inOrderTraverseIterative();", "public void postorder()\n {\n postorder(root);\n }", "public void postorder()\n {\n postorder(root);\n }", "public SortedSet<WIpLink> getOutgoingIpLinks () { return n.getOutgoingLinks(getNet().getIpLayer().getNe()).stream().map(ee->new WIpLink(ee)).filter(e->!e.isVirtualLink()).collect(Collectors.toCollection(TreeSet::new)); }", "public void doDfsIterative(Graph g, int s) {\n boolean[] myVisited = new boolean[8];\n Stack<Integer> stack = new Stack<>();\n stack.push(s);\n myVisited[s] = true;\n while (!stack.isEmpty()) {\n int top = stack.pop();\n System.out.print(\"[\" + top + \"] \");\n for (int e : g.adj[top]) {\n if (!myVisited[e]) {\n stack.push(e);\n myVisited[e] = true;\n }\n }\n }\n\n }", "public FourBreadthFirstPaths(Dungeon d, Site s) {\n\t\tmarked = new boolean[d.size()][d.size()];\n\t\tdistTo = new int[d.size()][d.size()];\n\t\tedgeTo = new Site[d.size()][d.size()];\n\t\tbfs(d, s);\n\t}", "public DefaultLink processSubtreeFiltering(Link appInstance, boolean isSelectAllSchemaChild) {\n LinkBuilder subTreeFilteringResultBuilder = new LinkBuilder();\n BitSet isAnySelectOrContainmentNode = new BitSet();\n if (!processLeafSubtreeFiltering(appInstance, subTreeFilteringResultBuilder, isAnySelectOrContainmentNode,\n isSelectAllSchemaChild)) {\n return null;\n }\n if (!processChildNodesSubTreeFiltering(appInstance, subTreeFilteringResultBuilder,\n isAnySelectOrContainmentNode, isSelectAllSchemaChild)) {\n return null;\n }\n if (yangAugmentedInfoMap.isEmpty()) {\n Set<Map.Entry<Class<?>, Object>> augment = appInstance.yangAugmentedInfoMap().entrySet();\n if (augment != null && !augment.isEmpty()) {\n Iterator<Map.Entry<Class<?>, Object>> augItr = augment.iterator();\n while (augItr.hasNext()) {\n Map.Entry<Class<?>, Object> aug = augItr.next();\n Class<?> augClass = aug.getKey();\n String augClassName = augClass.getName();\n int index = augClassName.lastIndexOf('.');\n String classPackage = augClassName.substring(0, index) +\n \".\" + \"Default\" + augClass.getSimpleName() + \"$\"\n + augClass.getSimpleName() + \"Builder\";\n ClassLoader classLoader = augClass.getClassLoader();\n try {\n Class<?> builderClass;\n builderClass = classLoader.loadClass(classPackage);\n Object builderObj = builderClass.newInstance();\n Method method = builderClass.getMethod(\"build\");\n Object defaultObj = method.invoke(builderObj);\n Class<?> defaultClass = defaultObj.getClass();\n method = defaultClass.getMethod\n (\"processSubtreeFiltering\", augClass,\n boolean.class);\n Object result = method.invoke(defaultObj, aug.getValue(),\n true);\n subTreeFilteringResultBuilder\n .addYangAugmentedInfo(result, augClass);\n } catch (ClassNotFoundException | InstantiationException\n | NoSuchMethodException |\n InvocationTargetException | IllegalAccessException e) {\n e.printStackTrace();\n }\n }\n }\n } else {\n Set<Map.Entry<Class<?>, Object>> augment = yangAugmentedInfoMap\n .entrySet();\n Iterator<Map.Entry<Class<?>, Object>> augItr = augment.iterator();\n while (augItr.hasNext()) {\n Map.Entry<Class<?>, Object> aug = augItr.next();\n Class<?> augClass = aug.getKey();\n Object appInstanceInfo = appInstance.yangAugmentedInfo(augClass);\n if (appInstanceInfo == null) {\n subTreeFilteringResultBuilder.addYangAugmentedInfo\n (aug.getValue(), aug.getKey());\n } else {\n Object processSubtreeFiltering;\n try {\n processSubtreeFiltering = aug.getValue().getClass()\n .getMethod(\"processSubtreeFiltering\",\n aug.getKey(), boolean.class)\n .invoke(aug.getValue(),\n appInstanceInfo, true);\n if (processSubtreeFiltering != null) {\n subTreeFilteringResultBuilder\n .addYangAugmentedInfo(processSubtreeFiltering, aug.getKey());\n }\n } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {\n e.printStackTrace();\n }\n }\n }\n }\n if (!isSelectAllSchemaChild && !isAnySelectOrContainmentNode.get(0)) {\n return processSubtreeFiltering(appInstance, true);\n }\n return (DefaultLink) subTreeFilteringResultBuilder.buildForFilter();\n }", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "public void makePreferredOTTOLRelationshipsNOConflicts() {\n \n // TraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n // .relationships(RelType.TAXCHILDOF, Direction.INCOMING);\n \n // get the start point\n Node life = getLifeNode();\n System.out.println(life.getProperty(\"name\"));\n \n Transaction tx = beginTx();\n addToPreferredIndexes(life, ALLTAXA);\n HashSet<Long> traveled = new HashSet<Long>();\n int nNewRels = 0;\n try {\n // walk out to the tips from the base of the tree\n for (Node n : TAXCHILDOF_TRAVERSAL.traverse(life).nodes()) {\n if (n.hasRelationship(Direction.INCOMING, RelType.TAXCHILDOF) == false) {\n \n // when we hit a tip, start walking back\n Node curNode = n;\n while (curNode.hasRelationship(Direction.OUTGOING, RelType.TAXCHILDOF)) {\n Node startNode = curNode;\n if (traveled.contains((Long)startNode.getId())){\n \tbreak;\n }else{\n \ttraveled.add((Long)startNode.getId());\n }\n Node endNode = null;\n \n // if the current node already has a preferred relationship, we will just follow it\n if (startNode.hasRelationship(Direction.OUTGOING, RelType.PREFTAXCHILDOF)) {\n Relationship prefRel = startNode.getSingleRelationship(RelType.PREFTAXCHILDOF, Direction.OUTGOING);\n \n // make sure we don't get stuck in an infinite loop (should not happen, could do weird things to the graph)\n if (prefRel.getStartNode().getId() == prefRel.getEndNode().getId()) {\n System.out.println(\"pointing to itself \" + prefRel + \" \" + prefRel.getStartNode().getId() + \" \" + prefRel.getEndNode().getId());\n break;\n }\n \n // prepare to move on\n endNode = prefRel.getEndNode();\n \n } else {\n \n // if there is no preferred rel then they all point to the same end node; just follow the first non-looping relationship\n for (Relationship rel : curNode.getRelationships(RelType.TAXCHILDOF, Direction.OUTGOING)) {\n if (rel.getStartNode().getId() == rel.getEndNode().getId()) {\n System.out.println(\"pointing to itself \" + rel + \" \" + rel.getStartNode().getId() + \" \" + rel.getEndNode().getId());\n break;\n } else {\n endNode = rel.getEndNode();\n break;\n }\n }\n \n // if we found a dead-end, die\n if (endNode == null) {\n System.out.println(curNode.getProperty(\"name\"));\n System.out.println(\"Strange, this relationship seems to be pointing at a nonexistent node. Quitting.\");\n System.exit(0);\n }\n \n // create preferred relationships\n curNode.createRelationshipTo(endNode, RelType.PREFTAXCHILDOF);\n curNode.createRelationshipTo(endNode, RelType.TAXCHILDOF).setProperty(\"source\", \"ottol\");\n nNewRels += 1;\n }\n \n if (startNode == endNode) {\n System.out.println(startNode);\n System.out.println(\"The node seems to be pointing at itself. This is a problem. Quitting.\");\n System.exit(0);\n \n // prepare for next iteration\n } else {\n curNode = endNode;\n addToPreferredIndexes(startNode, ALLTAXA);\n }\n }\n }\n \n if (nNewRels % transaction_iter == 0) {\n System.out.println(nNewRels);\n // tx.success();\n // tx.finish();\n // tx = beginTx();\n }\n }\n tx.success();\n } finally {\n tx.finish();\n }\n }", "private void bfs(Dungeon d, Site s) {\n\t\t\n\t\t// use a queue to do BFS, and initialize instance variables\n\t\tQueue<Site> q = new LinkedList<Site>();\n\t\tfor (int x = 0; x < d.size(); x++)\n\t\t\tfor (int y = 0; y < d.size(); y++)\n\t\t\t\tdistTo[x][y] = INFINITY; \n\t\tdistTo[s.getX()][s.getY()] = 0;\n\t\tmarked[s.getX()][s.getY()] = true;\n\t\t\n\t\t// pop site from queue until it's empty\n\t\tq.offer(s);\n\t\twhile (!q.isEmpty()) {\n\t\t\t\n\t\t\t// pop the next site in the queue\n\t\t\tSite v = q.poll(); \t \n\t\t\tint x = v.getX();\n\t\t\tint y = v.getY();\n\n\t\t\t// 4 adjacent sites\n\t\t\tSite east = new Site(x + 1, y);\n\t\t\tSite west = new Site(x - 1, y);\n\t\t\tSite north = new Site(x, y - 1);\n\t\t\tSite south = new Site(x, y + 1);\n\n\t\t\t// BFS the rest of the dungeon\n\t\t\tif (d.isLegalMove(v, east) && !marked[east.getX()][east.getY()]) {\n\t\t\t\tedgeTo[east.getX()][east.getY()] = v;\n\t\t\t\tdistTo[east.getX()][east.getY()] = distTo[x][y] + 1;\n\t\t\t\tmarked[east.getX()][east.getY()] = true;\n\t\t\t\tq.offer(east);\n\t\t\t}\n\t\t\tif (d.isLegalMove(v, west) && !marked[west.getX()][west.getY()]) {\n\t\t\t\tedgeTo[west.getX()][west.getY()] = v;\n\t\t\t\tdistTo[west.getX()][west.getY()] = distTo[x][y] + 1;\n\t\t\t\tmarked[west.getX()][west.getY()] = true;\n\t\t\t\tq.offer(west);\n\t\t\t}\n\t\t\tif (d.isLegalMove(v, north) && !marked[north.getX()][north.getY()]) {\n\t\t\t\tedgeTo[north.getX()][north.getY()] = v;\n\t\t\t\tdistTo[north.getX()][north.getY()] = distTo[x][y] + 1;\n\t\t\t\tmarked[north.getX()][north.getY()] = true;\n\t\t\t\tq.offer(north);\n\t\t\t}\n\t\t\tif (d.isLegalMove(v, south) && !marked[south.getX()][south.getY()]) {\n\t\t\t\tedgeTo[south.getX()][south.getY()] = v;\n\t\t\t\tdistTo[south.getX()][south.getY()] = distTo[x][y] + 1;\n\t\t\t\tmarked[south.getX()][south.getY()] = true;\n\t\t\t\tq.offer(south);\n\t\t\t}\n\n\t\t}\n\n\t}", "public List<SearchNode> expand() {\n\n List<SearchNode> neighbours = new ArrayList<>();\n\n if (this.getX() > 0) {\n SearchNode left = new SearchNode(this.getX() - 1, this.getY(), this.getDepth() + 1);\n neighbours.add(left);\n }\n if (this.getX() < 14) {\n SearchNode right = new SearchNode(this.getX() + 1, this.getY(), this.getDepth() + 1);\n neighbours.add(right);\n }\n if (this.getY() > 0) {\n SearchNode up = new SearchNode(this.getX(), this.getY() - 1, this.getDepth() + 1);\n neighbours.add(up);\n }\n if (this.getY() < 14) {\n SearchNode down = new SearchNode(this.getX(), this.getY() + 1, this.getDepth() + 1);\n neighbours.add(down);\n }\n\n return neighbours;\n }", "public DepthFirstSearch(Graph graph, int[] order) {\n // Same as constructor above except for the if statement.\n }", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "public boolean esDeterministico(){\n NodoA x, y;\n x = primerElemento();\n y = x.getLigaDer();\n boolean bandera = true;\n while(x != cabeza){\n while(y != cabeza){\n if(y.getSimbolo().equals( x.getSimbolo())){\n \n if(!listaND.contains(x)){\n listaND.add(x);\n }\n \n bandera= false;\n }\n y = y.getLigaDer();\n }\n \n x = x.getLigaDer();\n y = x.getLigaDer();\n \n \n }\n \n return bandera;\n \n }", "public void descendentsNodes(Node N, int element) {\n if (searchNodes(N, element)) {\n if (N.getData() == element) {\n printLDRNodes(N.getLeft());\n printLDRNodes(N.getRight());\n System.out.println();\n } else {\n descendentsNodes(N.getLeft(), element);\n descendentsNodes(N.getRight(), element);\n }\n }\n }", "private ArrayList<ContentNode> findDescendants(Node currentNode, ArrayList<ContentNode> allNodes) throws RepositoryException {\n NodeIterator iterator = currentNode.getNodes();\n\n while (iterator.hasNext()) {\n Node nextNode = iterator.nextNode();\n\n if (nextNode.isNode() && !nextNode.isNodeType(\"hippofacnav:facetnavigation\")) {\n if (!nextNode.getNodes().hasNext()) {\n allNodes.add(new ContentNode(nextNode.getName(), nextNode.getProperties()));\n log.info(\"Added descendant node; \" + nextNode.getName());\n }\n findDescendants(nextNode, allNodes);\n }\n }\n\n return allNodes;\n }", "ArrayList<PathFindingNode> neighbours(PathFindingNode node);", "public ResultMap<BaseNode> listRelatives(QName type, Direction direction);" ]
[ "0.57271093", "0.5466094", "0.5403343", "0.52674925", "0.52665687", "0.52466625", "0.5218252", "0.5203559", "0.51763916", "0.51756465", "0.51198083", "0.5092603", "0.4986432", "0.49860924", "0.49805662", "0.49741712", "0.49717927", "0.49601722", "0.4955219", "0.4898323", "0.48903558", "0.48876315", "0.48506665", "0.4816144", "0.48149377", "0.4792601", "0.4791361", "0.4782116", "0.478099", "0.47761327", "0.4770882", "0.47657993", "0.47515586", "0.4745357", "0.47412077", "0.47363576", "0.47309914", "0.4728889", "0.47243482", "0.4715701", "0.47103858", "0.47094458", "0.4688922", "0.46748173", "0.46695846", "0.46607444", "0.46596766", "0.46594486", "0.46592888", "0.464895", "0.46461305", "0.46426427", "0.46303767", "0.46291408", "0.46276358", "0.46254838", "0.46228263", "0.4622823", "0.46217847", "0.46201047", "0.46190748", "0.46156573", "0.46072868", "0.4601749", "0.45983157", "0.4596465", "0.45932275", "0.45906267", "0.458703", "0.45805454", "0.4577157", "0.4574751", "0.45703343", "0.4568648", "0.45672578", "0.45655134", "0.45633015", "0.45614666", "0.45595196", "0.45549932", "0.45547286", "0.45547223", "0.455159", "0.45507288", "0.45507288", "0.4540695", "0.4540101", "0.45300162", "0.45289373", "0.4528837", "0.45233062", "0.45210835", "0.45199576", "0.45188832", "0.451455", "0.4505439", "0.45028207", "0.45022595", "0.44998053", "0.44977123" ]
0.5434104
2
TODO: Add reverse flag with cardinality
@Test void attributeCardinality() { assertEquals( Sets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[0..*]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[0..2]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[1..2]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(BLEEDING_SKIN), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[1..1]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[0..1]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[0..0]" + FINDING_SITE + "=*"))); assertEquals( Sets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds("<<" + CLINICAL_FINDING + ":[1..2]" + FINDING_SITE + "= <<" + BODY_STRUCTURE))); assertEquals( Sets.newHashSet(BLEEDING_SKIN), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "[1..2]" + FINDING_SITE + "= <<" + BODY_STRUCTURE + "," + "[0..0]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS))); assertEquals( Sets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "[1..2]" + FINDING_SITE + "= <<" + BODY_STRUCTURE + "," + "[0..1]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS))); assertEquals( Sets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "[1..2]" + FINDING_SITE + "= <<" + BODY_STRUCTURE + "," + "[1..*]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS))); assertEquals( Sets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "{" + "[1..1]" + FINDING_SITE + " != <<" + PULMONARY_VALVE_STRUCTURE + "," + "[1..*]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS + "" + "}"))); assertEquals( Sets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING), strings(selectConceptIds( "<<" + CLINICAL_FINDING + ":" + "[0..0]" + FINDING_SITE + " != <<" + BODY_STRUCTURE + "," + "[1..*]" + ASSOCIATED_MORPHOLOGY + "= <<" + STENOSIS))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic int cardinality() {\n\t\treturn 2;\n\t}", "int cardinality();", "public int getCardinality();", "public int getNewCardinalityType(){\n return localNewCardinalityType;\n }", "@Override\r\n\tpublic boolean reverseAccrualIt() {\n\t\r\n\t\t\r\n\t\treturn false;\r\n\t}", "@Override\n public int characteristics() { return CONCURRENT | NONNULL | ORDERED; }", "@Override\n\tpublic boolean reverseAccrualIt() {\n\t\treturn false;\n\t}", "public int getOldCardinalityType(){\n return localOldCardinalityType;\n }", "@Test\n\tvoid reverseFlagAttributes() {\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE),\n\t\t\t\tstrings(selectConceptIds(\"*:R \" + FINDING_SITE + \" = <\" + DISORDER)));\n\n\t\t// Using Dot notation\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE),\n\t\t\t\tstrings(selectConceptIds(\"<\" + DISORDER + \".\" + FINDING_SITE)));\n\n\t\t// Dot notation against empty set of concepts\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(),\n\t\t\t\tstrings(selectConceptIds(\"<\" + RIGHT_VENTRICULAR_STRUCTURE + \".\" + LATERALITY)));\n\n\t\t// Select the Finding sites of descendants of Clinical finding\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, PULMONARY_VALVE_STRUCTURE, SKIN_STRUCTURE),\n\t\t\t\tstrings(selectConceptIds(\"<\" + CLINICAL_FINDING + \".\" + FINDING_SITE)));\n\n\t\t// Select the just the first two Finding sites of descendants of Clinical finding\n\t\tPageRequest pageRequest = PageRequest.of(0, 2);\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(RIGHT_VENTRICULAR_STRUCTURE, SKIN_STRUCTURE),\n\t\t\t\tstrings(selectConceptIds(\"<\" + CLINICAL_FINDING + \".\" + FINDING_SITE, pageRequest)));\n\n\t\t// Select the second page of Finding sites of descendants of Clinical finding\n\t\tpageRequest = PageRequest.of(1, 2);\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PULMONARY_VALVE_STRUCTURE),\n\t\t\t\tstrings(selectConceptIds(\"<\" + CLINICAL_FINDING + \".\" + FINDING_SITE, pageRequest)));\n\n\t\t// Select the Laterality of Finding sites of descendants of Clinical finding\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(RIGHT),\n\t\t\t\tstrings(selectConceptIds(\"<\" + CLINICAL_FINDING + \".\" + FINDING_SITE + \".\" + LATERALITY)));\n\t}", "public Reversal() {\n\t\tsuper();\n\t}", "@Override\n public int characteristics() {\n return ORDERED | NONNULL | IMMUTABLE;\n }", "public int getNewCardinalityNum(){\n return localNewCardinalityNum;\n }", "public abstract int numOfSameTypeNeighbourToReproduce();", "public int getOldCardinalityNum(){\n return localOldCardinalityNum;\n }", "public final ManchesterOWLSyntaxAutoComplete.cardinalityRestriction_return cardinalityRestriction() {\n ManchesterOWLSyntaxAutoComplete.cardinalityRestriction_return retval = new ManchesterOWLSyntaxAutoComplete.cardinalityRestriction_return();\n retval.start = input.LT(1);\n ManchesterOWLSyntaxAutoComplete.unary_return p = null;\n ManchesterOWLSyntaxAutoComplete.expression_return filler = null;\n try {\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:238:1:\n // ( ^( CARDINALITY_RESTRICTION MIN i= INTEGER p= unary (filler=\n // expression )? ) | ^( CARDINALITY_RESTRICTION MAX i= INTEGER p=\n // unary (filler= expression )? ) | ^( CARDINALITY_RESTRICTION\n // EXACTLY i= INTEGER p= unary (filler= expression )? ) )\n int alt14 = 3;\n int LA14_0 = input.LA(1);\n if (LA14_0 == CARDINALITY_RESTRICTION) {\n int LA14_1 = input.LA(2);\n if (LA14_1 == DOWN) {\n switch (input.LA(3)) {\n case MIN: {\n alt14 = 1;\n }\n break;\n case MAX: {\n alt14 = 2;\n }\n break;\n case EXACTLY: {\n alt14 = 3;\n }\n break;\n default:\n if (state.backtracking > 0) {\n state.failed = true;\n return retval;\n }\n NoViableAltException nvae = new NoViableAltException(\"\", 14,\n 2, input);\n throw nvae;\n }\n } else {\n if (state.backtracking > 0) {\n state.failed = true;\n return retval;\n }\n NoViableAltException nvae = new NoViableAltException(\"\", 14, 1, input);\n throw nvae;\n }\n } else {\n if (state.backtracking > 0) {\n state.failed = true;\n return retval;\n }\n NoViableAltException nvae = new NoViableAltException(\"\", 14, 0, input);\n throw nvae;\n }\n switch (alt14) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:239:5:\n // ^( CARDINALITY_RESTRICTION MIN i= INTEGER p= unary (filler=\n // expression )? )\n {\n match(input, CARDINALITY_RESTRICTION,\n FOLLOW_CARDINALITY_RESTRICTION_in_cardinalityRestriction719);\n if (state.failed) {\n return retval;\n }\n match(input, Token.DOWN, null);\n if (state.failed) {\n return retval;\n }\n match(input, MIN, FOLLOW_MIN_in_cardinalityRestriction722);\n if (state.failed) {\n return retval;\n }\n match(input, INTEGER, FOLLOW_INTEGER_in_cardinalityRestriction727);\n if (state.failed) {\n return retval;\n }\n pushFollow(FOLLOW_unary_in_cardinalityRestriction733);\n p = unary();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:239:65:\n // (filler= expression )?\n int alt11 = 2;\n int LA11_0 = input.LA(1);\n if (LA11_0 >= IDENTIFIER && LA11_0 <= ENTITY_REFERENCE\n || LA11_0 >= DISJUNCTION && LA11_0 <= NEGATED_EXPRESSION\n || LA11_0 >= SOME_RESTRICTION && LA11_0 <= ONE_OF\n || LA11_0 == INVERSE_OBJECT_PROPERTY_EXPRESSION) {\n alt11 = 1;\n }\n switch (alt11) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:239:65:\n // filler= expression\n {\n pushFollow(FOLLOW_expression_in_cardinalityRestriction740);\n filler = expression();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n }\n break;\n }\n match(input, Token.UP, null);\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start)\n .setCompletions(filler == null ? p.node.getCompletions()\n : filler.node.getCompletions());\n }\n }\n break;\n case 2:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:243:6:\n // ^( CARDINALITY_RESTRICTION MAX i= INTEGER p= unary (filler=\n // expression )? )\n {\n match(input, CARDINALITY_RESTRICTION,\n FOLLOW_CARDINALITY_RESTRICTION_in_cardinalityRestriction755);\n if (state.failed) {\n return retval;\n }\n match(input, Token.DOWN, null);\n if (state.failed) {\n return retval;\n }\n match(input, MAX, FOLLOW_MAX_in_cardinalityRestriction758);\n if (state.failed) {\n return retval;\n }\n match(input, INTEGER, FOLLOW_INTEGER_in_cardinalityRestriction762);\n if (state.failed) {\n return retval;\n }\n pushFollow(FOLLOW_unary_in_cardinalityRestriction768);\n p = unary();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:243:65:\n // (filler= expression )?\n int alt12 = 2;\n int LA12_0 = input.LA(1);\n if (LA12_0 >= IDENTIFIER && LA12_0 <= ENTITY_REFERENCE\n || LA12_0 >= DISJUNCTION && LA12_0 <= NEGATED_EXPRESSION\n || LA12_0 >= SOME_RESTRICTION && LA12_0 <= ONE_OF\n || LA12_0 == INVERSE_OBJECT_PROPERTY_EXPRESSION) {\n alt12 = 1;\n }\n switch (alt12) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:243:65:\n // filler= expression\n {\n pushFollow(FOLLOW_expression_in_cardinalityRestriction775);\n filler = expression();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n }\n break;\n }\n match(input, Token.UP, null);\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start)\n .setCompletions(filler == null ? p.node.getCompletions()\n : filler.node.getCompletions());\n }\n }\n break;\n case 3:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:247:6:\n // ^( CARDINALITY_RESTRICTION EXACTLY i= INTEGER p= unary\n // (filler= expression )? )\n {\n match(input, CARDINALITY_RESTRICTION,\n FOLLOW_CARDINALITY_RESTRICTION_in_cardinalityRestriction794);\n if (state.failed) {\n return retval;\n }\n match(input, Token.DOWN, null);\n if (state.failed) {\n return retval;\n }\n match(input, EXACTLY, FOLLOW_EXACTLY_in_cardinalityRestriction797);\n if (state.failed) {\n return retval;\n }\n match(input, INTEGER, FOLLOW_INTEGER_in_cardinalityRestriction802);\n if (state.failed) {\n return retval;\n }\n pushFollow(FOLLOW_unary_in_cardinalityRestriction809);\n p = unary();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:247:71:\n // (filler= expression )?\n int alt13 = 2;\n int LA13_0 = input.LA(1);\n if (LA13_0 >= IDENTIFIER && LA13_0 <= ENTITY_REFERENCE\n || LA13_0 >= DISJUNCTION && LA13_0 <= NEGATED_EXPRESSION\n || LA13_0 >= SOME_RESTRICTION && LA13_0 <= ONE_OF\n || LA13_0 == INVERSE_OBJECT_PROPERTY_EXPRESSION) {\n alt13 = 1;\n }\n switch (alt13) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:247:71:\n // filler= expression\n {\n pushFollow(FOLLOW_expression_in_cardinalityRestriction816);\n filler = expression();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n }\n break;\n }\n match(input, Token.UP, null);\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start)\n .setCompletions(filler == null ? p.node.getCompletions()\n : filler.node.getCompletions());\n }\n }\n break;\n }\n if (state.backtracking == 1) {\n retval.node = (ManchesterOWLSyntaxTree) retval.start;\n }\n } catch (@SuppressWarnings(\"unused\") RecognitionException | RewriteEmptyStreamException exception) {}\n return retval;\n }", "public void setNewCardinalityType(int param){\n \n // setting primitive attribute tracker to true\n localNewCardinalityTypeTracker =\n param != java.lang.Integer.MIN_VALUE;\n \n this.localNewCardinalityType=param;\n \n\n }", "@Override\n public boolean isReversible() {\n return true;\n }", "public boolean reverse() {\n if (type == 0) {\n return false;\n }\n type = (type == 1) ? 2 : 1;\n isFresh = false;\n return true;\n }", "public abstract int getCntOther();", "public void setNewCardinalityNum(int param){\n \n // setting primitive attribute tracker to true\n localNewCardinalityNumTracker =\n param != java.lang.Integer.MIN_VALUE;\n \n this.localNewCardinalityNum=param;\n \n\n }", "@Property\n public boolean reverse_has_the_same_size_as_original(@ForAll List<?> original) {\n return Lists.reverse(original).size() == original.size();\n }", "private FormProvider handleCardinality() throws XMLStreamException{\n //get cardinality based on the tag name\n int min = 1;\n int max = 1;\n String tag = reader.getLocalName();\n if(tag.equals(\"zeroOrMore\") || tag.equals(\"optional\")){ min = 0; }\n if(tag.equals(\"zeroOrMore\") || tag.equals(\"oneOrMore\")){\n max = Integer.MAX_VALUE;\n }\n \n //make sub structure\n reader.nextTag();\n FormProvider result = handleAll();\n \n //set cardinality on substructure\n if(min == 0){ result.setMin(min); }\n if(max == Integer.MAX_VALUE){ result.setMax(max); }\n \n //advance past the end of cardinality end element and return\n reader.nextTag();\n return result;\n }", "public void setOldCardinalityType(int param){\n \n // setting primitive attribute tracker to true\n localOldCardinalityTypeTracker =\n param != java.lang.Integer.MIN_VALUE;\n \n this.localOldCardinalityType=param;\n \n\n }", "@Override\r\n\tpublic int operar() {\n\t\treturn 0;\r\n\t}", "@Override\n\tprotected void createOtherOrbits()\n\t{\n\t}", "default int getCompositeBitLength() {\n return getHighBitLength() + getLowBitLength();\n }", "@Test\n public void correctnessReverse() {\n final Iterator<Partition<Integer>> it = Partitions.lexicographicEnumeration(Helper.newHashSet(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), new int[]{3, 5}, ImmutablePartition::new);\n final Iterator<Partition<Integer>> itr = Partitions.reverseLexicographicEnumeration(Helper.newHashSet(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), new int[]{3, 5}, ImmutablePartition::new);\n final List<Partition<Integer>> partitions = new ArrayList<>();\n final List<Partition<Integer>> partitionsReverse = new ArrayList<>();\n while (it.hasNext() && itr.hasNext()) {\n final Partition<Integer> p = it.next();\n final Partition<Integer> pr = itr.next();\n partitions.add(p);\n partitionsReverse.add(pr);\n }\n Assert.assertTrue(!it.hasNext() && !itr.hasNext());\n Collections.reverse(partitionsReverse);\n Assert.assertEquals(partitions, partitionsReverse);\n }", "@Test\n\tpublic void testReverseBits1() {\n\t sut.reverseBits(65536);\n\t\t// ASSERT.that(sut.addBinary(i1, i2)).is(o);\n\t}", "public boolean rightDistributive( Operator op){\n\t return false;\n }", "public void setOldCardinalityNum(int param){\n \n // setting primitive attribute tracker to true\n localOldCardinalityNumTracker =\n param != java.lang.Integer.MIN_VALUE;\n \n this.localOldCardinalityNum=param;\n \n\n }", "@Override\n\tpublic int countFlips() {\n\t\treturn 0;\n\t}", "BigInteger getCount();", "public int length() { return 1+maxidx; }", "public boolean getReverse() {\r\n return Reverse;\r\n }", "public boolean getReverse() {\r\n return Reverse;\r\n }", "void reverseTurnOrder() {\n turnOrder *= -1;\n }", "protected abstract IStoreFastLane make_express();", "LengthDistinct createLengthDistinct();", "public int orCardinality(final EWAHCompressedBitmap a) {\n\t\tfinal BitCounter counter = new BitCounter();\n\t\tor(a, counter);\n\t\treturn counter.getCount();\n\t}", "public int cardinality() {\n\t\treturn numElements; // dummy return\n\t}", "@Test\n public void testReverseRow(){\n ROW.getReverseRow(ROW.getIndex());\n }", "public abstract int numOfEmptyToReproduce();", "public void reverse() {\n throw new UnsupportedOperationException();\n }", "public void test_hk_03() {\n OntModelSpec spec = new OntModelSpec(OntModelSpec.OWL_MEM);\n spec.setReasoner(null);\n OntModel ontModel = ModelFactory.createOntologyModel(spec, null);\n OntProperty property = ontModel.createObjectProperty(\"http://www.aldi.de#property\");\n /* MinCardinalityRestriction testClass = */\n ontModel.createMinCardinalityRestriction(null, property, 42);\n \n }", "public static String getCardinalityDescription(int cardinality) {\n int code = getCardinalityCode(cardinality);\n String[] names = {\n \"not allowed\",\n \"exactly zero\",\n \"exactly one\",\n \"zero or one\",\n \"many\",\n \"zero or many\",\n \"one or more\",\n \"zero or more\"\n };\n return names[code];\n }", "@Override\n public int getOrder() {\n return 4;\n }", "public abstract int getCntRod();", "public IStoreFastLane express();", "void FlipBook()\r\n\t\t{\r\n\t\t\t Collections.reverse(this);\r\n\t\t}", "static int size_of_ori(String passed){\n\t\treturn 2;\n\t}", "@Override\n public int getOrder() {\n return 0;\n }", "public interface ReversibleOperation<O extends Operation<T>, T> extends Operation<T> {\n\n /**\n * Applies the operation to a target and returns a sequence of operations\n * which can reverse the application.\n *\n * @param target The target onto which to apply the operation.\n * @return A sequence of operations that reverses the application of this\n * operation. The returned sequence of operations, when applied in\n * order after this operation is applied, should reverse the effect of\n * this operation.\n */\n public List<? extends O> applyAndReturnReverse(T target) throws OperationException;\n\n}", "public BasicAttributesGrammarAccess.CardinalityElements getCardinalityAccess() {\n\t\treturn gaBasicAttributes.getCardinalityAccess();\n\t}", "@Property\n @Report(Reporting.GENERATED)\n public boolean reverse_of_reversed_is_equal_to_original(@ForAll List<?> original) {\n return Lists.reverse(Lists.reverse(original)).equals(original);\n }", "static int noValueSize() {\r\n return itemSize(false) * 2;\r\n }", "public int computeCardinality() {\n return operand.getCardinality();\n\t}", "int incCapacity()\r\n\t{\r\n\t\tint i,j;\r\n\t\tfor (i=0; i<=state; ++i)\r\n\t\t\tfor (j=0; j<=symbol; ++j)\r\n\t\t\t\tg[i][j][state]=g[state][j][i]=false;\r\n\t\treturn (state++);\r\n\t}", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Property\n @Report(Reporting.GENERATED)\n public boolean broken_reverse_property(@ForAll List<?> original) {\n return Lists.reverse(original).equals(original);\n }", "Boolean incremental();", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n public Integer reduceInit() { return 0; }", "@Test\n public void testQueryMore4() throws Exception {\n testQueryMore(true, false);\n }", "public void setReverse(boolean reverse) {\n\t\t_reverse = reverse;\n\t}", "@Test\n void descendingSetDescendingSetReturnsOriginalSet() {\n assertArrayEquals(filledSet.toArray(), reverseSet.descendingSet().toArray());\n }", "@Override\n public int retroceder() {\n return 0;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(new NO_190().reverseBits(43261596));\r\n\t\tSystem.out.println(new NO_190().reverseBits2(43261596));\r\n\t\t\r\n//\t\tSystem.out.println(1 << 31);\r\n\t}", "private LocalHistorySet(final int index) {\n\t\t\tsuper();\n\t\t\tthis.index = index;\n\t\t\tif (table[index] == null) {\n\t\t\t\ttable[index] = new BitSet(capacity);\n\t\t\t}\n\t\t}", "@Cardinality\n public int getCardinality() {\n return mBundle.getInt(CARDINALITY_FIELD, CARDINALITY_OPTIONAL);\n }", "abstract protected int getCapacity();", "private int getRealIndex()\r\n\t{\r\n\t\treturn index - 1;\r\n\t}", "public boolean isDirect()\r\n/* 76: */ {\r\n/* 77:111 */ return false;\r\n/* 78: */ }", "@Test\n public void testReverse() {\n System.out.println(\"reverse\");\n al.add(1);\n al.add(2);\n al.add(3);\n ArrayList<Integer> rl = new ArrayList<>();\n rl.add(3);\n rl.add(2);\n rl.add(1);\n al.reverse();\n assertEquals(rl.get(0), al.get(0));\n assertEquals(rl.get(1), al.get(1));\n assertEquals(rl.get(2), al.get(2));\n }", "@Override\n public int filterOrder() {\n return 1;\n }", "@Override\n public int filterOrder() {\n return 1;\n }", "@Test\n void descendingSetIteratorNextReturnsCorrectValue() {\n var it = reverseSet.iterator();\n assertEquals(Integer.valueOf(9), it.next());\n assertEquals(Integer.valueOf(6), it.next());\n assertEquals(Integer.valueOf(4), it.next());\n assertEquals(Integer.valueOf(2), it.next());\n assertEquals(Integer.valueOf(1), it.next());\n }", "@VTID(10)\n int getIndex();", "@Override\n\tpublic int getNextOperacionDetalle() {\n\t\treturn 0;\n\t}", "public abstract Card giveFavor(int playerIndex);", "OpList createOpList();", "public androidx.recyclerview.widget.RecyclerView.C1085v mo12723a(androidx.recyclerview.widget.RecyclerView.C1085v r15, java.util.List<androidx.recyclerview.widget.RecyclerView.C1085v> r16, int r17, int r18) {\n /*\n r14 = this;\n r0 = r15\n android.view.View r1 = r0.itemView\n int r1 = r1.getWidth()\n int r1 = r17 + r1\n android.view.View r2 = r0.itemView\n int r2 = r2.getHeight()\n int r2 = r18 + r2\n android.view.View r3 = r0.itemView\n int r3 = r3.getLeft()\n int r3 = r17 - r3\n android.view.View r4 = r0.itemView\n int r4 = r4.getTop()\n int r4 = r18 - r4\n int r5 = r16.size()\n r6 = 0\n r7 = -1\n r8 = 0\n L_0x0028:\n if (r8 >= r5) goto L_0x00be\n r9 = r16\n java.lang.Object r10 = r9.get(r8)\n androidx.recyclerview.widget.RecyclerView$v r10 = (androidx.recyclerview.widget.RecyclerView.C1085v) r10\n if (r3 <= 0) goto L_0x0053\n android.view.View r11 = r10.itemView\n int r11 = r11.getRight()\n int r11 = r11 - r1\n if (r11 >= 0) goto L_0x0053\n android.view.View r12 = r10.itemView\n int r12 = r12.getRight()\n android.view.View r13 = r0.itemView\n int r13 = r13.getRight()\n if (r12 <= r13) goto L_0x0053\n int r11 = java.lang.Math.abs(r11)\n if (r11 <= r7) goto L_0x0053\n r6 = r10\n goto L_0x0054\n L_0x0053:\n r11 = r7\n L_0x0054:\n if (r3 >= 0) goto L_0x0076\n android.view.View r7 = r10.itemView\n int r7 = r7.getLeft()\n int r7 = r7 - r17\n if (r7 <= 0) goto L_0x0076\n android.view.View r12 = r10.itemView\n int r12 = r12.getLeft()\n android.view.View r13 = r0.itemView\n int r13 = r13.getLeft()\n if (r12 >= r13) goto L_0x0076\n int r7 = java.lang.Math.abs(r7)\n if (r7 <= r11) goto L_0x0076\n r11 = r7\n r6 = r10\n L_0x0076:\n if (r4 >= 0) goto L_0x0098\n android.view.View r7 = r10.itemView\n int r7 = r7.getTop()\n int r7 = r7 - r18\n if (r7 <= 0) goto L_0x0098\n android.view.View r12 = r10.itemView\n int r12 = r12.getTop()\n android.view.View r13 = r0.itemView\n int r13 = r13.getTop()\n if (r12 >= r13) goto L_0x0098\n int r7 = java.lang.Math.abs(r7)\n if (r7 <= r11) goto L_0x0098\n r11 = r7\n r6 = r10\n L_0x0098:\n if (r4 <= 0) goto L_0x00b9\n android.view.View r7 = r10.itemView\n int r7 = r7.getBottom()\n int r7 = r7 - r2\n if (r7 >= 0) goto L_0x00b9\n android.view.View r12 = r10.itemView\n int r12 = r12.getBottom()\n android.view.View r13 = r0.itemView\n int r13 = r13.getBottom()\n if (r12 <= r13) goto L_0x00b9\n int r7 = java.lang.Math.abs(r7)\n if (r7 <= r11) goto L_0x00b9\n r6 = r10\n goto L_0x00ba\n L_0x00b9:\n r7 = r11\n L_0x00ba:\n int r8 = r8 + 1\n goto L_0x0028\n L_0x00be:\n return r6\n */\n throw new UnsupportedOperationException(\"Method not decompiled: app.zenly.locator.recommendation.swipeable.touchhelper.ItemTouchHelper.C5319g.mo12723a(androidx.recyclerview.widget.RecyclerView$v, java.util.List, int, int):androidx.recyclerview.widget.RecyclerView$v\");\n }", "@Override\n public Object build() {\n CardinalityAggregationBuilder cardinality = AggregationBuilders.cardinality(this.getName());\n\n for (ParamComposite param : this.getChildren().stream()\n .filter(child -> ParamComposite.class.isAssignableFrom(child.getClass()))\n .map(child -> (ParamComposite) child).collect(Collectors.toList())) {\n switch (param.getName().toLowerCase()) {\n case \"field\":\n cardinality.field((String)param.getValue());\n break;\n\n /*case \"script\":\n cardinality.script((String)param.getValue());\n break;*/\n\n case \"precision_threshold\":\n cardinality.precisionThreshold((long)param.getValue());\n break;\n }\n }\n\n return cardinality;\n }", "public boolean supportsReverseComparison() {\n return true;\n }", "@Override\n @Test\n public void testQuery_invalidAdvancedRankingWithChildrenRankingSignals() throws Exception { }", "public static int getCardinalityCode(int cardinality) {\n return (cardinality & CARDINALITY_MASK) >> 13;\n }", "boolean isIndexed();", "boolean isIndexed();", "boolean hasHas_consequence();", "public interface One extends RelationQuantifier\n{\n}", "private static boolean accepts(Automaton type, int tIndex, Automaton actual, int aIndex, Schema schema, BinaryMatrix assumptions) {\n\t\tAutomaton.Term tState = (Automaton.Term) type.get(tIndex);\n\t\tAutomaton.State aState = actual.get(aIndex);\n\t\tif (tState.kind == Types.K_Ref) {\t\t\t\n\t\t\tAutomaton.Term tTerm = (Automaton.Term) tState;\n\t\t\tint t_child = tTerm.contents;\n\t\t\tif(t_child < 0 || aIndex < 0) {\n\t\t\t\treturn accepts(type, t_child, actual, aState, schema, assumptions);\n\t\t\t} else if(assumptions.get(t_child, aIndex)) {\n\t\t\t\t// This is a cache hit\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tassumptions.set(t_child, aIndex, true);\n\t\t\t\tboolean r = accepts(type, t_child, actual, aState, schema, assumptions);\n\t\t\t\tassumptions.set(t_child, aIndex, false);\n\t\t\t\treturn r;\n\t\t\t}\t\t\t\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Query(\"SELECT inp FROM Input inp WHERE inp.deleteFlag=0 ORDER BY inp.id DESC\")\n List<Input> findAllDesc();", "public abstract int flags();", "void example12() {\n\t\t\n\t\t// an example of passing data to algorithms in reverse order\n\t\t\n\t\t// make some data\n\t\t\n\t\tIndexedDataSource<SignedInt32Member> nums =\n\t\t\t\tnom.bdezonia.zorbage.storage.Storage.allocate(G.INT32.construct(), \n\t\t\t\tnew int[] {-1, 345, 1, -3044, 0, 0, 1066, -12});\n\t\t\n\t\t// sort it\n\t\t\n\t\tSort.compute(G.INT32, nums);\n\t\t\n\t\t// this is how the results look\n\t\t// nums = [-3044, -12, -1, 0, 0, 1, 345, 1066]\n\t\t\n\t\t// now wrap a reverse filter around the data\n\t\t\n\t\tIndexedDataSource<SignedInt32Member> revNums = new ReversedDataSource<>(nums);\n\n\t\t// sort using the filter\n\t\t\n\t\tSort.compute(G.INT32, revNums);\n\t\t\n\t\t// this is how the results look\n\t\t// revNums = [-3044, -12, -1, 0, 0, 1, 345, 1066]\n\t\t// nums = [1066, 345, 1, 0, 0, -1, -12, -3044]\n\t\t\n\t\t// now here is a some code showing some another way to use the filter\n\t\t\n\t\tSignedInt32Member value = G.INT32.construct();\n\t\t\n\t\tGetV.second(revNums, value);\n\t\t\n\t\t// gets the second value in the reverse list. so it gets the second to last\n\t\t// value in the original list.\n\t\t// value = -12\n\t}", "public abstract boolean testRightmostBit();", "void method0() {\nprivate static final String ELEMENT_N = \"element_n\";\nprivate static final String ELEMENT_R = \"element_r\";\nprivate static final String ATTRIBUTE_N = \"attribute_n\";\nprivate static final String ATTRIBUTE_R = \"attribute_r\";\nprivate static int ATTIDX_COUNT = 0;\npublic static final int ATTIDX_ABSTRACT = ATTIDX_COUNT++;\npublic static final int ATTIDX_AFORMDEFAULT = ATTIDX_COUNT++;\npublic static final int ATTIDX_BASE = ATTIDX_COUNT++;\npublic static final int ATTIDX_BLOCK = ATTIDX_COUNT++;\npublic static final int ATTIDX_BLOCKDEFAULT = ATTIDX_COUNT++;\npublic static final int ATTIDX_DEFAULT = ATTIDX_COUNT++;\npublic static final int ATTIDX_EFORMDEFAULT = ATTIDX_COUNT++;\npublic static final int ATTIDX_FINAL = ATTIDX_COUNT++;\npublic static final int ATTIDX_FINALDEFAULT = ATTIDX_COUNT++;\npublic static final int ATTIDX_FIXED = ATTIDX_COUNT++;\npublic static final int ATTIDX_FORM = ATTIDX_COUNT++;\npublic static final int ATTIDX_ID = ATTIDX_COUNT++;\npublic static final int ATTIDX_ITEMTYPE = ATTIDX_COUNT++;\npublic static final int ATTIDX_MAXOCCURS = ATTIDX_COUNT++;\npublic static final int ATTIDX_MEMBERTYPES = ATTIDX_COUNT++;\npublic static final int ATTIDX_MINOCCURS = ATTIDX_COUNT++;\npublic static final int ATTIDX_MIXED = ATTIDX_COUNT++;\npublic static final int ATTIDX_NAME = ATTIDX_COUNT++;\npublic static final int ATTIDX_NAMESPACE = ATTIDX_COUNT++;\npublic static final int ATTIDX_NAMESPACE_LIST = ATTIDX_COUNT++;\npublic static final int ATTIDX_NILLABLE = ATTIDX_COUNT++;\npublic static final int ATTIDX_NONSCHEMA = ATTIDX_COUNT++;\npublic static final int ATTIDX_PROCESSCONTENTS = ATTIDX_COUNT++;\npublic static final int ATTIDX_PUBLIC = ATTIDX_COUNT++;\npublic static final int ATTIDX_REF = ATTIDX_COUNT++;\npublic static final int ATTIDX_REFER = ATTIDX_COUNT++;\npublic static final int ATTIDX_SCHEMALOCATION = ATTIDX_COUNT++;\npublic static final int ATTIDX_SOURCE = ATTIDX_COUNT++;\npublic static final int ATTIDX_SUBSGROUP = ATTIDX_COUNT++;\npublic static final int ATTIDX_SYSTEM = ATTIDX_COUNT++;\npublic static final int ATTIDX_TARGETNAMESPACE = ATTIDX_COUNT++;\npublic static final int ATTIDX_TYPE = ATTIDX_COUNT++;\npublic static final int ATTIDX_USE = ATTIDX_COUNT++;\npublic static final int ATTIDX_VALUE = ATTIDX_COUNT++;\npublic static final int ATTIDX_ENUMNSDECLS = ATTIDX_COUNT++;\npublic static final int ATTIDX_VERSION = ATTIDX_COUNT++;\npublic static final int ATTIDX_XML_LANG = ATTIDX_COUNT++;\npublic static final int ATTIDX_XPATH = ATTIDX_COUNT++;\npublic static final int ATTIDX_FROMDEFAULT = ATTIDX_COUNT++;\n//public static final int ATTIDX_OTHERVALUES = ATTIDX_COUNT++; \npublic static final int ATTIDX_ISRETURNED = ATTIDX_COUNT++;\nprivate static final XIntPool fXIntPool = new XIntPool();\n// constants to return \nprivate static final XInt INT_QUALIFIED = fXIntPool.getXInt(SchemaSymbols.FORM_QUALIFIED);\nprivate static final XInt INT_UNQUALIFIED = fXIntPool.getXInt(SchemaSymbols.FORM_UNQUALIFIED);\nprivate static final XInt INT_EMPTY_SET = fXIntPool.getXInt(XSConstants.DERIVATION_NONE);\nprivate static final XInt INT_ANY_STRICT = fXIntPool.getXInt(XSWildcardDecl.PC_STRICT);\nprivate static final XInt INT_ANY_LAX = fXIntPool.getXInt(XSWildcardDecl.PC_LAX);\nprivate static final XInt INT_ANY_SKIP = fXIntPool.getXInt(XSWildcardDecl.PC_SKIP);\nprivate static final XInt INT_ANY_ANY = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_ANY);\nprivate static final XInt INT_ANY_LIST = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_LIST);\nprivate static final XInt INT_ANY_NOT = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_NOT);\nprivate static final XInt INT_USE_OPTIONAL = fXIntPool.getXInt(SchemaSymbols.USE_OPTIONAL);\nprivate static final XInt INT_USE_REQUIRED = fXIntPool.getXInt(SchemaSymbols.USE_REQUIRED);\nprivate static final XInt INT_USE_PROHIBITED = fXIntPool.getXInt(SchemaSymbols.USE_PROHIBITED);\nprivate static final XInt INT_WS_PRESERVE = fXIntPool.getXInt(XSSimpleType.WS_PRESERVE);\nprivate static final XInt INT_WS_REPLACE = fXIntPool.getXInt(XSSimpleType.WS_REPLACE);\nprivate static final XInt INT_WS_COLLAPSE = fXIntPool.getXInt(XSSimpleType.WS_COLLAPSE);\nprivate static final XInt INT_UNBOUNDED = fXIntPool.getXInt(SchemaSymbols.OCCURRENCE_UNBOUNDED);\n// used to store the map from element name to attribute list \n// for 14 global elements \nprivate static final Hashtable fEleAttrsMapG = new Hashtable(29);\n// for 39 local elememnts \nprivate static final Hashtable fEleAttrsMapL = new Hashtable(79);\n// used to initialize fEleAttrsMap \n// step 1: all possible data types \n// DT_??? >= 0 : validate using a validator, which is initialized staticly \n// DT_??? < 0 : validate directly, which is done in \"validate()\" \nprotected static final int DT_ANYURI = 0;\nprotected static final int DT_ID = 1;\nprotected static final int DT_QNAME = 2;\nprotected static final int DT_STRING = 3;\nprotected static final int DT_TOKEN = 4;\nprotected static final int DT_NCNAME = 5;\nprotected static final int DT_XPATH = 6;\nprotected static final int DT_XPATH1 = 7;\nprotected static final int DT_LANGUAGE = 8;\n// used to store extra datatype validators \nprotected static final int DT_COUNT = DT_LANGUAGE + 1;\nprivate static final XSSimpleType[] fExtraDVs = new XSSimpleType[DT_COUNT];\nprotected static final int DT_BLOCK = -1;\nprotected static final int DT_BLOCK1 = -2;\nprotected static final int DT_FINAL = -3;\nprotected static final int DT_FINAL1 = -4;\nprotected static final int DT_FINAL2 = -5;\nprotected static final int DT_FORM = -6;\nprotected static final int DT_MAXOCCURS = -7;\nprotected static final int DT_MAXOCCURS1 = -8;\nprotected static final int DT_MEMBERTYPES = -9;\nprotected static final int DT_MINOCCURS1 = -10;\nprotected static final int DT_NAMESPACE = -11;\nprotected static final int DT_PROCESSCONTENTS = -12;\nprotected static final int DT_USE = -13;\nprotected static final int DT_WHITESPACE = -14;\nprotected static final int DT_BOOLEAN = -15;\nprotected static final int DT_NONNEGINT = -16;\nprotected static final int DT_POSINT = -17;\n// used to resolver namespace prefixes \nprotected XSDHandler fSchemaHandler = null;\n// used to store symbols. \nprotected SymbolTable fSymbolTable = null;\n// used to store the mapping from processed element to attributes \nprotected Hashtable fNonSchemaAttrs = new Hashtable();\n// temprory vector, used to hold the namespace list \nprotected Vector fNamespaceList = new Vector();\n// whether this attribute appeared in the current element \nprotected boolean[] fSeen = new boolean[ATTIDX_COUNT];\nprivate static boolean[] fSeenTemp = new boolean[ATTIDX_COUNT];\n// the following part implements an attribute-value-array pool. \n// when checkAttribute is called, it calls getAvailableArray to get \n// an array from the pool; when the caller is done with the array, \n// it calls returnAttrArray to return that array to the pool. \n// initial size of the array pool. 10 is big enough \nstatic final int INIT_POOL_SIZE = 10;\n// the incremental size of the array pool \nstatic final int INC_POOL_SIZE = 10;\n// the array pool \nObject[][] fArrayPool = new Object[INIT_POOL_SIZE][ATTIDX_COUNT];\n// used to clear the returned array \n// I think System.arrayCopy is more efficient than setting 35 fields to null \nprivate static Object[] fTempArray = new Object[ATTIDX_COUNT];\n// current position of the array pool (# of arrays not returned) \nint fPoolPos = 0;\n}", "@Override\n public void func_104112_b() {\n \n }", "public interface OrtFlags {\n\n /**\n * Gets the underlying flag value.\n *\n * @return The flag value.\n */\n public int getValue();\n\n /**\n * Converts an EnumSet of flags into the value expected by the C API.\n *\n * @param set The enum set to aggregate the values from.\n * @param <E> The enum type to aggregate.\n * @return The aggregated values\n */\n public static <E extends Enum<E> & OrtFlags> int aggregateToInt(EnumSet<E> set) {\n int value = 0;\n\n for (OrtFlags flag : set) {\n value |= flag.getValue();\n }\n\n return value;\n }\n}", "@Override\n void generateFalseData() {\n \n }", "@Test\n void descendingSetDescendingIteratorNextReturnsCorrectValue() {\n var it = reverseSet.descendingIterator();\n assertEquals(Integer.valueOf(1), it.next());\n assertEquals(Integer.valueOf(2), it.next());\n assertEquals(Integer.valueOf(4), it.next());\n assertEquals(Integer.valueOf(6), it.next());\n assertEquals(Integer.valueOf(9), it.next());\n }", "public abstract int arity();" ]
[ "0.5997813", "0.59792465", "0.56070054", "0.53824854", "0.53412306", "0.53027934", "0.52163637", "0.51979065", "0.51971537", "0.5161499", "0.5141528", "0.5117745", "0.5106585", "0.49864382", "0.49797857", "0.49170038", "0.48678923", "0.4865261", "0.48355114", "0.481774", "0.48153442", "0.48015377", "0.4775879", "0.47704887", "0.47536752", "0.4751753", "0.4723387", "0.47193924", "0.47152388", "0.467362", "0.46729347", "0.465318", "0.46410567", "0.46397465", "0.46397465", "0.46308708", "0.46272272", "0.46210426", "0.46181482", "0.46173304", "0.46147016", "0.4608678", "0.46013957", "0.4594251", "0.45926118", "0.45919913", "0.45919317", "0.4591349", "0.4580797", "0.4580018", "0.45788193", "0.45661458", "0.45643315", "0.45641693", "0.45597923", "0.4557483", "0.45572668", "0.45572323", "0.45404738", "0.45317808", "0.45146048", "0.45129725", "0.45082217", "0.4494972", "0.44936794", "0.44929564", "0.44927627", "0.4490939", "0.44810832", "0.44788706", "0.44771758", "0.44749784", "0.4474771", "0.4474307", "0.4474307", "0.44711003", "0.44690323", "0.4464537", "0.44578782", "0.44574878", "0.44571802", "0.44546175", "0.44511753", "0.44494796", "0.44482654", "0.44460893", "0.44460893", "0.44436175", "0.44407645", "0.44400483", "0.44397902", "0.4435683", "0.4430768", "0.4429891", "0.44263497", "0.44236213", "0.4418874", "0.4417436", "0.44160765", "0.44152495" ]
0.4789411
22
Sending a message to the console saying that the plugin has been enabled
@Override public void onEnable() { getLogger().info((TextFormat.GREEN + "Custom Messages plugin has been enabled.")); getServer().getPluginManager().registerEvents(this, this); // Registering the plugin's events // Config saveDefaultConfig(); config = getConfig(); // Checking config's version - Hard coded if (config.getInt("Version") != currentConfig){ getLogger().warn(TextFormat.RED + "Outdated config, please consider updating the plugin."); getServer().getPluginManager().disablePlugin(this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public boolean isPluginEnabled()\r\n {\n return true;\r\n }", "public void onEnable()\n\t{\n\t\t//Tells the user that the plugin is starting up.\n\t\tlog.info(\"Started up.\");\n\t}", "protected abstract void onPluginEnable();", "public void onEnable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n\n // Setup permissions\n Plugin permissionsPlugin = this.getServer().getPluginManager().getPlugin(\"Permissions\");\n\n if (permissionsPlugin == null) {\n log.info(\"[\" + pdfFile.getName() + \"] Permission system not detected, defaulting to all users\");\n usePermissions = false;\n } else {\n log.info(\"[\" + pdfFile.getName() + \"] Permission system detected\");\n usePermissions = true;\n this.permissionHandler = ((Permissions) permissionsPlugin).getHandler();\n }\n\n // Register commands\n getCommand(\"tradewolf\").setExecutor(new TradeWolfCommand(this));\n\n // Output to console that plugin is enabled\n log.info(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" enabled!\");\n }", "public void onEnable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is enabled!\" );\n }", "@Override\n public void onEnable(){\n \tgetLogger().info(\"onEnable has been invoked!\");\n \t// This will throw a NullPointerException if you don't have the command defined in your plugin.yml file!\n \tgetCommand(\"basic\").setExecutor(new BetatestCommandExecutor(this));\n \tgetCommand(\"WhatAmI\").setExecutor(new BetatestCommandExecutor(this));\n \tgetCommand(\"isonline\").setExecutor(new BetatestCommandExecutor(this));\n }", "public void onEnable() {\n\r\n \tloadSettings();\r\n \tinitDbPool();\r\n \t\r\n // EXAMPLE: Custom code, here we just output some info so we can check all is well\r\n PluginDescriptionFile pdfFile = this.getDescription();\r\n\t\tlogger.info( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is enabled!\" );\r\n }", "public void onEnable() {\n\t\tmain = this;\n\t\tthis.config = new YMLFile(\"plugins\", \"BBSkyBPvpArena\", \"config\");\n\t\tthis.etatDuJeu = 0;\n\t\tthis.pari = new Pari();\n\t\tthis.play = new Play();\n\t\tgetServer().getPluginManager().registerEvents(new pluginListeners(), this);\n\t\tgetCommand(\"arene\").setExecutor(new CommandListener());\n\t\tSystem.out.println(\"plugin SkyBlock Pvp Arena ON!\");\n\t}", "@Override\n\tpublic void onEnable() {\n\t\tcreateConfig();\n\t\tif(cfg == null) {\n\t \tcfg = getConfig();\n\t }\n\t\t// Listener registrieren\n\t\t//getServer().getPluginManager().registerEvents(new EnderchestListener(this), this));\n\t\t\n\t\t// Befehle registrieren\n\t\t// https://pastebin.com/6NsN6f6X sehr cooles Beispiel für TAB-Vervollständigung\n\t\tthis.getCommand(\"enderchest\").setExecutor(new CommandEnderchest(this));\n\t\t\n\t\t// abschließen\n \tgetLogger().info(pdf.getName() + \" version \" + pdf.getVersion() + \" by \" + pdf.getAuthors().get(0) + \" enabled! :)\");\n\t}", "public void enable(CommonPlugin plugin);", "@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 }", "public void enableChat();", "@EventHandler(priority = EventPriority.MONITOR)\r\n public void onPluginEnable(PluginEnableEvent ev) {\n Plugin pla = ev.getPlugin().getServer().getPluginManager().getPlugin(\"Heroes\");\r\n if (pla == ev.getPlugin()) {\r\n pl.logger.info(\"[HealthBar] Found heroes - implementing health system.\");\r\n // Do nothing but you know, make the message sound like its actually\r\n // doing someting other than:\r\n new HealthBarHeroes(pla);\r\n HealthBar.useHeroes = true;\r\n }\r\n }", "@Override\n public void onPluginEnable(PluginEnableEvent event) {\n if (!this.Methods.hasMethod()) {\n if(this.Methods.setMethod(event.getPlugin())) {\n // You might want to make this a public variable inside your MAIN class public Method Method = null;\n // then reference it through this.plugin.Method so that way you can use it in the rest of your plugin ;)\n ConnectFour.Method = this.Methods.getMethod();\n Log.info(\"Using: \" + ConnectFour.Method.getName() + \" - \" + ConnectFour.Method.getVersion());\n }\n }\n }", "void info( boolean enabled, Object... args ) ;", "public void sendCommFromPlugin(String command){\n\n sendCommand(command, true);\n this.fromPlugin = true;\n }", "public static void logStatus(){\r\n\t\tLogger log = Logger.getLogger(LOGGER_NAME);\r\n\t\tStringBuilder logString = new StringBuilder(\"\\n*** PlugIn Status ***\\n\");\r\n\t\t\r\n\t\tList<String> storagePlugins = getPluginsByType(PluginType.STORAGE);\r\n\t\tlogString.append(\"Storage PlugIns: \"+storagePlugins.size()+\"\\n\");\r\n\t\t\r\n\t\tlog.info(logString.toString());\r\n\t\treturn;\r\n\t}", "private boolean enablePlugin(PluginCommandManager manager, CommandSender player, String pluginName) {\r\n PluginManager pluginManager = Bukkit.getServer().getPluginManager();\r\n Plugin plugin = getPlugin(pluginName);\r\n if (plugin == null) {\r\n manager.sendMessage(player, \"A plugin with the name '\" + pluginName + \"' could not be found.\");\r\n return true;\r\n }\r\n pluginManager.enablePlugin(plugin);\r\n manager.sendMessage(player, \"The plugin '\" + pluginName + \"' was successfully enabled.\");\r\n m_plugin.cachePluginDetails();\r\n return true;\r\n }", "@Override\n public void onPluginEnable(PluginEnableEvent event) {\n if (!EconServerListener.Methods.hasMethod()) {\n if(EconServerListener.Methods.setMethod(event.getPlugin())) {\n // You might want to make this a public variable inside your MAIN class public Method Method = null;\n // then reference it through this.plugin.Method so that way you can use it in the rest of your plugin ;)\n this.plugin.Method = EconServerListener.Methods.getMethod();\n System.out.println(\"[\" + plugin.name + \"] Payment method found (\" + this.plugin.Method.getName() + \" version: \" + this.plugin.Method.getVersion() + \")\");\n EconomyHandler.currencyEnabled = true;\n }\n }\n }", "public boolean isPluginInstalled() {\n return Bukkit.getPluginManager().isPluginEnabled(Library.MCRPG.getInternalPluginName());\n }", "public void enable();", "@Override\n public void onEnable() {\n getConfig().options().copyDefaults(true);\n saveConfig();\n\n blockDamage = getConfig().getBoolean(\"damage.block\");\n playerDamage = getConfig().getBoolean(\"damage.player\");\n nukeCreeper = getConfig().getBoolean(\"natural.nuke_creeper\");\n\n loadListeners();\n loadCommands();\n\n getLogger().info(\"Successfully enabled.\");\n }", "public void onEnable() {\n super.onEnable();\n File config = new File(getDataFolder(), \"config.yml\");\n if (!getDataFolder().exists()) {\n getDataFolder().mkdir();\n }\n if (!config.exists()) {\n saveResource(\"config.yml\", true);\n }\n\n configuration = new ConfigManager(config).build();\n log(\"Loaded DeluxeCounter by FusionCoding\");\n\n countManager = new CountManager();\n countManager.init();\n\n PluginManager pm = Bukkit.getPluginManager();\n pm.registerEvents(new AsyncPlayerPreLoginListener(), this);\n getCommand(\"cowtester\").setExecutor(new CowTesterCommand());\n\n }", "public void onEnabled() {\r\n }", "private boolean pluginInformation(PluginCommandManager manager, CommandSender player, String pluginName) {\r\n Plugin plugin = getPlugin(pluginName);\r\n if (plugin == null) {\r\n manager.sendMessage(player, \"A plugin with the name '\" + pluginName + \"' could not be found.\");\r\n return true;\r\n }\r\n\r\n PluginDescriptionFile discription = plugin.getDescription();\r\n String authors = \"\";\r\n List<String> authorsList = discription.getAuthors();\r\n for (int authorIndex = 0; authorIndex < authorsList.size(); ++authorIndex) {\r\n String author = authorsList.get(authorIndex);\r\n authors += author + \", \";\r\n }\r\n if (authorsList.size() > 0) {\r\n authors = authors.substring(0, authors.length() - 2);\r\n } else {\r\n authors = \"Unknown\";\r\n }\r\n \r\n String key = \"plugin.\" + m_plugin.pluginNameToKey(plugin.getName());\r\n boolean showUrl = m_plugin.getSetting(key + \".webpage.url\", true);\r\n String url = m_plugin.getSetting(key + \".webpage.url\", discription.getWebsite());\r\n \r\n manager.sendMessage(player, ChatColor.GOLD + \"||======================================||\");\r\n manager.sendMessage(player, ChatColor.DARK_GREEN + \"Name: \" + ChatColor.WHITE + plugin.getName());\r\n manager.sendMessage(player, ChatColor.DARK_GREEN + \"Version: \" + ChatColor.WHITE + discription.getVersion());\r\n manager.sendMessage(player, ChatColor.DARK_GREEN + \"Authors: \" + ChatColor.WHITE + authors);\r\n if (showUrl) { manager.sendMessage(player, ChatColor.DARK_GREEN + \"Website: \" + ChatColor.BLUE + url); }\r\n manager.sendMessage(player, ChatColor.DARK_GREEN + \"Enabled: \" + ChatColor.WHITE + (plugin.isEnabled() ? \"True\" : \"False\"));\r\n manager.sendMessage(player, ChatColor.GOLD + \"||======================================||\");\r\n return true;\r\n }", "@Override\n public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {\n \tif (cmd.getName().equalsIgnoreCase(\"notifier\")) { // The menu and plugin info\n \t\tString[] say = {\n \t\t\t\t\"/-------------------------/\",\n \t\t\t\t\"-\" + PLUGIN_NAME + \" is running version \" + PLUGIN_VERSION,\n \t\t\t\t\"- Commands:\",\n \t\t\t\t\"- /notifier - Shows this\",\n \t\t\t\t\"- /notify - Toggle notifications\",\n \t\t\t\t\"/-------------------------/\"};\n \t\tsender.sendMessage(say);\n \t\treturn true;\n \t}\n \tif (cmd.getName().equalsIgnoreCase(\"notify\")) { // enable and disable notifications\n \t\tif (!(sender instanceof Player)) {\n \t\t\tsender.sendMessage(\"This command can only be run by a player.\");\n \t\t} else {\n \t\t\tPlayer player = (Player) sender;\n \t\t\tPlayerHandler todisable = null;\n \t\t\tfor(PlayerHandler ph : players){\n \t\t\t\tif(ph.getPlayerName().equals(player.getName())){\n \t\t\t\t\ttodisable = ph; // Found a player thread already running\n \t\t\t\t}\n \t\t\t}\n \t\t\tif(todisable != null){\n \t\t\t\t// Disable it and remove it from the ArrayList\n \t\t\t\ttodisable.disable();\n \t\t\t\tplayers.remove(todisable);\n \t\t\t\ttodisable.notify(1);\n \t\t\t\ttodisable = null;\n \t\t\t\tplayer.sendMessage(PLUGIN_NAME + \" disabled!\");\n \t\t\t\tshowConsole(\"Disabled player: \" + player.getName());\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\t// Enable\n \t\t\tPlayerHandler ph = new PlayerHandler(player, true);\n \t\t\tplayers.add(ph);\n \t\t\tplayer.sendMessage(PLUGIN_NAME + \" enabled!\");\n \t\t\tshowConsole(\"Enabled player: \" + player.getName());\n \t\t}\n \t\treturn true;\n \t}\n \tif(cmd.getName().equalsIgnoreCase(\"nudge\")){\n \t\tif(args.length != 1) return false;\n \t\tString name = args[0];\n \t\tif (!(sender instanceof Player)) {\n \t\t\tsender.sendMessage(\"Notifying player!\");\n this.notifyPlayer(name);\n \t\t} else {\n \t\t\tPlayer player = (Player) sender;\n \t\t\tplayer.sendMessage(\"This command is only available for the console!\");\n // this.notifyPlayer(name);\n // TODO Set delay for players without the right permission.\n \t\t}\n \t\treturn true;\n \t}\n \treturn false; \n }", "boolean isSetPluginstate();", "public void onEnable() {\n }", "@Override\n\tpublic void onEnable()\n\t{\n\t\tloggerPrefix = String.format(\"[InvReg %s]\", this.getDescription().getVersion());\n\t\tlogger().info(\"Enabled!\");\n\t\tsupportHandler = new SupportHandler(this);\n\t\tgetServer().getPluginManager().registerEvents(this.supportHandler, this);\n\n\t\t// Plugin support loading\n\t\tloadWorldGuardSupport();\n\t\tloadFactionSupport();\n\t\tloadGriefPrevention();\n\t\tloadForgeSupport();\n\t\tsupportHandler.load();\n\n\t\t// Config handling\n\t\tFile configFile = new File(References.CONFIG);\n\t\tYamlConfiguration config = null;\n\t\tif (configFile.exists())\n\t\t{\n\t\t\tconfig = YamlConfiguration.loadConfiguration(configFile);\n\t\t\tsupportHandler.loadConfig(config);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconfig = new YamlConfiguration();\n\t\t\tsupportHandler.createConfig(config);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tconfig.save(configFile);\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 onEnable() {\n\t\tpermissionsManager = new PermissionsManager();\n\n\t\t// build our notes table\n\t\tDatabaseTableInfo notesTable = new DatabaseTableInfo();\n\t\tnotesTable.name = \"notes\";\n\t\tnotesTable.fields = new String[]{\n\t\t\t\t\"date TIMESTAMP DEFAULT 0\",\n\t\t\t\t\"noteTaker TINYTEXT\",\n\t\t\t\t\"notee TINYTEXT\",\n\t\t\t\t\"note TEXT\"\n\t\t};\n\t\tDatabaseManager.addTableConstruct(notesTable);\n\t\t\n\t\t// initialize our database manager\n\t\tdatabaseManager = new DatabaseManager();\n\t\t\n\t\t// our note manager\n\t\tnoteManager = new NoteManager();\n\t\t\n\t\t// set our command executors\n\t\tcommandManager = new CommandManager();\n\t\tthis.getCommand(\"note\").setExecutor(commandManager);\n\t\tthis.getCommand(\"notes\").setExecutor(commandManager);\n\t\tthis.getCommand(\"editnote\").setExecutor(commandManager);\n\t\tthis.getCommand(\"notedate\").setExecutor(commandManager);\n\t\tthis.getCommand(\"notepad\").setExecutor(commandManager);\n\t\t\n\t\t// load our multiline chat handler\n\t\tmultilineChatEntry = new MultilineChatEntry();\n\t\t\n\t\t// load our configuration\n\t\t//this.saveDefaultConfig();\n\t\tconfigurationManager = new ConfigurationManager(this.getConfig());\n\t\tthis.saveConfig();\n\t\t\n\t\t// let them now!\n\t\tLogger.log(\"&aPlugin enabled!\");\n\t}", "@Override\n\tpublic void onEnable() {\n\t\tMBEPlugin Mbes = (MBEPlugin) this.getPluginManager().getPlugin(\"MbEssentials\");\n\t\t\n\t\t//Get the LogManager from the plugin\n\t\tLogManager log = Mbes.getLogManager();\n\t\t\n\t\t//Make a logger. The string tells the logmanager where to create the log\n\t\tLogger myLog = new Logger(\"plugins\\\\\"); \n\t\t// You can do this Logger myLog = new Logger(new File(\"plugins\\\\mylog.txt\")); it will overide the default name \n\t\t\n\t\t//Attach logger to the logManager\n\t\tlog.attachLogger(myLog);\n\t\t\t\n\t\t\t//write to the log\n\t\t\tlog.writeLog(\"Im logging this\",myLog,false); //Its false so it can log it using the default formatting\n\t\t\t// You can also do this log.writeLog(\"Im logging this\",myLog.getId(),false);\n\t\t}", "@Override\r\n public void onDisable() {\r\n log.info(\"[SeattleSummer] plugin disabled.\");\r\n }", "@Override\r\n public void onDisable() {\r\n \tBukkit.getLogger().info(\"[VoteHeads] Plugin Disabled.\");\r\n\r\n }", "@Override\n public boolean register() {\n Bukkit.getPluginManager().registerEvents(\n new MassiveCoreFactionsListener(),\n FactionsBridge.get().getDevelopmentPlugin()\n );\n return true;\n }", "public void run(){\n\n System.out.println(enabled);\n if (enabled) enable();\n else disable();\n\n }", "public void sendCommand(String command){\n sendCommand(command, true);\n fromPlugin = false;\n\n }", "private void initPlugin() {\n if (bluetoothAdapter == null) {\n Log.e(LOG_TAG, \"Bluetooth is not supported\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is supported\");\n\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.hasBT = true;\");\n\n //test if BLE supported\n if (!mcordova.getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Log.e(LOG_TAG, \"BluetoothLE is not supported\");\n } else {\n Log.e(LOG_TAG, \"BluetoothLE is supported\");\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.hasBTLE = true;\");\n }\n \n // test if BT is connected to a headset\n \n if (bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET) == BluetoothProfile.STATE_CONNECTED ) {\n Log.e(LOG_TAG, \" Bluetooth connected to headset\");\n sendJS(\"javascript:cordova.fireWindowEvent('BluetoothStatus.connected');\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is not connected to a headset \" + bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET));\n }\n\n //test if BT enabled\n if (bluetoothAdapter.isEnabled()) {\n Log.e(LOG_TAG, \"Bluetooth is enabled\");\n\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.BTenabled = true;\");\n sendJS(\"javascript:cordova.fireWindowEvent('BluetoothStatus.enabled');\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is not enabled\");\n }\n }\n }", "void enable();", "public static boolean isEnabled() {\n return true;\n }", "public void featureStatus(CommandSender sender) {\n\t\tString statusMessage = \"\";\n\t\t\n\t\tif (enabled.adminGUI) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Admin GUI\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Admin GUI\");\n\t\t}\n\t\t\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.publicGUI) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Public GUI\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Public GUI\");\n\t\t}\n\t\t\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.nightVision) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Night Vision\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Night Vision\");\n\t\t}\n\n\t\tstatusMessage += ChatColor.WHITE + \" | \";\n\t\t\n\t\tif (enabled.discord) {\n\t\t\tstatusMessage += (ChatColor.GREEN + \"Discord Bot\");\n\t\t} else {\n\t\t\tstatusMessage += (ChatColor.RED + \"Discord Bot\");\n\t\t}\n\t\t\n\t\tEChat.chat(sender, \"Enabled Features: \" + statusMessage);\n\t}", "@Override\n public void turnOn() {\n System.out.println(\"this wont happen\");\n }", "public void activateConsoleMode() {\n logger.addHandler(mConsoleHandler);\n }", "private void checkEnabled() {\n }", "public void turnOn( ) {\n\t\t\t\tSystem.out.println(\"Light is on \");\n\t\t}", "protected void setEnabled(boolean state) {\n enabled = state;\n log.warn(\"{} command has been {}.\", name, state ? \"enabled\" : \"disabled\");\n }", "public void enable ( ) {\r\n\t\tenabled = true;\r\n\t}", "@Override\n public void onEnable() {\n instance = this;\n\n getLogger().info(\"Hello, SpigotMC!\");\n\n getServer().getPluginManager().registerEvents(new Listeners(), this);\n }", "@Override\n public String displayInfo() {\n String str = getPluginName() + \"\\n\";\n str += \"Status: \";\n if (isRunning())\n str += \"running\";\n else\n str += \"stop\";\n str += \"\\nPort:\" + params.getUnifyExportPort();\n return str;\n }", "public void enable()\r\n\t{\r\n\t\tenabled = true;\r\n\t}", "@Override\n public void powerOn() {\n if(isOn)System.out.println(\"The Projector is already ON!\");\n else{\n System.out.println(\"The Projector is now ON!\");\n isOn = true;\n }\n }", "@Override\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"samsongTV powerOn\");\n\n\t}", "@Override\n public void onEnable() {\n this.saveDefaultConfig();\n\n // First read from the config\n FileConfiguration pluginConfig = this.getConfig();\n Logger logger = getLogger();\n boolean isValid = checkIntegrity(pluginConfig);\n\n logger.info(\"Started Polo plugin\");\n\n if (!isValid)\n logger.severe(\"Incomplete config.yml, please modify\");\n\n Config config = new Config(\n pluginConfig.getString(\"address\"),\n pluginConfig.getInt(\"port\"),\n pluginConfig.getString(\"token\"),\n pluginConfig.getBoolean(\"relay-minecraft-membership\"),\n pluginConfig.getBoolean(\"relay-minecraft-deaths\"),\n pluginConfig.getBoolean(\"relay-matrix-kicks\"),\n pluginConfig.getBoolean(\"relay-matrix-bans\")\n );\n\n // Grab the adventure-platform-bukkit audiences object\n this.audiences = BukkitAudiences.create(this);\n\n // Start up the web client\n WebClient webClient = new WebClient(\n this,\n config\n );\n\n // Make the WebClient log through our PluginLogger\n Logger.getLogger(WebClient.class.getName()).setParent(getLogger());\n\n // Start up the Minecraft event listener\n PluginManager manager = getServer().getPluginManager();\n manager.registerEvents(new MCListener(this, webClient), this);\n\n logger.info(\"Started webclient and chat listeners\");\n\n // Start up the Essentials event listener if the plugin is enabled\n if (manager.isPluginEnabled(\"Essentials\")) {\n manager.registerEvents(new Ess3Listener(this, webClient), this);\n logger.info(\"Started Essentials listener\");\n }\n\n // See if the address and port are pointing to Marco\n boolean vibeCheck = webClient.vibeCheck();\n\n if (vibeCheck) {\n logger.finer(\"Started bridge\");\n Sync sync = new Sync(webClient);\n getServer().getScheduler().runTaskTimerAsynchronously(this, sync, 0, 5*20);\n } else {\n logger.severe(\"Couldn't properly connect to marco is the address and port set properly?\");\n }\n }", "default void onEnable() {}", "void enableMod();", "@Override\n public void onEnable() {\n }", "private void enablePlugIn(WebSocketConnector aConnector, Token aToken) {\n\t\tif (mService == null) {\n\t\t\tmService = new AdminPlugInService(NS_ADMIN, mNumberOfDays, getServer());\n\t\t}\n\n\t\tif (mLog.isDebugEnabled()) {\n\t\t\tmLog.debug(\"Processing 'enablePlugIn'...\");\n\t\t}\n\n\t\tgetServer().sendToken(aConnector, mService.enablePlugIn(aConnector, aToken));\n\t}", "@Override\n\tpublic void onEnable() {\n\t}", "private void notifyAutomatically(){\n System.out.println(\"Notificando automaticamente...\");\n }", "public void enablePlugins(@SuppressWarnings(\"unused\") boolean toggle) {\n\t\tthrow new InternalWikiException(\"No longer supported.\");\n\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\tSystem.out.println(\"Provider enabled \" + provider);\n\t\t}", "boolean hasConsole();", "public boolean chatEnabled();", "private void enableBotonAceptar()\r\n\t{\r\n\t\t\r\n\t}", "public abstract void onEnable();", "public void enable() {\r\n m_enabled = true;\r\n }", "public void showEneableMessageIfNeeded() {\n if (!isNetworkAvailable()) {\n displayPromptForEnablingInternet();\n }\n }", "boolean hasEnabled();", "public void onProviderEnabled(String provider) {\n \toutputWindow.append(\"\\n onProviderEnabled\" + provider);\n }", "public boolean isChatEnabled();", "public void startPlugin() {\n\t\t// add a new ResourceChangeListener\n\t\tCheops.getInstance().addResourceChangeListener();\n\t}", "public abstract void Enabled();", "public boolean isEnabled();", "public boolean isEnabled();", "public boolean isEnabled();", "public boolean isEnabled();", "public boolean isEnabled();", "public void toolAccepted()\n {\n printOut(cliToolsManager.simpleQuestionsMaker(\"Strumento accettato\", 40, true));\n }", "public static void enableConsoleLogger(boolean enable){\n enableConsoleLogger = enable;\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 }", "public void enable() {\n\t\tenabled = true;\n\t\t//System.out.println(\"Enabled Controller\");\n\t}", "@Override\n\tpublic void onDisable() {\n\t\tgetLogger().info(\"SimplyWrapper successfully disabled !\");\n\t}", "public static void printUserGuide() {\n System.out.println(Message.USER_COMMAND_GUIDE);\n System.out.println(\"Go ahead!\");\n }", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();" ]
[ "0.7105032", "0.70839345", "0.6988201", "0.6957834", "0.6907927", "0.6756983", "0.64340675", "0.63058", "0.6292273", "0.62854964", "0.6262949", "0.61675394", "0.601432", "0.60097694", "0.5989865", "0.5920859", "0.5886482", "0.58857304", "0.5859403", "0.58082825", "0.5794734", "0.5791239", "0.57689726", "0.57615656", "0.57562155", "0.575278", "0.5727682", "0.572541", "0.57028407", "0.5685075", "0.568355", "0.5671732", "0.56690395", "0.5664232", "0.562241", "0.56183034", "0.5614023", "0.55783814", "0.5574012", "0.55715847", "0.5569634", "0.55653864", "0.55287665", "0.5523815", "0.5518586", "0.5509899", "0.55098987", "0.5509325", "0.5508052", "0.5506373", "0.54965913", "0.54919964", "0.54714215", "0.54581845", "0.54554147", "0.5446301", "0.5445769", "0.54456866", "0.5440026", "0.5406983", "0.5399294", "0.53991425", "0.539452", "0.5389911", "0.5376552", "0.5371848", "0.5371327", "0.53692037", "0.53664756", "0.5357663", "0.53567237", "0.5355161", "0.5355161", "0.5355161", "0.5355161", "0.5355161", "0.5346847", "0.5344852", "0.53411466", "0.5341031", "0.5339724", "0.53383297", "0.5338026", "0.5338026", "0.5338026", "0.5338026", "0.5338026", "0.5338026", "0.5338026", "0.5338026", "0.5338026", "0.5338026", "0.53309894", "0.53309894", "0.53309894", "0.53309894", "0.53309894", "0.53309894", "0.53309894", "0.53309894" ]
0.64761394
6
Assigning player into a variable
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) public void onJoin(PlayerJoinEvent joinEvent) { Player player = joinEvent.getPlayer(); String health = String.valueOf(player.getHealth()); String ping = String.valueOf(player.getPing()); if (config.getBoolean("JoinEnabled")) { joinEvent.setJoinMessage(config.getString("JoinMessage"). replace("%player%", player.getDisplayName()). replace("%server%", getServer().getMotd()). replace("%ping%", ping). replace("%health%", health)); // Checks if the user has put a join message or not if (config.getString("JoinMessage").trim().isEmpty() || config.getString("JoinMessage").equals("")) { this.getLogger().info("Couldn't define any join message."); } } else this.getLogger().info("Join messages are disabled."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "public void setPlayer(Player player) {\n this.currentPlayer = player;\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "public void setPlayer(Player p) {\n\t\tplayer = p;\n\t}", "public void setPlayer(String player) {\r\n this.player = player;\r\n }", "public static void setPlayer(Player p) {\n\t\tUniverse.player = p;\n\t}", "public void setPlayer(Player player) {\n\t\tthis.player = player;\r\n\t}", "private void setPlayer() {\n player = Player.getInstance();\n }", "public void setPlayer(Player player) {\n\t\tthis.player = player;\n\t}", "public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }", "@Override\n\tpublic void setPlayer(Player player) {\n\n\t}", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "protected Player getPlayer() { return player; }", "public int getPlayer()\n {\n return this.player;\n }", "public void setPlayer(Player player) {\n\t\t\tthis.player = player;\n\t\t}", "Player getCurrentPlayer();", "Player getCurrentPlayer();", "boolean setPlayer(String player);", "Player getPlayer();", "String getPlayer();", "public String getPlayer() {\r\n return player;\r\n }", "public void use(Player player) {\n\n\t}", "public void setPlayer(int play)\n {\n this.player=play;\n }", "public Player getPlayer() { return player; }", "public void setCurrentPlayer(Player P){\n this.currentPlayer = P;\n }", "public Player getPlayer()\r\n {\r\n return player;\r\n }", "public Player getPlayer() { return player;}", "public int getPlayer() {\r\n\t\treturn myPlayer;\r\n\t}", "public void setPlayer(Sprite player) {\n\t\tthis.player = player;\n\t}", "public void setPlayer(Player newPlayer) {\n roomPlayer = newPlayer;\n }", "@Override\r\n\tpublic void set(final Player t) {\n\r\n\t}", "public void setOwner(Player player) {\n owner = player;\n }", "Player currentPlayer();", "public String getPlayer() {\n return p;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\r\n return player;\r\n }", "public Player getPlayer();", "public Player getPlayer();", "public int getPlayer() {\r\n\t\treturn player;\r\n\t}", "public static void changePlayer() {\n\t\tvariableReset();\n\t\tif (curPlayer == 1)\n\t\t\tcurPlayer = player2;\n\t\telse\n\t\t\tcurPlayer = player1;\n\t}", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "Player(String playerName) {\n this.playerName = playerName;\n }", "Player getSelectedPlayer();", "public char getPlayer() {\n return player;\n }", "void createPlayer(Player player);", "public Player getPlayer() {\n return player;\n }", "Player() {\r\n setPlayerType(\"HUMAN\");\r\n\t}", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public void switchPlayer() {\r\n\t\tif (player == player1) {\r\n\t\t\tplayer = player2;\r\n\t\t} else {\r\n\t\t\tplayer = player1;\r\n\t\t}\r\n\t}", "void makePlay(int player) {\n }", "public Player updatePlayer(Player player);", "private void initPlayers() {\n this.playerOne = new Player(1, 5, 6);\n this.playerTwo = new Player(2, 0, 1);\n this.currentPlayer = playerOne;\n\n }", "public void setPlayer(ViewerManager2 player) {\n this.player = player;\n // the player is needed to be existent befor starting up the remote Server\n //startRemoteServer();\n\n }", "public Player getPlayer() {\n return p;\n }", "public Player getPlayer(){\r\n return player;\r\n }", "private void switchPlayer() {\n Player player;\n playerManager.switchPlayer();\n\n if(playerManager.getCurrentPlayer() == 1)\n player = playerManager.getPlayer(1);\n else if(playerManager.getCurrentPlayer() == 2)\n player = playerManager.getPlayer(2);\n else\n player = new Player(\"No Player exists\");\n\n updateLiveComment(\"Turn : \" + player.getName());\n }", "public void setPlayer1Name(String name){\n player1 = name;\n }", "public void setAsPlayer(){\n\t\tthis.isPlayer = true;\n\t}", "public static void set_players(){\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\tbat1=PlayBrain1.myteam[0];\n\t\t\tbat2=PlayBrain1.myteam[1];\n\t\t\tStriker=bat1;\n\t\t\tNonStriker=bat2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tbat1=PlayBrain1.oppteam[0];\n\t\t\t\tbat2=PlayBrain1.oppteam[1];\n\t\t\t\tStriker=bat1;\n\t\t\t\tNonStriker=bat2;\n\n\t\t\t\t}\n\t}", "private void setWhitePlayer(Player player) {\r\n\t\tthis.whitePlayer = player;\r\n\t}", "public Player getPlayer(){\n\t\treturn this.player;\n\t}", "public int getCurrentPlayer() {\n return player;\n }", "public void setoPlayer(Player oPlayer) {\n\t\tthis.oPlayer = oPlayer;\n\t}", "Player(String name){\n\t\tthis.name = name;\n\t}", "void updatePlayer(Player player);", "public Player getPlayer() {\r\n\t\treturn player;\r\n\t}", "public void setPlayer(Player player) {\n if(humanPlayer != null) {\n throw new IllegalArgumentException(\"The player has already been set to \"\n + humanPlayer.getName() + \" with the game piece \" + humanPlayer.getPiece());\n }\n if(player == null) {\n throw new IllegalArgumentException(\"Player cannot be null.\");\n }\n humanPlayer = player;\n }", "void playerPassedStart(Player player);", "public final Player getPlayer() {\n return player;\n }", "public void addPlayer(Player player) {\n //int id = Repository.getNextUniqueID();\n this.player = player;\n }", "static void setCurrentPlayer()\n {\n System.out.println(\"Name yourself, primary player of this humble game (or type \\\"I suck in life\\\") to quit: \");\n\n String text = input.nextLine();\n\n if (text.equalsIgnoreCase(\"I suck in life\"))\n quit();\n else\n Player.current.name = text;\n }", "public Player getPlayer1(){\n return jugador1;\n }", "public int getCurrentPlayer(){\n return this.currentPlayer;\n }", "public UserPlayer(){\n this.playerNum = 0;\n this.isLead = false;\n this.playerHand = new Hand();\n this.suitUserChose = null;\n }", "public Strider getPlayer() {\n return player;\n }", "public Player_ex1(String playerName){\n this.name = playerName;\n winner = false;\n }", "Player createPlayer();", "public void initPlayer();", "public void copy(Player player) {\n playerName = player.playerName;\n playerColor = player.playerColor;\n playerGamePiece = player.playerGamePiece;\n }", "public Player getPlayer() {\n return humanPlayer;\n }", "public void turnToPlay(Player opponent) {\n\n }", "public void nextPlayer() {\n\t\tif (currentPlayer.equals(vServerThread.get(0))){\n\t\t\tcurrentPlayer=vServerThread.get(1);\n\t\t} else if (currentPlayer.equals(vServerThread.get(1))){\n\t\t\tcurrentPlayer=vServerThread.get(0);\n\t\t}\n\t}", "public void welcomePlayer(Player p);", "public Player getCurrentPlayer(){\n return this.currentPlayer;\n }", "public PlayerID getPlayer(){\n\t\treturn this.player;\n\t}", "public Player getPlayer(String username){\n return this.players.get(username);\n }", "public void setActivePlayer()\n {\n activePlayer = !activePlayer;\n }", "public void setxPlayer(Player xPlayer) {\n\t\tthis.xPlayer = xPlayer;\n\t}", "public void generatePlayer()\n {\n board.getTile(8,0).insertPlayer(this.player);\n }", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}" ]
[ "0.7683957", "0.73966855", "0.73514533", "0.733405", "0.72985756", "0.72545695", "0.7243224", "0.71868926", "0.7113708", "0.7102396", "0.7015997", "0.69953907", "0.6988284", "0.69087356", "0.6891357", "0.6843835", "0.68388295", "0.68355167", "0.68355167", "0.6835227", "0.68334407", "0.6832045", "0.68068767", "0.6798887", "0.67931896", "0.6785634", "0.6782977", "0.67819685", "0.6774985", "0.6749448", "0.6745558", "0.672659", "0.6715884", "0.6662067", "0.66452193", "0.6607246", "0.65990525", "0.6596786", "0.65840495", "0.65840495", "0.6575144", "0.6556425", "0.65532994", "0.6535036", "0.65291363", "0.65276676", "0.6523249", "0.6521182", "0.65196717", "0.65194935", "0.65194935", "0.65194935", "0.65194935", "0.65194935", "0.6518755", "0.6510765", "0.65069395", "0.6503099", "0.6496724", "0.6458525", "0.6456494", "0.64408314", "0.64403087", "0.6439878", "0.643205", "0.6408923", "0.64069426", "0.64067435", "0.640505", "0.6397229", "0.6395064", "0.63909113", "0.63865364", "0.6385557", "0.6380983", "0.63604933", "0.63599014", "0.63490355", "0.6346517", "0.6345028", "0.6336583", "0.63334286", "0.6330488", "0.6326066", "0.6311766", "0.62985533", "0.62836975", "0.6280175", "0.6277855", "0.6272216", "0.6268678", "0.6265422", "0.6263551", "0.626204", "0.62590706", "0.62585276", "0.62585276", "0.62585276", "0.62585276", "0.62585276", "0.62585276" ]
0.0
-1
Assigning player into a variable
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) public void onQuit(PlayerQuitEvent quitEvent) { Player player = quitEvent.getPlayer(); String health = String.valueOf(player.getHealth()); String ping = String.valueOf(player.getPing()); if (config.getBoolean("QuitEnabled")) { quitEvent.setQuitMessage(config.getString("QuitMessage"). replace("%player%", player.getDisplayName()). replace("%server%", getServer().getMotd()). replace("%ping%", ping). replace("%health%", health)); // Checks if the user has put a quit message or not if (config.getString("QuitMessage").trim().isEmpty() || config.getString("QuitMessage").equals("")) { this.getLogger().info("Couldn't define any quit message."); } } else this.getLogger().info("Quit messages are disabled."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "public void setPlayer(Player player) {\n this.currentPlayer = player;\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "public void setPlayer(Player p) {\n\t\tplayer = p;\n\t}", "public void setPlayer(String player) {\r\n this.player = player;\r\n }", "public static void setPlayer(Player p) {\n\t\tUniverse.player = p;\n\t}", "public void setPlayer(Player player) {\n\t\tthis.player = player;\r\n\t}", "private void setPlayer() {\n player = Player.getInstance();\n }", "public void setPlayer(Player player) {\n\t\tthis.player = player;\n\t}", "public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }", "@Override\n\tpublic void setPlayer(Player player) {\n\n\t}", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "protected Player getPlayer() { return player; }", "public int getPlayer()\n {\n return this.player;\n }", "public void setPlayer(Player player) {\n\t\t\tthis.player = player;\n\t\t}", "Player getCurrentPlayer();", "Player getCurrentPlayer();", "boolean setPlayer(String player);", "Player getPlayer();", "String getPlayer();", "public String getPlayer() {\r\n return player;\r\n }", "public void use(Player player) {\n\n\t}", "public void setPlayer(int play)\n {\n this.player=play;\n }", "public Player getPlayer() { return player; }", "public void setCurrentPlayer(Player P){\n this.currentPlayer = P;\n }", "public Player getPlayer()\r\n {\r\n return player;\r\n }", "public Player getPlayer() { return player;}", "public int getPlayer() {\r\n\t\treturn myPlayer;\r\n\t}", "public void setPlayer(Sprite player) {\n\t\tthis.player = player;\n\t}", "public void setPlayer(Player newPlayer) {\n roomPlayer = newPlayer;\n }", "@Override\r\n\tpublic void set(final Player t) {\n\r\n\t}", "public void setOwner(Player player) {\n owner = player;\n }", "Player currentPlayer();", "public String getPlayer() {\n return p;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\r\n return player;\r\n }", "public Player getPlayer();", "public Player getPlayer();", "public int getPlayer() {\r\n\t\treturn player;\r\n\t}", "public static void changePlayer() {\n\t\tvariableReset();\n\t\tif (curPlayer == 1)\n\t\t\tcurPlayer = player2;\n\t\telse\n\t\t\tcurPlayer = player1;\n\t}", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "Player(String playerName) {\n this.playerName = playerName;\n }", "Player getSelectedPlayer();", "public char getPlayer() {\n return player;\n }", "void createPlayer(Player player);", "public Player getPlayer() {\n return player;\n }", "Player() {\r\n setPlayerType(\"HUMAN\");\r\n\t}", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public void switchPlayer() {\r\n\t\tif (player == player1) {\r\n\t\t\tplayer = player2;\r\n\t\t} else {\r\n\t\t\tplayer = player1;\r\n\t\t}\r\n\t}", "void makePlay(int player) {\n }", "public Player updatePlayer(Player player);", "private void initPlayers() {\n this.playerOne = new Player(1, 5, 6);\n this.playerTwo = new Player(2, 0, 1);\n this.currentPlayer = playerOne;\n\n }", "public void setPlayer(ViewerManager2 player) {\n this.player = player;\n // the player is needed to be existent befor starting up the remote Server\n //startRemoteServer();\n\n }", "public Player getPlayer() {\n return p;\n }", "public Player getPlayer(){\r\n return player;\r\n }", "private void switchPlayer() {\n Player player;\n playerManager.switchPlayer();\n\n if(playerManager.getCurrentPlayer() == 1)\n player = playerManager.getPlayer(1);\n else if(playerManager.getCurrentPlayer() == 2)\n player = playerManager.getPlayer(2);\n else\n player = new Player(\"No Player exists\");\n\n updateLiveComment(\"Turn : \" + player.getName());\n }", "public void setPlayer1Name(String name){\n player1 = name;\n }", "public void setAsPlayer(){\n\t\tthis.isPlayer = true;\n\t}", "public static void set_players(){\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\tbat1=PlayBrain1.myteam[0];\n\t\t\tbat2=PlayBrain1.myteam[1];\n\t\t\tStriker=bat1;\n\t\t\tNonStriker=bat2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tbat1=PlayBrain1.oppteam[0];\n\t\t\t\tbat2=PlayBrain1.oppteam[1];\n\t\t\t\tStriker=bat1;\n\t\t\t\tNonStriker=bat2;\n\n\t\t\t\t}\n\t}", "private void setWhitePlayer(Player player) {\r\n\t\tthis.whitePlayer = player;\r\n\t}", "public Player getPlayer(){\n\t\treturn this.player;\n\t}", "public int getCurrentPlayer() {\n return player;\n }", "public void setoPlayer(Player oPlayer) {\n\t\tthis.oPlayer = oPlayer;\n\t}", "Player(String name){\n\t\tthis.name = name;\n\t}", "void updatePlayer(Player player);", "public Player getPlayer() {\r\n\t\treturn player;\r\n\t}", "public void setPlayer(Player player) {\n if(humanPlayer != null) {\n throw new IllegalArgumentException(\"The player has already been set to \"\n + humanPlayer.getName() + \" with the game piece \" + humanPlayer.getPiece());\n }\n if(player == null) {\n throw new IllegalArgumentException(\"Player cannot be null.\");\n }\n humanPlayer = player;\n }", "void playerPassedStart(Player player);", "public final Player getPlayer() {\n return player;\n }", "public void addPlayer(Player player) {\n //int id = Repository.getNextUniqueID();\n this.player = player;\n }", "static void setCurrentPlayer()\n {\n System.out.println(\"Name yourself, primary player of this humble game (or type \\\"I suck in life\\\") to quit: \");\n\n String text = input.nextLine();\n\n if (text.equalsIgnoreCase(\"I suck in life\"))\n quit();\n else\n Player.current.name = text;\n }", "public Player getPlayer1(){\n return jugador1;\n }", "public int getCurrentPlayer(){\n return this.currentPlayer;\n }", "public UserPlayer(){\n this.playerNum = 0;\n this.isLead = false;\n this.playerHand = new Hand();\n this.suitUserChose = null;\n }", "public Strider getPlayer() {\n return player;\n }", "public Player_ex1(String playerName){\n this.name = playerName;\n winner = false;\n }", "Player createPlayer();", "public void initPlayer();", "public void copy(Player player) {\n playerName = player.playerName;\n playerColor = player.playerColor;\n playerGamePiece = player.playerGamePiece;\n }", "public Player getPlayer() {\n return humanPlayer;\n }", "public void turnToPlay(Player opponent) {\n\n }", "public void nextPlayer() {\n\t\tif (currentPlayer.equals(vServerThread.get(0))){\n\t\t\tcurrentPlayer=vServerThread.get(1);\n\t\t} else if (currentPlayer.equals(vServerThread.get(1))){\n\t\t\tcurrentPlayer=vServerThread.get(0);\n\t\t}\n\t}", "public void welcomePlayer(Player p);", "public Player getCurrentPlayer(){\n return this.currentPlayer;\n }", "public PlayerID getPlayer(){\n\t\treturn this.player;\n\t}", "public Player getPlayer(String username){\n return this.players.get(username);\n }", "public void setActivePlayer()\n {\n activePlayer = !activePlayer;\n }", "public void setxPlayer(Player xPlayer) {\n\t\tthis.xPlayer = xPlayer;\n\t}", "public void generatePlayer()\n {\n board.getTile(8,0).insertPlayer(this.player);\n }", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}" ]
[ "0.7683957", "0.73966855", "0.73514533", "0.733405", "0.72985756", "0.72545695", "0.7243224", "0.71868926", "0.7113708", "0.7102396", "0.7015997", "0.69953907", "0.6988284", "0.69087356", "0.6891357", "0.6843835", "0.68388295", "0.68355167", "0.68355167", "0.6835227", "0.68334407", "0.6832045", "0.68068767", "0.6798887", "0.67931896", "0.6785634", "0.6782977", "0.67819685", "0.6774985", "0.6749448", "0.6745558", "0.672659", "0.6715884", "0.6662067", "0.66452193", "0.6607246", "0.65990525", "0.6596786", "0.65840495", "0.65840495", "0.6575144", "0.6556425", "0.65532994", "0.6535036", "0.65291363", "0.65276676", "0.6523249", "0.6521182", "0.65196717", "0.65194935", "0.65194935", "0.65194935", "0.65194935", "0.65194935", "0.6518755", "0.6510765", "0.65069395", "0.6503099", "0.6496724", "0.6458525", "0.6456494", "0.64408314", "0.64403087", "0.6439878", "0.643205", "0.6408923", "0.64069426", "0.64067435", "0.640505", "0.6397229", "0.6395064", "0.63909113", "0.63865364", "0.6385557", "0.6380983", "0.63604933", "0.63599014", "0.63490355", "0.6346517", "0.6345028", "0.6336583", "0.63334286", "0.6330488", "0.6326066", "0.6311766", "0.62985533", "0.62836975", "0.6280175", "0.6277855", "0.6272216", "0.6268678", "0.6265422", "0.6263551", "0.626204", "0.62590706", "0.62585276", "0.62585276", "0.62585276", "0.62585276", "0.62585276", "0.62585276" ]
0.0
-1
menuunjukkan Tombol GETSTARTED dan menyembunyikan indikator dan tombol selanjutnya
private void loaddLastScreen() { btnSelanjutnya.setVisibility(View.INVISIBLE); btnMulai.setVisibility(View.VISIBLE); tvSkip.setVisibility(View.INVISIBLE); tabIndicator.setVisibility(View.INVISIBLE); // TODO : ADD an animation the getstarted button // penyiapan animasi btnMulai.setAnimation(btnAnim); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendeSpielStarten();", "@Override\n\tpublic void statusVomMenschen() {\n\t\tSystem.out.println(\"Sie wurden getroffen nun können Sie nicht mehr so schnell laufen!\");\n\t}", "public void start( )\n {\n // Implemented by student.\n }", "public void recibir_estado_partida(){\n\n }", "public void loadStatus (){\n\t}", "private void getStatus() {\n\t\t\n\t}", "public void start(){\n }", "public abstract void started();", "public void start() {\n\n System.out.println(\"Esto no debe salir por consola al sobreescribirlo\");\n\n }", "void transStatus()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(passenger != null && status.equals(\"soon\"))\r\n\t\t\t{\r\n\t\t\t\tService s_temp = new Service(passenger);\r\n\t\t\t\tdes = passenger.loc;\r\n\t\t\t\tmakeService(loc.i*80+loc.j,des.i*80+des.j);\r\n\t\t\t\tstatus = \"stop\";\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t\tstatus = \"serve\";\r\n\t\t\t\tdes = passenger.des;\r\n\t\t\t\ts_temp.path.add(loc);\r\n\t\t\t\tmakeService(loc.i*80+loc.j,des.i*80+des.j,s_temp.path);\r\n\t\t\t\tstatus = \"stop\";\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t\tcredit += 3;\r\n\t\t\t\tser_times += 1;\r\n\t\t\t\tservices.add(s_temp);\r\n\t\t\t\t//refresh:\r\n\t\t\t\tstatus = \"wait\";\r\n\t\t\t\tpassenger = null;\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 start()\r\n\t{\n\tSystem.out.println(\"normal start method\");\r\n\t}", "private void start() {\n\n\t}", "public void start(){\n return;\n }", "public void starting();", "public void start() {\n\n\t}", "long start();", "public void startGame() {\n status = Status.COMPLETE;\n }", "public void start() {\n boolean continua = true;\n Dati datiRMP;\n int codPiatto;\n int codRiga;\n int quantiCoperti;\n int quanteComande;\n String descPiatto;\n String catPiatto;\n Modulo modRMP = RMPModulo.get();\n Modulo modPiatto = PiattoModulo.get();\n Modulo modCategoria = CategoriaModulo.get();\n ModuloRisultati modRisultati = getModuloRisultati();\n Campo chiaveRMP;\n int codRMP;\n int codMenu;\n int[] codici;\n double qtaOff;\n double qtaCom;\n double gradimento = 0.0;\n PanCoperti panCoperti;\n\n try { // prova ad eseguire il codice\n\n /* azzera il numero di coperti serviti */\n panCoperti = getPanCoperti();\n panCoperti.setNumCopertiPranzo(0);\n panCoperti.setNumCopertiCena(0);\n\n /* svuota i dati del modulo risultati */\n getModuloRisultati().query().eliminaRecords();\n\n datiRMP = this.getDati();\n chiaveRMP = modRMP.getCampoChiave();\n\n /* spazzola le RMP trovate */\n for (int k = 0; k < datiRMP.getRowCount(); k++) {\n\n this.quanti++;\n\n codRMP = datiRMP.getIntAt(k, chiaveRMP);\n codPiatto = datiRMP.getIntAt(k, modRMP.getCampo(RMP.CAMPO_PIATTO));\n descPiatto = datiRMP.getStringAt(k,\n modPiatto.getCampo(Piatto.CAMPO_NOME_ITALIANO));\n catPiatto = datiRMP.getStringAt(k,\n modCategoria.getCampo(Categoria.CAMPO_SIGLA));\n\n codRiga = addPiatto(codPiatto, descPiatto, catPiatto);\n\n if (codRiga <= 0) {\n continua = false;\n break;\n }// fine del blocco if\n\n /* incrementa di 1 il numero di volte in cui il piatto è stato proposto\n * per questa riga risultati */\n incrementaCampo(codRiga, Campi.Ris.quanteVolte, 1);\n\n /* determina il numero dei coperti presenti nel menu al\n * quale questa RMP appartiene */\n codMenu = datiRMP.getIntAt(k, modRMP.getCampo(RMP.CAMPO_MENU));\n quantiCoperti = getQuantiCoperti(codMenu);\n\n /* incrementa il numero di coperti potenziali per questa riga risultati */\n incrementaCampo(codRiga, Campi.Ris.quantiCoperti, quantiCoperti);\n\n /* determina il numero di comande effettuate\n * per questa RMP */\n quanteComande = getQuanteComande(codRMP);\n\n /* incrementa il numero di comande effettuate per questa riga risultati */\n incrementaCampo(codRiga, Campi.Ris.quanteComande, quanteComande);\n\n /* interruzione nella superclasse */\n if (super.isInterrompi()) {\n continua = false;\n break;\n }// fine del blocco if\n\n } // fine del ciclo for\n\n /* spazzola le righe dei risultati per regolare il gradimento */\n if (continua) {\n codici = modRisultati.query().valoriChiave();\n for (int k = 0; k < codici.length; k++) {\n codRiga = codici[k];\n gradimento = 0.0;\n qtaOff = modRisultati.query()\n .valoreDouble(Campi.Ris.quantiCoperti.getCampo(), codRiga);\n qtaCom = modRisultati.query()\n .valoreDouble(Campi.Ris.quanteComande.getCampo(), codRiga);\n if (qtaOff != 0) {\n gradimento = qtaCom / qtaOff;\n gradimento = Lib.Mat.arrotonda(gradimento, 4);\n }// fine del blocco if\n modRisultati.query().registraRecordValore(codRiga,\n Campi.Ris.gradimento.getCampo(),\n gradimento);\n } // fine del ciclo for\n }// fine del blocco if\n\n datiRMP.close();\n\n getNavigatore().aggiornaLista();\n\n /* aggiorna il numero di coperti serviti */\n Filtro filtro;\n Number numero;\n Modulo moduloRMT = RMTModulo.get();\n Filtro filtroMenu = getFiltroMenu();\n Filtro filtroPranzo = FiltroFactory.crea(MenuModulo.get().getCampo(Menu.Cam.pasto), Ristorante.COD_DB_PRANZO);\n Filtro filtroCena = FiltroFactory.crea(MenuModulo.get().getCampo(Menu.Cam.pasto), Ristorante.COD_DB_CENA);\n filtro = new Filtro();\n filtro.add(filtroMenu);\n filtro.add(filtroPranzo);\n numero = moduloRMT.query().somma(RMT.Cam.coperti.get(), filtro);\n panCoperti.setNumCopertiPranzo(Libreria.getInt(numero));\n filtro = new Filtro();\n filtro.add(filtroMenu);\n filtro.add(filtroCena);\n numero = moduloRMT.query().somma(RMT.Cam.coperti.get(), filtro);\n panCoperti.setNumCopertiCena(Libreria.getInt(numero));\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n }", "@Override\r\n\tpublic void onStart() {\n\t\tsuper.onStart();\r\n\t\tgetticketplan();\r\n\t\tendloading();\r\n\t\t// getnewtime();\r\n\t\t// Stasttime();\r\n\t\t// if (chongqing.getInt(\"chongqing\", 0) == 10) {\r\n\t\t// tickettypecode = 4;\r\n\t\t// Editor edit = chongqing.edit();\r\n\t\t// edit.putInt(\"chongqing\", 0);\r\n\t\t// edit.commit();\r\n\t\t// }\r\n\r\n\t\tLog.e(TAG, \"onStart----->\");\r\n\t}", "public void start() {\n\r\n }", "public boolean start();", "public void start() {\n\t\t\n\t}", "public void start() {\n\t\t\n\t}", "@Override\r\n\tpublic void start() {\r\n\t\tsuper.start();\r\n\t\tresetDice();\r\n\t\tclearPlayer();\r\n\t\t// changing the state of all the players to playing.\r\n\r\n\t\tsuccessID = 0;\r\n\t\t// 输家ID\r\n\t\tfailID = 0;\r\n\r\n\t\tint taxes = hallType.getSystemTaxes();\r\n\t\tList<Player> list = getAllPlayers();\r\n\t\tfor (Player player : list) {\r\n\t\t\tplayer.setPlayerState(PlayerState.Playing);\r\n\t\t\tplayer.getPlayerDetail().addCoins(taxes * -1);\r\n\t\t\taddPlayer(player);\r\n\r\n\t\t\tplayer.resetPlayer(hallType.getGameType());\r\n\t\t}\r\n\t\tint gamePlayerCount = list.size();// 记录游戏类型的局数\r\n\t\tGameMgr.addGameTypeCount(gamePlayerCount);\r\n\t\tsendUpdatePlayerState();\r\n\r\n\t\tsortQueue();\r\n\t\tSendGameStart(taxes);\r\n\t\tgameState = GameState.Playing;\r\n\r\n\t\tWaitTime(1 * 1000);\r\n\t\t// checkState(0);\r\n\r\n\t}", "public void start() {}", "public void start() {}", "private void preRequest() {\n\t\tSystem.out.println(\"pre request, i am playing job\");\n\t}", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "int getStart();", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "@Override\n\tpublic void start()\n\t{\n\t\tarena = \"scenarios/boxpushing/arena/pioneer.controller.arena.txt\"; \n\n\t\t\n\t\tschedule.reset();\n\n\t\tsuper.start();\n\n\t\tresetBehavior();\n\n\t}", "boolean isStarted();", "boolean isStarted();", "@Override\r\n\tpublic void tellStarting() {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t\t// Not used here\r\n\t}", "public void start() {\n \tupdateHeader();\n }", "public void setStart(){\n\t\tthis.isStart=true;\n\t}", "public void start() {\n\n }", "@Override\r\n public void Story(){\r\n super.Story();\r\n System.out.println(\"=======================================================================================\");\r\n System.out.println(\"|| Arya harus bergegas untuk menyelamatkan seluruh warga. Dia tidak tau posisi warga ||\");\r\n System.out.println(\"|| yang harus diselamatkan ada pada ruangan yang mana. ||\");\r\n System.out.println(\"=======================================================================================\");\r\n }", "public void bayar() {\n transaksi.setStatus(\"lunas\");\n setLunas(true);\n }", "protected abstract boolean start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "void start();", "public void status() {\n System.out.println(\"Nome: \" + this.getNome());\n System.out.println(\"Data de Nascimento: \" + this.getDataNasc());\n System.out.println(\"Peso: \" + this.getPeso());\n System.out.println(\"Altura: \" + this.getAltura());\n }", "void onSuccessfulStarted();", "@Override\n\tpublic void start() {\n\n\t}", "public int start() { return _start; }", "protected abstract void displayStartMsg();", "public void start() {\n\t\tSystem.out.println(\"BMW.........start!!!.\");\n\t}", "void start() {\n \tm_e.step(); // 1, 3\n }", "@Override\n public void onStart(ITestContext tc) {\n StatusPrinter.printRunStart();\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n tembak();\r\n gerakKiri();\r\n gerakKanan();\r\n \r\n \r\n \r\n }", "public void start() {\n }", "public abstract void tellStarting();", "@Override\n\tpublic void getStatus() {\n\t\t\n\t}", "public void iniciarBatalha() {\r\n\t\trede.iniciarPartidaRede();\r\n\t}", "public void act() \r\n {\r\n mueve();\r\n //tocaJugador();\r\n //bala();\r\n disparaExamen();\r\n }", "public void handleStart()\n {\n }", "public void start2();", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "void doManualStart();", "void sendStartMessage();", "void sendStartMessage();", "@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}", "@Override\r\n public void start() {\r\n }", "@Override\n public void setStatus(int arg0) {\n\n }", "public void start() {\n System.out.println(\"start\");\n }", "public void start() {\n\t\tSystem.out.println(\"parent method\");\n\t}", "public void onStart(ITestContext context) {\n\t\tSystem.out.println(context.getName()+\"**********All Test Started.............This is result.getName\");\r\n\t\t\r\n\t}", "public void start() {\n\t\tSystem.out.println(\"BMW Slef-----start\");\n\t}", "public void onBegin() {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void setStarted(boolean started){\n \tthis.started = started;\n }", "void start ();", "public boolean Step(){\n\t\t\t\t\tboolean Result = true;\t\t\t\t\t\t// A vegso eredmeny: Stabil-e az aramkor\n\t\t\t\t\t_TEST stack = new _TEST();\t\t\t\t\t/* TEST */\n\t\t\t\t\tstack.PrintHeader(ID,\"\",\"true:boolean\");\t/* TEST */\n\t\t\t\t\tPreviousValue = Count();\t\t\t\t\t// Megnezzuk az elso futas erredmenyet\n\t\t\t\t\tinv0.Count();\t\t\t\t//feedback[0].Count(), elso ciklus\n\t\t\t\t\tPreviousValue = Count();\t//feedback 0 es 1 kozt magat frissiti\n\t\t\t\t\tinv0.Count();\t\t\t\t//feedback[0].Count(), masodik ciklus\n\t\t\t\t\tPreviousValue = Count();\t//frissiti magat. itt instabilitasi teszt jon a proto-ban\n\n\t\t\t\t\tstack.PrintTail(ID,\"\",Result + \":boolean\");\t/* TEST */\n\t\t\t\t\treturn Result;\n\t\t\t\t}", "@Override\r\n\tpublic void start() {\n\t\tsuper.start();\r\n\t\t\r\n\t}" ]
[ "0.6808683", "0.603524", "0.59176755", "0.5896238", "0.58350176", "0.5789307", "0.57834065", "0.57734233", "0.57634145", "0.5747383", "0.5733288", "0.57154393", "0.56987584", "0.5657745", "0.56571025", "0.565664", "0.56537306", "0.56461614", "0.5636992", "0.5636211", "0.56353873", "0.5615014", "0.5615014", "0.5597214", "0.5594053", "0.5594053", "0.55922484", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.55824965", "0.5580353", "0.55789167", "0.55734324", "0.5573099", "0.5573099", "0.55327153", "0.5530371", "0.5527637", "0.55253714", "0.5525185", "0.5520141", "0.55186296", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.55185336", "0.5516687", "0.55123466", "0.5511786", "0.55104494", "0.5508277", "0.5505302", "0.55010945", "0.5495188", "0.5481945", "0.548145", "0.5479443", "0.54700446", "0.54634434", "0.544836", "0.54462785", "0.54454714", "0.5441262", "0.5441262", "0.5441262", "0.5441262", "0.5437454", "0.5434817", "0.5434817", "0.5433368", "0.5420347", "0.5417917", "0.5406459", "0.5405896", "0.5405204", "0.54001784", "0.5397875", "0.5397275", "0.5383316", "0.53815055", "0.538078" ]
0.0
-1
Created by JustMe on 11/28/2017.
public interface MenuItem<T> { T[] getItems(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void mo38117a() {\n }", "@Override\n\tprotected void interr() {\n\t}", "private void m50366E() {\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void entrenar() {\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 init() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n public void init() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void gored() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n public void init() {}", "public void mo4359a() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "private void poetries() {\n\n\t}", "@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() {}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void ligar() {\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 initialize() \n {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override public int describeContents() { return 0; }", "@Override\n\tprotected void initialize() {\n\n\t}", "private void init() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\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 init() {\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}", "public final void mo91715d() {\n }", "private static void cajas() {\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}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "public void m23075a() {\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n protected void getExras() {\n }", "public void mo21877s() {\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public void initialize() { \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "public void mo21779D() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "public void mo12628c() {\n }", "public void mo12930a() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}" ]
[ "0.6028601", "0.5884795", "0.5872228", "0.5830608", "0.580863", "0.5717442", "0.5717442", "0.5690373", "0.5685771", "0.5652856", "0.56371534", "0.56297624", "0.56198454", "0.56080556", "0.558719", "0.5582353", "0.5565469", "0.555888", "0.555888", "0.555888", "0.555888", "0.555888", "0.55459344", "0.5536256", "0.55342555", "0.5533449", "0.5523417", "0.55214316", "0.55183655", "0.551493", "0.5504527", "0.5504527", "0.5504527", "0.5504527", "0.5504527", "0.5504527", "0.550362", "0.54976755", "0.5492408", "0.54828894", "0.54792255", "0.54780525", "0.54780525", "0.54674804", "0.5458323", "0.54425734", "0.5435869", "0.5435399", "0.5430201", "0.541629", "0.541629", "0.541629", "0.541346", "0.540564", "0.54050577", "0.54022527", "0.54022527", "0.5394592", "0.53927326", "0.53923875", "0.5387933", "0.53852427", "0.5385102", "0.5385102", "0.5385102", "0.5385102", "0.5385102", "0.5385102", "0.5385102", "0.53745013", "0.53738236", "0.53738236", "0.53738236", "0.5371797", "0.53703016", "0.53679496", "0.53679496", "0.53679496", "0.5361107", "0.5361107", "0.5360544", "0.5359051", "0.53518975", "0.5351498", "0.5343722", "0.5343549", "0.53371656", "0.5331288", "0.5320746", "0.5319759", "0.5304431", "0.5303216", "0.53001297", "0.529998", "0.52987903", "0.52987903", "0.5295254", "0.52950156", "0.52926123", "0.52866024", "0.52866024" ]
0.0
-1
Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.example.types
public ObjectFactory() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SchemaBuilder withFactory(String factoryClassName);", "ObjectTypeDefinition createObjectTypeDefinition();", "SchemaComponentType createSchemaComponentType();", "TypeSystemDefinition createTypeSystemDefinition();", "public interface GraphQLFactory extends EFactory\n{\n /**\n * The singleton instance of the factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @generated\n */\n GraphQLFactory eINSTANCE = io.github.katmatt.graphql.graphQL.impl.GraphQLFactoryImpl.init();\n\n /**\n * Returns a new object of class '<em>Type System Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type System Definition</em>'.\n * @generated\n */\n TypeSystemDefinition createTypeSystemDefinition();\n\n /**\n * Returns a new object of class '<em>Schema Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Schema Definition</em>'.\n * @generated\n */\n SchemaDefinition createSchemaDefinition();\n\n /**\n * Returns a new object of class '<em>Root Operation Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Root Operation Type Definition</em>'.\n * @generated\n */\n RootOperationTypeDefinition createRootOperationTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type Definition</em>'.\n * @generated\n */\n TypeDefinition createTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Scalar Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Scalar Type Definition</em>'.\n * @generated\n */\n ScalarTypeDefinition createScalarTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Object Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Type Definition</em>'.\n * @generated\n */\n ObjectTypeDefinition createObjectTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Interface Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Interface Definition</em>'.\n * @generated\n */\n InterfaceDefinition createInterfaceDefinition();\n\n /**\n * Returns a new object of class '<em>Field Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Definition</em>'.\n * @generated\n */\n FieldDefinition createFieldDefinition();\n\n /**\n * Returns a new object of class '<em>Union Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Union Type Definition</em>'.\n * @generated\n */\n UnionTypeDefinition createUnionTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Enum Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Type Definition</em>'.\n * @generated\n */\n EnumTypeDefinition createEnumTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Enum Value Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Value Definition</em>'.\n * @generated\n */\n EnumValueDefinition createEnumValueDefinition();\n\n /**\n * Returns a new object of class '<em>Input Object Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Input Object Type Definition</em>'.\n * @generated\n */\n InputObjectTypeDefinition createInputObjectTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Input Value Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Input Value Definition</em>'.\n * @generated\n */\n InputValueDefinition createInputValueDefinition();\n\n /**\n * Returns a new object of class '<em>Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type</em>'.\n * @generated\n */\n Type createType();\n\n /**\n * Returns a new object of class '<em>Named Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Named Type</em>'.\n * @generated\n */\n NamedType createNamedType();\n\n /**\n * Returns a new object of class '<em>List Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>List Type</em>'.\n * @generated\n */\n ListType createListType();\n\n /**\n * Returns a new object of class '<em>Int Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Int Value</em>'.\n * @generated\n */\n IntValue createIntValue();\n\n /**\n * Returns a new object of class '<em>Float Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Float Value</em>'.\n * @generated\n */\n FloatValue createFloatValue();\n\n /**\n * Returns a new object of class '<em>Null Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Null Value</em>'.\n * @generated\n */\n NullValue createNullValue();\n\n /**\n * Returns a new object of class '<em>String Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>String Value</em>'.\n * @generated\n */\n StringValue createStringValue();\n\n /**\n * Returns a new object of class '<em>Boolean Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Boolean Value</em>'.\n * @generated\n */\n BooleanValue createBooleanValue();\n\n /**\n * Returns a new object of class '<em>Enum Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Value</em>'.\n * @generated\n */\n EnumValue createEnumValue();\n\n /**\n * Returns a new object of class '<em>Object Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Value</em>'.\n * @generated\n */\n ObjectValue createObjectValue();\n\n /**\n * Returns a new object of class '<em>Object Field</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Field</em>'.\n * @generated\n */\n ObjectField createObjectField();\n\n /**\n * Returns a new object of class '<em>Const Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Const Value</em>'.\n * @generated\n */\n ConstValue createConstValue();\n\n /**\n * Returns a new object of class '<em>List Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>List Value</em>'.\n * @generated\n */\n ListValue createListValue();\n\n /**\n * Returns a new object of class '<em>Directive Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Directive Definition</em>'.\n * @generated\n */\n DirectiveDefinition createDirectiveDefinition();\n\n /**\n * Returns a new object of class '<em>Directive</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Directive</em>'.\n * @generated\n */\n Directive createDirective();\n\n /**\n * Returns a new object of class '<em>Argument</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Argument</em>'.\n * @generated\n */\n Argument createArgument();\n\n /**\n * Returns the package supported by this factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return the package supported by this factory.\n * @generated\n */\n GraphQLPackage getGraphQLPackage();\n\n}", "DomainType createDomainType();", "SchemaDefinition createSchemaDefinition();", "public static <T> RuntimeSchema<T> createFrom(Class<T> typeClass)\r\n {\r\n return createFrom(typeClass, NO_EXCLUSIONS);\r\n }", "JDefinedClass objectFactory();", "FieldType createFieldType();", "TypeDefinition createTypeDefinition();", "private ObjectFactory createObjectFactory(String objectFactoryNamespace)\r\n throws CockpitConfigurationException {\r\n try {\r\n return new ObjectFactory(new ConfigManagerSpecificationFactory(objectFactoryNamespace));\r\n } catch (IllegalReferenceException e) {\r\n throw new CockpitConfigurationException(\r\n \"IllegalReferenceException occurs while creating ObjectFactory instance using namespace \"\r\n + objectFactoryNamespace, e);\r\n } catch (SpecificationConfigurationException e) {\r\n throw new CockpitConfigurationException(\r\n \"SpecificationConfigurationException occurs while creating ObjectFactory instance using namespace \"\r\n + objectFactoryNamespace, e);\r\n }\r\n }", "Type createType();", "Type createType();", "Type createType();", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "ObjectFactoryGenerator objectFactoryGenerator();", "DataType createDataType();", "DatatypesType createDatatypesType();", "private TypePackage createPackageFrom(PackageDescription description) {\n return TypePackageImpl.create(description);\n }", "public static Factory factory() {\n return ext_dbf::new;\n }", "public static JavafxTypesFactory init() {\n\t\ttry {\n\t\t\tJavafxTypesFactory theJavafxTypesFactory = (JavafxTypesFactory)EPackage.Registry.INSTANCE.getEFactory(JavafxTypesPackage.eNS_URI);\n\t\t\tif (theJavafxTypesFactory != null) {\n\t\t\t\treturn theJavafxTypesFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new JavafxTypesFactoryImpl();\n\t}", "public ObjectifyFactory factory() {\n return ofy().factory();\n }", "public ObjectFactory() {\n super(grammarInfo);\n }", "public static <T> RuntimeSchema<T> createFrom(Class<T> typeClass, \r\n Map<String,String> declaredFields)\r\n {\r\n if(typeClass.isInterface() || Modifier.isAbstract(typeClass.getModifiers()))\r\n {\r\n throw new RuntimeException(\"The root object can neither be an abstract \" +\r\n \t\t\"class nor interface: \\\"\" + typeClass.getName());\r\n }\r\n \r\n ArrayList<Field<T>> fields = new ArrayList<Field<T>>(declaredFields.size());\r\n int i = 0;\r\n for(Map.Entry<String, String> entry : declaredFields.entrySet())\r\n {\r\n java.lang.reflect.Field f;\r\n try\r\n {\r\n f = typeClass.getDeclaredField(entry.getKey());\r\n }\r\n catch (Exception e)\r\n {\r\n throw new IllegalArgumentException(\"Exception on field: \" + entry.getKey(), e);\r\n }\r\n \r\n int mod = f.getModifiers();\r\n if(!Modifier.isStatic(mod) && !Modifier.isTransient(mod))\r\n {\r\n RuntimeFieldFactory<?> rff = RuntimeFieldFactory.getFieldFactory(f.getType());\r\n if(rff!=null)\r\n {\r\n Field<T> field = rff.create(i+1, entry.getValue(), f);\r\n if(field!=null)\r\n {\r\n i++;\r\n fields.add(field);\r\n }\r\n }\r\n }\r\n }\r\n if(fields.isEmpty())\r\n {\r\n throw new RuntimeException(\"Not able to map any fields from \" + \r\n typeClass + \". All fields are either transient/static. \" +\r\n \"Two dimensional array fields are excluded. \" +\r\n \"Collection/Map fields whose generic type is another \" +\r\n \"Collection/Map or another generic type, are excluded.\");\r\n }\r\n return new RuntimeSchema<T>(typeClass, fields, i);\r\n }", "XUMLRTFactory getXUMLRTFactory();", "public interface IoT_metamodelFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tIoT_metamodelFactory eINSTANCE = ioT_metamodel.impl.IoT_metamodelFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Thing</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Thing</em>'.\n\t * @generated\n\t */\n\tThing createThing();\n\n\t/**\n\t * Returns a new object of class '<em>Virtual Thing</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Virtual Thing</em>'.\n\t * @generated\n\t */\n\tVirtualThing createVirtualThing();\n\n\t/**\n\t * Returns a new object of class '<em>Physical Thing</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Physical Thing</em>'.\n\t * @generated\n\t */\n\tPhysicalThing createPhysicalThing();\n\n\t/**\n\t * Returns a new object of class '<em>Fog</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Fog</em>'.\n\t * @generated\n\t */\n\tFog createFog();\n\n\t/**\n\t * Returns a new object of class '<em>Fog Node</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Fog Node</em>'.\n\t * @generated\n\t */\n\tFogNode createFogNode();\n\n\t/**\n\t * Returns a new object of class '<em>Device</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Device</em>'.\n\t * @generated\n\t */\n\tDevice createDevice();\n\n\t/**\n\t * Returns a new object of class '<em>Actuator</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Actuator</em>'.\n\t * @generated\n\t */\n\tActuator createActuator();\n\n\t/**\n\t * Returns a new object of class '<em>Tag</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Tag</em>'.\n\t * @generated\n\t */\n\tTag createTag();\n\n\t/**\n\t * Returns a new object of class '<em>Rule</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Rule</em>'.\n\t * @generated\n\t */\n\tRule createRule();\n\n\t/**\n\t * Returns a new object of class '<em>External Sensor</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>External Sensor</em>'.\n\t * @generated\n\t */\n\tExternalSensor createExternalSensor();\n\n\t/**\n\t * Returns a new object of class '<em>Device Actuator</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Device Actuator</em>'.\n\t * @generated\n\t */\n\tDeviceActuator createDeviceActuator();\n\n\t/**\n\t * Returns a new object of class '<em>External Actuator</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>External Actuator</em>'.\n\t * @generated\n\t */\n\tExternalActuator createExternalActuator();\n\n\t/**\n\t * Returns a new object of class '<em>Action</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Action</em>'.\n\t * @generated\n\t */\n\tAction createAction();\n\n\t/**\n\t * Returns a new object of class '<em>Device State</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Device State</em>'.\n\t * @generated\n\t */\n\tDeviceState createDeviceState();\n\n\t/**\n\t * Returns a new object of class '<em>Composite State</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Composite State</em>'.\n\t * @generated\n\t */\n\tCompositeState createCompositeState();\n\n\t/**\n\t * Returns a new object of class '<em>Transition</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Transition</em>'.\n\t * @generated\n\t */\n\tTransition createTransition();\n\n\t/**\n\t * Returns a new object of class '<em>Digital Artifact</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Digital Artifact</em>'.\n\t * @generated\n\t */\n\tDigital_Artifact createDigital_Artifact();\n\n\t/**\n\t * Returns a new object of class '<em>Active Digital Artifact</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Active Digital Artifact</em>'.\n\t * @generated\n\t */\n\tActive_Digital_Artifact createActive_Digital_Artifact();\n\n\t/**\n\t * Returns a new object of class '<em>Passive Digital Artifact</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Passive Digital Artifact</em>'.\n\t * @generated\n\t */\n\tPassive_Digital_Artifact createPassive_Digital_Artifact();\n\n\t/**\n\t * Returns a new object of class '<em>User</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>User</em>'.\n\t * @generated\n\t */\n\tUser createUser();\n\n\t/**\n\t * Returns a new object of class '<em>Human User</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Human User</em>'.\n\t * @generated\n\t */\n\tHuman_User createHuman_User();\n\n\t/**\n\t * Returns a new object of class '<em>Communicator</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Communicator</em>'.\n\t * @generated\n\t */\n\tCommunicator createCommunicator();\n\n\t/**\n\t * Returns a new object of class '<em>Port</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Port</em>'.\n\t * @generated\n\t */\n\tPort createPort();\n\n\t/**\n\t * Returns a new object of class '<em>Information Resource</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Information Resource</em>'.\n\t * @generated\n\t */\n\tInformationResource createInformationResource();\n\n\t/**\n\t * Returns a new object of class '<em>On Device Resource</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>On Device Resource</em>'.\n\t * @generated\n\t */\n\tOn_Device_Resource createOn_Device_Resource();\n\n\t/**\n\t * Returns a new object of class '<em>Network Resource</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Network Resource</em>'.\n\t * @generated\n\t */\n\tNetwork_Resource createNetwork_Resource();\n\n\t/**\n\t * Returns a new object of class '<em>Device Resource</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Device Resource</em>'.\n\t * @generated\n\t */\n\tDevice_Resource createDevice_Resource();\n\n\t/**\n\t * Returns a new object of class '<em>Service Resource</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Service Resource</em>'.\n\t * @generated\n\t */\n\tService_Resource createService_Resource();\n\n\t/**\n\t * Returns a new object of class '<em>Property</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Property</em>'.\n\t * @generated\n\t */\n\tProperty createProperty();\n\n\t/**\n\t * Returns a new object of class '<em>VM</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>VM</em>'.\n\t * @generated\n\t */\n\tVM createVM();\n\n\t/**\n\t * Returns a new object of class '<em>Container</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Container</em>'.\n\t * @generated\n\t */\n\tContainer createContainer();\n\n\t/**\n\t * Returns a new object of class '<em>Analytics Engine</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Analytics Engine</em>'.\n\t * @generated\n\t */\n\tAnalytics_Engine createAnalytics_Engine();\n\n\t/**\n\t * Returns a new object of class '<em>Cloud</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Cloud</em>'.\n\t * @generated\n\t */\n\tCloud createCloud();\n\n\t/**\n\t * Returns a new object of class '<em>Database</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Database</em>'.\n\t * @generated\n\t */\n\tDatabase createDatabase();\n\n\t/**\n\t * Returns a new object of class '<em>Policy Repository</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Policy Repository</em>'.\n\t * @generated\n\t */\n\tPolicy_Repository createPolicy_Repository();\n\n\t/**\n\t * Returns a new object of class '<em>Reference Monitor</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Reference Monitor</em>'.\n\t * @generated\n\t */\n\tReference_Monitor createReference_Monitor();\n\n\t/**\n\t * Returns a new object of class '<em>Authorizor</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Authorizor</em>'.\n\t * @generated\n\t */\n\tAuthorizor createAuthorizor();\n\n\t/**\n\t * Returns a new object of class '<em>Information</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Information</em>'.\n\t * @generated\n\t */\n\tInformation createInformation();\n\n\t/**\n\t * Returns a new object of class '<em>Data Streams</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Data Streams</em>'.\n\t * @generated\n\t */\n\tDataStreams createDataStreams();\n\n\t/**\n\t * Returns a new object of class '<em>Atomic Data</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Atomic Data</em>'.\n\t * @generated\n\t */\n\tAtomicData createAtomicData();\n\n\t/**\n\t * Returns a new object of class '<em>Data Stream Attributes</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Data Stream Attributes</em>'.\n\t * @generated\n\t */\n\tDataStreamAttributes createDataStreamAttributes();\n\n\t/**\n\t * Returns a new object of class '<em>Atomic Data Attributes</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Atomic Data Attributes</em>'.\n\t * @generated\n\t */\n\tAtomicDataAttributes createAtomicDataAttributes();\n\n\t/**\n\t * Returns a new object of class '<em>Fog Services</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Fog Services</em>'.\n\t * @generated\n\t */\n\tFog_Services createFog_Services();\n\n\t/**\n\t * Returns a new object of class '<em>Operations</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Operations</em>'.\n\t * @generated\n\t */\n\tOperations createOperations();\n\n\t/**\n\t * Returns a new object of class '<em>Java Evaluator</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Java Evaluator</em>'.\n\t * @generated\n\t */\n\tJavaEvaluator createJavaEvaluator();\n\n\t/**\n\t * Returns a new object of class '<em>Entity</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Entity</em>'.\n\t * @generated\n\t */\n\tEntity createEntity();\n\n\t/**\n\t * Returns a new object of class '<em>Script Evaluator</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Script Evaluator</em>'.\n\t * @generated\n\t */\n\tScriptEvaluator createScriptEvaluator();\n\n\t/**\n\t * Returns a new object of class '<em>Device Sensor</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Device Sensor</em>'.\n\t * @generated\n\t */\n\tDeviceSensor createDeviceSensor();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tIoT_metamodelPackage getIoT_metamodelPackage();\n\n}", "TypeDef createTypeDef();", "@Override\n protected ObjectFactory initObjectFactory() {\n try {\n BeanManager bm = (BeanManager) new InitialContext().lookup(\"java:comp/BeanManager\");\n Set<Bean<?>> beans = bm.getBeans(CdiObjectFactory.class);\n Bean<CdiObjectFactory> beanType = (Bean<CdiObjectFactory>) beans.iterator().next();\n CreationalContext<CdiObjectFactory> ctx = bm.createCreationalContext(beanType);\n CdiObjectFactory objFactory = (CdiObjectFactory) bm.getReference(beanType, CdiObjectFactory.class, ctx);\n objFactory.init(this);\n return objFactory;\n } catch (Exception ex) {\n throw new RuntimeException(ex);\n }\n }", "public TypesAdapterFactory() {\n\t\tif (modelPackage == null) {\n\t\t\tmodelPackage = TypesPackage.eINSTANCE;\n\t\t}\n\t}", "public static Factory factory() {\n return ext_accdt::new;\n }", "public interface TypeFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tTypeFactory eINSTANCE = type.impl.TypeFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Repository</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Repository</em>'.\n\t * @generated\n\t */\n\tTypeRepository createTypeRepository();\n\n\t/**\n\t * Returns a new object of class '<em>Int Value</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Int Value</em>'.\n\t * @generated\n\t */\n\tIntValue createIntValue();\n\n\t/**\n\t * Returns a new object of class '<em>String Value</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>String Value</em>'.\n\t * @generated\n\t */\n\tStringValue createStringValue();\n\n\t/**\n\t * Returns a new object of class '<em>Boolean Value</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Boolean Value</em>'.\n\t * @generated\n\t */\n\tBooleanValue createBooleanValue();\n\n\t/**\n\t * Returns a new object of class '<em>Float Value</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Float Value</em>'.\n\t * @generated\n\t */\n\tFloatValue createFloatValue();\n\n\t/**\n\t * Returns a new object of class '<em>Enum List Value</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Enum List Value</em>'.\n\t * @generated\n\t */\n\tEnumListValue createEnumListValue();\n\n\t/**\n\t * Returns a new object of class '<em>Enum Value</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Enum Value</em>'.\n\t * @generated\n\t */\n\tEnumValue createEnumValue();\n\n\t/**\n\t * Returns a new object of class '<em>Range Value</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Range Value</em>'.\n\t * @generated\n\t */\n\tRangeValue createRangeValue();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tTypePackage getTypePackage();\n\n}", "public com.vodafone.global.er.decoupling.binding.request.DrmObjectType createDrmObjectType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.DrmObjectTypeImpl();\n }", "public ObjectFactory() {\n\t}", "static SchemaBuilder newInstance() {\n return new SchemaBuilderImpl();\n }", "DatatypeType createDatatypeType();", "public ObjectFactory() {\r\n\t}", "private ObjectFactory() { }", "Factory<? extends T> buildPersonFactory(String type);", "private static VerifierFactory createFactory( final String schemaType )\n throws VerifierConfigurationException\n {\n if( null == schemaType )\n {\n try\n {\n if( null == c_msvClass )\n {\n c_msvClass =\n Class.forName( \"com.sun.msv.verifier.jarv.TheFactoryImpl\" );\n }\n return (VerifierFactory)c_msvClass.newInstance();\n }\n catch( final Exception e )\n {\n final String message =\n \"Unable to load MSV factory and thus can \" +\n \"not auto-discover schema type.\";\n throw new VerifierConfigurationException( message, e );\n }\n }\n else\n {\n return VerifierFactory.newInstance( schemaType );\n }\n }", "Schema createSchema();", "static public ContentHandleFactory newFactory(JAXBContext context, Class<?>... pojoClasses) {\n if (context == null || pojoClasses == null || pojoClasses.length == 0)\n return null;\n return new JAXBHandleFactory(context, pojoClasses);\n }" ]
[ "0.6857429", "0.6674344", "0.65048665", "0.62852556", "0.6214055", "0.61864936", "0.6169888", "0.61467093", "0.6138808", "0.6122363", "0.6109448", "0.60802007", "0.6059718", "0.6059718", "0.6059718", "0.6045585", "0.6045585", "0.6045585", "0.6043686", "0.5972331", "0.5942515", "0.5930578", "0.5919767", "0.5911795", "0.58943963", "0.587908", "0.5877846", "0.58681613", "0.58525276", "0.58432484", "0.5831922", "0.5831288", "0.58286756", "0.58243597", "0.5816264", "0.579966", "0.5786457", "0.57848793", "0.5784411", "0.5784077", "0.57730246", "0.5758334", "0.575745", "0.5749863" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) throws IOException { WebDriverManager.firefoxdriver().setup(); WebDriver driver = new FirefoxDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("https://demo.nopcommerce.com/"); driver.manage().window().maximize(); driver.manage().deleteAllCookies(); //Full page screenshot // TakesScreenshot tScreenshot=(TakesScreenshot) driver; // File src = tScreenshot.getScreenshotAs(OutputType.FILE); // File target = new File(".\\screenshots\\homepage.png"); // FileUtils.copyFile(src, target); //Screenshot of a particular section // WebElement section = driver.findElement(By.xpath("//div[@class='category-grid home-page-category-grid']")); // File src = section.getScreenshotAs(OutputType.FILE); // File target = new File(".\\screenshots\\featurepdoducts.png"); // FileUtils.copyFile(src, target); //Screenshot for a specific element WebElement section = driver.findElement(By.xpath("//img[@alt='nopCommerce demo store']")); File src = section.getScreenshotAs(OutputType.FILE); File target = new File(".\\screenshots\\logo.jpg"); FileUtils.copyFile(src, target); driver.quit(); }
{ "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
Called when the activity is first created.
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent serviceIntent = new Intent(); serviceIntent.setAction("org.urish.soundtracker.doggie.DoggieService"); startService(serviceIntent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "protected void onCreate() {\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle arg0) {\n\t\tsuper.onActivityCreated(arg0);\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tinitData(savedInstanceState);\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tsetview();\r\n\t}", "@Override\n public void onCreate()\n {\n\n super.onCreate();\n }", "@Override\n public void onCreate() {\n initData();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onActivityCreated---------\");\n\t\tinitData(savedInstanceState);\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(Activity activity, Bundle savedInstanceState)\n\t{\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t}", "protected void onFirstTimeLaunched() {\n }", "@Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n initData(savedInstanceState);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {\n }", "@Override\n public void onCreate() {\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tsetupTextviews();\n\t\tsetupHorizontalScrollViews();\n\t\tsetupHorizontalSelectors();\n\t\tsetupButtons();\n\t}", "@Override\n public void onCreate() {\n\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitViewPager();\r\n\t\t\r\n\t\tinitView();\r\n\r\n\t\tinitCursor();\r\n\t\t\r\n\t\tinithuanxin(savedInstanceState);\r\n\t\r\n \r\n\t}", "public void onCreate() {\n }", "@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"onCreate\");\n\t\tsuper.onCreate();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n init();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsetContentView(R.layout.caifushi_record);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitview();\n\t\tMyApplication.getInstance().addActivity(this);\n\t\t\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_recent_activity);\n\t\tsetTitleFromActivityLabel(R.id.title_text);\n\t\tsetupStartUp();\n\t}", "@Override\n\tpublic void onCreate() {\n\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tgetLocation();\n\n\t\tregisterReceiver();\n\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle savedInstanceState) {\n eventManager.fire(Event.ACTIVITY_ON_CREATE, activity);\n }", "@Override\n public void onCreate()\n {\n\n\n }", "@Override\n\tprotected void onCreate() {\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tAnnotationProcessor.processActivity(this);\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n if (!KramPreferences.hasStartedAppBefore(this)) {\n // First time app is started\n requestFirstHug();\n HugRequestService.scheduleHugRequests(this);\n KramPreferences.putHasStartedAppBefore(this);\n }\n\n setContentView(R.layout.activity_main);\n initMonthView(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.act_myinfo);\n\t\tinitView();\n\t\tinitEvents();\n\n\t}", "public void onCreate();", "public void onCreate();", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.auth_activity);\n connectVariablesToViews();\n listenToFields();\n WorkSpace.authorizationCompleted = false;\n }", "@Override\n public void onCreate() {\n Log.d(TAG, TAG + \" onCreate\");\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) \r\n\t{\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\t\r\n\t\t// Get a reference to the tranistbuddy model.\r\n\t\tTransitBuddyApp app = (TransitBuddyApp)this.getApplicationContext();\r\n\t\tmModel = app.getTransitBuddyModel();\r\n\t\tmSettings = app.getTransitBuddySettings();\r\n\t\t\r\n\t\tsetTitle( getString(R.string.title_prefix) + \" \" + mSettings.getSelectedCity());\r\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tinit();\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n // Prepare the loader. Either re-connect with an existing one,\n // or start a new one.\n\t\tgetLoaderManager().initLoader(FORECAST_LOADER_ID, null, this);\n\t\tsuper.onActivityCreated(savedInstanceState); // From instructor correction\n\t}", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\tgetWindowManager().getDefaultDisplay().getMetrics(dm);\n\n\t\tintScreenX = dm.widthPixels;\n\t\tintScreenY = dm.heightPixels;\n\t\tscreenRect = new Rect(0, 0, intScreenX, intScreenY);\n\n\t\thideTheWindowTitle();\n\n\t\tSampleView view = new SampleView(this);\n\t\tsetContentView(view);\n\n\t\tsetupRecord();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tif (BuildConfig.DEBUG) {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();\n\t\t} else {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();\n\t\t}\n\t\tBaseApplication.totalList.add(this);\n\t}", "@Override\n public void onActivityPreCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {/**/}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n setupAddPotLaunch();\n setupListView();\n setupPotClick();\n }", "public void onStart() {\n super.onStart();\n ApplicationStateMonitor.getInstance().activityStarted();\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n }", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initArguments();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\t\t\n\t\tappManager = AppManager.getAppManager();\n\t\tappManager.addActivity(this);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\n\t\tmContext = (LFActivity) getActivity();\n\t\tinit();\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceBundle)\n\t{\n\t\tsuper.onCreate(savedInstanceBundle);\n\t\tView initView = initView();\n\t\tsetBaseView(initView);\n\t\tinitValues();\n\t\tinitListeners();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.listexcursionscreen);\n\n ActionsDelegator.getInstance().synchronizeActionsWithServer(this);\n runId = PropertiesAdapter.getInstance(this).getCurrentRunId();\n\n RunDelegator.getInstance().loadRun(this, runId);\n ResponseDelegator.getInstance().synchronizeResponsesWithServer(this, runId);\n\n }", "@Override\n\tprotected void onCreate() {\n\t\tSystem.out.println(\"onCreate\");\n\t}", "@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tAppManager.getInstance().addActivity(this);\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n\tpublic void onCreate() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onCreate();\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.add_daily_task);\n init_database();\n init_view();\n init_click();\n init_data();\n init_picker();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t\n\t\tactivity = (MainActivity)getActivity(); \n\t\t\n\t\tactivity.setContListener(this);\n\t\t\n\t\tif(MODE == Const.MODE_DEFAULT){\n\t\t\tinitializeInfoForm();\n\t\t}else{\n\t\t\tinitializeAddEditForm();\t\t\t\n\t\t}\n\t\t\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tinitView();\n\n\t\tinitData();\n\n\t\tinitEvent();\n\n\t\tinitAnimation();\n\n\t\tshowUp();\n\t}", "@Override\n public void onCreate() {\n Thread.setDefaultUncaughtExceptionHandler(new TryMe());\n\n super.onCreate();\n\n // Write the content of the current application\n context = getApplicationContext();\n display = context.getResources().getDisplayMetrics();\n\n\n // Initializing DB\n App.databaseManager.initial(App.context);\n\n // Initialize user secret\n App.accountModule.initial();\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n }" ]
[ "0.791686", "0.77270156", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7637394", "0.7637394", "0.7629958", "0.76189965", "0.76189965", "0.7543775", "0.7540053", "0.7540053", "0.7539505", "0.75269467", "0.75147736", "0.7509639", "0.7500879", "0.74805456", "0.7475343", "0.7469598", "0.7469598", "0.7455178", "0.743656", "0.74256307", "0.7422192", "0.73934627", "0.7370002", "0.73569906", "0.73569906", "0.7353011", "0.7347353", "0.7347353", "0.7333878", "0.7311508", "0.72663945", "0.72612154", "0.7252271", "0.72419256", "0.72131634", "0.71865886", "0.718271", "0.71728176", "0.7168954", "0.7166841", "0.71481615", "0.7141478", "0.7132933", "0.71174103", "0.7097966", "0.70979583", "0.7093163", "0.7093163", "0.7085773", "0.7075851", "0.7073558", "0.70698684", "0.7049258", "0.704046", "0.70370424", "0.7013127", "0.7005552", "0.7004414", "0.7004136", "0.69996923", "0.6995201", "0.69904065", "0.6988358", "0.69834954", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69783133", "0.6977392", "0.69668365", "0.69660246", "0.69651115", "0.6962911", "0.696241", "0.6961096", "0.69608897", "0.6947069", "0.6940148", "0.69358927", "0.6933102", "0.6927288", "0.69265485", "0.69247025" ]
0.0
-1
Add attribute values in the order of attributes as specified by the dataset
public void addAttribute(String i) { if (attributes == null) attributes = new ArrayList<String>(); attributes.add(i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addAttrAnnotation(List<Iattribute> attributes, String packageName, String className) {\n\n FileSavedAnnotAttr annotAttr;\n\n for (Iattribute itemAttr: attributes) {\n\n for (Iannotation itemAnnot: itemAttr.getAttrAnnotations()) {\n\n if (itemAnnot.isChangen()) {\n\n if (itemAnnot.isParam()) {\n\n annotAttr = new FileSavedAnnotAttr(packageName, className, itemAnnot.getName(), itemAnnot.getValue(), itemAttr.getName(), itemAttr.getType());\n }else {\n\n annotAttr = new FileSavedAnnotAttr(packageName, className, itemAnnot.getName(), null, itemAttr.getName(), itemAttr.getType());\n }\n\n saveAnnotaion.add(annotAttr);\n }\n }\n }\n }", "protected void addTrainData( int i, int val )\n\t{\n\t\tthis.attribute_list.get( i ).add_data( val );\n\t}", "public void addAttribute(int index, TLAttribute attribute);", "public void addAttributesValue() {\r\n\t\t boolean flag=true;\r\n\t\t wsrdModel.setErrorMsg(\"\");\r\n\t\t List<UiAirplaneModel> modelList = new ArrayList<UiAirplaneModel>(uiAirplaneModel.getApNamesList());\t\r\n\t\t\tfor(UiAirplaneModel save:modelList) {\r\n\t\t\t\tif(save.isInputDisplayItem()) {\r\n\t\t\t\t\tflag = false;\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(flag) {\r\n\t\t\t\tmodelList.add(emptyAttributesValue());\r\n\t\t\t\tuiAirplaneModel.setApNamesList(modelList);\r\n\t\t\t}else {\r\n\t\t\t\taddErrorMessage(\"wsrdAdmin:addAirplaneNamesPanelID\", \"edit.edit\");\r\n\t\t\t}\r\n\t\t}", "void addAttribute(String attrName, Attribute<?> newAttr);", "public void visitAttribute(final Attribute attr)\n\t{\n\t\tif (attrs == null)\n\t\t{\n\t\t\tattrs = new ArrayList(1);\n\t\t}\n\t\tattrs.add(attr);\n\t}", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "public void addTo(Point p){\n Point point = new Point(this.nbAttributes);\n float accu = 0;\n for (int i = 0; i < this.attributes.length; i++){\n accu = this.attributes[i] + p.attributes[i];\n this.attributes[i] = Math.round(accu) ;\n// System.out.print(accu + \" \");\n }\n }", "public void sortAttributes(Comparator<TLAttribute> comparator);", "public Uid addAttributeValues(Uid uid, Set<Attribute> attrs,\n\t\t\tString targetObjCls, ObjectClass objClass) {\n\t\tLOG.info(\"BEGIN\");\n\t\tfinal String sMethodName=\"addAttributeValues\";\n\t\tString retUid = null;\n\t\tModifyRequest modifyRequest = new ModifyRequest();\n\t\t// Logs SPML request if user requires to print request in LOG\n\t\tModifyRequest logModifyReq = new ModifyRequest();\n\t\tList<Object> lstAddRecords = new ArrayList();\n\t\tString attrName = null;\n\t\tSAPUMEUtil objUMEUtil = new SAPUMEUtil(connection, configuration);\n\t\ttry {\n\t\t\t// Start:Unique ID Issue in AC - BUG 17910026\n\t\t\t// String sUid = setUniqueIdentifier(uid.getUidValue(), attrs);\n\t\t\t// Set<Attribute> valuesToAdd =\n\t\t\t// removeCurrentAttrFromSet(attrs,objClass);\n\t\t\tString sUid = null;\n\t\t\tSet<Attribute> valuesToAdd;\n\t\t\tif (AttributeUtil.getCurrentAttributes(attrs) != null) {\n\t\t\t\tsUid = setUniqueIdentifier(uid.getUidValue(), attrs);\n\t\t\t\tmodifyRequest.setIdentifier(sUid);\n\t\t\t\tvaluesToAdd = removeCurrentAttrFromSet(attrs, objClass);\n\t\t\t} else {\n\t\t\t\tsUid = uid.getUidValue();\n\t\t\t\tmodifyRequest.setIdentifier(sUid);\n\t\t\t\tvaluesToAdd = attrs;\n\t\t\t}\n\t\t\t// END - BUG 17910026\n\t\t\tIterator<Attribute> attrsIter = valuesToAdd.iterator();\n\t\t\t// modifyRequest.setIdentifier(sUid);\n\n\t\t\t// Logs SPML request if user requires to print request in LOG\n\t\t\tif (configuration.getLogSPMLRequest())\n\t\t\t\tlogModifyReq.setIdentifier(sUid); // BUG 17910026\n\n\t\t\t// In case of OIM update is called for each attribute modification\n\t\t\t// individually but in case of OWS\n\t\t\t// all the modified attributes are sent in single set\n\t\t\twhile (attrsIter.hasNext()) {\n\t\t\t\tAttribute attr = attrsIter.next();\n\n\t\t\t\t// Converts OW/OIM attributes name to SAP UME target system\n\t\t\t\t// attributes which is understandable by the target\n\t\t\t\tattrName = SAPUMEUtil.mapConnAttrToTargetAttr(targetObjCls,\n\t\t\t\t\t\tattr.getName().toString());\n\n\t\t\t\t// Modification for multi value attribute such as\n\t\t\t\t// assignroles, assigngroups or members\n\t\t\t\tif (attrName.equalsIgnoreCase(ASSIGNED_ROLES)\n\t\t\t\t\t\t|| attrName.equalsIgnoreCase(ASSIGNED_GROUPS)\n\t\t\t\t\t\t|| attrName.equalsIgnoreCase(MEMBER)) {\n\t\t\t\t\t// Newlst :List of newly added ROLES or GROUPS\n\t\t\t\t\tlstAddRecords = attr.getValue();\n\t\t\t\t\tif (lstAddRecords != null && lstAddRecords.size() > 0) {\n\t\t\t\t\t\tfor (Object addRecord : lstAddRecords) {\n\t\t\t\t\t\t\tModification mod = new Modification(attrName,\n\t\t\t\t\t\t\t\t\taddRecord);\n\t\t\t\t\t\t\tmod.setOperation(ADD);\n\t\t\t\t\t\t\tmodifyRequest.addModification(mod);\n\n\t\t\t\t\t\t\t// Logs SPML request if user requires to print\n\t\t\t\t\t\t\t// request in LOG\n\t\t\t\t\t\t\tif (configuration.getLogSPMLRequest())\n\t\t\t\t\t\t\t\tlogModifyReq.addModification(mod);\n\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\t// If modifyRequest attribute is null or size is equal to zero then\n\t\t\t// throws connector expections\n\t\t\tif (modifyRequest.getModifications() == null\n\t\t\t\t\t|| modifyRequest.getModifications().size() == 0) {\n\t\t\t\tLOG.info(configuration\n\t\t\t\t\t\t.getMessage(\"SAPUME_ERR_MODIFY_REQUEST_ATTR\"),\n\t\t\t\t\t\tlogModifyReq.toXml());\n\t\t\t\tLOG.error(configuration\n\t\t\t\t\t\t.getMessage(\"SAPUME_ERR_MODIFY_REQUEST_ATTR\"),logModifyReq.toXml());\n\t\t\t\tthrow new ConnectorException(configuration\n\t\t\t\t\t\t.getMessage(\"SAPUME_ERR_MODIFY_REQUEST_ATTR\"));\n\t\t\t}\n\t\t\t// Logs SPML request if user requires to print request in LOG\n\t\t\tif (configuration.getLogSPMLRequest())\n\t\t\t\tLOG.info(configuration.getMessage(\"SAPUME_INFO_SPML_REQUEST\"),\n\t\t\t\t\t\tlogModifyReq.toXml());\n\t\t\tLOG.error(\"Perf: \"+sMethodName+\" Updating {1} started for user {0} \", util.getLogonnameFromUID(sUid), valuesToAdd);\t\t\n\t\t\tSpmlResponse spmlResponse = connection.getResponse(modifyRequest\n\t\t\t\t\t.toXml());\n\t\t\tLOG.error(\"Perf: \"+sMethodName+\" Updating {1} completed for user {0} \", util.getLogonnameFromUID(sUid), valuesToAdd);\t\t\n\t\t\t// getting info from spmlResponse\n\t\t\tretUid = objUMEUtil.getResponse(spmlResponse, sUid);\n\t\t} catch (Exception e) {\n\t\t\tLOG.error(e, configuration.getMessage(\"SAPUME_ERR_ADD_ATTR_VALUES\"));\n\t\t\tthrow new ConnectorException(configuration\n\t\t\t\t\t.getMessage(\"SAPUME_ERR_ADD_ATTR_VALUES\")\n\t\t\t\t\t+ \" \" + e.getMessage(), e);\n\t\t}\n\t\tLOG.info(\"END\");\n\t\treturn new Uid(retUid);\n\t}", "public static void addAttr(int attr)\n {\n attributes[attrX][attrY] = attr;\n\n if(++attrX >= 16)\n {\n attrX=0;\n if(++attrY >= 15) attrY=0;\n }\n }", "public void addAttribute(java.lang.String r1, java.lang.String r2, java.lang.String r3, java.lang.String r4, java.lang.String r5) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: org.xml.sax.ext.Attributes2Impl.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.xml.sax.ext.Attributes2Impl.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String):void\");\n }", "private void appendExtraAttributes( final Attributes attributes )\n {\n final Iterator iterator = m_extraAttributes.iterator();\n while( iterator.hasNext() )\n {\n final ExtraAttribute attribute =\n (ExtraAttribute)iterator.next();\n attributes.putValue( attribute.getName(),\n attribute.getValue() );\n }\n }", "@Test\n\tpublic void addAttributeMultiple() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\n\t\tXMLTagParser.editElement(\"Person\", \"name\", \"tony\");\n\t\tassertEquals(XMLTagParser.getTagValueFromElement(\"Person\", \"name\"), \"tony\");\n\t\t\n\t\tXMLTagParser.editElement(\"Person\", \"surname\", \"blaire\");\n\t\tassertEquals(XMLTagParser.getTagValueFromElement(\"Person\", \"surname\"), \"blaire\");\n\t}", "private ArrayList<Attribute> generateAttributes(HashMap<Integer,AttributeInfo> attributesData) throws Exception {\n ArrayList<Attribute> listToReturn = new ArrayList<>();\n for (int i=0; i<attributesData.size(); i++) {\n AttributeInfo tmpAtt = attributesData.get(i);\n Attribute att = null;\n switch(tmpAtt.getAttributeType())\n {\n case Numeric:\n att = new Attribute(Integer.toString(i),i);\n break;\n case Discrete:\n List<String> values = new ArrayList<>();\n int numOfDiscreteValues = tmpAtt.getNumOfDiscreteValues();\n for (int j=0; j<numOfDiscreteValues; j++) { values.add(Integer.toString(j)); }\n att = new Attribute(Integer.toString(i), values, i);\n break;\n case String:\n //Most classifiers can't handle Strings. Currently we don't include them in the dataset\n break;\n case Date:\n //Currently we don't include them in the dataset. We don't have a way of handling \"raw\" dates\n break;\n default:\n throw new Exception(\"unsupported column type\");\n }\n if (att != null) {\n listToReturn.add(att);\n }\n }\n\n return listToReturn;\n }", "public void addAttribute(FactAttribute param) {\r\n if (localAttribute == null) {\r\n localAttribute = new FactAttribute[]{};\r\n }\r\n\r\n\r\n //update the setting tracker\r\n localAttributeTracker = true;\r\n\r\n\r\n java.util.List list =\r\n org.apache.axis2.databinding.utils.ConverterUtil.toList(localAttribute);\r\n list.add(param);\r\n this.localAttribute =\r\n (FactAttribute[]) list.toArray(\r\n new FactAttribute[list.size()]);\r\n\r\n }", "public void addAttribute(Attribute attr) {\n attributes.add(attr);\n }", "public void sortAttributes() {\n\t\tCollections.sort(this.attributes, new FlexoModelObject.FlexoNameComparator<FlexoModelObject>());\n\t}", "public List<HashMap<Integer,AttributeInfo>> generateTrainingSetDataseAttributes(Dataset dataset, Properties properties) throws Exception {\n List<HashMap<Integer,AttributeInfo>> candidateAttributesList = new ArrayList<>();\n String[] classifiers = properties.getProperty(\"classifiersForMLAttributesGeneration\").split(\",\");\n\n //obtaining the attributes for the dataset itself is straightforward\n DatasetBasedAttributes dba = new DatasetBasedAttributes();\n for (String classifier : classifiers) {\n\n //For each dataset and classifier combination, we need to get the results on the \"original\" dataset so we can later compare\n Evaluation evaluationResults = runClassifier(classifier, dataset.generateSet(true), dataset.generateSet(false), properties);\n double originalAuc = CalculateAUC(evaluationResults, dataset);\n\n //Generate the dataset attributes\n HashMap<Integer, AttributeInfo> datasetAttributes = dba.getDatasetBasedFeatures(dataset, classifier, properties);\n\n //Add the identifier of the classifier that was used\n\n AttributeInfo classifierAttribute = new AttributeInfo(\"Classifier\", Column.columnType.Discrete, getClassifierIndex(classifier), 3);\n datasetAttributes.put(datasetAttributes.size(), classifierAttribute);\n\n\n //now we need to generate the candidate attributes and evaluate them. This requires a few preliminary steps:\n // 1) Replicate the dataset and create the discretized features and add them to the dataset\n OperatorsAssignmentsManager oam = new OperatorsAssignmentsManager(properties);\n List<Operator> unaryOperators = oam.getUnaryOperatorsList();\n //The unary operators need to be evaluated like all other operator assignments (i.e. attribtues generation)\n List<OperatorAssignment> unaryOperatorAssignments = oam.getOperatorAssignments(dataset, null, unaryOperators, Integer.parseInt(properties.getProperty(\"maxNumOfAttsInOperatorSource\")));\n Dataset replicatedDataset = generateDatasetReplicaWithDiscretizedAttributes(dataset, unaryOperatorAssignments, oam);\n\n // 2) Obtain all other operator assignments (non-unary). IMPORTANT: this is applied on the REPLICATED dataset so we can take advantage of the discretized features\n List<Operator> nonUnaryOperators = oam.getNonUnaryOperatorsList();\n List<OperatorAssignment> nonUnaryOperatorAssignments = oam.getOperatorAssignments(replicatedDataset, null, nonUnaryOperators, Integer.parseInt(properties.getProperty(\"maxNumOfAttsInOperatorSource\")));\n\n // 3) Generate the candidate attribute and generate its attributes\n nonUnaryOperatorAssignments.addAll(unaryOperatorAssignments);\n\n //oaList.parallelStream().forEach(oa -> {\n int counter = 0;\n //for (OperatorAssignment oa : nonUnaryOperatorAssignments) {\n ReentrantLock wrapperResultsLock = new ReentrantLock();\n nonUnaryOperatorAssignments.parallelStream().forEach(oa -> {\n try {\n OperatorsAssignmentsManager oam1 = new OperatorsAssignmentsManager(properties);\n Dataset datasetReplica = dataset.replicateDataset();\n ColumnInfo candidateAttribute = null;\n try {\n candidateAttribute = oam1.generateColumn(datasetReplica, oa, true);\n }\n catch (Exception ex) {\n candidateAttribute = oam1.generateColumn(datasetReplica, oa, true);\n }\n\n\n OperatorAssignmentBasedAttributes oaba = new OperatorAssignmentBasedAttributes();\n HashMap<Integer, AttributeInfo> candidateAttributes = oaba.getOperatorAssignmentBasedAttributes(dataset, oa, candidateAttribute, properties);\n\n datasetReplica.addColumn(candidateAttribute);\n Evaluation evaluationResults1 = runClassifier(classifier, datasetReplica.generateSet(true), datasetReplica.generateSet(false), properties);\n\n double auc = CalculateAUC(evaluationResults1, datasetReplica);\n double deltaAuc = auc - originalAuc;\n AttributeInfo classAttrubute;\n if (deltaAuc > 0.01) {\n classAttrubute = new AttributeInfo(\"classAttribute\", Column.columnType.Discrete, 1,2);\n System.out.println(\"found positive match\");\n } else {\n classAttrubute = new AttributeInfo(\"classAttribute\", Column.columnType.Discrete, 0,2);\n }\n\n //finally, we need to add the dataset attribtues and the class attribute\n for (AttributeInfo datasetAttInfo : datasetAttributes.values()) {\n candidateAttributes.put(candidateAttributes.size(), datasetAttInfo);\n }\n\n candidateAttributes.put(candidateAttributes.size(), classAttrubute);\n wrapperResultsLock.lock();\n candidateAttributesList.add(candidateAttributes);\n wrapperResultsLock.unlock();\n }\n catch (Exception ex) {\n System.out.println(\"Error in ML features generation : \" + oa.getName() + \" : \" + ex.getMessage());\n }\n });\n }\n\n return candidateAttributesList;\n }", "@Override\r\n\tpublic void addAttr(String name, String value) {\n\t}", "private void addAttr(String tag, String attr, int mode, String def)\n\t{\n\t\tif (!attrs.containsKey(tag))\n\t\t{\n\t\t\tattrs.put(tag, new ArrayList<String>());\n\t\t\tamodes.put(tag, new ArrayList<Integer>());\n\t\t\tdefs.put(tag, new ArrayList<String>());\n\t\t}\n\n\t\t((List<String>) attrs.get(tag)).add(attr);\n\t\t((List<Integer>) amodes.get(tag)).add(mode);\n\t\t((List<String>) defs.get(tag)).add(def);\n\t}", "public void addAttribute(TLAttribute attribute);", "Pair<String, String> getAdditionalAttribute();", "public short addAttribute(AttributeRecord attrRec) {\n attrRec.setAttributeId(nextAttributeId++);\n attributes.add(attrRec);\n Collections.sort(attributes);\n return attrRec.getAttributeId();\n }", "@Override\n\tpublic <E> void add(Attr<E> newAttr) {\n\t\t\n\t}", "public Result addAttrs(TypedEntry<?> e1, TypedEntry<?> e2, TypedEntry<?> e3) {\n return withAttrs(attrs.putAll(e1, e2, e3));\n }", "private void buildAttrsIndex() {\n\t\tsortAttrsIndex = new Vector<Integer>();\n\t\tboolean[] inAttrs = new boolean[schema.size()];\n\t\tfor(int i = 0; i < inAttrs.length; i++) {\n\t\t\tinAttrs[i] = false;\n\t\t}\n\t\tfor(String attr: sortAttrs) {\n\t\t\tsortAttrsIndex.add(schema.get(attr));\n\t\t\tinAttrs[schema.get(attr)] = true;\n\t\t}\n\t\tfor(int i = 0; i < inAttrs.length; i++) {\n\t\t\tif(!inAttrs[i]) {\n\t\t\t\tsortAttrsIndex.add(i);\n\t\t\t}\n\t\t}\n\t}", "void setAttributes(String attributeName, String attributeValue);", "@Override\n\tpublic void insertAttributeAt(final int position) {\n\n\t}", "@Override\n\tpublic void setAttributeIndices(String value) {\n\t\t\n\t}", "private void arrangeAttributes(List<IOutputAttribute> outputAttributesList,\r\n \t\tList<Object> list)\r\n {\r\n \tList<Object> oldList = new ArrayList<Object>();\r\n \toldList.addAll(list);\r\n \tfor(int counter = 0;counter < outputAttributesList.size();counter++)\r\n \t{\r\n \t\tAttributeInterface attribute = outputAttributesList.get(counter).getAttribute();\r\n \t\tString value = edu.wustl.query.util.global.Utility.getTagValue(attribute,Constants.TAGGED_VALUE_RESULTVIEW);\r\n \t\tif(attribute.getName().equals(Constants.ID)\r\n \t\t&& attribute.getEntity().getName().equals(Constants.MED_ENTITY_NAME))\r\n \t\t{\r\n \t\t\tString conceptName = \"\";\r\n \t\t\tif (oldList.get(counter) != null)\r\n \t\t\t{\r\n \t\t\t\tconceptName = MedLookUpManager.instance().\r\n \t\t\t\t\tgetConceptName( outputAttributesList.get(counter),(String)(oldList.get(counter)));\r\n \t\t\t}\r\n \t\t\toldList.set(counter,conceptName);\r\n \t\t\tvalue = edu.wustl.query.util.global.Utility.getTagValue(outputAttributesList.get(counter).getExpression().\r\n \t\t \tgetQueryEntity().getDynamicExtensionsEntity(),Constants.TAGGED_VALUE_RESULTORDER);\r\n \t\t}\r\n \t\tif(!value.equals(\"\"))\r\n \t\t{\r\n \t\t\tlist.set(Integer.valueOf(value).intValue(),oldList.get(counter));\r\n \t\t}\r\n \t}\r\n }", "public void addLookupAttributes( Entry[] attrs ) throws RemoteException {\n\t\tlog.config(\"adding attributes: \"+attrs.length );\n\t\ttry {\n\t\t\tPersistentData data = io.readState();\n\t\t\tdumpItems( \"read state\", log, data.attrs );\n\t\t\tmgr.addAttributes( attrs, true );\n\t\t\tEntry[] newa = mgr.getAttributes();\n\t\t\tdumpItems( \"after add\", log, newa );\n\t\tlog.fine(\"merging arrays\");\n\t\t\tVector v = mergeArrays( data.attrs, attrs );\n\t\t\tdata.attrs = new Entry[v.size()];\n\t\t\tv.copyInto( data.attrs );\n\t\t\tdumpItems( \"merged\", log, data.attrs );\n\t\t\tlog.fine(\"using \"+io+\" to write state(\"+data+\")\");\n\t\t\tio.writeState( data );\n\t\t} catch( ClassNotFoundException ex ) {\n\t\t\tthrow new ServerException(ex.toString());\n\t\t} catch( IOException ex ) {\n\t\t\tthrow new ServerException(ex.toString());\n\t\t}\n\t}", "private void preProcessDataModel() {\r\n collectAllAttribtueDefinitions();\r\n\r\n for (AttributeDefinition attribute : dataModel.getAttributeDefinitions()) {\r\n attribute.setAttributeType(UINameToValueMap.get(attribute.getAttributeType()));\r\n }\r\n\r\n if (null != dataModel.getLocalSecondaryIndexes()) {\r\n for (LocalSecondaryIndex index : dataModel.getLocalSecondaryIndexes()) {\r\n index.getProjection().setProjectionType(UINameToValueMap.get(index.getProjection().getProjectionType()));\r\n }\r\n }\r\n\r\n if (null != dataModel.getGlobalSecondaryIndexes()) {\r\n for (GlobalSecondaryIndex index : dataModel.getGlobalSecondaryIndexes()) {\r\n index.getProjection().setProjectionType(UINameToValueMap.get(index.getProjection().getProjectionType()));\r\n }\r\n }\r\n }", "public void setAttribute(List<Attribute> attribute) {\n\t\tthis.attribute = attribute;\n\t}", "default void putAttribute(ConceptName name, Attribute attribute) {}", "public void addAttribute(DictionarySimpleAttribute dsa) {\n\t\tif(dsa == null) {\n\t\t\tthrow new IllegalArgumentException(\"Dictionary attribute must not be null\");\n\t\t}\n\n\t\tString prevKey = this.attributes.getKey(dsa);\n\t\tDictionarySimpleAttribute prev = this.attributes.put(dsa.getXmlName(), dsa);\n\n\t\tif(prevKey != null) {\n\t\t\tlog.warn(\"Two attributes with same CBOR mapping: old:\" + prevKey + \", new:\" + dsa.getXmlName());\n\t\t}\n\t\tif(prev != null) {\n\t\t\tlog.warn(\"Previous attribute mapping overridden: \" + dsa.getXmlName() + \", Attribute:\" + prev.toString());\n\t\t}\n\t}", "public static void attributes(ArrayList<tok> pHolder, ArrayList<tok> xmlList){\r\n\t\t\r\n\t\tboolean localCompression = false; // this variable is used in \r\n\t\t\t\t\t\t\t\t\t\t\t// changing setCompress to t/f\r\n\t\t\r\n\t\tif(pHolder.get(index).getType() == Token_Type.TOK_PLUS\r\n\t\t\t\t|| pHolder.get(index).getType() == Token_Type.TOK_ID){\r\n\t\t\t\r\n\t\t\t// the compression grammar method has been changed to boolean to\r\n\t\t\t// make this work\r\n\t\t\tif(compression(pHolder, xmlList)){\r\n\t\t\t\tlocalCompression = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pHolder.get(index).getType() == Token_Type.TOK_ID){\r\n\t\t\t\t\r\n\t\t\t\t// (re)initialize the tableName so table can be set in tok\r\n\t\t\t\tString tableName = pHolder.get(index).getTerm();\r\n\t\t\t\tindex++;\r\n\t\t\t\tif(pHolder.get(index).getType() == Token_Type.TOK_PERIOD){\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\tif(pHolder.get(index).getType() == Token_Type.TOK_ID){\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Adding attribute to the xmlList (table.attr format)\r\n\t\t\t\t\t\txmlList.add(new tok(pHolder.get(index).getTerm(), null));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Setting the tableName of the attribute\r\n\t\t\t\t\t\txmlList.get(xmlIndex).setTableName(tableName);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/* Setting the tagname as whatever the \"current\" tagname\r\n\t\t\t\t\t\t * is. tagnameArray is incremented when the parser sees \r\n\t\t\t\t\t\t * a \"<\" and decremented when it sees a \">\"\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\txmlList.get(xmlIndex).setTagname(tagnameArray[tagIndex]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Checks to see if this attribute it compressed,\r\n\t\t\t\t\t\t// if it is, sets the compression to true.\r\n\t\t\t\t\t\tif(localCompression){\r\n\t\t\t\t\t\t\txmlList.get(xmlIndex).setCompress(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{noError = false;}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Adding attribute to the xmlList\r\n\t\t\t\txmlList.add(new tok(pHolder.get(index).getTerm(), null));\r\n\t\t\t\t\r\n\t\t\t\t/* Setting the tagname as whatever the \"current\" tagname\r\n\t\t\t\t * is. tagnameArray is incremented when the parser sees \r\n\t\t\t\t * a \"<\" and decremented when it sees a \">\"\r\n\t\t\t\t */\r\n\t\t\t\txmlList.get(xmlIndex).setTagname(tagnameArray[tagIndex]);\r\n\t\t\t\t\r\n\t\t\t\t// Checks to see if this attribute it compressed,\r\n\t\t\t\t// if it is, sets the compression to true.\r\n\t\t\t\tif(localCompression){ \r\n\t\t\t\t\txmlList.get(xmlIndex).setCompress(true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trename(pHolder, xmlList);\r\n\t\t\t\t// increase xmlIndex after it has checked to see if the attr\r\n\t\t\t\t// is going to have an alias.\r\n\t\t\t\txmlIndex++;\r\n\t\t\t\taddAttr(pHolder, xmlList);\r\n\t\t\t}\r\n\t\t\telse{noError = false;}\r\n\t\t}\r\n\t\telse if(pHolder.get(index).getType() == Token_Type.TOK_LTHAN){\r\n\t\t\tindex++;\r\n\t\t\t// increment tagnameArray with \"<\"\r\n\t\t\ttagIndex++;\r\n\t\t\ttagBegin(pHolder, xmlList);\r\n\t\t}\r\n\t\telse{noError = false;}\r\n\t}", "public void addAttribute(String nodeType, Attribute a)\r\n {\r\n\tfinal NodeTypeHolder nt = ntMap.get(nodeType);\r\n\tnt.getAttributes().add(a);\r\n\t\r\n\t// Synchronize all Nodes of this type to have the new field.\r\n\tfor (final Node node : nt.getNodes())\r\n\t node.addValues();\r\n }", "protected void addAttribute(AttributeField af) { \n\tthis.attributeFields.addElement(af);\n }", "ArrayList getAttributes();", "AdditionalAttributes setAttribute(String name, Object value, boolean force);", "public void addAttribute(Attribute attribute) {\n\t\tgetAttribute().add(attribute);\n\t}", "@Test\n\tpublic void testChangeMultiAttributeOrderDoesMatterLDAP96()\n\t\t\tthrows Exception {\n\t\tfinal Attributes fixtureAttrs = new BasicAttributes();\n\t\tAttribute multi = new BasicAttribute(\"title\");\n\t\tmulti.add(\"Juergen\");\n\t\tmulti.add(\"George\");\n\t\tfixtureAttrs.put(multi);\n\t\tclass TestableDirContextAdapter extends DirContextAdapter {\n\t\t\tpublic TestableDirContextAdapter() {\n\t\t\t\tsuper(fixtureAttrs, null);\n\t\t\t\tsetUpdateMode(true);\n\t\t\t}\n\t\t}\n\t\ttested = new TestableDirContextAdapter();\n\t\tassertTrue(tested.isUpdateMode());\n\t\ttested.setAttributeValues(\"title\", new String[] { \"Jim\", \"George\",\n\t\t\t\t\"Juergen\" }, true);\n\n\t\t// change\n\t\tModificationItem[] mods = tested.getModificationItems();\n\t\tassertEquals(1, mods.length);\n\t\tassertEquals(DirContext.REPLACE_ATTRIBUTE, mods[0].getModificationOp());\n\t\tAttribute attr = mods[0].getAttribute();\n\t\tassertEquals(\"Jim\", attr.get(0));\n\t\tassertEquals(\"George\", attr.get(1));\n\t\tassertEquals(\"Juergen\", attr.get(2));\n\t}", "public Attrs merge(Contest contest);", "private static void SetAttributes( DataSet ds,\n String filename,\n SNS_Tof_to_Q_map mapper )\n {\n int[] RunNums = new int[1];\n RunNums[0] = getRunNumber( filename );\n\n float L1 = mapper.getL1();\n float T0 = mapper.getT0();\n Attribute L1Attr = new FloatAttribute( Attribute.INITIAL_PATH, L1);\n Attribute T0Attr = new FloatAttribute( Attribute.T0_SHIFT, T0);\n Attribute RunsAttr = new IntListAttribute( Attribute.RUN_NUM, RunNums );\n\n float TotTotCount = 0;\n\n for( int i = 0; i < ds.getNum_entries(); i++)\n {\n Data D = ds.getData_entry(i);\n D.setAttribute( RunsAttr );\n D.setAttribute( L1Attr );\n D.setAttribute( T0Attr);\n\n float[] yvals = D.getY_values();\n float TotCount =0;\n for( int j = 0; j < yvals.length; j++ )\n TotCount +=yvals[j];\n \n TotTotCount +=TotCount;\n D.setAttribute( new FloatAttribute( Attribute.TOTAL_COUNT, TotCount));\n // TO DO: Add effective position and pixel info list\n // TO DO: Add delta 2 theta\n // TO DO: Add Total Solid Angle\n // TO DO: Add list of Bank IDs\n // TO DO: Add list of Pixel IDs\n }\n\n ds.setAttribute( new StringAttribute( Attribute.FILE_NAME, filename));\n\n String instr = FileIO.getSNSInstrumentName( filename );\n if( instr != null && instr.length()>2)\n ds.setAttribute( new StringAttribute(Attribute.INST_NAME, instr));\n\n ds.setAttribute( new StringAttribute( Attribute.FACILITY_NAME, \"SNS\"));\n\n // TO DO: add Instrument Type\n\n ds.setAttribute( \n new StringAttribute( Attribute.DS_TYPE, Attribute.SAMPLE_DATA));\n\n // TO DO: add run title\n\n ds.setAttribute( RunsAttr );\n\n AddDateTimeAttribute( ds, (new File( filename )).lastModified());\n\n ds.setAttribute( new FloatAttribute(Attribute.TOTAL_COUNT, TotTotCount ));\n // TO DO: add number of pulses\n // TO DO: add proton count \n // TO DO: add user name\n\n }", "protected void mergeAttributes( Element element, AttributeSet attr, AttributeFilter filter, SimpleFeature feature )\n \t{\n \t\tif( attr.size() > 0 )\n \t\t{\n \t\t\tfor( String key: attr.keySet() )\n \t\t\t{\n \t\t\t\tif( filter != null )\n \t\t\t\t{\n \t\t\t\t\tif( filter.isKept( key ) )\n \t\t\t\t\t\telement.setAttribute( key, attr.get( key ) );\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\telement.setAttribute( key, attr.get( key ) );\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n //\t\tif( addEdgeShapeAttribute && element instanceof Edge )\n //\t\t\taddEdgeShapeStyle( (Edge)element, feature );\n \t}", "private static Webpage processElementAttributes(Webpage webpage, Element element, String tag) {\n //Current element is already catalogued\n if (Utils.bigHashHasKey(webpage.getElementAttributes(), tag)) {\n //Get current values\n HashMap<String, Integer> elementAttributes = webpage.getSpecificElementAttributes(tag);\n //Cycle through all attributes of the currently analyzed element\n for (Attribute attribute : element.attributes()) {\n String attributeName = Utils.removeLineBreaks(attribute.getKey().toLowerCase());\n //Current attribute is already catalogued for this element, increment it\n if (Utils.hashHasKey(elementAttributes, attributeName))\n elementAttributes = Utils.hashIncreaseValue(elementAttributes, attributeName, 1);\n //Current attribute is new for this element, add it\n else\n elementAttributes.put(attributeName, 1);\n }\n //Add the new values to the web page\n webpage.setSpecificElementAttributes(elementAttributes, tag);\n }\n //Current element is not catalogued, add it\n else {\n //Create new element attributes list\n HashMap<String, Integer> newElement = new HashMap<String, Integer>();\n //Add attributes\n for (Attribute attribute : element.attributes())\n newElement.put(Utils.removeLineBreaks(attribute.getKey().toLowerCase()), 1);\n //Add the new values to the web page\n webpage.setSpecificElementAttributes(newElement, tag);\n }\n return webpage;\n }", "public int storeAttribute(String key, String value);", "public void setAttribute(FactAttribute[] param) {\r\n\r\n validateAttribute(param);\r\n\r\n localAttributeTracker = true;\r\n\r\n this.localAttribute = param;\r\n }", "void addAttribute(AttributeDefinition ad) throws ResultException, DmcValueException {\n \t\n \tattributeDefinitions.add(ad);\n \t\n if (checkAndAddDOT(ad.getDotName(),ad,globallyUniqueMAP,null) == false){\n \tResultException ex = new ResultException();\n \tex.addError(clashMsgDOT(ad.getObjectName(),ad,globallyUniqueMAP,\"definition names\"));\n \tthrow(ex);\n }\n \n if (ad.getDmdID() == null){\n \tResultException ex = new ResultException(\"Missing dmdID for attribute: \" + ad.getName());\n \tthrow(ex);\n }\n \n if (ad.getDefinedIn() == null){\n \tResultException ex = new ResultException(\"definedIn missing for attribute: \" + ad.getName());\n \tthrow(ex);\n }\n else{\n \tif (performIDChecks){\n\t \tif ( (ad.getDefinedIn().getSchemaBaseID() == null) ||\n\t \t\t (ad.getDefinedIn().getSchemaIDRange() == null) ){\n\t \tResultException ex = new ResultException(\"schemaBaseID or schemaIDRange missing for schema: \" + ad.getDefinedIn().getName());\n\t \tthrow(ex);\n\t \t}\n \t}\n \t\n }\n \n if (performIDChecks){\n\t // Bump up the DMD ID by the amount of schemaBaseID\n\t int base = ad.getDefinedIn().getSchemaBaseID();\n\t int range = ad.getDefinedIn().getSchemaIDRange();\n\t int current = ad.getDmdID();\n\t \n\t if (current >= range){\n\t \tResultException ex = new ResultException(\"Number of attributes exceeds schema ID range: \" + ad.getName());\n\t \tthrow(ex); \t\n\t }\n\t \n\t ad.setDmdID(base + current);\n }\n \n \tif (attrByID.get(ad.getDmdID()) != null){\n \tResultException ex = new ResultException();\n \tex.addError(clashingIDsMsg(ad.getDmdID(),ad,attrByID,\"dmdID\"));\n \tthrow(ex);\n }\n attrByID.put(ad.getDmdID(), ad);\n \n if (ad.getAbbrev() != null){\n // We have an abbreviation - so it must also be unique and\n // added to the appropriate maps\n \tDefinitionName abbrevName = new DefinitionName(ad.getAbbrev());\n \t\n DotName dotAbbrevName = new DotName(ad.getDefinedIn().getName() + \".\" + ad.getAbbrev());\n if (checkAndAddDOT(dotAbbrevName,ad,globallyUniqueMAP,null) == false){\n \tDefinitionName errName = new DefinitionName(ad.getDefinedIn().getName() + \".\" + ad.getAbbrev());\n \tResultException ex = new ResultException();\n \tex.addError(clashMsgDOT(errName,ad,globallyUniqueMAP,\"definition names\"));\n \tthrow(ex);\n }\n\n attrAbbrevs.put(abbrevName,ad);\n }\n \n if (extensions.size() > 0){\n \tfor(SchemaExtensionIF ext : extensions.values()){\n \t\text.addAttribute(ad);\n \t}\n }\n \n }", "public Result addAttrs(TypedEntry<?> e1) {\n return withAttrs(attrs.putAll(e1));\n }", "public static void addAttributesToNodesGenlabGraphFromIgraph(\n\t\t\tIGenlabGraph genlabGraph, \n\t\t\tIGraphGraph igraphGraph,\n\t\t\tString attributeName,\n\t\t\tdouble[] attributesValues\n\t\t\t) {\n\t\n\t\t// check data size\n\t\tif (genlabGraph.getVerticesCount() != attributesValues.length)\n\t\t\tthrow new ProgramException(\"wrong number of vertices\");\n\t\t\t\n\t\t// declare the resulting parameter\n\t\tgenlabGraph.declareVertexAttribute(attributeName, Double.class);\n\t\n\t\t// transfert data\n\t\tfor (int i=0; i<attributesValues.length; i++) {\n\t\t\tgenlabGraph.setVertexAttribute(\n\t\t\t\t\tigraphGraph.getGenlabIdForIGraphNode(i), \n\t\t\t\t\tattributeName, \n\t\t\t\t\tattributesValues[i]\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\t// done.\n\t\t\n\t}", "private void copyAttributes(APDataCollection apData, String sourcePath, String targetPath, int[] indexes) {\n\t\tAggregate registeredStateElement = new Aggregate();\n\n\t\tif (registeredStateElement.acquireFrom(apData, sourcePath, indexes)) {\n\t\t\tElement element = registeredStateElement.getElement();\n\n\t\t\tList<Attribute> attributes = element.getAttributes();\n\t\t\tfor (Attribute attribute : attributes) {\n\t\t\t\tString attributeName = attribute.getName();\n\t\t\t\tString attributeValue = attribute.getValue();\n\t\t\t\tString attributePath = concat(targetPath, \".@\", attributeName);\n\t\t\t\tapData.setFieldValue(attributePath, indexes, attributeValue);\n\t\t\t}\n\t\t}\n\t}", "private void addAttributes(final AttributeStatement attributeStatement, final SAMLAttributes samlAttributes, final String attName) {\n\t\t\n // <saml2:Attribute Name=\"urn:esgf:test:attribute_name\" NameFormat=\"http://www.w3.org/2001/XMLSchema#string\">\n // \t\t<saml2:AttributeValue xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"xs:string\">test_attribute_value</saml2:AttributeValue>\n // </saml2:Attribute>\n\t\tfor (final String attValue : samlAttributes.getAttributes().get(attName)) {\t\n\t\t\tattributeStatement.getAttributes().add( builder.getAttribute(attName, null, attValue) );\n\t\t}\n\t\t\n\t}", "public GraphAttributeMerger getAttributeMerger();", "public Result addAttrs(List<TypedEntry<?>> entries) {\n return withAttrs(attrs.putAll(entries));\n }", "private XMLDocument addAttributes(Object[] attributes) {\r\n if (attributes != null) {\r\n for (int i = 0; i < attributes.length; i += 2) {\r\n Object name = attributes[i];\r\n\r\n if (name instanceof List<?>) {\r\n List<?> attributesList = (List<?>) name;\r\n i--;\r\n\r\n addAttributes(attributesList);\r\n\r\n } else {\r\n Object value = attributes[i + 1];\r\n xml.append(\" \").append(name).append(\"=\\\"\").append(value).append(\"\\\"\");\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n }", "public void addAttribut(AttributDescribe attribut){\r\n \tattributs.add(attribut);\r\n \tfireTableRowsInserted(attributs.size() -1, attributs.size() -1);\r\n }", "public Measurement addValues(List<ProbeValue> values) {\n\tattributes.addAll(values);\n\treturn this;\n }", "public void addAttributeFor(Field field) {\r\n fieldToUseAsAttribute.add(field);\r\n }", "public final void combine ( ExtAttributes eas )\n{\n for ( ExtAttr ea = eas.m_head; ea != null; ea = ea.next )\n add( ea.clone() );\n m_flags |= eas.m_flags;\n}", "public void addAttribute(AttributeDeclInfo attr){\r\n\t\tif(attributes==null){\r\n\t\t\tattributes = new ArrayList<AttributeDeclInfo>();\r\n\t\t}\r\n\t\t\r\n\t\tattributes.add(attr);\r\n\t}", "private XMLDocument addAttributes(List<?> attributes) {\r\n if (attributes != null) {\r\n for (int i = 0; i < attributes.size(); i += 2) {\r\n Object name = attributes.get(i);\r\n\r\n if (name instanceof List<?>) {\r\n List<?> attributesList = (List<?>) name;\r\n i--;\r\n\r\n addAttributes(attributesList);\r\n\r\n } else {\r\n Object value = attributes.get(i + 1);\r\n xml.append(\" \").append(name).append(\"=\\\"\").append(value).append(\"\\\"\");\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n }", "public Result addAttrs(TypedEntry<?> e1, TypedEntry<?> e2) {\n return withAttrs(attrs.putAll(e1, e2));\n }", "protected void attributeInserted(MutationEvent evt) throws MelodyException {\r\n\t\tsuper.attributeInserted(evt);\r\n\t\t// the target element\r\n\t\tElement t = (Element) evt.getTarget();\r\n\t\tDUNID tdunid = DUNIDDocHelper.getDUNID(t);\r\n\t\t// Modify the DUNIDDoc\r\n\t\tElement tori = getOwnerDUNIDDoc(t).getElement(tdunid);\r\n\t\ttori.setAttribute(evt.getAttrName(), evt.getNewValue());\r\n\t\t// Modify the targets descriptor\r\n\t\tif (!areTargetsFiltersDefined()) {\r\n\t\t\t/*\r\n\t\t\t * If there is no targets filters defined, there's no need to modify\r\n\t\t\t * the targets descriptor.\r\n\t\t\t */\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttori = getTargetsDescriptor().getElement(tdunid);\r\n\t\tif (tori != null) { // target node is in the targets descriptor\r\n\t\t\ttori.setAttribute(evt.getAttrName(), evt.getNewValue());\r\n\t\t}\r\n\t}", "public final native void attributeFollows(String name, Element newNode, Element oldNode) /*-{ attributeFollows(name, newNode, oldNode); }-*/;", "public Result addAttrs(TypedEntry<?>... entries) {\n return withAttrs(attrs.putAll(entries));\n }", "protected final void addAttribute(final String name, final String value) {\n if(value == null) attributes.remove(name);\n else attributes.put(name, value);\n\t}", "private void addAttribute(AttributesImpl attrs, String attrName, String attrValue,\n String type) {\n // Provide identical values for the qName & localName (although Javadocs indicate that both\n // can be omitted!)\n attrs.addAttribute(\"\", attrName, attrName, type, attrValue);\n // Saxon throws an exception if either omitted:\n // \"Saxon requires an XML parser that reports the QName of each element\"\n // \"Parser configuration problem: namespsace reporting is not enabled\"\n // The IBM JRE implementation produces bad xml if the qName is omitted,\n // but handles a missing localName correctly\n }", "public abstract void setData(Map attributes, Iterator accessPoints);", "public void collectAllAttribtueDefinitions() {\r\n dataModel.getAttributeDefinitions().clear();\r\n\r\n // Primary keys\r\n dataModel.getAttributeDefinitions().add(new AttributeDefinition().withAttributeName(dataModel.getHashKeyName()).withAttributeType(dataModel.getHashKeyType()));\r\n if (dataModel.getEnableRangeKey()) {\r\n dataModel.getAttributeDefinitions().add(new AttributeDefinition().withAttributeName(dataModel.getRangeKeyName()).withAttributeType(dataModel.getRangeKeyType()));\r\n }\r\n\r\n // Index keys defined in the second page\r\n dataModel.getAttributeDefinitions().addAll(secondPage.getAllIndexKeyAttributeDefinitions());\r\n }", "@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type, byte flags) {\n }", "public void addAttributeDef(int index,AttributeDef attributeDef1)\n // -end- 358A62100395 add2_head358A5F2B0354 \"IdentDef::add2AttributeDef\"\n {\n // -beg- preserve=no 358A62100395 add2_body358A5F2B0354 \"IdentDef::add2AttributeDef\"\n attributeDef.add(index,attributeDef1);\n attributeDef1._linkIdentDef(this);\n ch.ehi.uml1_4.changepropagation.MetaModel.getInstance().notifyChange(new ch.ehi.uml1_4.changepropagation.MetaModelChange(this,\"addAttributeDef\"));\n return;\n // -end- 358A62100395 add2_body358A5F2B0354 \"IdentDef::add2AttributeDef\"\n }", "public static void addAttributesToEdgesGenlabGraphFromIgraph(\n\t\t\tIGenlabGraph genlabGraph, \n\t\t\tIGraphGraph igraphGraph,\n\t\t\tString attributeName,\n\t\t\tdouble[] attributesValues\n\t\t\t) {\n\t\n\t\t// check data size\n\t\tif (genlabGraph.getEdgesCount() != attributesValues.length)\n\t\t\tthrow new ProgramException(\"wrong number of edges\");\n\t\t\t\n\t\t// declare the resulting parameter\n\t\tgenlabGraph.declareEdgeAttribute(attributeName, Double.class);\n\t\n\t\t\n\t\t// TODO is the ID of edges unique enough ???\n\t\t\n\t\t// transfert data\n\t\tint i=0;\n\t\tif (genlabGraph.isMultiGraph()) {\n\t\t\t\n\t\t\t// in the case of multi graphs, we may discover such a situtation:\n\t\t\t// 0 -- 1\n\t\t\t// 0 -- 2\t// several times !\n\t\t\t// 0 -- 2 // several times !\n\t\t\t// 0 -- 3\n\t\t\t\n\t\t\t// So to solve this case, we build a black list of edges already processed\n\t\t\tHashSet<String> alreadyProcessedEdges = new HashSet<String>();\n\t\t\t\n\t\t\tfor (IGraphEdge edge: igraphGraph) {\n\t\t\t\t\n\t\t\t\tif (i >= attributesValues.length)\n\t\t\t\t\tthrow new ProgramException(\"wrong number of attributes, they are less numerous (\"+i+\") than edges in the graph\");\n\t\t\t\t\n\t\t\t\tCollection<String> edgesId = genlabGraph.getEdgesBetween(\n\t\t\t\t\t\tigraphGraph.getGenlabIdForIGraphNode(edge.node1id),\n\t\t\t\t\t\tigraphGraph.getGenlabIdForIGraphNode(edge.node2id)\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif (edgesId == null || edgesId.isEmpty())\n\t\t\t\t\tthrow new ProgramException(\"unable to find an edge: \"+edge.node1id+\" \"+edge.node2id);\n\t\t\t\t\n\t\t\t\t// don't reuse the edges already used\n\t\t\t\tedgesId.removeAll(alreadyProcessedEdges);\t\t\t\n\t\t\t\t\n\t\t\t\tif (edgesId.isEmpty())\n\t\t\t\t\tthrow new ProgramException(\"unable to find an edge: \"+edge.node1id+\" \"+edge.node2id);\n\t\t\t\t\n\t\t\t\t// and use the first one\n\t\t\t\tString edgeId = edgesId.iterator().next();\n\t\t\t\talreadyProcessedEdges.add(edgeId);\n\t\t\t\t\n\t\t\t\tgenlabGraph.setEdgeAttribute(\n\t\t\t\t\t\tedgeId, \n\t\t\t\t\t\tattributeName, \n\t\t\t\t\t\tattributesValues[i]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\ti++;\n\t\t\t\t\n\t\t\t}\n\t\t\tif (i != attributesValues.length)\n\t\t\t\tthrow new ProgramException(\"wrong number of attributes, they are more numerous (\"+i+\") than edges in the graph\");\n\t\t\t\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t\n\t\t\tfor (IGraphEdge edge: igraphGraph) {\n\t\t\t\t\n\t\t\t\tif (i >= attributesValues.length)\n\t\t\t\t\tthrow new ProgramException(\"wrong number of attributes, they are less numerous (\"+i+\") than edges in the graph\");\n\t\t\t\t\n\t\t\t\tString edgeId = genlabGraph.getEdgeBetween(\n\t\t\t\t\t\tigraphGraph.getGenlabIdForIGraphNode(edge.node1id),\n\t\t\t\t\t\tigraphGraph.getGenlabIdForIGraphNode(edge.node2id)\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif (edgeId == null)\n\t\t\t\t\tthrow new ProgramException(\"unable to find an edge: \"+edge.node1id+\" \"+edge.node2id);\n\t\t\t\t\n\t\t\t\tgenlabGraph.setEdgeAttribute(\n\t\t\t\t\t\tedgeId, \n\t\t\t\t\t\tattributeName, \n\t\t\t\t\t\tattributesValues[i]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\ti++;\n\t\t\t\t\n\t\t\t}\n\t\t\tif (i != attributesValues.length)\n\t\t\t\tthrow new ProgramException(\"wrong number of attributes, they are more numerous (\"+i+\") than edges in the graph\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\n\t\t// done.\n\t\t\n\t}", "private void addAttribute(XmlAttribute xa, Method method, Object[] args) {\n/* 147 */ assert xa != null;\n/* */ \n/* 149 */ checkStartTag();\n/* */ \n/* 151 */ String localName = xa.value();\n/* 152 */ if (xa.value().length() == 0) {\n/* 153 */ localName = method.getName();\n/* */ }\n/* 155 */ _attribute(xa.ns(), localName, args);\n/* */ }", "List<Attribute<T, ?>> getAttributes();", "public void addAttributes(Attributes a)\r\n {\r\n\tfinal String name = a.getName();\r\n\tif (ntMap.containsKey(name))\r\n\t throw new RuntimeException(\"Graph already contains <\"+name+\">\");\r\n\tntMap.put(name, new NodeTypeHolder(a));\r\n }", "public void addAttributeValues(String serviceName, String attrName,\n Set values) throws SMSException {\n validateConfigImpl();\n if (serviceName == null || attrName == null) {\n return;\n }\n \n if (migratedTo70) {\n // Lowercase the servicename\n serviceName = serviceName.toLowerCase();\n try {\n CachedSMSEntry cEntry = CachedSMSEntry.getInstance(token,\n orgDN);\n if (cEntry.isDirty()) {\n cEntry.refresh();\n }\n SMSEntry e = cEntry.getClonedSMSEntry();\n ServiceSchemaManager ssm = new ServiceSchemaManager(\n serviceName, token);\n ServiceSchema ss = ssm.getOrganizationCreationSchema();\n if (ss == null) {\n throw (new SMSException(SMSEntry.bundle\n .getString(\"sms-SMSSchema_service_notfound\"),\n \"sms-SMSSchema_service_notfound\"));\n }\n \n Map map = new HashMap(2);\n Set newValues = new HashSet(values);\n Map allAttributes = ss.getAttributeDefaults();\n Set existingValues = (Set)allAttributes.get(attrName);\n if ((existingValues != null) && !existingValues.isEmpty()) {\n newValues.addAll(existingValues);\n }\n map.put(attrName, newValues);\n ss.validateAttributes(map);\n SMSUtils.addAttribute(e, serviceName + \"-\" + attrName,\n values, ss.getSearchableAttributeNames());\n e.save(token);\n cEntry.refresh(e);\n } catch (SSOException ssoe) {\n SMSEntry.debug.error(\"OrganizationConfigManager: Unable \"\n + \"to add Attribute Values\", ssoe);\n throw (new SMSException(SMSEntry.bundle\n .getString(\"sms-INVALID_SSO_TOKEN\"),\n \"sms-INVALID_SSO_TOKEN\"));\n }\n }\n \n // If in coexistMode and serviceName is idRepoService\n // add the attributes to AMSDK organization\n if (coexistMode\n && serviceName\n .equalsIgnoreCase(OrgConfigViaAMSDK.IDREPO_SERVICE)) {\n amsdk.addAttributeValues(attrName, values);\n }\n }", "private String getDataAttributes() {\n StringBuilder sb = new StringBuilder();\n\n dataAttribute.forEach((key, value) -> {\n sb.append(key).append(\"='\").append(value).append(\"' \");\n });\n\n return sb.toString().trim();\n }", "int insertSelective(AttributeExtend record);", "@Override\n\tpublic void setAttribute(String arg0, Object arg1, int arg2) {\n\n\t}", "@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type) {\n }", "void visit(Attribute node);", "public void attributeAdded(Component component, String attr, String newValue);", "@Override\n public void addAttribute(ConfigurationNode attr)\n {\n attributes.addNode(attr);\n attr.setAttribute(true);\n attr.setParentNode(this);\n }", "private void readAttribute(final CyAttributes attributes,\n \t\t\tfinal String targetName, final Att curAtt) {\n \n \t\t// check args\n \t\tfinal String dataType = curAtt.getType();\n \t\tif (dataType == null) {\n \t\t\treturn;\n \t\t}\n \n \t\t// null value only ok when type is list or map\n \t\tif (!dataType.equals(LIST_TYPE) && !dataType.equals(MAP_TYPE)\n \t\t\t\t&& curAtt.getValue() == null) {\n \t\t\treturn;\n \t\t}\n \n \t\t// string\n \t\tif (dataType.equals(STRING_TYPE)) {\n \t\t\tattributes.setAttribute(targetName, curAtt.getName(), curAtt\n \t\t\t\t\t.getValue());\n \t\t}\n \t\t// integer\n \t\telse if (dataType.equals(INT_TYPE)) {\n \t\t\tattributes.setAttribute(targetName, curAtt.getName(), new Integer(\n \t\t\t\t\tcurAtt.getValue()));\n \t\t}\n \t\t// float\n \t\telse if (dataType.equals(FLOAT_TYPE)) {\n \t\t\tattributes.setAttribute(targetName, curAtt.getName(), new Double(\n \t\t\t\t\tcurAtt.getValue()));\n \t\t}\n \t\t// boolean\n \t\telse if (dataType.equals(BOOLEAN_TYPE)) {\n \t\t\tattributes.setAttribute(targetName, curAtt.getName(), new Boolean(\n \t\t\t\t\tcurAtt.getValue()));\n \t\t}\n \t\t// list\n \t\telse if (dataType.equals(LIST_TYPE)) {\n \t\t\tfinal ArrayList listAttr = new ArrayList();\n \t\t\tfinal Iterator listIt = curAtt.getContent().iterator();\n \t\t\twhile (listIt.hasNext()) {\n \t\t\t\tfinal Object listItem = listIt.next();\n \t\t\t\tif (listItem != null && listItem.getClass() == AttImpl.class) {\n \t\t\t\t\tfinal Object itemClassObject = createObjectFromAttValue((AttImpl) listItem);\n \t\t\t\t\tif (itemClassObject != null)\n \t\t\t\t\t\tlistAttr.add(itemClassObject);\n \t\t\t\t}\n \t\t\t}\n \t\t\tattributes.setAttributeList(targetName, curAtt.getName(), listAttr);\n \t\t}\n \t\t// map\n \t\telse if (dataType.equals(MAP_TYPE)) {\n \t\t\tfinal HashMap mapAttr = new HashMap();\n \t\t\tfinal Iterator mapIt = curAtt.getContent().iterator();\n \t\t\twhile (mapIt.hasNext()) {\n \t\t\t\tfinal Object mapItem = mapIt.next();\n \t\t\t\tif (mapItem != null && mapItem.getClass() == AttImpl.class) {\n \t\t\t\t\tfinal Object mapClassObject = createObjectFromAttValue((AttImpl) mapItem);\n \t\t\t\t\tif (mapClassObject != null) {\n \t\t\t\t\t\tmapAttr.put(((AttImpl) mapItem).getName(),\n \t\t\t\t\t\t\t\tmapClassObject);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tattributes.setAttributeMap(targetName, curAtt.getName(), mapAttr);\n \t\t}\n \t\t// complex type\n \t\telse if (dataType.equals(COMPLEX_TYPE)) {\n \t\t\tfinal String attributeName = curAtt.getName();\n \t\t\tfinal int numKeys = Integer.valueOf((String) curAtt.getValue())\n \t\t\t\t\t.intValue();\n\t\t\tdefineComplexAttribute(attributeName, attributes, curAtt, null, 0,\n\t\t\t\t\tnumKeys);\n \t\t\tcreateComplexAttribute(attributeName, attributes, targetName,\n \t\t\t\t\tcurAtt, null, 0, numKeys);\n \t\t}\n \t}", "private FastVector getAccInstanceAttributes() {\n Attribute x_mean = new Attribute(\"x-axis mean\");\n Attribute x_var = new Attribute(\"x-axis var\");\n Attribute y_mean = new Attribute(\"y-axis mean\");\n Attribute y_var = new Attribute(\"y-axis var\");\n Attribute z_mean = new Attribute(\"z-axis mean\");\n Attribute z_var = new Attribute(\"z-axis var\");\n\n // Declare the class attribute along with its values\n FastVector fvClassVal = new FastVector(2);\n fvClassVal.addElement(\"none\");\n fvClassVal.addElement(\"tap\");\n Attribute classAttribute = new Attribute(\"theClass\", fvClassVal);\n\n // Declare the feature vector\n FastVector fvWekaAttributes = new FastVector(7);\n\n fvWekaAttributes.addElement(x_mean);\n fvWekaAttributes.addElement(x_var);\n fvWekaAttributes.addElement(y_mean);\n fvWekaAttributes.addElement(y_var);\n fvWekaAttributes.addElement(z_mean);\n fvWekaAttributes.addElement(z_var);\n fvWekaAttributes.addElement(classAttribute);\n\n// // Declare the numeric attributes\n// Attribute x_var = new Attribute(\"var_x\");\n// Attribute x_var_delta = new Attribute(\"delta_var_x\");\n// Attribute y_var = new Attribute(\"var_y\");\n// Attribute y_var_delta = new Attribute(\"delta_var_y\");\n// Attribute z_var = new Attribute(\"var_z\");\n// Attribute z_var_delta = new Attribute(\"delta_var_z\");\n//\n// // Declare the class attribute along with its values\n// FastVector fvClassVal = new FastVector(3);\n// fvClassVal.addElement(\"none\");\n// fvClassVal.addElement(\"motion\");\n// fvClassVal.addElement(\"tap\");\n// Attribute classAttribute = new Attribute(\"theClass\", fvClassVal);\n\n// // Declare the feature vector\n// FastVector fvWekaAttributes = new FastVector(7);\n//\n// fvWekaAttributes.addElement(x_var);\n// fvWekaAttributes.addElement(x_var_delta);\n// fvWekaAttributes.addElement(y_var);\n// fvWekaAttributes.addElement(y_var_delta);\n// fvWekaAttributes.addElement(z_var);\n// fvWekaAttributes.addElement(z_var_delta);\n// fvWekaAttributes.addElement(classAttribute);\n\n return fvWekaAttributes;\n }", "int insert(AttributeExtend record);", "protected abstract boolean populateAttributes();", "public void setAttributeValues(String[] attributeValues){\n m_attributeValues = attributeValues;\n }", "public void copyAttribute(String oldAttrName, String newAttrName) {\n log.debug(\"copyAttribute: \" + oldAttrName + \", \" + newAttrName);\n if (isAttributeDefined(newAttrName)) {\n deleteAttribute(newAttrName);\n }\n String typeDef = getAttrTypeDef(oldAttrName);\n defineAttribute(newAttrName, typeDef);\n NST oldAttrNST = getAttrDataNST(oldAttrName);\n NST newAttrNST = getAttrDataNST(newAttrName);\n newAttrNST.insertRowsFromNST(oldAttrNST);\n oldAttrNST.release();\n newAttrNST.release();\n }", "private static void anonymize(String patientId, AttributeList attributeList, AttributeList replacementAttributeList) {\r\n for (Attribute attribute : getAttributeListValues(attributeList).values()) {\r\n AttributeTag tag = attribute.getTag();\r\n if (attribute instanceof SequenceAttribute) {\r\n Iterator<?> si = ((SequenceAttribute)attribute).iterator();\r\n while (si.hasNext()) {\r\n SequenceItem item = (SequenceItem)si.next();\r\n anonymize(patientId, item.getAttributeList(), replacementAttributeList);\r\n }\r\n }\r\n else {\r\n Attribute replacement = replacementAttributeList.get(tag);\r\n if (replacement != null) {\r\n anonymizeNonSequenceAttribute(patientId, attribute, replacement);\r\n }\r\n }\r\n }\r\n }", "public void addAttributeDef(AttributeDef attributeDef1)\n // -end- 358A62100395 add_head358A5F2B0354 \"IdentDef::addAttributeDef\"\n {\n // -beg- preserve=no 358A62100395 add_body358A5F2B0354 \"IdentDef::addAttributeDef\"\n attributeDef.add(attributeDef1);\n attributeDef1._linkIdentDef(this);\n ch.ehi.uml1_4.changepropagation.MetaModel.getInstance().notifyChange(new ch.ehi.uml1_4.changepropagation.MetaModelChange(this,\"addAttributeDef\"));\n return;\n // -end- 358A62100395 add_body358A5F2B0354 \"IdentDef::addAttributeDef\"\n }", "protected void init(Collection<Double> data) {\n\t\tList<Attribute> attList = Util.newList();\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tAttribute att = new Attribute(\"w\" + i, Type.real);\n\t\t\tattList.add(att);\n\t\t}\n\t\tsetAttRef(AttributeList.create(attList));\n\t\t\n\t\tint i = 0;\n\t\tfor (double value : data) {\n\t\t\tsetValue(i, value);\n\t\t\ti++;\n\t\t}\n\t}", "protected abstract void createAttributes();", "private void createAttributes(String type, String unit, Dataset dataset) throws HDF5Exception\n\t{\n\t\t// One piece of information per attribute, e.g. one for\n\t\t// unit and one for metatype\n\t\tlong[] attrDims = { 1 };\n\t\t// create attribute holding metatype (parameternode or variablenode)\n\t\tif(type != null)\n\t\t{\n\t\t\tif(!type.equals(\"\"))\n\t\t\t{\n\t\t\t\tString[] classValue = { type };\n\t\t\t\tDatatype attrType = new H5Datatype(Datatype.CLASS_STRING, classValue[0].length() + 1, -1, -1);\n\t\t\t\tAttribute attr = new Attribute(\"metatype\", attrType, attrDims);\n\t\t\t\tattr.setValue(classValue);\n\t\t\t\trecordingsH5File.writeAttribute(dataset, attr, false);\n\t\t\t}\n\t\t}\n\n\t\t// create attribute holding unit of measurement\n\t\tif(unit != null)\n\t\t{\n\t\t\tif(!unit.equals(\"\"))\n\t\t\t{\n\t\t\t\tString[] classValue2 = { unit };\n\t\t\t\tDatatype attrType2 = new H5Datatype(Datatype.CLASS_STRING, classValue2[0].length() + 1, -1, -1);\n\t\t\t\tAttribute attr2 = new Attribute(\"unit\", attrType2, attrDims);\n\t\t\t\tattr2.setValue(classValue2);\n\t\t\t\trecordingsH5File.writeAttribute(dataset, attr2, false);\n\t\t\t}\n\t\t}\n\t}", "final void setAttributes(int param1, int param2) {\n }", "private void addGroupAndRoles(final AttributeStatement attributeStatement, final SAMLAttributes samlAttributes, final String attName) {\n\t\t\n\t // <saml:Attribute FriendlyName=\"GroupRole\" Name=\"urn:esg:group:role\" NameFormat=\"groupRole\">\n //\t\t<saml:AttributeValue>\n //\t\t\t<esg:groupRole xmlns:esg=\"http://www.esg.org\" group=\"Test Group A\" role=\"default\"/>\n\t //\t\t</saml:AttributeValue>\n\t //\t\t<saml:AttributeValue>\n //\t\t\t<esg:groupRole xmlns:esg=\"http://www.esg.org\" group=\"User\" role=\"default\"/>\n\t //\t\t</saml:AttributeValue>\n\t //\t</saml:Attribute>\n\t\tfor (final GroupRole grouprole : samlAttributes.getGroupAndRoles().get(attName)) {\n\t\t final Attribute grAttribute = builder.getGroupRoleAttribute(attName);\n\t \tfinal XSAny grAttributeValue = builder.getGroupRoleAttributeValue(grouprole.getGroup(), grouprole.getRole());\n\t grAttribute.getAttributeValues().add(grAttributeValue);\n\t\t attributeStatement.getAttributes().add(grAttribute);\n\t\t}\n\t \n\t}", "static FastVector attributeValues(Instances instances,Attribute attribute){\n\t\t\t\n\t\tFastVector rvals = new FastVector();\n\n\t\tif (attribute.isNumeric()){\n\t\t\tdouble[] rdouble = instances.attributeToDoubleArray(attribute.index());\n\t\t\tfor(int i = 0;i < rdouble.length;i++){\n\t\t\t\trvals.addElement(rdouble[i]);\n\t\t\t}\n\t\t}else if (attribute.isNominal()){\n\t\t\tfor(int i = 0;i < instances.numInstances();i++){\n\t\t\t\tInstance instance = instances.instance(i);\n\t\t\t\tString value = instance.toString(attribute);\n\t\t\t\trvals.addElement(value);\n\t\t\t}\n\t\t}else if (attribute.isString()){\n\t\t\tfor(int i = 0;i < instances.numInstances();i++){\t\t\n\t\t\t\tInstance instance = instances.instance(i);\n\t\t\t\tString value = instance.stringValue(attribute); \n\t\t\t\trvals.addElement(value);\n\t\t\t}\n\t\t}\n\t\treturn(rvals); \n\t}" ]
[ "0.6109258", "0.582032", "0.5796908", "0.57939076", "0.5783285", "0.5762076", "0.5747164", "0.5747164", "0.5647515", "0.56095785", "0.5595055", "0.55887806", "0.5582452", "0.55712956", "0.55571735", "0.5537927", "0.5518079", "0.54779917", "0.5476848", "0.5471753", "0.54678494", "0.5428923", "0.54236054", "0.5420176", "0.54123235", "0.5404973", "0.5398153", "0.53907996", "0.53449553", "0.5342094", "0.5333702", "0.53315836", "0.5329356", "0.532925", "0.5328132", "0.53063035", "0.5302185", "0.5273186", "0.52707255", "0.52641284", "0.5260762", "0.5247722", "0.5233583", "0.5230778", "0.519341", "0.51933444", "0.5188727", "0.51853883", "0.518199", "0.5176753", "0.5174786", "0.5170824", "0.5168575", "0.51683277", "0.51537246", "0.51529497", "0.5146449", "0.5144909", "0.512647", "0.5122977", "0.5120503", "0.5117339", "0.5115476", "0.5114249", "0.51123524", "0.5110723", "0.5098714", "0.50906247", "0.5081275", "0.50790274", "0.5076542", "0.5074382", "0.5074094", "0.5073517", "0.50710297", "0.50628674", "0.5055171", "0.50504816", "0.5050481", "0.50385016", "0.5029756", "0.5022979", "0.50137246", "0.4995397", "0.49904755", "0.49904597", "0.49871415", "0.49797046", "0.49784854", "0.4975098", "0.49740943", "0.49734408", "0.49698508", "0.49635357", "0.49630174", "0.49583533", "0.49520838", "0.49513865", "0.4941134", "0.49402082" ]
0.5873237
1
TODO Autogenerated method stub
@Override public int getMediaDuration() { 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
============================== / true if all required fields (dbnotnull fields) are valid
public boolean isDBValid(){ return noInduk != null && !noInduk.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean CheckAllRequiredFields() {\n\t\tboolean res = true;\n\t\tres &= CheckParkSelection();\n\t\tres &= CheckDateSelection();\n\t\tres &= CheckVisitorHour();\n\t\tres &= CheckEmail();\n\t\tres &= CheckPhoneNumber();\n\t\treturn res;\n\t}", "protected boolean isAllRequiredTxtFieldsFilled() {\r\n JTextField[] txtFields = {\r\n txtFieldFirstName, txtFieldLastName,\r\n txtFieldDateOfBirth, txtFieldIBAN,\r\n txtFieldState, txtFieldHouseNumber,\r\n txtFieldPostcode, txtFieldLocation,\r\n txtFieldCountry, txtFieldState\r\n };\r\n\r\n for (JTextField txtField : txtFields) {\r\n if (txtField.getText().equals(\"\")) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public boolean isValid() {\n return _id != null && !_id.isEmpty() &&\n _name != null && !_name.isEmpty() &&\n _created != null && !_created.isEmpty();\n }", "private boolean validateRequiredFields(StringBuffer b){\n boolean result = true;\n\n if (!TextFieldHelper.isNumericFieldValid(this.goalValue, \" Цель: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.startWeightValue, \" Исходный вес: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.heightValue, \" Рост: \", b) ||\n !CalendarHelper.isFieldValid(startProgramDateValue, \" Старт программы: \", b) ||\n !new ComboBoxFieldHelper<Client>().isFieldValid(clientFIOValue, \" Клиент: \", b))\n {\n result = false;\n }\n\n return result;\n }", "private boolean validateFields() {\r\n\t\tif (txUsuario.getText().equals(\"\") || txPassword.getText().equals(\"\")\r\n\t\t\t\t|| checkAdmin.isIndeterminate()|| checkTPV.isIndeterminate())\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "private boolean checkfields() {\n try {\n Integer.parseInt(checknum.getText().toString());\n Integer.parseInt(banknum.getText().toString());\n Integer.parseInt(branchnum.getText().toString());\n Integer.parseInt(accountnum.getText().toString()); //was commented\n\n } catch (NumberFormatException e) { // at least one of these numbers is not Integer\n return false;\n }\n\n if (checknum.getText().toString().equals(null) || banknum.getText().toString().equals(null) ||branchnum.getText().toString().equals(null)|| accountnum.getText().toString().equals(null))\n return false; // At least one of the fields is empty\n\n return true;\n }", "private boolean checkFields() {\n if (editTxtName.getText().equals(\"\")) return false;//name\n if (editTxtDesc.getText().equals(\"\")) return false;//desc\n if (editClrColor.getValue() == null) return false;//color\n if (oldEnvironment == null) return false;//environment is null\n return true;//everything is valid\n }", "boolean valid() {\n boolean valid = true;\n\n if (!isAgencyLogoPathValid()) {\n valid = false;\n }\n if (!isMemFieldValid()) {\n valid = false;\n }\n if (!isLogNumFieldValid()) {\n valid = false;\n }\n\n return valid;\n }", "private boolean checkFields() {\n boolean test = true;\n if (fname.isEmpty()) {\n test = false;\n }\n if (lname.isEmpty()) {\n test = false;\n }\n if (cin.isEmpty()) {\n test = false;\n }\n if (typeCompte.equals(\"Bancaire\")) {\n if (decouvertNF.isEmpty())\n test = false;\n } else if (typeCompte.equals(\"Epargne\")) {\n if (tauxInteretNF.isEmpty())\n test = false;\n }\n if (s_datePK.getValue() == null) {\n s_datePK.setStyle(\"-fx-border-color:red;-fx-border-radius:3px;-fx-border-size: 1px;\");\n test = false;\n }\n\n return test;\n }", "private boolean checkFields() {\n\t\tboolean status = true;\n\n\t\treturn status;\n\t}", "private boolean validateInputs() {\n return !proID.getText().isEmpty() || \n !proName.getText().isEmpty() ||\n !proPrice.getText().isEmpty();\n }", "@Override\n\tprotected Boolean isValid(String[] fields) {\n\t\t//check - evnet_id, yes, maybe, invited, no\n return (fields.length > 4);\n\t}", "public boolean isInputValid()\n {\n String[] values = getFieldValues();\n if(values[0].length() > 0 || values[1].length() > 0 || values[2].length() > 0)\n return true;\n else\n return false;\n }", "private void checkRequiredFields() {\n // check the fields which should be non-null\n if (configFileName == null || configFileName.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'configFileName' should not be null.\");\n }\n if (configNamespace == null || configNamespace.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'configNamespace' should not be null.\");\n }\n if (searchBundleManagerNamespace == null\n || searchBundleManagerNamespace.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'searchBundleManagerNamespace' should not be null.\");\n }\n if (entityManager == null) {\n throw new DAOConfigurationException(\n \"The 'entityManager' should not be null.\");\n }\n }", "private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }", "private void validate() {\n for (DBRow row : rows) {\n for (DBColumn column : columns) {\n Cell cell = Cell.at(row, column);\n DBValue value = values.get(cell);\n notNull(value,\"Cell \" + cell);\n }\n }\n }", "public final boolean hasAllRequiredField() {\n EditText editText = (EditText) _$_findCachedViewById(C2723R.C2726id.etUserName);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etUserName\");\n CharSequence obj = editText.getText().toString();\n int length = obj.length() - 1;\n int i = 0;\n boolean z = false;\n while (i <= length) {\n boolean z2 = obj.charAt(!z ? i : length) <= ' ';\n if (!z) {\n if (!z2) {\n z = true;\n } else {\n i++;\n }\n } else if (!z2) {\n break;\n } else {\n length--;\n }\n }\n String obj2 = obj.subSequence(i, length + 1).toString();\n EditText editText2 = (EditText) _$_findCachedViewById(C2723R.C2726id.etPassword);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPassword\");\n CharSequence obj3 = editText2.getText().toString();\n int length2 = obj3.length() - 1;\n int i2 = 0;\n boolean z3 = false;\n while (i2 <= length2) {\n boolean z4 = obj3.charAt(!z3 ? i2 : length2) <= ' ';\n if (!z3) {\n if (!z4) {\n z3 = true;\n } else {\n i2++;\n }\n } else if (!z4) {\n break;\n } else {\n length2--;\n }\n }\n String obj4 = obj3.subSequence(i2, length2 + 1).toString();\n if (TextUtils.isEmpty(obj2) || TextUtils.isEmpty(obj4)) {\n return false;\n }\n return true;\n }", "public boolean hasFieldErrors();", "public void validate() throws org.apache.thrift.TException {\n if (is_null == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'is_null' was not present! Struct: \" + toString());\n }\n // check for sub-struct validity\n }", "public boolean fieldsAreFilled(){\r\n boolean filled = true;\r\n if(txtFName.getText().trim().isEmpty() | txtFEmail.getText().trim().isEmpty() | txtFPhone.getText().trim().isEmpty()){\r\n filled = false;\r\n }\r\n return filled;\r\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "private boolean formIsValid(){\r\n // check if all the required fields have been filled in\r\n boolean allFieldsEntered = formComplete();\r\n // check if Name field has valid input\r\n boolean nameFieldValid = isAllChars(NAME_FIELD.getText());\r\n // check if city field has valid input\r\n boolean cityFieldValid = isAllChars(CITY_FIELD.getText());\r\n // check if country field has valid input\r\n boolean ctryFieldValid = isAllChars(COUNTRY_FIELD.getText());\r\n // check if zipcode field has valid input\r\n boolean zipFieldValid = isAllNums(ZIP_FIELD.getText());\r\n // check if phone field has valid input\r\n boolean phoneFieldValid = isAllNums(PHONE_FIELD.getText());\r\n // check if all fields and form are valid\r\n return allFieldsEntered && nameFieldValid &&\r\n cityFieldValid && ctryFieldValid &&\r\n zipFieldValid && phoneFieldValid; \r\n }", "private void checkForEmptyFields() throws EmptyTextFieldException {\n\n if (date == null || title.equals(\"\") || function.equals(\"\") || protagonist.equals(\"\")\n || source.equals(\"\") || references.equals(\"\") || description.equals(\"\")) {\n throw new EmptyTextFieldException();\n }\n }", "private boolean Validate() {\n EditText titleText = findViewById(R.id.register_movie_title_txt);\n EditText yearText = findViewById(R.id.register_movie_year_txt);\n EditText ratingText = findViewById(R.id.register_movie_rating_txt);\n\n\n boolean is_filled_required_fields = false;\n is_filled_required_fields = titleText.getText().toString().length() > 0\n && yearText.getText().toString().length() > 0\n && ratingText.getText().toString().length() > 0;\n\n if (!is_filled_required_fields) {\n Snackbar mySnackbar = Snackbar.make(findViewById(R.id.activity_register_base_layout), \"Please fill required fields\", BaseTransientBottomBar.LENGTH_SHORT);\n mySnackbar.show();\n }\n return is_filled_required_fields;\n }", "public boolean validateInputFields(){\n if(titleText.getText().isEmpty() || descriptionText.getText().isEmpty()){\n showError(true, \"All fields are required. Please complete.\");\n return false;\n }\n if(locationCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a location.\");\n return false;\n }\n if(contactCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a contact.\");\n return false;\n }\n if(typeCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select the type.\");\n return false;\n }\n if(customerCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a customer.\");\n return false;\n }\n if(userCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a user.\");\n return false;\n }\n return true;\n }", "private void fillMandatoryFields() {\n\n }", "public static boolean checkMandatoryFields(Object obj) {\n\n\t\tif (obj instanceof UserDTO) {\n\n\t\t\tUserDTO userDTO = (UserDTO) obj;\n\n\t\t\tif (userDTO.getPasscode().trim().isEmpty()) {\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean externalFilled() {\n return firstName != null && !firstName.isEmpty()\n || lastName != null && !lastName.isEmpty()\n || email != null && !email.isEmpty();\n }", "private boolean validateObjectForDB() {\n\t\tboolean l_ret = true;\n\t\tif (m_country_name.equals(\"\")) {\n\t\t\tm_error_string = \"Unable to add the country. Country name is required.\";\n\t\t\tl_ret = false;\n\t\t}\n\t\treturn (l_ret);\n\t}", "private boolean fieldsFilled(){\n return !editTextEmail.getText().toString().isEmpty() &&\n !editTextPassword.getText().toString().isEmpty();\n }", "private boolean fieldsAreFilled(){\n return !textboxName.isEnabled() && !textboxInitialValue.isEnabled();\n }", "public boolean isRequired();", "public void validate() throws org.apache.thrift.TException {\n if (key_column_name == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'key_column_name' was not present! Struct: \" + toString());\n }\n if (key_column_type == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'key_column_type' was not present! Struct: \" + toString());\n }\n // alas, we cannot check 'is_preaggregation' because it's a primitive and you chose the non-beans generator.\n // check for sub-struct validity\n }", "boolean isRequired();", "boolean isRequired();", "boolean isRequired();", "public boolean isValidRecord () {\n int sumError = latitudeError +\n longitudeError +\n depthError +\n temperatureMinError +\n temperatureMaxError +\n salinityMinError +\n salinityMaxError +\n oxygenMinError +\n oxygenMaxError +\n nitrateMinError +\n nitrateMaxError +\n phosphateMinError +\n phosphateMaxError +\n silicateMinError +\n silicateMaxError +\n chlorophyllMinError +\n chlorophyllMaxError;\n return (sumError == 0 ? true : false);\n }", "public void validate() throws org.apache.thrift.TException {\n if (version == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'version' was not present! Struct: \" + toString());\n }\n if (am_handle == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'am_handle' was not present! Struct: \" + toString());\n }\n if (user == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'user' was not present! Struct: \" + toString());\n }\n if (resources == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'resources' was not present! Struct: \" + toString());\n }\n // alas, we cannot check 'gang' because it's a primitive and you chose the non-beans generator.\n // check for sub-struct validity\n if (am_handle != null) {\n am_handle.validate();\n }\n if (reservation_id != null) {\n reservation_id.validate();\n }\n }", "private boolean isValid(){\n if(txtFirstname.getText().trim().isEmpty() || txtLastname.getText().trim().isEmpty() ||\n txtEmailAddress.getText().trim().isEmpty() || dobPicker.getValue()==null\n || txtPNum.getText().trim().isEmpty()\n || txtDefUsername.getText().trim().isEmpty()\n || curPassword.getText().trim().isEmpty()){\n \n return false; // return false if one/more fields are not filled\n }else{\n if(!newPassword.getText().trim().isEmpty()){\n if(!confirmPassword.getText().trim().isEmpty()){\n return true;\n }else{\n return false;\n }\n }\n return true; // return true if all fields are filled\n }\n }", "private void validateFields() throws InvalidConnectionDataException {\n if (driver == null) throw new InvalidConnectionDataException(\"No driver field\");\n if (address == null) throw new InvalidConnectionDataException(\"No address field\");\n if (username == null) throw new InvalidConnectionDataException(\"No username field\");\n if (password == null) throw new InvalidConnectionDataException(\"No password field\");\n }", "public boolean inputIsValid() {\n return nameIsValid() &&\n descriptionIsValid() &&\n priceIsValid() &&\n streetIsValid() &&\n zipcodeIsValid() &&\n cityIsValid() &&\n imageIsSelected();\n }", "private boolean noFieldsEmpty() {\n if ( nameField.getText().isEmpty()\n || addressField.getText().isEmpty()\n || cityField.getText().isEmpty()\n || countryComboBox.getSelectionModel().getSelectedItem() == null\n || divisionComboBox.getSelectionModel().getSelectedItem() == null\n || postalField.getText().isEmpty()\n || phoneField.getText().isEmpty() ) {\n errorLabel.setText(rb.getString(\"fieldBlank\"));\n return false;\n }\n return true;\n }", "private boolean verifyObligedFields() {\n if(label.getText().toString().isEmpty() || label.getText().toString().equals(\"\"))\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.label_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(category.getSelectedItem().toString().isEmpty())\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.category_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(cost.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.cost_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(dateDue.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.date_due_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private boolean areFieldsValid() {\n // Whether the values from the fields can be inserted into the database without conflict.\n boolean retVal = true;\n\n if (vehicleId == -1) {\n // Then we don't know which vehicle to attach this issue to. This should never happen\n return false;\n // TODO: Display something to the user\n }\n\n // If we're creating a new Issue, we need to create the Issue object\n if (issue == null) {\n // A new issue is not fixed, and thus will be open.\n // Try to get the open status id and ensure it properly fetched\n int openIssueId = dbHelper.getOpenIssueStatusId();\n if (openIssueId != -1) {\n issue = new Issue(mTitle.getText().toString().trim(), vehicleId, openIssueId);\n }\n }\n\n // Convert the EditText fields to strings\n String checkTitle = mTitle.getText().toString().trim();\n String checkDescription = mDescription.getText().toString().trim();\n String checkPriority = mPriority.getText().toString().trim();\n\n if (checkTitle.isEmpty()) {\n retVal = false;\n eTitle.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessage));\n } else if (!VerifyUtil.isStringSafe(checkTitle)) {\n retVal = false;\n eTitle.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessageInvalidCharacters));\n } else {\n eTitle.setError(null);\n issue.setTitle(checkTitle);\n }\n\n if (checkDescription.isEmpty()) {\n retVal = false;\n eDescription.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessage));\n } else if (!VerifyUtil.isTextSafe(checkDescription)) {\n retVal = false;\n eDescription.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessageInvalidCharacters));\n } else {\n eDescription.setError(null);\n issue.setDescription(checkDescription);\n }\n\n if (checkPriority.isEmpty()) {\n retVal = false;\n ePriority.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessage));\n } else {\n ePriority.setError(null);\n issue.setPriority(priorityStringToInt(checkPriority));\n }\n\n return retVal;\n }", "public void validate() throws org.apache.thrift.TException {\n if (institutionID == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'institutionID' was not present! Struct: \" + toString());\n }\n if (productids == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'productids' was not present! Struct: \" + toString());\n }\n // check for sub-struct validity\n }", "public static boolean isNull_fields_allowed() {\n return null_fields_allowed;\n }", "public boolean isValid() {\n\t\tif(username == null)\n\t\t\treturn false;\n\t\telse if(createdAt == null)\n\t\t\treturn false;\n\t\telse if(updatedAt == null)\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "public boolean validatePersonalData() {\n\t\tif (firstName == null)\n\t\t\treturn false;\n\t\tif (lastName == null)\n\t\t\treturn false;\n\t\tif (phoneNum == null)\n\t\t\treturn false;\n\t\tif (email == null)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "private boolean validarCampos() {\r\n\t\tif (cedula.equals(\"\") || nombre.equals(\"\") || apellido.equals(\"\") || telefono.equals(\"\")) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void verifyInput(){\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n\n mNameFieldsFilled = !TextUtils.isEmpty(firstName) && !TextUtils.isEmpty(lastName);\n\n }", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "public void validate() throws org.apache.thrift.TException {\n if (tableType == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'tableType' was not present! Struct: \" + toString());\n }\n // alas, we cannot check 'numCols' because it's a primitive and you chose the non-beans generator.\n // alas, we cannot check 'numClusteringCols' because it's a primitive and you chose the non-beans generator.\n if (tableName == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'tableName' was not present! Struct: \" + toString());\n }\n if (dbName == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'dbName' was not present! Struct: \" + toString());\n }\n // check for sub-struct validity\n if (hdfsTable != null) {\n hdfsTable.validate();\n }\n if (hbaseTable != null) {\n hbaseTable.validate();\n }\n if (dataSourceTable != null) {\n dataSourceTable.validate();\n }\n }", "public boolean isEveryIdValid()\n {\n return(idValidation.size()==0);\n }", "@Override\n\tprotected boolean verifyFields() {\n\t\treturn false;\n\t}", "public boolean getIsValid() {\n return projectName != null && packageName != null && !projectName.isEmpty() && !packageName.isEmpty();\n }", "public boolean isValid() {\n //primary variables must have proper values to identify the Book with\n if (this.author == null || this.title == null || dop == 0) {\n return false;\n }\n return true;\n }", "public boolean validate() {\n if (value == null || currencyCode == null) {\n return false;\n }\n return true;\n }", "protected boolean isValidData() {\n return true;\n }", "public void validate() throws org.apache.thrift.TException {\n if (limb == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'limb' was not present! Struct: \" + toString());\n }\n if (pos == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'pos' was not present! Struct: \" + toString());\n }\n if (ori == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'ori' was not present! Struct: \" + toString());\n }\n if (speed == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'speed' was not present! Struct: \" + toString());\n }\n if (angls == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'angls' was not present! Struct: \" + toString());\n }\n if (mode == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'mode' was not present! Struct: \" + toString());\n }\n if (kin == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'kin' was not present! Struct: \" + toString());\n }\n // check for sub-struct validity\n if (pos != null) {\n pos.validate();\n }\n if (ori != null) {\n ori.validate();\n }\n if (speed != null) {\n speed.validate();\n }\n if (angls != null) {\n angls.validate();\n }\n }", "public static boolean checkMandatoryFieldsRegistration(Object obj) {\n\n\t\tif (obj instanceof UserDTO) {\n\n\t\t\tUserDTO userDTO = (UserDTO) obj;\n\n\t\t\tif (userDTO.getPasscode().trim().isEmpty()) {\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean isValid() {\n return !TextUtils.isEmpty(getId())\n && !TextUtils.isEmpty(getName())\n && getControlFilter() != null;\n }", "boolean isSetRequired();", "@Override\n public boolean validate() throws ValidationException\n {\n boolean isValid = super.validate();\n return checkAAField() && isValid;\n }", "public static boolean checkMandatoryFieldsUpdateUser(Object obj) {\n\n\t\tif (obj instanceof UpdateUserDTO) {\n\n\t\t\tUpdateUserDTO updateUserDTO = (UpdateUserDTO) obj;\n\n\t\t\tif (updateUserDTO.getFirstName().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getLastName().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getAddress1().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getCity().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getState().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getZipCode().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getNewEmailId().trim().isEmpty()\n\n\t\t\t) {\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isValid(SchemaField field, Data data) {\n\t\treturn false;\n\t}", "public void validate() throws org.apache.thrift.TException {\n if (!isSetColName()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'colName' is unset! Struct:\" + toString());\n }\n\n if (!isSetColType()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'colType' is unset! Struct:\" + toString());\n }\n\n if (!isSetStatsData()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'statsData' is unset! Struct:\" + toString());\n }\n\n // check for sub-struct validity\n }", "public void checkFields(){\n }", "private boolean formComplete(){\r\n return NAME_FIELD.getLength()>0 && ADDRESS_1_FIELD.getLength()>0 &&\r\n CITY_FIELD.getLength()>0 && ZIP_FIELD.getLength()>0 && \r\n COUNTRY_FIELD.getLength()>0 && PHONE_FIELD.getLength()>0; \r\n }", "private void validCheck ()\n\t{\n\t\tassert allButLast != null || cachedFlatListOrMore != null;\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public static FieldValidator anyButNull() {\n return isNotNull();\n }", "public boolean checkEntryInputs() {\n\t\tboolean isValid = true;\n\t\tif(sampleNumberTF.getText().equals(\"\")) {\n\t\t\tisValid = false;\n\t\t}\n\t\t\n\t\tif(materialDescriptionTF.getText().equals(\"\")) {\n\t\t\tisValid = false;\n\t\t}\n\t\t\n\t\tif(Double.valueOf(bacteroidesConcentrationTF.getText())==null) {\n\t\t\tisValid = false;\n\t\t}\n\t\treturn isValid;\n\t}", "public boolean verifyData()\n {\n if(jTextFieldName.getText().equals(\"\") && jTextFieldNumber.getText().equals(\"\") \n || jTextFieldSupplier.getText().equals(\"\") || jTextArea1.getText().equals(\"\") || jTextFieldModel.getText().equals(\"\"))\n {\n JOptionPane.showMessageDialog(null, \"One or More Fields Are Empty\");\n return false;\n }\n \n else\n {\n return true;\n }\n \n }", "public boolean validateEmployeePackage() {\n\t\treturn this.validateID() && this.validateFirstName() && this.validateLastName();\n\t}", "public boolean isDataValid() {\r\n boolean dataValid = true;\r\n\r\n if (this.needDefaultValue) {\r\n try {\r\n this.getDefaultValue();\r\n } catch (Exception e) {\r\n dataValid = false;\r\n }\r\n }\r\n\r\n if (this.nameTextField.getText() == null || this.nameTextField.getText().length() == 0) {\r\n dataValid = false;\r\n }\r\n\r\n return dataValid;\r\n\r\n }", "private boolean validateInputs() {\n if (Constants.NULL.equals(review)) {\n reviewET.setError(\"Must type a review!\");\n reviewET.requestFocus();\n return false;\n }\n if (Constants.NULL.equals(heading)) {\n headingET.setError(\"Heading cannot be empty\");\n headingET.requestFocus();\n return false;\n }\n return true;\n }", "boolean hasField4();", "@Override\n\tprotected boolean validateRequiredParameters() throws Exception {\n\t\treturn true;\n\t}", "public boolean isNullRecord () {\n if ((latitude == FLOATNULL) &&\n (longitude == FLOATNULL) &&\n (depth == FLOATNULL) &&\n (temperatureMin == FLOATNULL) &&\n (temperatureMax == FLOATNULL) &&\n (salinityMin == FLOATNULL) &&\n (salinityMax == FLOATNULL) &&\n (oxygenMin == FLOATNULL) &&\n (oxygenMax == FLOATNULL) &&\n (nitrateMin == FLOATNULL) &&\n (nitrateMax == FLOATNULL) &&\n (phosphateMin == FLOATNULL) &&\n (phosphateMax == FLOATNULL) &&\n (silicateMin == FLOATNULL) &&\n (silicateMax == FLOATNULL) &&\n (chlorophyllMin == FLOATNULL) &&\n (chlorophyllMax == FLOATNULL)) {\n return true;\n } else {\n return false;\n } // if ...\n }", "boolean hasField3();", "public boolean validations() {\n boolean result = false;\n String nameString = mItemNameEditText.getText().toString().trim();\n String locationString = mItemLocationEditText.getText().toString().trim();\n\n if (nameString.isEmpty() || nameString == null || locationString.isEmpty() || locationString == null || isImageNotPresent()) {\n displayToastMessage(getString(R.string.fields_mandatory_msg));\n return result;\n } else {\n result = true;\n return result;\n }\n }", "@Override\n public boolean isValid() {\n return dateFrom != null && dateTo != null;\n }", "public void validateAfterParse() \r\n\t{\n\t\tValidate.fieldNotBlank(getName(), \"name\");\r\n\t\t\r\n\t\t//Must have columns and they can't be null\r\n\t\tValidate.fieldNotEmptyWithNoNullElements(getColumns(), \"columns\");\r\n\t\t\r\n\t\tint numPrimaryKeysDefined = 0;\r\n\t\t\r\n\t\tfor (ColumnDefinition def : getColumns())\r\n\t\t{\r\n\t\t\tif (def.isPrimaryKey())\r\n\t\t\t{\r\n\t\t\t\tnumPrimaryKeysDefined++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Can only have 1 PK\r\n\t\tValidate.isTrue(numPrimaryKeysDefined == 1);\r\n\r\n\t\tfor (ColumnDefinition def : getColumns())\r\n\t\t{\r\n\t\t\tdef.validateAfterParse();\r\n\t\t}\r\n\t\t\r\n\t\t//Check over indexes, make sure each column name for the indexes actually exists\r\n\t\tfor(IndexDefinition def : getIndexes())\r\n\t\t{\r\n\t\t\tfor(String idxColName : def.getColumnNames())\r\n\t\t\t{\r\n\t\t\t Validate.isTrue(getColumns().contains(ColumnDefinition.valueOf(idxColName))); //Can't use containsColumn yet as that map gets initialized in postParse()\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "@Override\n\tprotected boolean checkDataStructure(Data data) throws ImportitException {\n\t\tdata.setDatabase(39);\n\t\tdata.setGroup(3);\n\t\tboolean validDb = checkDatabaseName(data);\n\t\tboolean validHead = false;\n\t\tboolean validTable = false;\n\t\tboolean existImportantFields = false;\n\t\tif (validDb) {\n\t\t\tList<Field> headerFields = data.getHeaderFields();\n\t\t\tList<Field> tableFields = data.getTableFields();\n\t\t\tvalidHead = false;\n\t\t\tvalidTable = false;\n\t\t\ttry {\n\n\t\t\t\tvalidHead = checkWarehouseGroupProperties(headerFields, data.getOptionCode().useEnglishVariables());\n\t\t\t\tvalidTable = checkFieldList(tableFields, 39, 3, false, data.getOptionCode().useEnglishVariables());\n\t\t\t\tString[] checkDataCustomerPartProperties = checkDataWarehouseGroupProperties(data);\n\t\t\t\texistImportantFields = checkDataCustomerPartProperties.length == 2;\n\n\t\t\t} catch (ImportitException e) {\n\t\t\t\tlogger.error(e);\n\t\t\t\tdata.appendError(Util.getMessage(\"err.structure.check\", e.getMessage()));\n\t\t\t}\n\t\t}\n\t\tif (validTable && validHead && validDb & existImportantFields) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isPKValid() {\r\n\treturn (this.pk == null) ? false : this.pk.isValid();\r\n }", "private void validator() throws Exception {\n if (getDBTable() == null) throw new Exception(\"getDBTable missing\");\n if (getColumnsString() == null) throw new Exception(\"getColumnsString missing\");\n if (getColumnsType() == null || getColumnsType().size() <= 0) throw new Exception(\"getColumnsType missing\");\n if (getDuplicateUpdateColumnString() == null) {\n if (getColumnsString().split(\",\").length != getColumnsType().size())\n throw new Exception(\"mismatch for type and columns\");\n\n } else {\n if (getColumnsString().split(\",\").length +\n getDuplicateUpdateColumnString().split(\",\").length != getColumnsType().size())\n throw new Exception(\"mismatch for type and columns\");\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (partition_exprs == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'partition_exprs' was not present! Struct: \" + toString());\n }\n if (partition_infos == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'partition_infos' was not present! Struct: \" + toString());\n }\n if (rollup_schemas == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'rollup_schemas' was not present! Struct: \" + toString());\n }\n // check for sub-struct validity\n }", "public boolean validatePatient() {\n\t\tif (dateOfBirth == null)\n\t\t\treturn false;\n\t\tif (insuranceProvider == null)\n\t\t\treturn false;\n\t\tif (subscriberID == null)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "public boolean valid() {\n return start != null && ends != null && weavingRegion != null;\n }", "boolean isMandatory();", "public boolean checkFields(){\n String message = \"\";\n if (firstName.getText().isEmpty()){\n message=\"First name is required\";\n }\n if (lastName.getText().isEmpty()){\n if (message.isEmpty())\n message = \"Last name is required\";\n else\n message = \"First name and Last name are required\";\n }\n if (birthday.getValue() == null){\n if (message.isEmpty())\n message = \"please select your birthday\";\n else if (firstName.getText().isEmpty()&& !lastName.getText().isEmpty())\n message = \"First name and birthday required\";\n else if (!firstName.getText().isEmpty() && lastName.getText().isEmpty())\n message = \"Last name and birthday required\";\n else\n message = \"all fields are required\";\n }\n errorDisplay.setText(message);\n return message.equals(\"\");\n }", "private boolean validCreateInput() throws SQLException {\n // Checks if any of the fields is empty\n if(teamNameCreateField.getText().equals(\"\") || abbrevationCreateField.getText().equals(\"\")\n || chooseCityBoxCreate.getValue() == null || chooseLeagueBoxCreate.getValue() == null\n || chooseAgeGroupCreate.getValue() == null || chooseLeagueTeamBoxCreate.getValue() == null){\n displayMessage(messagePane,\"Please fill all the fields\",true);\n return false;\n }\n // Checks the abbrevation length\n else if(abbrevationCreateField.getText().length() > 3)\n {\n displayMessage(messagePane,\"Abbrevations must be at most 3 characters\",true);\n return false;\n }\n // Checks team name length\n else if (teamNameCreateField.getText().length() > 30){\n displayMessage(messagePane,\"Team Names must be smaller than 30 characters\",true);\n return false;\n }\n return true;\n }", "public boolean isSetFields() {\n return this.fields != null;\n }", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "protected abstract List<TemporalField> validFields();", "private boolean validEditInput() throws SQLException {\n // Checks if any of the fields is empty\n if(teamNameEditField.getText().equals(\"\") || abbrevationEditField.getText().equals(\"\")\n || chooseCityBox.getValue() == null || chooseLeagueBox.getValue() == null\n || chooseLeagueTeamBox.getValue() == null) {\n displayMessage(messagePane,\"Please fill all the fields\",true);\n return false;\n }\n // Checks the abbrevation length\n else if(abbrevationEditField.getText().length() > 3)\n {\n displayMessage(messagePane,\"Abbrevations must be at most 3 characters\",true);\n return false;\n }\n // Checks team name length\n else if (teamNameEditField.getText().length() > 30){\n displayMessage(messagePane,\"Team Names must be smaller than 30 characters\",true);\n return false;\n }\n return true;\n }", "public void validate() throws org.apache.thrift.TException {\n if (functionName == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'functionName' was not present! Struct: \" + toString());\n }\n if (className == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'className' was not present! Struct: \" + toString());\n }\n if (resources == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'resources' was not present! Struct: \" + toString());\n }\n // check for sub-struct validity\n }", "public boolean isValid()\n {\n return this.address >= 0 && this.slaveId >= 0 && this.xlator != null\n && this.gatewayProtocol != null\n && (this.serialParameters != null\n || (this.gatewayIPAddress != null\n && this.gatewayPort != null));\n }", "public boolean isValid() {\n\t\t\t// empty fields are invalid by default - which means that every\n\t\t\t// field is required by default.\n\t\t\tif (this.getContents().isEmpty()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// check whether we have a regex validation and if it matches the\n\t\t\t// fields content.\n\t\t\tif (FieldComposite.this.hasRegexValidation()\n\t\t\t\t\t&& this.getContents().matches(FieldComposite.this.regexValidation.getPattern())) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}" ]
[ "0.7501502", "0.7319795", "0.71993804", "0.7075136", "0.6971481", "0.6967834", "0.69482225", "0.6899647", "0.689031", "0.68826413", "0.6875583", "0.68567157", "0.6844625", "0.6822824", "0.6811073", "0.6746601", "0.67418283", "0.6737112", "0.673031", "0.67087185", "0.67065895", "0.67056394", "0.6691169", "0.6658496", "0.6642399", "0.6628356", "0.66197854", "0.6600657", "0.6582615", "0.6574596", "0.65673614", "0.65621156", "0.65572596", "0.6556255", "0.6556255", "0.6556255", "0.6539868", "0.6538027", "0.6533427", "0.6525118", "0.65142167", "0.65110564", "0.65009224", "0.6497611", "0.6492352", "0.6484693", "0.64657956", "0.64238685", "0.6399308", "0.636699", "0.63669217", "0.63485813", "0.6345867", "0.63397115", "0.6334468", "0.6333578", "0.6326698", "0.6314852", "0.63109356", "0.630688", "0.6295946", "0.6287895", "0.62834406", "0.62833625", "0.6280195", "0.6279009", "0.62638277", "0.626368", "0.62608904", "0.62557715", "0.62545", "0.62492114", "0.6248362", "0.62415254", "0.6240254", "0.62324613", "0.623004", "0.62197703", "0.62068766", "0.62014955", "0.6195256", "0.61949027", "0.6184323", "0.617701", "0.6168292", "0.6164043", "0.6153708", "0.6151944", "0.61300164", "0.6126286", "0.6124827", "0.61234385", "0.61203736", "0.6118491", "0.6114314", "0.6110551", "0.61020017", "0.6100538", "0.60981244", "0.6097485" ]
0.6643129
24
/ rs.isBeforeFirst must be false throws KasirException(BAD_RECORD, tableName) if the resulting Profil.isDBValid = false never ret null
public Profil dynFromResultSet(ResultSet rs, boolean onCallingObj) throws SQLException, KasirException{ assert !rs.isBeforeFirst() : "rs.isBeforeFirst = true"; Profil profil = onCallingObj? this : new Profil(); profil.noInduk = rs.getString(noIndukColName); profil.currentLevel = Level.fromResultSet(rs, currentLevelColName); profil.biodata = Biodata.fromResultSet(rs); profil.tanggalMasuk = Kalender.fromResultSet(rs, tanggalMasukColName); profil.tanggalLulus = Kalender.fromResultSet(rs, tanggalLulusColName); String tmpGelombang = rs.getString(gelombangColName); if(tmpGelombang != null){ if(tmpGelombang.equalsIgnoreCase("GELOMBANG_1")){ profil.gelombang = Gelombang.GELOMBANG_1; }else if(tmpGelombang.equalsIgnoreCase("GELOMBANG_2")){ profil.gelombang = Gelombang.GELOMBANG_2; } } profil.totalIuran = rs.getFloat(totalIuranColName); String tmpStatusPendaftaran = rs.getString(statusPendaftaranColName); if(tmpStatusPendaftaran != null){ if(tmpStatusPendaftaran.equalsIgnoreCase("DAFTAR")){ profil.statusPendaftaran = StatusPendaftaran.DAFTAR; }else if(tmpStatusPendaftaran.equalsIgnoreCase("PROSES")){ profil.statusPendaftaran = StatusPendaftaran.PROSES; }else if(tmpStatusPendaftaran.equalsIgnoreCase("LUNAS")){ profil.statusPendaftaran = StatusPendaftaran.LUNAS; }else if (tmpStatusPendaftaran.equalsIgnoreCase("BATAL")){ profil.statusPendaftaran = StatusPendaftaran.BATAL; } } profil.lastUpdateDate = Kalender.fromResultSet(rs, lastUpdateDateColName); if(profil.isDBValid()) return profil; else throw new KasirException(KasirException.Tipe.BAD_RECORD, tableName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void beforeFirst() throws SQLException\n {\n m_rs.beforeFirst();\n }", "public void beforeFirst() throws SQLException {\n/* 251 */ notSupported();\n/* */ }", "public boolean isBeforeFirst() throws SQLException\n {\n return m_rs.isBeforeFirst();\n }", "public boolean isBeforeFirst() throws SQLException {\n/* 151 */ return (this.currentPositionInEntireResult < 0);\n/* */ }", "public boolean isBeforeFirst() throws SQLException {\n\n try {\n debugCodeCall(\"isBeforeFirst\");\n checkClosed();\n return result.getRowId() < 0;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public boolean isFirst() throws SQLException {\n/* 208 */ return (this.currentPositionInEntireResult == 0);\n/* */ }", "public void beforeFirst() throws SQLException {\n\n try {\n debugCodeCall(\"beforeFirst\");\n checkClosed();\n if (result.getRowId() >= 0) {\n resetResult();\n }\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public boolean isFirst() throws SQLException {\n\n try {\n debugCodeCall(\"isFirst\");\n checkClosed();\n int row = result.getRowId();\n return row == 0 && row < result.getRowCount();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public boolean isFirst() throws SQLException\n {\n return m_rs.isFirst();\n }", "public boolean first() throws SQLException {\n\n try {\n debugCodeCall(\"first\");\n checkClosed();\n if (result.getRowId() < 0) { return nextRow(); }\n resetResult();\n return nextRow();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public boolean first() throws SQLException\n {\n return m_rs.first();\n }", "private boolean shouldExecuteDbFirst() throws ServiceException {\n DbSearchConstraints.Leaf top = getTopLeafConstraint();\n if (top.convId > 0 || !top.itemIds.isEmpty()) {\n return true;\n }\n\n if (luceneOp != null && luceneOp.shouldExecuteDbFirst()) {\n return true;\n }\n\n return constraints.tryDbFirst(context.getMailbox());\n }", "public void beforeLast() throws SQLException {\n/* 261 */ notSupported();\n/* */ }", "R getFirstRowOrThrow();", "private boolean inDatabase() {\r\n \t\treturn inDatabase(0, null);\r\n \t}", "public boolean onNextRecord(IDataTableRecord record) throws Exception;", "public boolean isSetFirstRow()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FIRSTROW$22) != 0;\n }\n }", "@Test(timeout = 4000)\n public void test46() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n PipedReader pipedReader0 = new PipedReader();\n Boolean boolean0 = Boolean.FALSE;\n SQLUtil.isQuery(\"selectntowrong c|ck\");\n Boolean.valueOf(true);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"selectntowrong c|ck\");\n // Undeclared exception!\n try { \n defaultDBTable0.getUniqueConstraint(\"^h=wZ>:9%}Pj6(#%M\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "@Override\r\n public Boolean moreRecords()\r\n {\r\n Boolean blnRet = false;\r\n try\r\n {\r\n blnRet = dbRecordset.next();\r\n }\r\n catch (Exception e)\r\n {\r\n blnRet = false;\r\n }\r\n return blnRet; // only one RETURN in each function!\r\n }", "@Override\r\n\tprotected boolean isValidTable(final ResultSet resultSet) throws SQLException {\r\n\t\treturn !resultSet.getString(3).contains(\"BIN$\");\r\n\t}", "@Test\n public void selectStatementSuccessful() throws SQLException {\n assertNotNull(testConnection.selectStatement(con, \"SELECT * FROM Employees;\"));\n assertNull(testConnection.selectStatement(con, \"SELECT * FROM Emp;\"));\n\n //Test if RS is empty\n assertTrue(testConnection.selectStatement(con, \"SELECT * FROM Employees\").next());\n assertFalse(testConnection.selectStatement(con, \"SELECT * FROM Employees WHERE email='x'\").next());\n }", "abstract boolean tableExist() throws SQLException;", "private boolean checkInputTableName(AccessInputMeta meta){\n if (meta.getTableName()==null || meta.getTableName().length()<1)\n {\n MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );\n mb.setMessage(BaseMessages.getString(PKG, \"AccessInputDialog.TableMissing.DialogMessage\"));\n mb.setText(BaseMessages.getString(PKG, \"System.Dialog.Error.Title\"));\n mb.open(); \n\n return false;\n }\n else\n {\n \treturn true;\n }\n\t}", "@Test(timeout = 4000)\n public void test041() throws Throwable {\n SimpleResultSet simpleResultSet0 = new SimpleResultSet();\n Object object0 = DBUtil.parseAndSimplifyResultSet(simpleResultSet0);\n assertNotNull(object0);\n }", "@Test(timeout = 4000)\n public void test006() throws Throwable {\n SimpleResultSet simpleResultSet0 = new SimpleResultSet();\n Statement statement0 = DBUtil.getStatement(simpleResultSet0);\n assertNull(statement0);\n }", "public void testOneTableSyn() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName FROM AD_Table t WHERE t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Table=t|0]\", fixture.toString());\n }", "public void MoveFirst()\r\n {\r\n\r\n \t try{\r\n \t\t rsTution.first();\r\n \t\t Display();\r\n\r\n\r\n \t }catch(SQLException sqle)\r\n \t {System.out.println(\"MoveFirst Error:\"+sqle);}\r\n \t}", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public boolean validateTable(boolean inclWarn)\n {\n // This method is intended to be executed from the command line\n String utableName = this.getUntranslatedTableName();\n Print.logInfo(\"\");\n Print.logInfo(\"Validating \" + utableName + \":\");\n\n boolean pass = true;\n try {\n\n /* validation constructor */\n MethodAction valConst = null;\n try {\n valConst = new MethodAction(this.getRecordClass(), ResultSet.class, ValidationLog.class);\n } catch (Throwable t) { // NoSuchMethodException, ...\n throw new ValidationNotImplementedException(\"Missing validation Constructor\");\n }\n \n /* 'select' */\n // DBSelect: SELECT * FROM table\n DBConnection dbc = null;\n Statement stmt = null;\n ResultSet rs = null;\n try {\n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this);\n dbc = DBConnection.getDBConnection_read();\n stmt = dbc.execute(dsel.toString(), true); // needs to be row-by-row\n rs = stmt.getResultSet();\n while (rs.next()) {\n ValidationLog failLog = new ValidationLog(utableName, inclWarn);\n try {\n valConst.invoke(rs, failLog);\n if (failLog.hasErrors()) {\n Print.logError(failLog.toString());\n pass = false; \n } else\n if (inclWarn && !failLog.hasHeader()) {\n throw new ValidationNotImplementedException(\"No log header\");\n }\n } catch (Throwable t) { // InvocationTargetException, ValidationNotImplementedException, ...\n Print.logException(\"Validating \" + utableName + \": \", t);\n pass = false;\n }\n }\n } finally {\n if (rs != null) { try { rs.close(); } catch (Throwable t) {} }\n if (stmt != null) { try { stmt.close(); } catch (Throwable t) {} }\n DBConnection.release(dbc);\n }\n \n /* passed? */\n if (pass) {\n String e = inclWarn? \"errors/warnings\" : \"severe errors\";\n Print.logInfo(\" No \" + e + \" detected\");\n }\n return pass;\n \n } catch (ValidationNotImplementedException vnie) {\n Print.logError(\" Validation not implemented: \" + vnie.getMessage());\n } catch (DBException dbe) {\n Print.logException(\"Validating \" + utableName + \": \", dbe);\n } catch (SQLException sqe) {\n Print.logException(\"Validating \" + utableName + \": \", sqe);\n }\n \n return false;\n \n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_28()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\"), (DBSchema) null, (String) null, (String) null);\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\t\tString columnName2 = \"0123456789\";\n\t\tString columnName3 = \"An��t-1.0.txt\";\n\t\tString columnName4 = null;\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1, columnName2, columnName3, columnName4);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getCatalog(LazyTable.java:130)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}", "boolean hasFirstField();", "@Test(timeout = 4000)\n public void test039() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n try { \n DBUtil.parseResultSet(errorMessages0);\n fail(\"Expecting exception: SQLException\");\n \n } catch(SQLException e) {\n //\n // getObject\n //\n verifyException(\"org.apache.derby.vti.VTITemplate\", e);\n }\n }", "private void create_SQL_IsNull_PK(String fieldPK, String table_name, String schema_name) throws SQLException {\n String SQL = \"select \\n\" +\n \"\\tcase \\n\" +\n \"\\t\\twhen sum(difference) != sum(countAll) then 'True' else 'False' end as result \\n\" +\n \"\\t\\tfrom (\\n\" +\n \"\\t\\t\\t\\t\\tselect \\n\" +\n \"\\t\\t\\t\\t\\t\\tcount(*) as countAll,\\n\" +\n \"\\t\\t\\t\\t\\t\\tcount(*) - \\n\" +\n \"\\t\\t\\t\\t\\t\\t\\t(select count(*) as \" + fieldPK + \" from \" + schema_name + \".\" + table_name + \" where \" + fieldPK + \" = '' or \" + fieldPK + \" is null) as difference\\n\" +\n \"\\t\\t\\t\\t\\tfrom \" + schema_name + \".\" + table_name + \"\\n\" +\n \")t\";\n\n log.info(\"SQL create_SQL_IsNull_PK = \" + SQL);\n\n executesResultSet = new Connection_executes_result_set();\n\n resultSet = executesResultSet.getBeanContext(LOCATION_PATH, CONTEXT_BEAN, SQL);\n\n\n boolean status = false;\n while (resultSet.next()) {\n String result = resultSet.getString(\"result\");\n log.info(\"FK_IsNull tbl [\" + table_name + \"] & field [\" + fieldPK + \"] = \" + result);\n\n status = Boolean.parseBoolean(result);\n }\n\n Dimension dimension = new Dimension();\n\n dimension.setRule_name(StepName);\n dimension.setProcessDate(new Date());\n dimension.setTable_name(table_name);\n dimension.setDate_string(date_string);\n dimension.setSql(SQL);\n dimension.setKey_PK(fieldPK);\n dimension.setStatus(status);\n dimension.setJob_id(DimensionJobName);\n// dimension.setMonth_id(new Date().getMonth() + 1);\n dimension.setVersion_No(lastVersion + 1);\n dimensionRule3List.add(dimension);\n }", "public boolean insertResultSet(ResultSet rs) throws SQLException, KasirException{\r\n if(isInsertDBValid())\r\n return flushResultSet(rs, true);\r\n else\r\n throw new KasirException(KasirException.Tipe.DB_INVALID, this);\r\n }", "public void testOneTable() {\n\n String\tsql\t= \"SELECT AD_Table_ID, TableName FROM AD_Table WHERE IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Table|0]\", fixture.toString());\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\tif (entityType2tableName.isEmpty())\n\t\t\treturn true;\n\t\t\n\t\t// the hard way \n\t\ttry {\n\t\t\tStatement st = connection.createStatement(\n\t\t\t\t\tResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t ResultSet.CONCUR_READ_ONLY);\n\t\t\t\n\t\t\tfor (String tableName: entityType2tableName.values()) {\n\t\t\t\t//ResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\";\");\n\t\t\t\t\n\t\t\t\tResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\" LIMIT 1\");\n\t\t\t\t\n\t\t\t\tif (!set.next())\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\n\t\t} catch (SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tthrow new RuntimeException(\"Error while checking if the table is empty\",e1);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean previous() throws SQLException\n {\n return m_rs.previous();\n }", "private boolean studentTableExists() throws SQLException{\n\n String checkTablePresentQuery = \"SHOW TABLES LIKE '\" + STUDENT_TABLE_NAME + \"'\"; //Can query the database schema\n ResultSet tablesRS = ConnectDB.statement.executeQuery(checkTablePresentQuery);\n return (tablesRS.next());\n }", "public TableGenRow nextRow() {\n try {\n if(DBMacros.next(rs)) {\n return this;\n }\n } catch (Exception t) {\n dbg.ERROR(\"nextRow() Exception skipping to the next record!\");\n dbg.Caught(t);\n }\n return null;\n }", "private boolean validaInsert(Entity e) throws SQLException {\r\n stmt = conn.createStatement();\r\n String sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(0) + \"= \" + e.getCell(0).getValue();\r\n if (e.getTableName().equals(\"Contato\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(3) + \"= '\" + String.valueOf(e.getCell(3).getValue()) + \"' and \" + e.getColumnName(1) + \"= '\" + String.valueOf(e.getCell(1).getValue()) + \"';\";\r\n\r\n }\r\n if (e.getTableName().equals(\"Telefone\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(2) + \"= '\" + String.valueOf(e.getCell(2).getValue()) + \"' and \" + e.getColumnName(1) + \"= '\" + String.valueOf(e.getCell(1).getValue()) + \"' and \" + e.getColumnName(3) + \"= '\" + String.valueOf(e.getCell(3).getValue()) + \"';\";\r\n\r\n }\r\n if (e.getTableName().equals(\"Solicitacoes\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(6) + \"= '\" + String.valueOf(e.getCell(6).getValue()) + \"' and \" + e.getColumnName(7) + \"= '\" + String.valueOf(e.getCell(7).getValue()) + \"';\";\r\n\r\n }\r\n System.out.println(sql);\r\n rs = stmt.executeQuery(sql);\r\n if (rs.next()) {\r\n stmt.close();\r\n rs.close();\r\n return false;\r\n }\r\n stmt.close();\r\n rs.close();\r\n return true;\r\n\r\n }", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.prepareStatement((Connection) null, \"Expected exactly one row, found more.\", true);\n fail(\"Expecting exception: IllegalStateException\");\n \n } catch(IllegalStateException e) {\n //\n // Tried to mutate a database with read-only settings: Expected exactly one row, found more.\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public XQValue bornAgain() {\n try {\n rset.beforeFirst();\n }\n catch (SQLException e) { }\t// just try\n return new Result(rset); \n }", "private boolean tableExistsAndIsOK() throws SQLException {\n trace(\"tableExistsAndIsOK\");\n boolean result;\n Statement stmt = _connection.createStatement();\n try {\n stmt.setMaxRows(1);\n String command = \"SELECT \" + LONG_VALUE + \" FROM \" + _tableName;\n ResultSet rs = stmt.executeQuery(command);\n rs.close();\n result = true;\n } catch (SQLException e) {\n result = false;\n }\n stmt.close();\n return result;\n }", "public boolean checkIfThisHBRecordIsInTheDB()\n\t{\n\t\treturn checkIfThisRecordIsInTheDB(getWhereConditionBaseOnIdRecord());\n\t}", "@Test(timeout = 4000)\n public void test022() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n try { \n DBUtil.parseAndSimplifyResultSet(errorMessages0);\n fail(\"Expecting exception: SQLException\");\n \n } catch(SQLException e) {\n //\n // getObject\n //\n verifyException(\"org.apache.derby.vti.VTITemplate\", e);\n }\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_27()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"\"), new DBSchema(\"0123456789\", new DBCatalog(\"\", new DefaultDatabase(\"\", \"\", VersionNumber.valueOf(\"\")))), \"An��t-1.0.txt\", \"An��t-1.0.txt\");\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\t\tString columnName2 = \"0123456789\";\n\t\tString columnName3 = \"An��t-1.0.txt\";\n\t\tString columnName4 = null;\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1, columnName2, columnName3, columnName4);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.JDBCDBImporter.importColumns(JDBCDBImporter.java:430)\n\t\t// at org.databene.jdbacl.model.jdbc.JDBCDBImporter.importTableDetails(JDBCDBImporter.java:389)\n\t\t// at org.databene.jdbacl.model.jdbc.JDBCDBImporter.importTable(JDBCDBImporter.java:384)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}", "@Test(timeout = 4000)\n public void test030() throws Throwable {\n NameSpec nameSpec0 = NameSpec.NEVER;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "void checkFirstRecord(int code, int lineCount) {\n if (lineCount == 1) {\n outputError(lineCount + \" - Fatal - \" +\n \"Load file must start with a code 01 record. \" +\n \"This record is code: \" + code);\n } // if (lineCount == 1)\n }", "private void checkTableRecord(final String value) {\n final DataSource dsValidatation = DataSourceFactory.createDataSource();\n dsValidatation.addTable(AFM_TBLS);\n dsValidatation.addField(TABLE_NAME);\n dsValidatation.addRestriction(Restrictions.eq(AFM_TBLS, TABLE_NAME, value));\n if (dsValidatation.getRecords().isEmpty() && !isTableNameSelected(value)) {\n this.requiredTablesNames.add(value);\n this.isDependencyNeeded = true;\n }\n }", "@Test(timeout = 4000)\n public void test091() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String string0 = SQLUtil.typeAndName(defaultDBTable0);\n assertEquals(\"table null\", string0);\n assertNotNull(string0);\n }", "public boolean previous() throws SQLException {\n\n try {\n debugCodeCall(\"previous\");\n checkClosed();\n return relative(-1);\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_11()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\"), (DBSchema) null, (String) null, (String) null);\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = true;\n\t\tString columnName1 = \"\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getCatalog(LazyTable.java:130)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}", "public void testOneTableSynAS() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName FROM AD_Table AS t WHERE t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Table=t|0]\", fixture.toString());\n }", "FetchFirst createFetchFirst();", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n String string0 = \"+1MIm}!B_/+\";\n SQLUtil.normalize(\"+1MIm}!B_/+\", true);\n String string1 = \"call,\";\n SQLUtil.mutatesDataOrStructure(\"call,\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String string2 = \"update\";\n // Undeclared exception!\n try { \n defaultDBTable0.getColumn(\"update\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Column 'update' not found in table 'null'\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "@Test\r\n\tvoid testImportSingleRowShouldReturnFalseIfUnsuccessful() {\r\n\t\tRecordParser parser = new RecordParser();\r\n\t\tassertFalse(parser.importSingleRecord(\"This is a row of bad data. There's too much and nothing useful!\"));\r\n\t}", "@Test(timeout = 4000)\n public void test39() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\" WHERE \");\n String string0 = SQLUtil.typeAndName(defaultDBTable0);\n assertEquals(\"table WHERE \", string0);\n }", "private SimpleHashtable.TableEntry<K, V> findNextNonNullTableRowEntry() {\r\n\t\t\tcurrentRow++;\r\n\r\n\t\t\twhile (currentRow < table.length) {\r\n\t\t\t\tif (table[currentRow] != null) {\r\n\t\t\t\t\treturn table[currentRow];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcurrentRow++;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}", "@Test(timeout = 4000)\n public void test056() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[4];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"org.databene.commons.condition.CompositeCondition\", true, stringArray0);\n // Undeclared exception!\n try { \n DBUtil.containsMandatoryColumn(dBUniqueConstraint0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Column 'null' not found in table 'null'\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "@Test(timeout = 4000)\n public void test011() throws Throwable {\n NameSpec nameSpec0 = NameSpec.NEVER;\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"NestedRawReadOnlyUserTransaction\");\n // Undeclared exception!\n try { \n SQLUtil.renderCreateTable(defaultDBTable0, false, nameSpec0, (PrintWriter) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "boolean requiresRollbackAfterSqlError();", "public boolean tableHasRecords(String tableName) {\n\n int count = 0;\n\n try{\n PreparedStatement query = conn.prepareStatement(\"SELECT COUNT(id) AS 'count' FROM \" + tableName + \";\");\n ResultSet results = query.executeQuery();\n\n while (results.next()){\n count = results.getInt(\"count\");\n } \n\n if(count > 0){\n return true;\n }\n\n } catch (SQLException e){\n e.printStackTrace();\n }\n\n return false;\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_17()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\"), (DBSchema) null, (String) null, (String) null);\n\t\tString name = \"0123456789\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"0123456789\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getCatalog(LazyTable.java:130)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}", "@Test(timeout = 4000)\n public void test040() throws Throwable {\n boolean boolean0 = SQLUtil.isDDL(\"\");\n assertFalse(boolean0);\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, (String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_29()\n\t\tthrows Exception {\n\t\tDBTable table = new DefaultDBTable(\"\");\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(\"CONSTRAINT PRIMARY KEY ()\", result.toString());\n\t\tassertEquals(false, result.isNameDeterministic());\n\t\tassertEquals(\"\", result.getName());\n\t\tassertEquals(\"unique constraint\", result.getObjectType());\n\t\tassertEquals(null, result.getDoc());\n\t}", "@Test(timeout = 4000)\n public void test037() throws Throwable {\n DBUtil.checkReadOnly(\"SELECT pronae,oid FROM pg_roc WHEE \", false);\n }", "@Test(timeout = 4000)\n public void test096() throws Throwable {\n String[] stringArray0 = new String[6];\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"NestedRawReadOnlyUserTransaction\");\n DBPrimaryKeyConstraint dBPrimaryKeyConstraint0 = new DBPrimaryKeyConstraint(defaultDBTable0, \"getRowId(int)\", true, stringArray0);\n String string0 = SQLUtil.pkSpec(dBPrimaryKeyConstraint0, nameSpec0);\n assertEquals(\"CONSTRAINT getRowId(int) PRIMARY KEY (, , , , , )\", string0);\n }", "@Override\n public boolean SearchSQL() {\n\n /*\n appunto su query.next()\n inizialmente query.next è posto prima della prima riga\n alla prima chiaata si posiziona sulla prima row\n alla seconda chiamata si posiziona sulla seconda row e cosi via\n */\n\n boolean controllo = false;\n\n openConnection();\n\n String sql =\"select user,pass,vol_o_cand from pass where user='\"+userInserito+\"'\";\n ResultSet query = selectQuery(sql);\n\n try {\n\n if(query.next()){\n\n String pass = query.getString(\"pass\");\n\n if(pass.equals(passInserita)) {\n controllo = true;\n volocand = query.getString(\"vol_o_cand\");\n }\n\n }\n\n\n }catch(SQLException se){\n se.printStackTrace();\n }finally{\n closeConnection();\n }\n\n\n return controllo;\n\n }", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"\");\n String string0 = SQLUtil.ownerDotComponent(defaultDBTable0);\n assertEquals(\"\", string0);\n }", "public XQValue bornAgain() {\n try {\n rset.beforeFirst();\n }\n catch (SQLException e) { }\t// just try\n return new RawResult(rset); \n }", "public void beforeExecution(PreparedStatement stmt, StatementContext ctx) throws SQLException\n {\n }", "@Test\n public void retriveByIdTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(1);\n assertNotNull(servizio,\"Should return true if return Servizio 1\");\n }", "@Test\n public void testPreparedStatementOne() throws Throwable\n {\n assertNotNull(ds);\n Connection c = ds.getConnection();\n assertNotNull(c);\n \n Statement st = c.createStatement();\n assertNotNull(st);\n \n // Create\n st.execute(\"CREATE TABLE Employees (Employee_ID INTEGER, Name VARCHAR(30));\");\n st.execute(\"INSERT INTO Employees VALUES (1, '#1')\");\n st.execute(\"INSERT INTO Employees VALUES (2, '#2')\");\n \n // Prepared statement\n PreparedStatement pstmt = c.prepareStatement(\"SELECT * FROM Employees WHERE Employee_ID = ?\");\n assertNotNull(pstmt);\n \n pstmt.setInt(1, 1);\n \n ResultSet rs = pstmt.executeQuery();\n assertNotNull(rs);\n \n assertTrue(rs.next());\n \n // Drop\n st.execute(\"DROP TABLE Employees\");\n \n rs.close();\n pstmt.close();\n st.close();\n c.close();\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseResultRow((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public boolean fetchPrev(Transaction trans, DatasetCursor cursor,\n DBObject obj, Filter filter, boolean forUpdate)\n throws StorageException, LockConflict {\n Rowid rowid = cursor.getRowid();\n int index = rowid.getIndex();\n\n if (index == Short.MAX_VALUE)\n index = dir.getCount();\n\n while (true) {\n --index;\n\n if (index < 0 || index >= dir.getCount())\n return false;\n\n rowid.setIndex((short) index);\n\n if (_read(trans, obj, index, forUpdate, filter))\n return true;\n }\n }", "@Test(timeout = 4000)\n public void test004() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String string0 = SQLUtil.renderValue(defaultDBTable0);\n assertNull(string0);\n }", "private boolean checkTableExists(String plate){\n //there is no need to close or start connection\n //function is only used in the context of an already created connection\n \n try {\n rs = stmt.executeQuery(\"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC'\");\n \n while(rs.next()){\n if(plate.equalsIgnoreCase(rs.getString(\"TABLE_NAME\"))){\n return true;\n }\n }\n \n rs.close();\n \n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return false;\n }", "@Test\n public void testGetTabella_PreparedStatement() throws MainException, SQLException {\n System.out.println(\"getTabella\");\n LinkingDb instance = new LinkingDb(new ConfigurazioneTO(\"jdbc:hsqldb:file:database/\",\n \"ADISysData\", \"asl\", \"\"));\n instance.connect();\n PreparedStatement stmt = instance.prepareStatement(\n \"select * from infermieri\");\n ADISysTableModel result = instance.getTabella(stmt);\n assertNotNull(result);\n }", "protected void preUpdateSchema(CiDb db) throws OrmException, SQLException {\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_23()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\"), (DBSchema) null, (String) null, (String) null);\n\t\tString name = \"0123456789\";\n\t\tboolean nameDeterministic = true;\n\t\tString columnName1 = \"\";\n\t\tString columnName2 = \"0123456789\";\n\t\tString columnName3 = \"An��t-1.0.txt\";\n\t\tString columnName4 = null;\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1, columnName2, columnName3, columnName4);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getCatalog(LazyTable.java:130)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public boolean tableRequired()\n {\n return true;\n }", "private boolean init() {\n\t\tString sql = \"SELECT v FROM user WHERE k='version'\";\t// TODO right now we are care only about is table exists of not\n //init_required = true;\n\t\tif (!this.r(sql)) {\n\t\t\tsql= \"CREATE TABLE user ( k CHAR(50), v TEXT );\";\n\t\t\tthis.r(sql);\n\t\t\tsql= \"CREATE UNIQUE INDEX kindex on user (k);\";\n\t\t\tthis.r(sql);\n\t\t\tsql= \"INSERT INTO user (k,v) VALUES ('version','1'), ('login',''), ('password',''), ('remember','1');\";\n\t\t\treturn this.r(sql);\n\t\t}\n\t\treturn true;\n\t}", "public static Profil fromResultSet(ResultSet rs) throws SQLException, KasirException{\r\n return new Profil().dynFromResultSet(rs, true);\r\n }", "@Test(timeout = 4000)\n public void test059() throws Throwable {\n DBUtil.assertAllDbResourcesClosed(false);\n DBCatalog dBCatalog0 = new DBCatalog();\n // Undeclared exception!\n try { \n dBCatalog0.getTable(\"uJr'z\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Table 'uJr'z'\n //\n verifyException(\"org.databene.jdbacl.model.DBCatalog\", e);\n }\n }", "private boolean tableAlreadyExists(SQLException e) {\r\n boolean exists;\r\n if(e.getSQLState().equals(\"X0Y32\")) {\r\n exists = true;\r\n } else {\r\n exists = false;\r\n }\r\n return exists;\r\n }", "@Test(timeout = 4000)\n public void test061() throws Throwable {\n DBSchema dBSchema0 = new DBSchema(\"1?o)b59l\");\n List<DBTable> list0 = DBUtil.dependencyOrderedTables(dBSchema0);\n assertTrue(list0.isEmpty());\n }", "@Test(timeout = 4000)\n public void test109() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\" SELECT * FROM \");\n assertFalse(boolean0);\n assertNotNull(boolean0);\n }", "@Test(timeout = 4000)\n public void test025() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n // Undeclared exception!\n try { \n DBUtil.getStatement(errorMessages0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Error getting statement from result set\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test137() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[0];\n String string0 = SQLUtil.renderQuery(defaultDBTable0, stringArray0, stringArray0);\n assertEquals(\"SELECT * FROM null WHERE \", string0);\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n String[] stringArray0 = new String[0];\n SQLUtil.leftJoin(\"cxecute\", stringArray0, \"cxecute\", \"cxecute\", stringArray0);\n DBCatalog dBCatalog0 = new DBCatalog(\"cxecute\");\n DBSchema dBSchema0 = new DBSchema(\"\");\n // Undeclared exception!\n try { \n dBSchema0.getDatabase();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DBSchema\", e);\n }\n }", "public boolean checkIfThisHBRecordIsInTheDB(String sqlWhereStatement)\n\t{\n\n\t\treturn checkIfThisRecordIsInTheDB(sqlWhereStatement);\n\t}", "@Nullable\n\tprotected abstract T readCursor(ResultSet rs, int currentRow) throws SQLException;", "@Test\n public void testSelectSpecificRowThatDoesNotExist() throws SQLException {\n // Arrange\n CommitStructure commit = getSampleCommit();\n String commitID = commit.getCommitID() + \"A\";\n // Act\n mysqlDatabase.insertCommitToDatabase(commit);\n CommitStructure commits = mysqlDatabase.selectSpecificRow(commitID);\n // Assert\n assertNull(commits);\n }", "public boolean findType(int typeId){ //Checks if the typeId is registered - true if it's found\n try(Connection con = DatabaseConnector.getConnection();\n PreparedStatement ps = con.prepareStatement(TYPE_BY_ID + typeId);\n ResultSet rs = ps.executeQuery()){\n \n if(rs.isBeforeFirst()){ //If the resultset has data\n return true;\n }\n }catch(Exception e){\n System.out.println(\"Exception: \" + e);\n } \n return false;\n }", "@Test(timeout = 4000)\n public void test108() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\"select into\");\n assertNotNull(boolean0);\n assertTrue(boolean0);\n }", "@Test(timeout = 4000)\n public void test057() throws Throwable {\n DBSchema dBSchema0 = new DBSchema(\"Er\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"Er\", dBSchema0);\n String[] stringArray0 = new String[0];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"e/ \", false, stringArray0);\n boolean boolean0 = DBUtil.containsMandatoryColumn(dBUniqueConstraint0);\n assertFalse(boolean0);\n }", "public boolean hasNext() throws SQLException {\n/* 285 */ if (this.fetchedRows != null && this.fetchedRows.size() == 0) {\n/* 286 */ return false;\n/* */ }\n/* */ \n/* 289 */ if (this.owner != null && this.owner.owningStatement != null) {\n/* 290 */ int maxRows = this.owner.owningStatement.maxRows;\n/* */ \n/* 292 */ if (maxRows != -1 && this.currentPositionInEntireResult + 1 > maxRows) {\n/* 293 */ return false;\n/* */ }\n/* */ } \n/* */ \n/* 297 */ if (this.currentPositionInEntireResult != -1) {\n/* */ \n/* 299 */ if (this.currentPositionInFetchedRows < this.fetchedRows.size() - 1)\n/* 300 */ return true; \n/* 301 */ if (this.currentPositionInFetchedRows == this.fetchedRows.size() && this.lastRowFetched) {\n/* 302 */ return false;\n/* */ }\n/* */ \n/* 305 */ fetchMoreRows();\n/* */ \n/* 307 */ return (this.fetchedRows.size() > 0);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 313 */ fetchMoreRows();\n/* */ \n/* 315 */ return (this.fetchedRows.size() > 0);\n/* */ }", "public boolean checkRowDBVNode(ResultSet rs){\n\t\ttry{\n\t\t\twhile(rs.next()){\n\t\t\t\tif(rs.getString(\"id\").equals(id))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}catch(SQLException e){\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.69291705", "0.68749285", "0.685676", "0.68139315", "0.66679424", "0.6574376", "0.6359694", "0.6189364", "0.612648", "0.6073402", "0.5998289", "0.58882767", "0.57872564", "0.570905", "0.5588507", "0.55815387", "0.5543167", "0.548924", "0.5473715", "0.536849", "0.5363756", "0.5360766", "0.53484166", "0.5344629", "0.53339916", "0.52903336", "0.52820325", "0.52288496", "0.52160496", "0.5206773", "0.519142", "0.51877344", "0.5186144", "0.5182253", "0.5181152", "0.517455", "0.5165778", "0.51652104", "0.5159592", "0.5149541", "0.5148113", "0.5126865", "0.51251286", "0.5119814", "0.5116213", "0.5112686", "0.50999063", "0.50894064", "0.50826395", "0.5080509", "0.5077908", "0.50769144", "0.5075616", "0.5070659", "0.50672245", "0.5065276", "0.5064677", "0.5062323", "0.50592405", "0.50588936", "0.5050826", "0.50486714", "0.5045448", "0.5035166", "0.50337887", "0.50231826", "0.5022866", "0.5014704", "0.50142485", "0.50025284", "0.50023526", "0.5002276", "0.5000914", "0.49972376", "0.49964365", "0.49888036", "0.49836865", "0.49831203", "0.49831092", "0.49829698", "0.49819848", "0.49772418", "0.49714032", "0.49647957", "0.49637878", "0.4963022", "0.49617893", "0.4958213", "0.49574134", "0.49518558", "0.49409854", "0.49318618", "0.4930461", "0.49201542", "0.49195188", "0.49186498", "0.49185306", "0.4913524", "0.4911078", "0.4905287" ]
0.5462786
19
/ never ret null throws KasirException(BAD_RECORD, tableName) if the resulting Profil.isDBValid = false
public static Profil fromResultSet(ResultSet rs) throws SQLException, KasirException{ return new Profil().dynFromResultSet(rs, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(timeout = 4000)\n public void test059() throws Throwable {\n DBUtil.assertAllDbResourcesClosed(false);\n DBCatalog dBCatalog0 = new DBCatalog();\n // Undeclared exception!\n try { \n dBCatalog0.getTable(\"uJr'z\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Table 'uJr'z'\n //\n verifyException(\"org.databene.jdbacl.model.DBCatalog\", e);\n }\n }", "@Test(timeout = 4000)\n public void test46() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n PipedReader pipedReader0 = new PipedReader();\n Boolean boolean0 = Boolean.FALSE;\n SQLUtil.isQuery(\"selectntowrong c|ck\");\n Boolean.valueOf(true);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"selectntowrong c|ck\");\n // Undeclared exception!\n try { \n defaultDBTable0.getUniqueConstraint(\"^h=wZ>:9%}Pj6(#%M\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "private boolean checkInputTableName(AccessInputMeta meta){\n if (meta.getTableName()==null || meta.getTableName().length()<1)\n {\n MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );\n mb.setMessage(BaseMessages.getString(PKG, \"AccessInputDialog.TableMissing.DialogMessage\"));\n mb.setText(BaseMessages.getString(PKG, \"System.Dialog.Error.Title\"));\n mb.open(); \n\n return false;\n }\n else\n {\n \treturn true;\n }\n\t}", "public boolean validateTable(boolean inclWarn)\n {\n // This method is intended to be executed from the command line\n String utableName = this.getUntranslatedTableName();\n Print.logInfo(\"\");\n Print.logInfo(\"Validating \" + utableName + \":\");\n\n boolean pass = true;\n try {\n\n /* validation constructor */\n MethodAction valConst = null;\n try {\n valConst = new MethodAction(this.getRecordClass(), ResultSet.class, ValidationLog.class);\n } catch (Throwable t) { // NoSuchMethodException, ...\n throw new ValidationNotImplementedException(\"Missing validation Constructor\");\n }\n \n /* 'select' */\n // DBSelect: SELECT * FROM table\n DBConnection dbc = null;\n Statement stmt = null;\n ResultSet rs = null;\n try {\n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this);\n dbc = DBConnection.getDBConnection_read();\n stmt = dbc.execute(dsel.toString(), true); // needs to be row-by-row\n rs = stmt.getResultSet();\n while (rs.next()) {\n ValidationLog failLog = new ValidationLog(utableName, inclWarn);\n try {\n valConst.invoke(rs, failLog);\n if (failLog.hasErrors()) {\n Print.logError(failLog.toString());\n pass = false; \n } else\n if (inclWarn && !failLog.hasHeader()) {\n throw new ValidationNotImplementedException(\"No log header\");\n }\n } catch (Throwable t) { // InvocationTargetException, ValidationNotImplementedException, ...\n Print.logException(\"Validating \" + utableName + \": \", t);\n pass = false;\n }\n }\n } finally {\n if (rs != null) { try { rs.close(); } catch (Throwable t) {} }\n if (stmt != null) { try { stmt.close(); } catch (Throwable t) {} }\n DBConnection.release(dbc);\n }\n \n /* passed? */\n if (pass) {\n String e = inclWarn? \"errors/warnings\" : \"severe errors\";\n Print.logInfo(\" No \" + e + \" detected\");\n }\n return pass;\n \n } catch (ValidationNotImplementedException vnie) {\n Print.logError(\" Validation not implemented: \" + vnie.getMessage());\n } catch (DBException dbe) {\n Print.logException(\"Validating \" + utableName + \": \", dbe);\n } catch (SQLException sqe) {\n Print.logException(\"Validating \" + utableName + \": \", sqe);\n }\n \n return false;\n \n }", "abstract boolean tableExist() throws SQLException;", "public static boolean checkOrCreateTable(jsqlite.Database db, String tableName){\n\t\t\n\t\tif (db != null){\n\t\t\t\n\t String query = \"SELECT name FROM sqlite_master WHERE type='table' AND name='\"+tableName+\"'\";\n\n\t boolean found = false;\n\t try {\n\t Stmt stmt = db.prepare(query);\n\t if( stmt.step() ) {\n\t String nomeStr = stmt.column_string(0);\n\t found = true;\n\t Log.v(\"SPATIALITE_UTILS\", \"Found table: \"+nomeStr);\n\t }\n\t stmt.close();\n\t } catch (Exception e) {\n\t Log.e(\"SPATIALITE_UTILS\", Log.getStackTraceString(e));\n\t return false;\n\t }\n\n\t\t\tif(found){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t// Table not found creating\n Log.v(\"SPATIALITE_UTILS\", \"Table \"+tableName+\" not found, creating..\");\n\t\t\t\t\n if(tableName.equalsIgnoreCase(\"punti_accumulo_data\")){\n\n \tString create_stmt = \"CREATE TABLE 'punti_accumulo_data' (\" +\n \t\t\t\"'PK_UID' INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n \t\t\t\"'ORIGIN_ID' TEXT, \" +\n \t\t\t\"'DATA_SCHEDA' TEXT, \" +\n \t\t\t\"'DATA_AGG' TEXT, \" +\n \t\t\t\"'NOME_RILEVATORE' TEXT, \" +\n \t\t\t\"'COGNOME_RILEVATORE' TEXT, \" +\n \t\t\t\"'ENTE_RILEVATORE' TEXT, \" +\n \t\t\t\"'TIPOLOGIA_SEGNALAZIONE' TEXT, \" +\n \t\t\t\"'PROVENIENZA_SEGNALAZIONE' TEXT, \" +\n \t\t\t\"'CODICE_DISCARICA' TEXT, \" +\n \t\t\t\"'TIPOLOGIA_RIFIUTO' TEXT, \" +\n \t\t\t\"'COMUNE' TEXT, \" +\n \t\t\t\"'LOCALITA' TEXT, \" +\n \t\t\t\"'INDIRIZZO' TEXT, \" +\n \t\t\t\"'CIVICO' TEXT, \" +\n \t\t\t\"'PRESA_IN_CARICO' TEXT, \" +\n \t\t\t\"'EMAIL' TEXT, \" +\n \t\t\t\"'RIMOZIONE' TEXT, \" +\n \t\t\t\"'SEQUESTRO' TEXT, \" +\n \t\t\t\"'RESPONSABILE_ABBANDONO' TEXT, \" +\n \t\t\t\"'QUANTITA_PRESUNTA' NUMERIC);\";\n\n \tString add_geom_stmt = \"SELECT AddGeometryColumn('punti_accumulo_data', 'GEOMETRY', 4326, 'POINT', 'XY');\";\n \tString create_idx_stmt = \"SELECT CreateSpatialIndex('punti_accumulo_data', 'GEOMETRY');\";\n \n \t// TODO: check if all statements are complete\n \t\n \ttry { \t\n \t\tStmt stmt01 = db.prepare(create_stmt);\n\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t\t//TODO This will never happen, CREATE statements return empty results\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Table Created\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// TODO: Check if created, fail otherwise\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01 = db.prepare(add_geom_stmt);\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Geometry Column Added \"+stmt01.column_string(0));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01 = db.prepare(create_idx_stmt);\n\t\t\t\t\t\tif (stmt01.step()) {\n\t\t\t\t\t\t Log.v(\"UTILS\", \"Index Created\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tstmt01.close();\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (jsqlite.Exception e) {\n\t\t\t\t\t\tLog.e(\"UTILS\", Log.getStackTraceString(e));\n\t\t\t\t\t}\n \treturn true;\n }\n\t\t\t}\n\t\t}else{\n\t\t\tLog.w(\"UTILS\", \"No valid database received, aborting..\");\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "@Test(timeout = 4000)\n public void test004() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String string0 = SQLUtil.renderValue(defaultDBTable0);\n assertNull(string0);\n }", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n String string0 = \"+1MIm}!B_/+\";\n SQLUtil.normalize(\"+1MIm}!B_/+\", true);\n String string1 = \"call,\";\n SQLUtil.mutatesDataOrStructure(\"call,\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String string2 = \"update\";\n // Undeclared exception!\n try { \n defaultDBTable0.getColumn(\"update\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Column 'update' not found in table 'null'\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "public DatabaseTable getDatabaseInstance(String tableName) {\n\t\tDatabaseTable dTb = annotatedTableSchema.get(tableName);\n\n\t\tif (dTb == null) {\n\t\t\ttry {\n\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\"This table doesn't appear in the annotation list\"\n\t\t\t\t\t\t\t\t+ tableName);\n\t\t\t} catch (RuntimeException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(RuntimeExceptionType.UNKNOWTABLENAME);\n\t\t\t}\n\t\t}\n\t\treturn dTb;\n\t}", "public boolean checkTable(int layerId)\n\n {\n boolean isAvailable = false;\n try {\n\n //This statement will fetch all tables available in database.\n\n ResultSet rs1 = conn.getMetaData().getTables(null, null, null, null);\n while (rs1.next()) {\n\n String ld = rs1.getString(\"TABLE_NAME\");\n\n //This statement will extract digits from table names.\n if(!(ld.equals(\"PurgeTable\")||ld.equals(\"UserToCertMap\"))){\n String intValue = ld.replaceAll(\"[^0-9]\", \"\");\n int v;\n if (intValue != null) {\n v = Integer.parseInt(intValue);\n if (v == layerId) {\n isAvailable = true;\n }\n }\n }\n /* String intValue = ld.replaceAll(\"[^0-9]\", \"\");\n int v;\n if (intValue != null) {\n v = Integer.parseInt(intValue);\n if (v == layerId) {\n isAvailable = true;\n }\n }\n //This statement will compare layerid with digits of table names.*/\n\n }\n rs1.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n return isAvailable;\n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, (String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test011() throws Throwable {\n NameSpec nameSpec0 = NameSpec.NEVER;\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"NestedRawReadOnlyUserTransaction\");\n // Undeclared exception!\n try { \n SQLUtil.renderCreateTable(defaultDBTable0, false, nameSpec0, (PrintWriter) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private boolean checkTableExists(String plate){\n //there is no need to close or start connection\n //function is only used in the context of an already created connection\n \n try {\n rs = stmt.executeQuery(\"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC'\");\n \n while(rs.next()){\n if(plate.equalsIgnoreCase(rs.getString(\"TABLE_NAME\"))){\n return true;\n }\n }\n \n rs.close();\n \n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return false;\n }", "private void checkTableRecord(final String value) {\n final DataSource dsValidatation = DataSourceFactory.createDataSource();\n dsValidatation.addTable(AFM_TBLS);\n dsValidatation.addField(TABLE_NAME);\n dsValidatation.addRestriction(Restrictions.eq(AFM_TBLS, TABLE_NAME, value));\n if (dsValidatation.getRecords().isEmpty() && !isTableNameSelected(value)) {\n this.requiredTablesNames.add(value);\n this.isDependencyNeeded = true;\n }\n }", "@Override\r\n\tprotected boolean isValidTable(final ResultSet resultSet) throws SQLException {\r\n\t\treturn !resultSet.getString(3).contains(\"BIN$\");\r\n\t}", "@Test(timeout = 4000)\n public void test091() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String string0 = SQLUtil.typeAndName(defaultDBTable0);\n assertEquals(\"table null\", string0);\n assertNotNull(string0);\n }", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test71() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n FileSystemHandling.shouldThrowIOException((EvoSuiteFile) null);\n TableContainer tableContainer0 = new TableContainer(\"-KwE,kZ\");\n DefaultDBTable defaultDBTable1 = new DefaultDBTable();\n DBDataType.getInstance((-1717986917), \"%~-1t&Ncqx{&'OP~@\");\n tableContainer0.getSchema();\n Integer integer0 = RawTransaction.SAVEPOINT_ROLLBACK;\n Integer integer1 = RawTransaction.LOCK_ESCALATE;\n SQLUtil.removeComments(\"/**/\");\n System.setCurrentTimeMillis(1722L);\n // Undeclared exception!\n try { \n SQLUtil.normalize((String) null, false);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.io.StringReader\", e);\n }\n }", "public synchronized Result<? extends Record> solve(final String tableName)\n throws ModelException {\n return solve(Set.of(tableName)).get(tableName);\n }", "@Test(timeout = 4000)\n public void test022() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n try { \n DBUtil.parseAndSimplifyResultSet(errorMessages0);\n fail(\"Expecting exception: SQLException\");\n \n } catch(SQLException e) {\n //\n // getObject\n //\n verifyException(\"org.apache.derby.vti.VTITemplate\", e);\n }\n }", "@Override\n\tpublic void recovery() {\n\t\tRecordTable recordTable = new RecordTable(); \n\t\tjava.util.List<FileRecordInfoModel> lst = null;\n\t\ttry {\n\t\t\tlst = recordTable.findAllRows();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfor(FileRecordInfoModel model : lst)\n\t\t\t_recordSingle.addParam(model,false);\n\t\t\t// 读取配置,看是否需要扫描文件。--以后加\n\t}", "@Test(timeout = 4000)\n public void test039() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n try { \n DBUtil.parseResultSet(errorMessages0);\n fail(\"Expecting exception: SQLException\");\n \n } catch(SQLException e) {\n //\n // getObject\n //\n verifyException(\"org.apache.derby.vti.VTITemplate\", e);\n }\n }", "@Test(timeout = 4000)\n public void test37() throws Throwable {\n String string0 = null;\n Character character0 = new Character('G');\n SQLUtil.renderValue(character0);\n String string1 = \"\";\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n String string2 = \"7,;h@u(x3;.o)$2Y+\";\n DBCatalog dBCatalog0 = new DBCatalog(\"'G'\");\n String string3 = \"XSDAB.S\";\n // Undeclared exception!\n try { \n dBCatalog0.getTable(\"XSDAB.S\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Table 'XSDAB.S'\n //\n verifyException(\"org.databene.jdbacl.model.DBCatalog\", e);\n }\n }", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnListWithTableName(\"pw?(g[&h!X$;C/\", (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"\");\n String string0 = SQLUtil.ownerDotComponent(defaultDBTable0);\n assertEquals(\"\", string0);\n }", "private boolean tableExistsAndIsOK() throws SQLException {\n trace(\"tableExistsAndIsOK\");\n boolean result;\n Statement stmt = _connection.createStatement();\n try {\n stmt.setMaxRows(1);\n String command = \"SELECT \" + LONG_VALUE + \" FROM \" + _tableName;\n ResultSet rs = stmt.executeQuery(command);\n rs.close();\n result = true;\n } catch (SQLException e) {\n result = false;\n }\n stmt.close();\n return result;\n }", "public static boolean wwdChk4Table(Connection conTst) throws SQLException {\n boolean chk = true;\n boolean doCreate = false;\n try {\n Statement s = conTst.createStatement();\n s.execute(\"update WISH_LIST set ENTRY_DATE = CURRENT_TIMESTAMP, WISH_ITEM = 'TEST ENTRY' where 1=3\");\n } catch (SQLException sqle) {\n String theError = (sqle).getSQLState();\n // System.out.println(\" Utils GOT: \" + theError);\n /** If table exists will get - WARNING 02000: No row was found **/\n if (theError.equals(\"42X05\")) // Table does not exist\n {\n return false;\n } else if (theError.equals(\"42X14\") || theError.equals(\"42821\")) {\n System.out.println(\"WwdChk4Table: Incorrect table definition. Drop table WISH_LIST and rerun this program\");\n throw sqle;\n } else {\n System.out.println(\"WwdChk4Table: Unhandled SQLException\");\n throw sqle;\n }\n }\n // System.out.println(\"Just got the warning - table exists OK \");\n return true;\n }", "@Test\n public void reading()\n throws FileNotFoundException, IOException, CorruptedTableException\n {\n final Database database =\n new Database(new File(\"src/test/resources/\" + versionDirectory + \"/rndtrip\"), version);\n final Set<String> tableNames = database.getTableNames();\n\n assertEquals(2,\n tableNames.size());\n assertTrue(\"TABLE1 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE1.DBF\"));\n assertTrue(\"TABLE2 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE2.DBF\"));\n\n final Table t1 = database.getTable(\"TABLE1.DBF\");\n\n try\n {\n t1.open(IfNonExistent.ERROR);\n\n assertEquals(\"Table name incorrect\",\n \"TABLE1.DBF\",\n t1.getName());\n assertEquals(\"Last modified date incorrect\",\n Util.createDate(2009, Calendar.APRIL, 1),\n t1.getLastModifiedDate());\n\n final List<Field> fields = t1.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 3);\n\n final Field stringField = nameFieldMap.get(\"STRFIELD\");\n assertEquals(Type.CHARACTER,\n stringField.getType());\n assertEquals(stringField.getLength(),\n 50);\n\n final Field logicField = nameFieldMap.get(\"LOGICFIELD\");\n assertEquals(Type.LOGICAL,\n logicField.getType());\n assertEquals(logicField.getLength(),\n 1);\n\n final Field dateField = nameFieldMap.get(\"DATEFIELD\");\n assertEquals(Type.DATE,\n dateField.getType());\n assertEquals(8,\n dateField.getLength());\n\n final Field floatField = nameFieldMap.get(\"FLOATFIELD\");\n assertEquals(Type.NUMBER,\n floatField.getType());\n assertEquals(10,\n floatField.getLength());\n\n final List<Record> records = UnitTestUtil.createSortedRecordList(t1.recordIterator(),\n \"ID\");\n final Record r0 = records.get(0);\n\n assertEquals(1,\n r0.getNumberValue(\"ID\"));\n assertEquals(\"String data 01\",\n r0.getStringValue(\"STRFIELD\").trim());\n assertEquals(true,\n r0.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(Util.createDate(1909, Calendar.MARCH, 18),\n r0.getDateValue(\"DATEFIELD\"));\n assertEquals(1234.56,\n r0.getNumberValue(\"FLOATFIELD\"));\n\n final Record r1 = records.get(1);\n\n assertEquals(2,\n r1.getNumberValue(\"ID\"));\n assertEquals(\"String data 02\",\n r1.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r1.getDateValue(\"DATEFIELD\"));\n assertEquals(-23.45,\n r1.getNumberValue(\"FLOATFIELD\"));\n\n final Record r2 = records.get(2);\n\n assertEquals(3,\n r2.getNumberValue(\"ID\"));\n assertEquals(\"\",\n r2.getStringValue(\"STRFIELD\").trim());\n assertEquals(null,\n r2.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(null,\n r2.getDateValue(\"DATEFIELD\"));\n assertEquals(null,\n r2.getNumberValue(\"FLOATFIELD\"));\n\n final Record r3 = records.get(3);\n\n assertEquals(4,\n r3.getNumberValue(\"ID\"));\n assertEquals(\"Full5678901234567890123456789012345678901234567890\",\n r3.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r3.getDateValue(\"DATEFIELD\"));\n assertEquals(-0.30,\n r3.getNumberValue(\"FLOATFIELD\"));\n }\n finally\n {\n t1.close();\n }\n\n final Table t2 = database.getTable(\"TABLE2.DBF\");\n\n try\n {\n t2.open(IfNonExistent.ERROR);\n\n final List<Field> fields = t2.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID2\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 4);\n\n final Field stringField = nameFieldMap.get(\"MEMOFIELD\");\n assertEquals(Type.MEMO,\n stringField.getType());\n assertEquals(10,\n stringField.getLength());\n\n final Iterator<Record> recordIterator = t2.recordIterator();\n final Record r = recordIterator.next();\n\n String declarationOfIndependence = \"\";\n\n declarationOfIndependence += \"When in the Course of human events it becomes necessary for one people \";\n declarationOfIndependence += \"to dissolve the political bands which have connected them with another and \";\n declarationOfIndependence += \"to assume among the powers of the earth, the separate and equal station to \";\n declarationOfIndependence += \"which the Laws of Nature and of Nature's God entitle them, a decent respect \";\n declarationOfIndependence += \"to the opinions of mankind requires that they should declare the causes which \";\n declarationOfIndependence += \"impel them to the separation.\";\n declarationOfIndependence += \"\\r\\n\\r\\n\";\n declarationOfIndependence += \"We hold these truths to be self-evident, that all men are created equal, \";\n declarationOfIndependence += \"that they are endowed by their Creator with certain unalienable Rights, \";\n declarationOfIndependence += \"that among these are Life, Liberty and the persuit of Happiness.\";\n\n assertEquals(1,\n r.getNumberValue(\"ID2\"));\n assertEquals(declarationOfIndependence,\n r.getStringValue(\"MEMOFIELD\"));\n }\n finally\n {\n t2.close();\n }\n }", "private boolean inDatabase() {\r\n \t\treturn inDatabase(0, null);\r\n \t}", "default boolean checkDbObj(Object object) {\n return false;\n }", "@Test(timeout = 4000)\n public void test68() throws Throwable {\n PipedReader pipedReader0 = new PipedReader();\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(pipedReader0);\n streamTokenizer0.nval = 713.6331870209585;\n SQLUtil.renderNumber(streamTokenizer0);\n SQLUtil.normalize(\"lhXRl\", true);\n Random.setNextRandom((-4));\n String string0 = null;\n DBSchema dBSchema0 = new DBSchema((String) null);\n SQLUtil.typeAndName(dBSchema0);\n String string1 = \"%~-1t&Ncqx{&'OP~@\";\n TableContainer tableContainer0 = new TableContainer(\"^jnE\");\n tableContainer0.getSchema();\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"%~-1t&Ncqx{&'OP~@\", (DBSchema) null);\n String[] stringArray0 = new String[2];\n stringArray0[0] = null;\n stringArray0[1] = \"713.6331870209585\";\n DBPrimaryKeyConstraint dBPrimaryKeyConstraint0 = new DBPrimaryKeyConstraint(defaultDBTable0, (String) null, true, stringArray0);\n defaultDBTable0.setPrimaryKey(dBPrimaryKeyConstraint0);\n SQLUtil.typeAndName(dBPrimaryKeyConstraint0);\n // Undeclared exception!\n try { \n DBDataType.getInstance((-1717986917), (String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DBDataType\", e);\n }\n }", "@Test(timeout = 4000)\n public void test032() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n try { \n DBUtil.currentLine(errorMessages0);\n fail(\"Expecting exception: SQLException\");\n \n } catch(SQLException e) {\n //\n // getObject\n //\n verifyException(\"org.apache.derby.vti.VTITemplate\", e);\n }\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n String[] stringArray0 = new String[0];\n SQLUtil.leftJoin(\"cxecute\", stringArray0, \"cxecute\", \"cxecute\", stringArray0);\n DBCatalog dBCatalog0 = new DBCatalog(\"cxecute\");\n DBSchema dBSchema0 = new DBSchema(\"\");\n // Undeclared exception!\n try { \n dBSchema0.getDatabase();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DBSchema\", e);\n }\n }", "public Profil dynFromResultSet(ResultSet rs, boolean onCallingObj) throws SQLException, KasirException{\r\n assert !rs.isBeforeFirst() : \"rs.isBeforeFirst = true\";\r\n \r\n Profil profil = onCallingObj? this : new Profil();\r\n \r\n profil.noInduk = rs.getString(noIndukColName);\r\n profil.currentLevel = Level.fromResultSet(rs, currentLevelColName);\r\n profil.biodata = Biodata.fromResultSet(rs);\r\n profil.tanggalMasuk = Kalender.fromResultSet(rs, tanggalMasukColName);\r\n profil.tanggalLulus = Kalender.fromResultSet(rs, tanggalLulusColName);\r\n String tmpGelombang = rs.getString(gelombangColName);\r\n if(tmpGelombang != null){\r\n if(tmpGelombang.equalsIgnoreCase(\"GELOMBANG_1\")){\r\n profil.gelombang = Gelombang.GELOMBANG_1;\r\n }else if(tmpGelombang.equalsIgnoreCase(\"GELOMBANG_2\")){\r\n profil.gelombang = Gelombang.GELOMBANG_2;\r\n }\r\n }\r\n profil.totalIuran = rs.getFloat(totalIuranColName);\r\n String tmpStatusPendaftaran = rs.getString(statusPendaftaranColName);\r\n if(tmpStatusPendaftaran != null){\r\n if(tmpStatusPendaftaran.equalsIgnoreCase(\"DAFTAR\")){\r\n profil.statusPendaftaran = StatusPendaftaran.DAFTAR;\r\n }else if(tmpStatusPendaftaran.equalsIgnoreCase(\"PROSES\")){\r\n profil.statusPendaftaran = StatusPendaftaran.PROSES;\r\n }else if(tmpStatusPendaftaran.equalsIgnoreCase(\"LUNAS\")){\r\n profil.statusPendaftaran = StatusPendaftaran.LUNAS;\r\n }else if (tmpStatusPendaftaran.equalsIgnoreCase(\"BATAL\")){\r\n profil.statusPendaftaran = StatusPendaftaran.BATAL;\r\n }\r\n }\r\n profil.lastUpdateDate = Kalender.fromResultSet(rs, lastUpdateDateColName);\r\n if(profil.isDBValid())\r\n return profil;\r\n else\r\n throw new KasirException(KasirException.Tipe.BAD_RECORD, tableName);\r\n }", "private boolean filterTable(Map.Entry<CorfuStoreMetadata.TableName,\n CorfuRecord<CorfuStoreMetadata.TableDescriptors, CorfuStoreMetadata.TableMetadata>> table) {\n return (namespace == null || table.getKey().getNamespace().equals(namespace)) &&\n (!taggedTables || table.getValue().getMetadata().getTableOptions().getRequiresBackupSupport());\n }", "@Test(timeout = 4000)\n public void test020() throws Throwable {\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n // Undeclared exception!\n try { \n SQLUtil.renderCreateTable((DBTable) null, false, nameSpec0, (PrintWriter) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n public void testCaja() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM caja\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table caja exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'caja' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "@Test(timeout = 4000)\n public void test030() throws Throwable {\n NameSpec nameSpec0 = NameSpec.NEVER;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private void checkIfIsAValidClass(IDatabaseClass annotationClass){\n if (annotationClass == null || annotationClass.tableName() == \"\") {\n throw new CustomException(\"No table name found in your class declaration!\");\n }\n }", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n PipedReader pipedReader0 = new PipedReader(pipedWriter0);\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(pipedReader0);\n DBCatalog dBCatalog0 = new DBCatalog();\n SQLUtil.ownerDotComponent(dBCatalog0);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n MockFileOutputStream mockFileOutputStream0 = new MockFileOutputStream(\"null\", true);\n // Undeclared exception!\n try { \n DBDataType.getInstance((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DBDataType\", e);\n }\n }", "private boolean studentTableExists() throws SQLException{\n\n String checkTablePresentQuery = \"SHOW TABLES LIKE '\" + STUDENT_TABLE_NAME + \"'\"; //Can query the database schema\n ResultSet tablesRS = ConnectDB.statement.executeQuery(checkTablePresentQuery);\n return (tablesRS.next());\n }", "public String getDbTable() {return dbTable;}", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseResultRow((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Override\n\tpublic void checkTableVersion() {\n\n\t}", "public String readTable(String tableName) {\n\t\tif (tables.containsKey(tableName)) {\n\t\t\treturn tables.get(tableName).toString();\n\t\t}\n\t\tSystem.out.println(\"Error: The table \" + tableName + \" does not exist.\");\n\t\tthrow new NullPointerException();\n\t}", "private void checkDatabaseStructure(DatabaseUpdateType update) {\n }", "@Test(timeout = 4000)\n public void test019() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseResultSet((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public boolean supportsTableCheck() {\n \t\treturn true;\n \t}", "@Test(timeout = 4000)\n public void test041() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.isDDL((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public static void test()\n\t{\n\t Environment myDbEnvironment = null;\n\t Database myDatabase = null;\n\n\t /* OPENING DB */\n\n\t // Open Database Environment or if not, create one.\n\t EnvironmentConfig envConfig = new EnvironmentConfig();\n\t envConfig.setAllowCreate(true);\n\t myDbEnvironment = new Environment(new File(\"db/\"), envConfig);\n\n\t // Open Database or if not, create one.\n\t DatabaseConfig dbConfig = new DatabaseConfig();\n\t dbConfig.setAllowCreate(true);\n\t dbConfig.setSortedDuplicates(true);\n\t myDatabase = myDbEnvironment.openDatabase(null, \"schema\", dbConfig);\n\n\t Cursor cursor = null;\n\t /* GET <K,V > FROM DB */\n\t DatabaseEntry foundKey = new DatabaseEntry();\n\t DatabaseEntry foundData = new DatabaseEntry();\n\n\t cursor = myDatabase.openCursor(null, null);\n\t cursor.getFirst(foundKey, foundData, LockMode.DEFAULT);\n\n\t do {\n\t try {\n\t String keyString = new String(foundKey.getData(), \"UTF-8\");\n\t String dataString = new String(foundData.getData(), \"UTF-8\");\n\t System.out.println(\"<\" + keyString + \", \" + dataString + \">\");\n\t } catch (UnsupportedEncodingException e) {\n\t e.printStackTrace();\n\t }\n\t } while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS);\n\t if (cursor != null) cursor.close();\n\t System.out.println(\"-----\");\n\t \n\t if (myDatabase != null) myDatabase.close();\n\t if (myDbEnvironment != null) myDbEnvironment.close();\n\t}", "public void testOneTable() {\n\n String\tsql\t= \"SELECT AD_Table_ID, TableName FROM AD_Table WHERE IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Table|0]\", fixture.toString());\n }", "@Test(timeout = 4000)\n public void test023() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseAndSimplifyResultSet((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test025() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n // Undeclared exception!\n try { \n DBUtil.getStatement(errorMessages0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Error getting statement from result set\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test057() throws Throwable {\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n File file0 = MockFile.createTempFile(\"W8!w^xpz~\", \" WHERE \");\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);\n // Undeclared exception!\n try { \n SQLUtil.renderCreateTable((DBTable) null, true, nameSpec0, mockPrintWriter0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public boolean isDBValid(){\r\n return noInduk != null && !noInduk.isEmpty();\r\n }", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n DBSchema dBSchema0 = new DBSchema(\"create table\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"_2W8l71V=lzq~*\", dBSchema0);\n String[] stringArray0 = new String[8];\n Object[] objectArray0 = new Object[6];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, stringArray0, objectArray0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 6\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public boolean checkDbStructure(){\n\t\tboolean isStructureOk = false;\n\t\t\n\t\ttry {\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Description, Version from \" + mDbName + \".\" + TABLE_AREA);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Area_ID, Route_ID from \" + mDbName + \".\" + TABLE_AREA_HAS_ROUTES);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Ticket_ID, Name, StartName, EndName from \" + mDbName + \".\" + TABLE_ROUTE);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Route_ID, Station_ID, Position from \" + mDbName + \".\" + TABLE_ROUTE_HAS_STATIONS);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Abbreviation, Latitude, Longitude from \" + mDbName + \".\" + TABLE_STATION);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Icon, Is_Superior from \" + mDbName + \".\" + TABLE_TICKET);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tisStructureOk = true;\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t\tisStructureOk = false;\n\t\t}\n\t\t\n\t\treturn isStructureOk;\n\t}", "@Test(timeout = 4000)\n public void test044() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.isDDL((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(timeout = 4000)\n public void test038() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.executeUpdate(\"--DAN-438-tmp\", (Connection) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public 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 }", "@Test(timeout = 4000)\n public void test048() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.getStatement((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"O\\\"6T\");\n File file0 = MockFile.createTempFile(\"<*kYz\", \"BLOB\");\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertNull(defaultDBTable0.getDoc());\n }", "public org.apache.spark.sql.SchemaRDD table (java.lang.String tableName) { throw new RuntimeException(); }", "private boolean validateId(String tableId) throws IOException {\n try {\n Asset asset = engine.assets().get(tableId).execute();\n return \"table\".equalsIgnoreCase(asset.getType());\n } catch (GoogleJsonResponseException ex) {\n // A \"400 Bad Request\" is thrown when the asset ID is missing or invalid\n return false;\n }\n }", "@Test(timeout = 4000)\n public void test077() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n try { \n DBUtil.format(errorMessages0);\n fail(\"Expecting exception: SQLException\");\n \n } catch(SQLException e) {\n //\n // getObject\n //\n verifyException(\"org.apache.derby.vti.VTITemplate\", e);\n }\n }", "@Test(timeout = 4000)\n public void test056() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[4];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"org.databene.commons.condition.CompositeCondition\", true, stringArray0);\n // Undeclared exception!\n try { \n DBUtil.containsMandatoryColumn(dBUniqueConstraint0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Column 'null' not found in table 'null'\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "public boolean updateInformationSchemaTable(){\n\t\tSchema currentSchema = Schema.getSchemaInstance();\n\t\tString currentSchemaName = currentSchema.getCurrentSchema();\n\t\tboolean isFound = false;\n\t\ttry {\n\t\t\tRandomAccessFile tablesTableFile = new RandomAccessFile(\"information_schema.table.tbl\", \"rw\");\n\n\t\t\t//Searching to see if the information schema is present or not\n\t\t\twhile(tablesTableFile.getFilePointer() < tablesTableFile.length()){\n\t\t\t\tString readSchemaName = \"\";\n\t\t\t\tbyte varcharLength = tablesTableFile.readByte();\n\t\t\t\tfor(int j = 0; j < varcharLength; j++)\n\t\t\t\t\treadSchemaName += (char)tablesTableFile.readByte();\n\n\t\t\t\tif(readSchemaName.equals(currentSchemaName)){\n\t\t\t\t\tString readTableName = \"\";\n\t\t\t\t\tbyte varcharTableLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < varcharTableLength; j++)\n\t\t\t\t\t\treadTableName += (char)tablesTableFile.readByte();\n\n\t\t\t\t\tif(readTableName.equals(tableName)){\n\t\t\t\t\t\tisFound = true;\n\t\t\t\t\t\tSystem.out.println(\"Table '\" + tableName + \"' already exits...\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t} else {\n\t\t\t\t\tbyte traverseLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < traverseLength; j++)\n\t\t\t\t\t\ttablesTableFile.readByte();\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\tif(!isFound){\n\t\t\t\t//Traversing to the end of file\n\t\t\t\ttablesTableFile.seek(tablesTableFile.length());\n\t\t\t\ttablesTableFile.writeByte(currentSchemaName.length()); // TABLE_SCHEMA\n\t\t\t\ttablesTableFile.writeBytes(currentSchemaName);\n\t\t\t\ttablesTableFile.writeByte(tableName.length()); // TABLE_NAME\n\t\t\t\ttablesTableFile.writeBytes(tableName);\n\t\t\t\ttablesTableFile.writeLong(0); // TABLE_ROWS\n\t\t\t}\n\n\t\t\ttablesTableFile.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}\t\n\t\treturn isFound;\n\t}", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnListWithTableName((String) null, (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void setDbTable(String v) {this.dbTable = v;}", "@Test(timeout = 4000)\n public void test089() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"exec\");\n String string0 = SQLUtil.typeAndName(defaultDBTable0);\n assertEquals(\"table exec\", string0);\n }", "private void getDbTables() throws LdvTableException, SQLException, ViewConfigException\n {\n if (db == null)\n {\n ViewerConfig vc = new ViewerConfig();\n db = vc.getDb();\n if (db == null)\n {\n throw new LdvTableException(\"Can't connect to LigoDV-web database\");\n }\n }\n if (chanTbl == null)\n {\n chanTbl = new ChannelTable(db);\n }\n }", "@VisibleForTesting\n protected String getFullTableName(String stageName) {\n String fullTableName = stageToFullTableNameMap.get(stageName);\n\n if (fullTableName == null) {\n throw new SQLEngineException(String.format(\"Unable to determine full table name for stage '%s'\", stageName));\n }\n\n return fullTableName;\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n String[] stringArray0 = new String[18];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public abstract String getPrimaryKey(String tableName);", "private void GetData(){\n try {\n Connection conn =(Connection)app.pegawai.Database.koneksiDB();\n java.sql.Statement stm = conn.createStatement();\n java.sql.ResultSet sql = stm.executeQuery(\"select * from user\");\n data.setModel(DbUtils.resultSetToTableModel(sql));\n\n }\n catch (SQLException | HeadlessException e) {\n }\n}", "@Test(timeout = 4000)\n public void test024() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.nextLine((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "private List<Table> getTableFromStringTableName(String tableName) throws HyracksDataException {\n\n // Get all the tables\n if (generateAllTables) {\n // Remove the DBGEN_VERSION table and all children tables, parent tables will generate them\n return Table.getBaseTables().stream()\n .filter(table -> !table.equals(Table.DBGEN_VERSION) && !table.isChild())\n .collect(Collectors.toList());\n }\n\n // Search for the table\n List<Table> matchedTables = Table.getBaseTables().stream()\n .filter(table -> tableName.equalsIgnoreCase(table.getName())).collect(Collectors.toList());\n\n // Ensure the table was found\n if (matchedTables.isEmpty()) {\n throw new RuntimeDataException(ErrorCode.TPCDS_INVALID_TABLE_NAME, getFunctionIdentifier().getName(),\n tableName);\n }\n\n return matchedTables;\n }", "@Test(timeout = 4000)\n public void test002() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n defaultDBTable0.setName(\"4O)ZgZ_/TD!\");\n String string0 = SQLUtil.substituteMarkers(\"\", \"CONSTRAINT 4O)ZgZ_/TD! PRIMARY KEY (, , , , , , , , , , , , , , , , , )\", defaultDBTable0);\n assertEquals(\"\", string0);\n }", "@Test\n public void testGetTabella_PreparedStatement() throws MainException, SQLException {\n System.out.println(\"getTabella\");\n LinkingDb instance = new LinkingDb(new ConfigurazioneTO(\"jdbc:hsqldb:file:database/\",\n \"ADISysData\", \"asl\", \"\"));\n instance.connect();\n PreparedStatement stmt = instance.prepareStatement(\n \"select * from infermieri\");\n ADISysTableModel result = instance.getTabella(stmt);\n assertNotNull(result);\n }", "protected abstract void initTable() throws RemoteException, NotBoundException, FileNotFoundException;", "public void formDatabaseTable() {\n }", "@Test(timeout = 4000)\n public void test033() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.currentLine((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Override\n\tpublic String ifTable(String table) {\n\t\treturn \"select 1 from user_tables where table_name ='\"+table+\"'\";\n\t}", "@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}", "public boolean tableRequired()\n {\n return true;\n }", "public boolean initDB() {\n System.out.println(\"initDB\");\n\n boolean initOK = false;\n\n String s;\n StringBuilder sb = new StringBuilder();\n\n try {\n FileReader fr = new FileReader(new File(\"resources\\\\initDB.sql\"));\n BufferedReader br = new BufferedReader(fr);\n\n while ((s = br.readLine()) != null) {\n sb.append(s);\n }\n br.close();\n\n String[] inst = sb.toString().split(\";\");\n\n Statement stmt = getConnection().createStatement();\n\n for (int i = 0, instLength = inst.length; i < instLength; i++) {\n String anInst = inst[i];\n if (!anInst.trim().equals(\"\")) {\n System.out.println(i + \": \" + anInst);\n\n try {\n stmt.executeUpdate(anInst);\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }\n }\n\n initOK = true;\n } catch (FileNotFoundException ex) {\n ex.printStackTrace();\n// throw new RuntimeException(ex);\n } catch (SQLException ex) {\n ex.printStackTrace();\n// throw new RuntimeException(ex);\n } catch (IOException ex) {\n ex.printStackTrace();\n// throw new RuntimeException(ex);\n } catch (NullPointerException ex) {\n ex.printStackTrace();\n }\n\n return initOK;\n }", "@Test\n public void testCorte_de_caja() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM corte_caja\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table corte_caja exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'corte_caja' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_28()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\"), (DBSchema) null, (String) null, (String) null);\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\t\tString columnName2 = \"0123456789\";\n\t\tString columnName3 = \"An��t-1.0.txt\";\n\t\tString columnName4 = null;\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1, columnName2, columnName3, columnName4);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getCatalog(LazyTable.java:130)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n String[] stringArray0 = new String[9];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n DBDataType dBDataType0 = DBDataType.getInstance((-280560843), \"\");\n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"new org.apache.derby.catalog.TriggerOldTransitionRows() \", (DBTable) null, dBDataType0);\n DBColumn[] dBColumnArray0 = new DBColumn[4];\n dBColumnArray0[0] = (DBColumn) defaultDBColumn0;\n // Undeclared exception!\n try { \n SQLUtil.renderColumnNames(dBColumnArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private void test() throws SQLException {\n\n\t}", "private boolean validaTerminalesLReservaLocal(int CodEmp,int CodLoc, int CodCot){\n boolean blnRes=true;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc!=null){\n stmLoc=conLoc.createStatement();\n strSql=\"\"; \n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot, a2.tx_codALt, trim(SUBSTR (UPPER(a2.tx_codalt), length(a2.tx_codalt) ,1)) as terminal \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" and a1.co_loc=\"+CodLoc+\" and a1.co_cot=\"+CodCot+\" \\n\";\n System.out.println(\"validaTerminalesLReservaLocal... \"+ strSql);\n rstLoc = stmLoc.executeQuery(strSql);\n while(rstLoc.next()){\n if(rstLoc.getString(\"terminal\").equals(\"L\")){\n blnRes=false;\n }\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(null, e);\n blnRes=false;\n }\n return blnRes;\n }", "@Test\n public void testVentas() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM ventas\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table ventas exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'ventas' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "@Test(timeout = 4000)\n public void test029() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.format((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test45() throws Throwable {\n EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile(\"/home/ubuntu/evosuite_readability_gen/projects/13_jdbacl\");\n FileSystemHandling.createFolder(evoSuiteFile0);\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"z}yVJPxVp_\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n mockPrintWriter0.print(false);\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\"selectwp.pr\");\n assertFalse(boolean0);\n assertNotNull(boolean0);\n }", "@Override\n\tpublic IDBRecord insertNoSyn(ITableDBContext context, Table table, IDBRecord record) throws Throwable {\n\t\trecord.setTableName(table.getName());\n \t\trecord.updateVersion();\n \t\tString dbName = table.getName();\n \t\tif (!INSERTS.containsKey(dbName))\n \t\t\tINSERTS.putIfAbsent(dbName, new HashMap<String,IDBRecord>());\n \t\tMap<String, IDBRecord> map = INSERTS.get(dbName);\n \t\tmap.put(record.getString(table.getId().getName()), record);\n\t\treturn record;\n\t}", "private boolean init() {\n\t\tString sql = \"SELECT v FROM user WHERE k='version'\";\t// TODO right now we are care only about is table exists of not\n //init_required = true;\n\t\tif (!this.r(sql)) {\n\t\t\tsql= \"CREATE TABLE user ( k CHAR(50), v TEXT );\";\n\t\t\tthis.r(sql);\n\t\t\tsql= \"CREATE UNIQUE INDEX kindex on user (k);\";\n\t\t\tthis.r(sql);\n\t\t\tsql= \"INSERT INTO user (k,v) VALUES ('version','1'), ('login',''), ('password',''), ('remember','1');\";\n\t\t\treturn this.r(sql);\n\t\t}\n\t\treturn true;\n\t}", "@Test(timeout = 4000)\n public void test094() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n try { \n DBUtil.nextLine(errorMessages0);\n fail(\"Expecting exception: SQLException\");\n \n } catch(SQLException e) {\n //\n // getObject\n //\n verifyException(\"org.apache.derby.vti.VTITemplate\", e);\n }\n }", "@Test\n\tpublic void testDBPrimaryKeyConstraint_27()\n\t\tthrows Exception {\n\t\tDBTable table = new LazyTable(new JDBCDBImporter(\"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"0123456789\", \"\"), new DBSchema(\"0123456789\", new DBCatalog(\"\", new DefaultDatabase(\"\", \"\", VersionNumber.valueOf(\"\")))), \"An��t-1.0.txt\", \"An��t-1.0.txt\");\n\t\tString name = \"\";\n\t\tboolean nameDeterministic = false;\n\t\tString columnName1 = \"\";\n\t\tString columnName2 = \"0123456789\";\n\t\tString columnName3 = \"An��t-1.0.txt\";\n\t\tString columnName4 = null;\n\n\t\tDBPrimaryKeyConstraint result = new DBPrimaryKeyConstraint(table, name, nameDeterministic, columnName1, columnName2, columnName3, columnName4);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.NullPointerException\n\t\t// at org.databene.jdbacl.model.jdbc.JDBCDBImporter.importColumns(JDBCDBImporter.java:430)\n\t\t// at org.databene.jdbacl.model.jdbc.JDBCDBImporter.importTableDetails(JDBCDBImporter.java:389)\n\t\t// at org.databene.jdbacl.model.jdbc.JDBCDBImporter.importTable(JDBCDBImporter.java:384)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.getRealTable(LazyTable.java:256)\n\t\t// at org.databene.jdbacl.model.jdbc.LazyTable.setPrimaryKey(LazyTable.java:97)\n\t\t// at org.databene.jdbacl.model.DBPrimaryKeyConstraint.<init>(DBPrimaryKeyConstraint.java:47)\n\t\tassertNotNull(result);\n\t}" ]
[ "0.59152126", "0.5841673", "0.5698307", "0.56806445", "0.5675238", "0.5525149", "0.5523695", "0.5487325", "0.5486973", "0.5482588", "0.5476363", "0.54642475", "0.5463523", "0.543096", "0.54258126", "0.54185814", "0.53789383", "0.53746986", "0.53727317", "0.5350806", "0.53468126", "0.5346299", "0.53416735", "0.53386915", "0.53320247", "0.5317433", "0.5313669", "0.53126687", "0.53117865", "0.5299067", "0.5288343", "0.5282143", "0.5247734", "0.5243265", "0.5223868", "0.5215748", "0.52039796", "0.51578903", "0.5144147", "0.51415753", "0.51394236", "0.51325876", "0.51313347", "0.51294696", "0.51276135", "0.51227313", "0.5120115", "0.51060593", "0.510366", "0.51015496", "0.50991213", "0.50966173", "0.50930214", "0.50915754", "0.50838417", "0.50770223", "0.5064818", "0.5063915", "0.5058298", "0.50552315", "0.5051492", "0.5051333", "0.5045169", "0.5036561", "0.5032089", "0.5027056", "0.50268155", "0.5025935", "0.5025817", "0.50255054", "0.50245905", "0.5024553", "0.5024281", "0.5021113", "0.50193024", "0.50170344", "0.5008769", "0.50076056", "0.5003525", "0.5003099", "0.50009537", "0.49939784", "0.49905953", "0.49877217", "0.4987629", "0.4987629", "0.49873456", "0.49858463", "0.49818888", "0.49812424", "0.4979257", "0.49730942", "0.4970037", "0.49642107", "0.49619734", "0.49610558", "0.49548307", "0.49532247", "0.49504894", "0.49462605", "0.4941033" ]
0.0
-1
/ noInduk may not be null / empty never ret null throws KasirException(ROW_NOT_FOUND, noInduk) if no matching row found throws KasirException(BAD_RECORD, tableName) if the resulting Profil.isDBValid = false
public static Profil fromResultSet(ResultSet rs, String noInduk) throws SQLException, KasirException { assert noInduk != null && !noInduk.isEmpty() : "fromResultSet(ResultSet, String noInduk = null / empty)"; return fromResultSet(rs, noIndukColName, false, noInduk); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Profil select(String noInduk) throws SQLException, KasirException{\r\n assert noInduk != null && !noInduk.isEmpty() : \"selectProfil(String, String, String noInduk = null)\";\r\n\r\n return select(noIndukColName, false, noInduk);\r\n }", "public boolean updateNoInduk(String oldNoInduk) throws SQLException, KasirException{\r\n assert oldNoInduk != null;\r\n\r\n //profil.noInduk is also retrieved to check for noInduk duplication\r\n ResultSet rs = DBSR.takeResultSetByString(tableName, noIndukColName, 1, oldNoInduk, noInduk);\r\n\r\n if(updateResultSetNoInduk(rs, oldNoInduk)){\r\n rs.updateRow();\r\n return true;\r\n }else\r\n return false;\r\n }", "public static boolean delete(String noInduk) throws SQLException, KasirException{\r\n return DBSR.deleteKasirO(tableName, noIndukColName, false, noInduk);\r\n }", "public boolean updateResultSetNoInduk(ResultSet rs, String oldNoInduk) throws SQLException, KasirException {\r\n assert oldNoInduk != null : \"oldNoInduk = null\";\r\n \r\n if(!isDBValid())\r\n throw new KasirException(KasirException.Tipe.DB_INVALID, this);\r\n \r\n if(noInduk.equals(oldNoInduk)){\r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n return flushResultSet(rs, false);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this);\r\n }else{\r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n throw new KasirException(KasirException.Tipe.DUPLICATE_PRIMARY_KEY, this);\r\n \r\n if(DBSR.searchRow(rs, noIndukColName, false, oldNoInduk) > 0)\r\n return flushResultSet(rs, true);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, oldNoInduk);\r\n }\r\n }", "public boolean isDBValid(){\r\n return noInduk != null && !noInduk.isEmpty();\r\n }", "public static Map<String,Profil> selectS(Set<String> noInduks) throws SQLException, KasirException{\r\n ResultSet rs;\r\n Map<String,Profil> noIndukProfil;\r\n if(noInduks == null){\r\n rs = DBSR.takeResultSetByStringColl(tableName, noIndukColName, -1, null);\r\n\r\n noIndukProfil = new HashMap<>(DBSR.rowCountRS(rs)); \r\n rs.beforeFirst();\r\n while(rs.next()){\r\n Profil p = Profil.fromResultSet(rs);\r\n noIndukProfil.put(p.noInduk, p);\r\n }\r\n }else{\r\n Set<String> validNoInduk = new HashSet<>(CollectionUtils.subtract(noInduks, Arrays.asList(null, \"\")));\r\n rs = DBSR.takeResultSetByStringColl(tableName, noIndukColName, -1, validNoInduk);\r\n\r\n noIndukProfil = new HashMap<>(validNoInduk.size()); \r\n for(String noInduk : validNoInduk){\r\n try{\r\n noIndukProfil.put(noInduk, Profil.fromResultSet(rs, noInduk));\r\n }catch(KasirException e){\r\n noIndukProfil.put(noInduk, null);\r\n }\r\n }\r\n }\r\n\r\n return noIndukProfil;\r\n }", "protected void handleNoRowFound()\r\n/* 37: */ throws DataAccessException\r\n/* 38: */ {\r\n/* 39: 92 */ throw new EmptyResultDataAccessException(\r\n/* 40: 93 */ \"LobStreamingResultSetExtractor did not find row in database\", 1);\r\n/* 41: */ }", "public boolean checkIfExist(Coupon coupon) throws DbException;", "@Override\n\tpublic MahasiswaModel getById(String nik) throws SQLException {\n\t\tgetByidStatement.setString(1, nik);\n\t\tResultSet rs = getByidStatement.executeQuery();\n\t\tif(rs.next()){\n\t\t\tMahasiswaModel mhs = new MahasiswaModel();\n\t\t\tmhs.setNik(rs.getString(\"nik\"));\n\t\t\tmhs.setNama(rs.getString(\"nama\"));\n\t\t\tmhs.setKelas(rs.getString(\"kelas\"));\n\t\t\tmhs.setJurusan(rs.getString(\"jurusan\"));\n\t\t\treturn mhs;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public static void searchHdd(){\r\n try { \r\n singleton.dtm = new DefaultTableModel();\r\n singleton.dtm.setColumnIdentifiers(hdd);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n \r\n Statement stmt = singleton.conn.createStatement();\r\n ResultSet rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart\");\r\n \r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n \r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "public boolean checkIfRowExists(String tablename, int n, int m, int k) throws SQLException {\n String sql = \"SELECT * FROM \" + tablename + \" WHERE n = ? AND m = ? AND k = ?\";\n PreparedStatement preparedStatement = (PreparedStatement) this.getConn().prepareStatement(sql);\n preparedStatement.setInt(1, n);\n preparedStatement.setInt(2, m);\n preparedStatement.setInt(3, k);\n return ((ResultSet) preparedStatement.executeQuery()).next();\n }", "public boolean updateResultSet(ResultSet rs) throws SQLException, KasirException{\r\n if(!isDBValid())\r\n throw new KasirException(KasirException.Tipe.DB_INVALID, this);\r\n \r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n return flushResultSet(rs, false);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this);\r\n }", "private boolean validaItemsServicio(int CodEmp, int CodLoc, int CodCot){\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n boolean blnRes=true;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc != null) {\n stmLoc=conLoc.createStatement();\n strSql=\"\";\n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" AND a1.co_loc=\"+CodLoc+\" AND a1.co_cot=\"+CodCot+\" AND (a3.st_ser='S' OR a3.st_ser='T' OR a3.st_ser='O') \\n\";\n rstLoc=stmLoc.executeQuery(strSql);\n if(rstLoc.next()){\n blnRes=false;\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n }\n conLoc.close();\n conLoc=null;\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false;\n }\n return blnRes;\n }", "@Test\n\tvoid existDataInDBTest2() {\n\t\tparkName = \"Tel-Aviv Park\";\n\t\tdate = new Date(120, 5, 1);\n\t\texpected = \"11 22 33 44 55 66 17 23 5 8 4 2 3 2 54 34 2 32 1 61 1 75 32 46 12 67 23 82 12 56 32 36 12 85 232 7\";\n\t\tresult = ReportsController.getReport(date, reportType, parkName);\n\n\t\tassertEquals(expected, result);\n\n\t}", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, (String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\r\n public void testSearch() throws Exception {\r\n System.out.println(\"rechNom\");\r\n Bureau obj1 = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n Bureau obj2 = new Bureau(0,\"Test2\",\"000000001\",\"\");\r\n String nomrech = \"Test\";\r\n BureauDAO instance = new BureauDAO();\r\n instance.setConnection(dbConnect);\r\n obj1=instance.create(obj1);\r\n obj2=instance.create(obj2);\r\n \r\n \r\n String result = instance.search(nomrech);\r\n if(result.contains(obj1.getSigle())) fail(\"record introuvable \"+obj1);\r\n if(result.contains(obj2.getSigle())) fail(\"record introuvable \"+obj2);\r\n instance.delete(obj1);\r\n instance.delete(obj2);\r\n }", "public void okFind()\n {\n ASPManager mgr = getASPManager();\n\n trans.clear();\n q = trans.addQuery(headblk);\n q.addWhereCondition(\"WO_NO<(SELECT Number_Serie_API.Get_Last_Wo_Number FROM DUAL) AND CONTRACT IN(SELECT User_Allowed_Site_API.Authorized(CONTRACT) FROM DUAL)\");\n q.addWhereCondition(\"CONNECTION_TYPE_DB = 'EQUIPMENT'\");\n q.includeMeta(\"ALL\");\n\n // nimhlk - Begin\n if (mgr.dataTransfered())\n {\n ASPBuffer retBuffer = mgr.getTransferedData();\n if (retBuffer.itemExists(\"WO_NO\"))\n {\n String ret_wo_no = retBuffer.getValue(\"WO_NO\");\n q.addWhereCondition(\"WO_NO = ?\");\n q.addParameter(\"WO_NO\",ret_wo_no);\n }\n else\n q.addOrCondition(mgr.getTransferedData());\n }\n // nimhlk - End\n\n mgr.querySubmit(trans,headblk);\n\n if (headset.countRows() == 0)\n {\n mgr.showAlert(mgr.translate(\"PCMWACTIVESEPARATENODATA: No data found.\"));\n headset.clear();\n }\n if (headset.countRows() == 1)\n {\n lay.setLayoutMode(lay.SINGLE_LAYOUT);\n }\n mgr.createSearchURL(headblk);\n }", "@Test\n\tvoid existDataInDBTest() {\n\t\tparkName = \"Haifa Park\";\n\t\tdate = new Date(120, 2, 1);\n\t\texpected = \"1 2 3 4 5 6 1 23 2 8 9 2 3 2 4 3 2 2 1 1 1 5 32 6 12 7 23 8 12 5 32 6 12 5 23 7\";\n\t\tresult = ReportsController.getReport(date, reportType, parkName);\n\n\t\tassertEquals(expected, result);\n\n\t}", "public int Kullanicino_Bul(String kullanici_adi) throws SQLException {\n baglanti vb = new baglanti();\r\n try {\r\n \r\n vb.baglan();\r\n int kullanicino = 0;\r\n String sorgu = \"select kullanici_no from kullanicilar where kullanici_adi='\" + kullanici_adi + \"';\";\r\n\r\n ps = vb.con.prepareStatement(sorgu);\r\n\r\n rs = ps.executeQuery(sorgu);\r\n while (rs.next()) {\r\n kullanicino = rs.getInt(1);\r\n }\r\n return kullanicino;\r\n\r\n } catch (Exception e) {\r\n Logger.getLogger(siparis.class.getName()).log(Level.SEVERE, null, e);\r\n return 0;\r\n }\r\n finally{\r\n vb.con.close();\r\n }\r\n }", "public boolean checkIfRowExists(String tablename, int n, int m, int k, double p) throws SQLException {\n String sql = \"SELECT * FROM \" + tablename + \" WHERE n = ? AND m = ? AND k = ? AND p = ?\";\n PreparedStatement preparedStatement = (PreparedStatement) this.getConn().prepareStatement(sql);\n preparedStatement.setInt(1, n);\n preparedStatement.setInt(2, m);\n preparedStatement.setInt(3, k);\n preparedStatement.setDouble(4, p);\n return ((ResultSet) preparedStatement.executeQuery()).next();\n }", "private boolean checkInputTableName(AccessInputMeta meta){\n if (meta.getTableName()==null || meta.getTableName().length()<1)\n {\n MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );\n mb.setMessage(BaseMessages.getString(PKG, \"AccessInputDialog.TableMissing.DialogMessage\"));\n mb.setText(BaseMessages.getString(PKG, \"System.Dialog.Error.Title\"));\n mb.open(); \n\n return false;\n }\n else\n {\n \treturn true;\n }\n\t}", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseResultRow((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\tif (entityType2tableName.isEmpty())\n\t\t\treturn true;\n\t\t\n\t\t// the hard way \n\t\ttry {\n\t\t\tStatement st = connection.createStatement(\n\t\t\t\t\tResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t ResultSet.CONCUR_READ_ONLY);\n\t\t\t\n\t\t\tfor (String tableName: entityType2tableName.values()) {\n\t\t\t\t//ResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\";\");\n\t\t\t\t\n\t\t\t\tResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\" LIMIT 1\");\n\t\t\t\t\n\t\t\t\tif (!set.next())\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\n\t\t} catch (SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tthrow new RuntimeException(\"Error while checking if the table is empty\",e1);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "@Override\n public boolean SearchSQL() {\n\n /*\n appunto su query.next()\n inizialmente query.next è posto prima della prima riga\n alla prima chiaata si posiziona sulla prima row\n alla seconda chiamata si posiziona sulla seconda row e cosi via\n */\n\n boolean controllo = false;\n\n openConnection();\n\n String sql =\"select user,pass,vol_o_cand from pass where user='\"+userInserito+\"'\";\n ResultSet query = selectQuery(sql);\n\n try {\n\n if(query.next()){\n\n String pass = query.getString(\"pass\");\n\n if(pass.equals(passInserita)) {\n controllo = true;\n volocand = query.getString(\"vol_o_cand\");\n }\n\n }\n\n\n }catch(SQLException se){\n se.printStackTrace();\n }finally{\n closeConnection();\n }\n\n\n return controllo;\n\n }", "public String validarResponsableYaAsignado (DTOResponsable dtoe) throws MareException { \n UtilidadesLog.info(\"DAOZON.validarResponsableYaAsignado(DTOResponsable dtoe): Entrada\");\n StringBuffer consulta = new StringBuffer();\n Vector parametros = new Vector();\n RecordSet rs = new RecordSet();\n \n String asignado = null;\n String unidadAdministrativa = null;\n Long marca = null;\n Long canal = null;\n Long pais = null;\n\n //Recuperamos el pais, marca y canal de la Unidad Administrativa \n BelcorpService bs = UtilidadesEJB.getBelcorpService();\n\n /*if (dtoe.getIndUA().intValue() == 1) { \n consulta.append(\" SELECT pais_oid_pais PAIS, marc_oid_marc MARCA, cana_oid_cana canal \");\n consulta.append(\" FROM zon_sub_geren_venta \");\n consulta.append(\" WHERE oid_subg_vent = ? \");\n unidadAdministrativa = \"Subgerencia\";\n }*/\n if (dtoe.getIndUA().intValue() == 2){\n consulta.append(\" SELECT pais_oid_pais PAIS, marc_oid_marc MARCA, cana_oid_cana canal \");\n consulta.append(\" FROM zon_regio \");\n consulta.append(\" WHERE oid_regi = ? \");\n unidadAdministrativa = \"Region\";\n }\n if (dtoe.getIndUA().intValue() == 3){\n consulta.append(\" SELECT pais_oid_pais PAIS, marc_oid_marc MARCA, cana_oid_cana canal \");\n consulta.append(\" FROM zon_zona \");\n consulta.append(\" WHERE oid_zona = ? \");\n unidadAdministrativa = \"Zona\";\n }\n /*if (dtoe.getIndUA().intValue() == 4){\n consulta.append(\" SELECT zon.pais_oid_pais PAIS, zon.marc_oid_marc MARCA, zon.cana_oid_cana canal \");\n consulta.append(\" FROM zon_zona zon, zon_secci sec \");\n consulta.append(\" WHERE sec.zzon_oid_zona = zon.oid_zona \"); \n consulta.append(\" AND sec.oid_secc = ? \");\n unidadAdministrativa = \"Seccion\"; \n }*/\n parametros.add(dtoe.getOidUA());\n \n try {\n rs = bs.dbService.executePreparedQuery(consulta.toString(), parametros);\n UtilidadesLog.debug(\"rs: \" + rs);\n } catch (Exception e) {\n codigoError = CodigosError.ERROR_DE_ACCESO_A_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(codigoError));\n }\n\n if (rs.esVacio()) {\n UtilidadesLog.debug(\"****DAOZON.validarResponsableYaAsignado: No existe Unidad Administrativa \");\t\t\t\t\n String sCodigoError = CodigosError.ERROR_DE_PETICION_DE_DATOS_NO_EXISTENTE;\n throw new MareException(new Exception(), UtilidadesError.armarCodigoError(sCodigoError));\n } else {\n pais = new Long(((BigDecimal)rs.getValueAt(0,\"PAIS\")).longValue());\n marca = new Long(((BigDecimal)rs.getValueAt(0,\"MARCA\")).longValue());\n canal = new Long(((BigDecimal)rs.getValueAt(0,\"CANAL\")).longValue());\n }\n\n //Buscamos si el cliente es responsable en otra unidad administrativa\n //para el pais, marca y canal de la unidad administrativa a asignar\n parametros = new Vector(); \n consulta = new StringBuffer();\n /*consulta.append(\" SELECT 'SubGerencia: ' || zon_sub_geren_venta.des_subg_vent DESCUNIDADADMIN \");\n consulta.append(\" FROM zon_sub_geren_venta, mae_clien \");\n consulta.append(\" WHERE mae_clien.oid_clie = zon_sub_geren_venta.clie_oid_clie \"); \n consulta.append(\" AND mae_clien.oid_clie = ? \");\n parametros.add(dtoe.getOidResponsable());\n consulta.append(\" AND zon_sub_geren_venta.pais_oid_pais = ? \");\n parametros.add(pais);\n consulta.append(\" AND zon_sub_geren_venta.marc_oid_marc = ? \");\n parametros.add(marca);\n consulta.append(\" AND zon_sub_geren_venta.cana_oid_cana = ? \");\n parametros.add(canal);\n consulta.append(\" AND zon_sub_geren_venta.ind_borr = 0 \");\n\n consulta.append(\" UNION \");*/\n \n consulta.append(\" SELECT 'Region: ' || zon_regio.des_regi DESCUNIDADADMIN \");\n consulta.append(\" FROM mae_clien, zon_sub_geren_venta, zon_regio \");\n consulta.append(\" WHERE mae_clien.oid_clie = zon_regio.clie_oid_clie \");\n consulta.append(\" AND mae_clien.oid_clie = ? \");\n parametros.add(dtoe.getOidResponsable());\n consulta.append(\" AND zon_regio.zsgv_oid_subg_vent = zon_sub_geren_venta.oid_subg_vent \");\n consulta.append(\" AND zon_sub_geren_venta.pais_oid_pais = ? \");\n parametros.add(pais);\n consulta.append(\" AND zon_sub_geren_venta.marc_oid_marc = ? \");\n parametros.add(marca);\n consulta.append(\" AND zon_sub_geren_venta.cana_oid_cana = ? \");\n parametros.add(canal);\n consulta.append(\" AND zon_sub_geren_venta.ind_borr = 0 \");\n consulta.append(\" AND zon_regio.ind_borr = 0 \");\n \n consulta.append(\" UNION \");\n \n consulta.append(\" SELECT 'Zona: ' || zon_zona.des_zona DESCUNIDADADMIN \");\n consulta.append(\" FROM zon_sub_geren_venta, zon_regio, zon_zona, mae_clien \");\n consulta.append(\" WHERE zon_zona.clie_oid_clie = mae_clien.oid_clie \");\n consulta.append(\" AND mae_clien.oid_clie = ? \");\n parametros.add(dtoe.getOidResponsable());\n consulta.append(\" AND zon_sub_geren_venta.pais_oid_pais = ? \");\n parametros.add(pais);\n consulta.append(\" AND zon_sub_geren_venta.marc_oid_marc = ? \");\n parametros.add(marca);\n consulta.append(\" AND zon_sub_geren_venta.cana_oid_cana = ? \");\n parametros.add(canal);\n consulta.append(\" AND zon_regio.zsgv_oid_subg_vent = zon_sub_geren_venta.oid_subg_vent \");\n consulta.append(\" AND zon_zona.zorg_oid_regi = zon_regio.oid_regi \");\n consulta.append(\" AND zon_zona.ind_borr = 0 \");\n consulta.append(\" AND zon_sub_geren_venta.ind_borr = 0 \");\n consulta.append(\" AND zon_regio.ind_borr = 0 \");\n \n /*consulta.append(\" UNION \");\n \n consulta.append(\" SELECT 'Seccion: ' || zon_secci.des_secci DESCUNIDADADMIN \");\n consulta.append(\" FROM zon_sub_geren_venta, zon_regio, \");\n consulta.append(\" zon_zona, zon_secci, mae_clien \");\n consulta.append(\" WHERE zon_secci.clie_oid_clie = mae_clien.oid_clie \");\n consulta.append(\" AND mae_clien.oid_clie = ? \");\n parametros.add(dtoe.getOidResponsable());\n consulta.append(\" AND zon_sub_geren_venta.pais_oid_pais = ? \");\n parametros.add(pais);\n consulta.append(\" AND zon_sub_geren_venta.marc_oid_marc = ? \");\n parametros.add(marca);\n consulta.append(\" AND zon_sub_geren_venta.cana_oid_cana = ? \");\n parametros.add(canal);\n consulta.append(\" AND zon_regio.zsgv_oid_subg_vent = zon_sub_geren_venta.oid_subg_vent \");\n consulta.append(\" AND zon_zona.zorg_oid_regi = zon_regio.oid_regi \");\n consulta.append(\" AND zon_secci.zzon_oid_zona = zon_zona.oid_zona \"); \n consulta.append(\" AND zon_secci.ind_borr = 0 \");\n consulta.append(\" AND zon_zona.ind_borr = 0 \");\n consulta.append(\" AND zon_sub_geren_venta.ind_borr = 0 \");\n consulta.append(\" AND zon_regio.ind_borr = 0 \");*/\n\n try {\n rs = bs.dbService.executePreparedQuery(consulta.toString(), parametros);\n UtilidadesLog.debug(\"rs: \" + rs);\n } catch (Exception e) {\n codigoError = CodigosError.ERROR_DE_ACCESO_A_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(codigoError));\n }\n\n if (rs.esVacio()) {\n UtilidadesLog.debug(\"****DAOZON.validarResponsableYaAsignado: No hay datos \");\t\t\t\t\n }\n else {\n UtilidadesLog.debug(\"****DAOZON.validarResponsableYaAsignado: se encontro al menos un cliente \");\t\t\t\t\n asignado = rs.getValueAt(0,\"DESCUNIDADADMIN\").toString();\n }\n \n UtilidadesLog.info(\"DAOZON.validarResponsableYaAsignado(DTOResponsable dtoe): Salida\"); \n \n return asignado;\n }", "@Test\n public void testGetTabella_String() throws MainException, SQLException {\n System.out.println(\"getTabella\");\n String queryText = \"select * from infermieri\";\n LinkingDb instance = new LinkingDb(new ConfigurazioneTO(\"jdbc:hsqldb:file:database/\",\n \"ADISysData\", \"asl\", \"\"));\n instance.connect();\n ADISysTableModel result = instance.getTabella(queryText);\n assertNotNull(result);\n queryText = \"select * from infermieri where id = -1\";\n result = instance.getTabella(queryText);\n assertTrue(result.getRowCount() == 0);\n }", "@Test\n\tpublic void testGetTable() throws SQLException\n\t{\n\t\tnew Nail(\"asdf\",5,5,5.0,20);\n\t\tResultSet rs = DatabaseGateway.getTable(\"Nail\");\n\t\tif(rs.next())\n\t\t{\n\t\t\tassertEquals(rs.getInt(\"id\"),1);\n\t\t\tassertEquals(rs.getInt(\"ManufacturerID\"),5);\n\t\t\tassertEquals(rs.getInt(\"Price\"),5);\n\t\t\tassertEquals(rs.getString(\"UPC\"),\"asdf\");\n\t\t\tassertTrue(rs.getDouble(\"Length\") == 5.0);\n\t\t\tassertEquals(rs.getInt(\"NumberInBox\"), 20);\n\t\t}\n\t}", "@Test\n public void testSelectSpecificRowThatDoesNotExist() throws SQLException {\n // Arrange\n CommitStructure commit = getSampleCommit();\n String commitID = commit.getCommitID() + \"A\";\n // Act\n mysqlDatabase.insertCommitToDatabase(commit);\n CommitStructure commits = mysqlDatabase.selectSpecificRow(commitID);\n // Assert\n assertNull(commits);\n }", "public void rubahDataProduk(){\n loadDataProduk();\n \n //uji koneksi dan eksekusi perintah\n try{\n //test koneksi\n Statement stat = (Statement) koneksi.getKoneksi().createStatement();\n \n //perintah sql untuk simpan data\n String sql = \"UPDATE barang SET nama_barang = '\"+ nama_barang +\"',\"\n + \"merk_barang = '\"+ merk_barang +\"',\"\n + \"jumlah_stok = '\"+ jumlah_stok +\"',\"\n + \"harga = '\"+ harga +\"'\" \n + \"WHERE kode_barang = '\" + kode_barang +\"'\";\n PreparedStatement p = (PreparedStatement) koneksi.getKoneksi().prepareStatement(sql);\n p.executeUpdate();\n \n //ambil data\n getDataProduk();\n }catch(SQLException err){\n JOptionPane.showMessageDialog(null, err.getMessage());\n }\n }", "@Test\r\n public void testRead() throws Exception {\r\n System.out.println(\"read\");\r\n int idbureau = 0;\r\n BureauDAO instance = new BureauDAO();\r\n instance.setConnection(dbConnect);\r\n Bureau obj = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n Bureau expResult = instance.create(obj);\r\n idbureau=expResult.getIdbur();\r\n Bureau result = instance.read(idbureau);\r\n assertEquals(\"sigles différents\",expResult.getSigle(), result.getSigle());\r\n assertEquals(\"tel différents\",expResult.getTel(), result.getTel());\r\n //etc\r\n assertEquals(\"id différents\",expResult.getIdbur(),result.getIdbur());\r\n try{\r\n result=instance.read(0);\r\n fail(\"exception d'id inconnu non générée\");\r\n }\r\n catch(SQLException e){}\r\n instance.delete(result);\r\n }", "@Test(timeout = 4000)\n public void test019() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseResultSet((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Override\r\n\tprotected boolean isValidTable(final ResultSet resultSet) throws SQLException {\r\n\t\treturn !resultSet.getString(3).contains(\"BIN$\");\r\n\t}", "@Test(timeout = 4000)\n public void test024() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.nextLine((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "private boolean validaInsert(Entity e) throws SQLException {\r\n stmt = conn.createStatement();\r\n String sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(0) + \"= \" + e.getCell(0).getValue();\r\n if (e.getTableName().equals(\"Contato\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(3) + \"= '\" + String.valueOf(e.getCell(3).getValue()) + \"' and \" + e.getColumnName(1) + \"= '\" + String.valueOf(e.getCell(1).getValue()) + \"';\";\r\n\r\n }\r\n if (e.getTableName().equals(\"Telefone\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(2) + \"= '\" + String.valueOf(e.getCell(2).getValue()) + \"' and \" + e.getColumnName(1) + \"= '\" + String.valueOf(e.getCell(1).getValue()) + \"' and \" + e.getColumnName(3) + \"= '\" + String.valueOf(e.getCell(3).getValue()) + \"';\";\r\n\r\n }\r\n if (e.getTableName().equals(\"Solicitacoes\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(6) + \"= '\" + String.valueOf(e.getCell(6).getValue()) + \"' and \" + e.getColumnName(7) + \"= '\" + String.valueOf(e.getCell(7).getValue()) + \"';\";\r\n\r\n }\r\n System.out.println(sql);\r\n rs = stmt.executeQuery(sql);\r\n if (rs.next()) {\r\n stmt.close();\r\n rs.close();\r\n return false;\r\n }\r\n stmt.close();\r\n rs.close();\r\n return true;\r\n\r\n }", "private String CheckRecordExistInAlarmDB(String alarmCount) {\n DataHolder mDataHolder;\n String url = \"select * from \" + mDbHelper.mTableAlarm + \" where \" + mDbHelper.mFieldAlarmUserId + \"= '\" + mPreferenceHelper.getUserId() + \"'\" + \" and \" + mDbHelper.mFieldAlarmCountNo + \"= '\" + alarmCount + \"'\";\n System.out.println(\" URL : \" + url);\n mDataHolder = mDbHelper.read(url);\n if (mDataHolder != null) {\n System.out.println(\" AlarmList : \" + url + \" : \" + mDataHolder.get_Listholder().size());\n if (mDataHolder != null && mDataHolder.get_Listholder().size() != 0) {\n return mDataHolder.get_Listholder().get(0).get(mDbHelper.mFieldAlarmLocalID);\n } else {\n return \"-1\";\n }\n }\n return \"-1\";\n }", "public Profil dynFromResultSet(ResultSet rs, boolean onCallingObj) throws SQLException, KasirException{\r\n assert !rs.isBeforeFirst() : \"rs.isBeforeFirst = true\";\r\n \r\n Profil profil = onCallingObj? this : new Profil();\r\n \r\n profil.noInduk = rs.getString(noIndukColName);\r\n profil.currentLevel = Level.fromResultSet(rs, currentLevelColName);\r\n profil.biodata = Biodata.fromResultSet(rs);\r\n profil.tanggalMasuk = Kalender.fromResultSet(rs, tanggalMasukColName);\r\n profil.tanggalLulus = Kalender.fromResultSet(rs, tanggalLulusColName);\r\n String tmpGelombang = rs.getString(gelombangColName);\r\n if(tmpGelombang != null){\r\n if(tmpGelombang.equalsIgnoreCase(\"GELOMBANG_1\")){\r\n profil.gelombang = Gelombang.GELOMBANG_1;\r\n }else if(tmpGelombang.equalsIgnoreCase(\"GELOMBANG_2\")){\r\n profil.gelombang = Gelombang.GELOMBANG_2;\r\n }\r\n }\r\n profil.totalIuran = rs.getFloat(totalIuranColName);\r\n String tmpStatusPendaftaran = rs.getString(statusPendaftaranColName);\r\n if(tmpStatusPendaftaran != null){\r\n if(tmpStatusPendaftaran.equalsIgnoreCase(\"DAFTAR\")){\r\n profil.statusPendaftaran = StatusPendaftaran.DAFTAR;\r\n }else if(tmpStatusPendaftaran.equalsIgnoreCase(\"PROSES\")){\r\n profil.statusPendaftaran = StatusPendaftaran.PROSES;\r\n }else if(tmpStatusPendaftaran.equalsIgnoreCase(\"LUNAS\")){\r\n profil.statusPendaftaran = StatusPendaftaran.LUNAS;\r\n }else if (tmpStatusPendaftaran.equalsIgnoreCase(\"BATAL\")){\r\n profil.statusPendaftaran = StatusPendaftaran.BATAL;\r\n }\r\n }\r\n profil.lastUpdateDate = Kalender.fromResultSet(rs, lastUpdateDateColName);\r\n if(profil.isDBValid())\r\n return profil;\r\n else\r\n throw new KasirException(KasirException.Tipe.BAD_RECORD, tableName);\r\n }", "public boolean searchCertainItem(String itemname, String tableName)\n {\n String selectStr;\n ResultSet rs;\n try{\n\n selectStr=\"SELECT \"+itemname+\" FROM \"+tableName;\n rs = stmt.executeQuery(selectStr);\n\n while (rs.next())\n {\n return true;\n }\n }catch(Exception e){\n System.out.println(\"Error occurred in searchLogin\");\n }\n\n return false;\n\n }", "private void load_buku() {\n Object header[] = {\"ID BUKU\", \"JUDUL BUKU\", \"PENGARANG\", \"PENERBIT\", \"TAHUN TERBIT\"};\n DefaultTableModel data = new DefaultTableModel(null, header);\n bookTable.setModel(data);\n String sql_data = \"SELECT * FROM tbl_buku\";\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\n String d[] = {d1, d2, d3, d4, d5};\n data.addRow(d);\n }\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }", "@Override\n\tpublic String getQueryDeExiste(Onibus entidade) {\n\t\treturn null;\n\t}", "public Boolean checkBusExistedByTuyen(String Tuyen) {\n String sql = \"select exists (select * from tuyen_bus where Tuyen = ?);\";\n Object[] params = {Tuyen};\n return jdbcTemplate.queryForObject(sql, Boolean.class, params);\n }", "@Test(timeout = 4000)\n public void test46() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n PipedReader pipedReader0 = new PipedReader();\n Boolean boolean0 = Boolean.FALSE;\n SQLUtil.isQuery(\"selectntowrong c|ck\");\n Boolean.valueOf(true);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"selectntowrong c|ck\");\n // Undeclared exception!\n try { \n defaultDBTable0.getUniqueConstraint(\"^h=wZ>:9%}Pj6(#%M\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnListWithTableName(\"pw?(g[&h!X$;C/\", (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void test00200Cancel_Retrieval_NonExistingRecord() throws Exception\n\t{\n\t\tSystem.out.println(\"test00200Cancel_Retrieval_NonExistingRecord()\");\n\t\tEquationStandardTransaction transaction = getTransaction();\n\t\ttransaction.setMode(IEquationStandardObject.FCT_DEL);\n\t\tsetupNonExistKeyFields(transaction);\n\t\tapplyRetrieval(transaction, false);\n\t}", "@Test(timeout = 4000)\n public void test71() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n FileSystemHandling.shouldThrowIOException((EvoSuiteFile) null);\n TableContainer tableContainer0 = new TableContainer(\"-KwE,kZ\");\n DefaultDBTable defaultDBTable1 = new DefaultDBTable();\n DBDataType.getInstance((-1717986917), \"%~-1t&Ncqx{&'OP~@\");\n tableContainer0.getSchema();\n Integer integer0 = RawTransaction.SAVEPOINT_ROLLBACK;\n Integer integer1 = RawTransaction.LOCK_ESCALATE;\n SQLUtil.removeComments(\"/**/\");\n System.setCurrentTimeMillis(1722L);\n // Undeclared exception!\n try { \n SQLUtil.normalize((String) null, false);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.io.StringReader\", e);\n }\n }", "public void test3() throws ClassNotFoundException, SQLException {\r\n\t\tsqlTable tbl = new sqlTable();\r\n\t\ttbl.printInAplication(\"SELECT * FROM metropolises WHERE metropolis = \" + \"\\\"Mumbai\" + \"\\\";\");\r\n\t\tassertTrue(tbl.getGrid().get(0).get(1).equals(\"Asia\"));\r\n\t\ttbl.printInAplication(\"SELECT * FROM metropolises WHERE metropolis = \" + \"\\\"New York\" + \"\\\";\");\r\n\t\tassertTrue(tbl.getGrid().get(0).get(1).equals(\"North America\"));\r\n\t\ttbl.printInAplication(\"SELECT * FROM metropolises WHERE population >= \" + 20400000 +\";\"); \r\n\t\tassertTrue(tbl.getGrid().get(0).get(0).equals(\"Mumbai\"));\r\n\t\ttbl.printInAplication(\"SELECT * FROM metropolises WHERE population >= \" + 21000000 +\";\");\r\n\t\tassertTrue(tbl.getGrid().get(0).get(0).equals(\"New York\"));\r\n\t}", "public boolean existe(Atendente atendente) throws Execption {\r\n\r\n String sql = \"SELECT * FROM tb_atendente WHERE nome = ? \"\r\n + \"AND senha = ?\";\r\n\r\n try {\r\n // conexao = new ConexaoDB ();\r\n Connection conn = ConexaoDB.obtemConexao();\r\n\r\n PreparedStatement pst = conn.prepareStatement(sql);\r\n\r\n pst.setString(1, atendente.getNome());\r\n pst.setString(2, atendente.getSenha());\r\n\r\n // executando o comando 'select'\r\n // e recebendo o retorno\r\n ResultSet resultado = pst.executeQuery();\r\n\r\n if (resultado.next()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n return false;\r\n }\r\n\r\n }", "private void GetData(){\n try {\n Connection conn =(Connection)app.pegawai.Database.koneksiDB();\n java.sql.Statement stm = conn.createStatement();\n java.sql.ResultSet sql = stm.executeQuery(\"select * from user\");\n data.setModel(DbUtils.resultSetToTableModel(sql));\n\n }\n catch (SQLException | HeadlessException e) {\n }\n}", "@Test(timeout = 4000)\n public void test137() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[0];\n String string0 = SQLUtil.renderQuery(defaultDBTable0, stringArray0, stringArray0);\n assertEquals(\"SELECT * FROM null WHERE \", string0);\n }", "public Integer checkEmpty()\n {\n return coronaRepository.checkEmptyTable();\n }", "public static boolean Check_if_exsists(String table, String[][] fields) throws SQLException {\r\n if (fields.length > 0) {\r\n String key, value, data;\r\n data = \"\";\r\n value = \"\";\r\n key = \"\";\r\n for (int i = 0; i < fields.length; i++) {\r\n for (int j = 0; j < fields[i].length; j++) {\r\n\r\n if (i < fields.length - 1) {\r\n\r\n key += fields[i][j] + \"=?\";\r\n if (j < fields[i].length - 1) {\r\n key += \" AND \";\r\n }\r\n } else {\r\n data += fields[i][j];\r\n value += \"?\";\r\n if (j < fields[i].length - 1) {\r\n value += \", \";\r\n }\r\n }\r\n }\r\n }\r\n\r\n try {\r\n Connection con;\r\n con = Apache_Connectionpool.getInstance().getConnection();\r\n \r\n\r\n// PreparedStatement ps = con.prepareStatement(\"INSERT INTO \" + table + \"(\" + key + \") VALUES(\" + value + \")\");\r\n PreparedStatement ps = con.prepareStatement(\"SELECT COUNT(*) as Count FROM \" + table + \" WHERE \" + key);\r\n for (int i = 0; i < fields.length; i++) {\r\n for (int j = 0; j < fields[i].length; j++) {\r\n\r\n if (i < fields.length - 1) {\r\n\r\n } else {\r\n data += fields[i][j];\r\n ps.setString(j + 1, fields[i][j]);\r\n\r\n }\r\n }\r\n }\r\n\r\n ResultSet rs = ps.executeQuery();\r\n if (rs.next()) {\r\n Integer temp = rs.getInt(\"Count\");\r\n con.close();\r\n rs.close();\r\n if (temp > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n con.close();\r\n rs.close();\r\n return false;\r\n }\r\n\r\n } catch (Exception ex) {\r\n ErrorDAO.Error_Add(new managedModal.Error(\"Check if data for multiple fields exisit method\", \"inserting data into table \" + table, \" Message: \" + ex.getMessage(), date));\r\n return false;\r\n }\r\n\r\n }\r\n return false;\r\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n String[] stringArray0 = new String[18];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test033() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.currentLine((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "abstract boolean tableExist() throws SQLException;", "protected void requestedNotAndData(JTable jt,String searchTerm1, String searchTerm2, boolean soundex) throws SQLException\r\n\t{\r\n\t\tif(!soundex)\r\n\t\t{\r\n\t\tString query2 = \"select docID from inverted_file where word = '\"+searchTerm1+\"' group by docID\";\r\n\t\tPreparedStatement pstmt2 = con.prepareStatement(query2);\r\n\t\tResultSet rs1 = pstmt2.executeQuery();//then execute the statement\r\n\t\tif (!rs1.next()) {\r\n\t\t\tString query = \"select file_name as File, docID as Document_ID from inverted_file where word='\"+searchTerm2+\"' AND visible=1 group by file_name\";\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\r\n\t\t\tif (!rs2.next()) {\r\n\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t rs2.beforeFirst();\r\n\t\t\t pstmt.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\trs2.beforeFirst();\r\n\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\tpstmt.close();\r\n\t\t rs1.beforeFirst();\r\n\t\t pstmt2.close();\r\n\t\t return;\r\n\t\t} \r\n\t\t\r\n\t\tString query = \"select file_name as File, docID as Document_ID from inverted_file where (docID !=\"+rs1.getInt(1)+\" AND word='\"+searchTerm2+\"') AND visible=1 group by file_name\";\r\n\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\r\n\t\t//Checking if the term found in the database\r\n\t\tif (!rs2.next()) {\r\n\t\t\tjt.setModel(dataModel);\r\n\t\t\tdataModel.setRowCount(0);\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t rs2.beforeFirst();\r\n\t\t pstmt.close();\r\n\t\t return;\r\n\t\t} \r\n\t\t\r\n\t\trs2.beforeFirst();\r\n\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\tpstmt.close();\r\n\t\tpstmt2.close();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tString query2 = \"select docID from soundex_table where soundex = ? group by docID\";\r\n\t\t\tPreparedStatement pstmt2 = con.prepareStatement(query2);\r\n\t\t\tpstmt2.setString(1, sndx.encode(searchTerm1));\r\n\t\t\tResultSet rs1 = pstmt2.executeQuery();//then execute the statement\r\n\t\t\tif (!rs1.next()) {\r\n\t\t\t\tString query = \"select file_name as File, docID as Document_ID from soundex_table where soundex=? AND visible=1 group by file_name\";\r\n\t\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\t\tpstmt.setString(1, sndx.encode(searchTerm2));\r\n\t\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\t\r\n\t\t\t\tif (!rs2.next()) {\r\n\t\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t rs2.beforeFirst();\r\n\t\t\t\t pstmt.close();\r\n\t\t\t\t return;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\trs2.beforeFirst();\r\n\t\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\t\tpstmt.close();\r\n\t\t\t rs1.beforeFirst();\r\n\t\t\t pstmt2.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tString query = \"select file_name as File, docID as Document_ID from soundex_table where (docID !=\"+rs1.getInt(1)+\" AND soundex=?) AND visible=1 group by file_name\";\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\tpstmt.setString(1, sndx.encode(searchTerm2));\r\n\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\r\n\t\t\t//Checking if the term found in the database\r\n\t\t\tif (!rs2.next()) {\r\n\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t rs2.beforeFirst();\r\n\t\t\t pstmt.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\trs2.beforeFirst();\r\n\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\tpstmt.close();\r\n\t\t\tpstmt2.close();\r\n\t\t}\t\r\n\t}", "public Buku findById(Integer idBuku) throws SQLException {\n\r\n KoneksiDatabase koneksiDB = new KoneksiDatabase();\r\n DataSource dataSource = koneksiDB.getDataSource();\r\n Connection koneksi = dataSource.getConnection();\r\n\r\n String sql = \"select id,judul_buku,tahun_terbit,pengarang,jumlah_buku from perpus.buku where id = ?\";\r\n PreparedStatement statement = koneksi.prepareStatement(sql);\r\n statement.setInt(1, idBuku);\r\n ResultSet resultSet = statement.executeQuery();\r\n Buku buku = new Buku();\r\n\r\n if (resultSet.next()) {\r\n// System.out.println(resultSet.getInt(\"id\"));\r\n //mengambil data dari database\r\n\r\n buku.setId(resultSet.getInt(\"id\"));\r\n buku.setJudulBuku(resultSet.getString(\"judul_buku\"));\r\n buku.setTahunTerbit(resultSet.getInt(\"tahun_terbit\"));\r\n buku.setPengarang(resultSet.getString(\"pengarang\"));\r\n buku.setJumlahBuku(resultSet.getInt(\"jumlah_buku\"));\r\n\r\n// listBuku.add(buku); //menyimpan ke variabel listBuku\r\n }\r\n\r\n resultSet.close();\r\n statement.close();\r\n koneksi.close();\r\n\r\n return buku;\r\n }", "public void checkUsernameExist() {\n\n try {\n BLUser bluser = new BLUser();\n User user = new User();\n\n ResultSet rs = bluser.selectUserIdFromUsername(txt_username.getText());\n\n user.setUsername(txt_username.getText());\n bluser.setUser(user);\n\n if (bluser.checkUsernameExist()) {\n \n populateDataOnTable();\n }// end if\n else {\n JOptionPane.showMessageDialog(rootPane, \"Invalid username!\");\n }// end else \n\n }// end try\n catch (Exception ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"Exception\", JOptionPane.INFORMATION_MESSAGE);\n }//end catch\n }", "protected void requestedNotOrData(JTable jt,String searchTerm1, String searchTerm2, boolean soundex) throws SQLException\r\n\t{\r\n\t\tif(!soundex)\r\n\t\t{\r\n\t\tString query2 = \"select docID from inverted_file where word = '\"+searchTerm1+\"' group by docID\";\r\n\t\tPreparedStatement pstmt2 = con.prepareStatement(query2);\r\n\t\tResultSet rs1 = pstmt2.executeQuery();//then execute the statement\r\n\t\tif (!rs1.next()) {\r\n\t\t\tString query = \"select file_name as File, docID as Document_ID from inverted_file where word='\"+searchTerm2+\"' AND visible=1 group by file_name\";\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\r\n\t\t\tif (!rs2.next()) {\r\n\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t rs2.beforeFirst();\r\n\t\t\t pstmt.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\trs2.beforeFirst();\r\n\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\tpstmt.close();\r\n\t\t rs1.beforeFirst();\r\n\t\t pstmt2.close();\r\n\t\t return;\r\n\t\t} \r\n\t\t\r\n\t\tString query = \"select file_name as File, docID as Document_ID from inverted_file where (docID !=\"+rs1.getInt(1)+\" OR word='\"+searchTerm2+\"') AND visible=1 group by file_name\";\r\n\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\r\n\t\t//Checking if the term found in the database\r\n\t\tif (!rs2.next()) {\r\n\t\t\tjt.setModel(dataModel);\r\n\t\t\tdataModel.setRowCount(0);\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t rs2.beforeFirst();\r\n\t\t pstmt.close();\r\n\t\t return;\r\n\t\t} \r\n\t\t\r\n\t\trs2.beforeFirst();\r\n\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\tpstmt.close();\r\n\t\tpstmt2.close();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tString query2 = \"select docID from soundex_table where soundex = ? group by docID\";\r\n\t\t\tPreparedStatement pstmt2 = con.prepareStatement(query2);\r\n\t\t\tpstmt2.setString(1, sndx.encode(searchTerm1));\r\n\t\t\tResultSet rs1 = pstmt2.executeQuery();//then execute the statement\r\n\t\t\tif (!rs1.next()) {\r\n\t\t\t\tString query = \"select file_name as File, docID as Document_ID from soundex_table where soundex=? AND visible=1 group by file_name\";\r\n\t\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\t\tpstmt.setString(1, sndx.encode(searchTerm2));\r\n\t\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\t\r\n\t\t\t\tif (!rs2.next()) {\r\n\t\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t rs2.beforeFirst();\r\n\t\t\t\t pstmt.close();\r\n\t\t\t\t return;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\trs2.beforeFirst();\r\n\t\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\t\tpstmt.close();\r\n\t\t\t rs1.beforeFirst();\r\n\t\t\t pstmt2.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tString query = \"select file_name as File, docID as Document_ID from soundex_table where (docID !=\"+rs1.getInt(1)+\" OR soundex=?) AND visible=1 group by file_name\";\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(query);\r\n\t\t\tpstmt.setString(1, sndx.encode(searchTerm2));\r\n\t\t\tResultSet rs2 = pstmt.executeQuery();//then execute the statement\r\n\t\t\t\r\n\t\t\t//Checking if the term found in the database\r\n\t\t\tif (!rs2.next()) {\r\n\t\t\t\tjt.setModel(dataModel);\r\n\t\t\t\tdataModel.setRowCount(0);\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Term not found!\", \"Error!\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t rs2.beforeFirst();\r\n\t\t\t pstmt.close();\r\n\t\t\t return;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\trs2.beforeFirst();\r\n\t\t\tjt.setModel(DbUtils.resultSetToTableModel(rs2));\t\r\n\t\t\tpstmt.close();\r\n\t\t\tpstmt2.close();\r\n\t\t}\r\n\t\t\r\n\t}", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n String[] stringArray0 = new String[9];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n public void testProductos() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM productos\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table productos exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table 'productos' does not exist.\");\n Assert.fail(e.getMessage());\n }\n }", "private boolean markNodHijos(String nodPadSel){\n boolean blnRes=true;\n Connection conNodHij;\n Statement stmNodHij;\n ResultSet rstNodHij;\n String strNodPadSel=nodPadSel==null?\"\":nodPadSel;\n arlDatNodHij.clear();\n try{\n conNodHij=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if(conNodHij!=null){\n stmNodHij=conNodHij.createStatement();\n strSQL=\"\";\n strSQL+=\" SELECT a1.co_emp, a1.co_cta, a1.tx_codCta, a1.ne_pad\";\n strSQL+=\" FROM tbm_plaCta AS a1\";\n strSQL+=\" WHERE a1.co_emp=\" + objParSis.getCodigoEmpresa() + \"\";\n strSQL+=\" AND a1.tx_codCta like('\" + objTblModPlaCta.getValueAt(tblDatPlaCta.getSelectedRow(), INT_TBL_PLA_CTA_NUM_CTA) + \"%')\";\n strSQL+=\" ORDER BY a1.tx_codCta\";\n\n rstNodHij=stmNodHij.executeQuery(strSQL);\n while(rstNodHij.next()){\n arlRegNodHij=new ArrayList();\n arlRegNodHij.add(INT_ARL_COD_EMP, \"\" + rstNodHij.getString(\"co_emp\"));\n arlRegNodHij.add(INT_ARL_COD_CTA_SEL, \"\" + rstNodHij.getString(\"ne_pad\"));\n arlRegNodHij.add(INT_ARL_COD_CTA_HIJ, \"\" + rstNodHij.getString(\"co_cta\"));\n arlDatNodHij.add(arlRegNodHij);\n }\n conNodHij.close();\n conNodHij=null;\n stmNodHij.close();\n stmNodHij=null;\n rstNodHij.close();\n rstNodHij=null;\n }\n }\n catch(java.sql.SQLException e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n catch(Exception e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "public boolean asignaNumeroFac(java.sql.Connection conIns, int intCodEmp,int intCodLoc, int intCodTipDocFacEle, int intCodDoc, int intCodCot) \r\n {\r\n boolean blnRes = false;\r\n java.sql.Statement stmLoc, stmLocIns;\r\n java.sql.ResultSet rstLoc;\r\n String strSql = \"\";\r\n String strSqlIns = \"\";\r\n int intNumDoc = 0;\r\n int intNumDocGuia = 0;\r\n try \r\n {\r\n if (conIns != null){\r\n stmLoc = conIns.createStatement();\r\n strSql = \"SELECT CASE WHEN (ne_ultDoc+1) IS NULL THEN 1 ELSE (ne_ultDoc+1) END AS ultnum \"\r\n + \" FROM tbm_cabTipDoc WHERE co_emp=\" +intCodEmp+ \" \"\r\n + \" AND co_loc=\" +intCodLoc+ \" AND co_tipDoc=\" + intCodTipDocFacEle;\r\n// System.out.println(\"numero \" + strSql);\r\n rstLoc = stmLoc.executeQuery(strSql);\r\n if (rstLoc.next()) {\r\n intNumDoc = rstLoc.getInt(\"ultnum\");\r\n }\r\n rstLoc.close();\r\n rstLoc = null;\r\n stmLoc.close();\r\n stmLoc = null;\r\n \r\n \r\n strSqlIns += \" UPDATE tbm_cabTipDoc SET ne_ultDoc=\" + intNumDoc + \" WHERE co_emp=\" +intCodEmp+ \" \"\r\n + \" AND co_loc=\" +intCodLoc+ \" AND co_tipDoc=\" + intCodTipDocFacEle;\r\n strSqlIns += \";UPDATE tbm_cabmovinv SET ne_numdoc=\" +intNumDoc+\", ne_numgui=\"+intNumDocGuia+\", st_reg='A' , st_imp='S' \"\r\n + \" WHERE co_emp=\" +intCodEmp+ \" AND co_loc=\" +intCodLoc+ \" AND co_tipdoc=\" + intCodTipDocFacEle + \" \"\r\n + \" AND co_doc=\" + intCodDoc + \" and st_reg not in ('I','E') AND ne_numcot=\" + intCodCot;\r\n strSqlIns += \" ; UPDATE tbm_cabdia SET tx_numdia='\" + intNumDoc + \"' WHERE co_emp=\" +intCodEmp+ \" AND co_loc=\" +intCodLoc+ \" AND co_tipdoc=\" + intCodTipDocFacEle + \" \"\r\n + \" AND co_dia=\" + intCodDoc + \" and st_reg not in ('I','E') \";\r\n System.out.println(\"asignaNumeroFac \"+strSqlIns);\r\n stmLocIns = conIns.createStatement();\r\n stmLocIns.executeUpdate(strSqlIns);\r\n stmLocIns.close();\r\n stmLocIns = null;\r\n intNumFacElec=intNumDoc;\r\n blnRes = true;\r\n }\r\n } \r\n catch (SQLException Evt) {\r\n blnRes = false;\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n } \r\n catch (Exception Evt) {\r\n blnRes = false;\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n }\r\n return blnRes;\r\n }", "private boolean validaTerminalesLSSegunEmpresaLocal(int CodEmp,int CodLoc, int CodCot){\n boolean blnRes=true;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc!=null){\n stmLoc=conLoc.createStatement();\n strSql=\"\"; \n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot, a2.tx_codALt, trim(SUBSTR (UPPER(a2.tx_codalt), length(a2.tx_codalt) ,1)) as terminal,\\n\";\n strSql+=\" CASE WHEN ( (trim(SUBSTR (UPPER(a3.tx_codalt), length(a3.tx_codalt) ,1)) IN ( \\n\";\n strSql+=\" SELECT UPPER(trim(tx_cad)) FROM tbm_reginv WHERE co_emp=\"+CodEmp+\" AND co_loc=\"+CodLoc+\" \\n\";\n strSql+=\" AND co_tipdoc=228 AND co_usr=(SELECT co_usrIng from tbm_cabCotVen WHERE co_emp=\"+CodEmp+\" AND co_loc=\"+CodLoc+\" AND co_cot=\"+CodCot+\" ) AND st_reg='A' /* AND st_tipmov='C' */ \\n\";\n strSql+=\" ))) THEN 'S' ELSE 'N' END as isterL \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" and a1.co_loc=\"+CodLoc+\" and a1.co_cot=\"+CodCot+\" \\n\";\n System.out.println(\"validaTerminalesLSSegunEmpresaLocal... \"+ strSql);\n rstLoc = stmLoc.executeQuery(strSql);\n while(rstLoc.next()){\n if(rstLoc.getString(\"terminal\").equals(\"L\") ){\n if(rstLoc.getString(\"isterL\").equals(\"N\")){\n blnRes=false;\n } \n }\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(null, e);\n blnRes=false;\n }\n return blnRes;\n }", "@Test(timeout = 4000)\n public void test023() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseAndSimplifyResultSet((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test010() throws Throwable {\n String[] stringArray0 = new String[6];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery((DBTable) null, stringArray0, stringArray0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private boolean checkIfExist(int klik, int x, int y){\r\n\t\tif (klik == 1){\r\n\t\t\tif (discTable[x][y].owner != 0 && discTable[x][y].owner <= 2) return true;\r\n\t\t\telse return false;\r\n\t\t}else return false;\r\n\t}", "public void load2() throws Exception {\n String query = \"select * from catalog_snapshot where item_id = \" + item_id + \" and facility_id = '\" + facility_id + \"'\";\n query += \" and fac_item_id = '\" + this.fac_item_id + \"'\";\n DBResultSet dbrs = null;\n ResultSet rs = null;\n try {\n dbrs = db.doQuery(query);\n rs = dbrs.getResultSet();\n if (rs.next()) {\n setItemId( (int) rs.getInt(\"ITEM_ID\"));\n setFacItemId(rs.getString(\"FAC_ITEM_ID\"));\n setMaterialDesc(rs.getString(\"MATERIAL_DESC\"));\n setGrade(rs.getString(\"GRADE\"));\n setMfgDesc(rs.getString(\"MFG_DESC\"));\n setPartSize( (float) rs.getFloat(\"PART_SIZE\"));\n setSizeUnit(rs.getString(\"SIZE_UNIT\"));\n setPkgStyle(rs.getString(\"PKG_STYLE\"));\n setType(rs.getString(\"TYPE\"));\n setPrice(BothHelpObjs.makeBlankFromNull(rs.getString(\"PRICE\")));\n setShelfLife( (float) rs.getFloat(\"SHELF_LIFE\"));\n setShelfLifeUnit(rs.getString(\"SHELF_LIFE_UNIT\"));\n setUseage(rs.getString(\"USEAGE\"));\n setUseageUnit(rs.getString(\"USEAGE_UNIT\"));\n setApprovalStatus(rs.getString(\"APPROVAL_STATUS\"));\n setPersonnelId( (int) rs.getInt(\"PERSONNEL_ID\"));\n setUserGroupId(rs.getString(\"USER_GROUP_ID\"));\n setApplication(rs.getString(\"APPLICATION\"));\n setFacilityId(rs.getString(\"FACILITY_ID\"));\n setMsdsOn(rs.getString(\"MSDS_ON_LINE\"));\n setSpecOn(rs.getString(\"SPEC_ON_LINE\"));\n setMatId( (int) rs.getInt(\"MATERIAL_ID\"));\n setSpecId(rs.getString(\"SPEC_ID\"));\n setMfgPartNum(rs.getString(\"MFG_PART_NO\"));\n\n //trong 3-27-01\n setCaseQty(BothHelpObjs.makeZeroFromNull(rs.getString(\"CASE_QTY\")));\n }\n } catch (Exception e) {\n e.printStackTrace();\n HelpObjs.monitor(1,\n \"Error object(\" + this.getClass().getName() + \"): \" + e.getMessage(), null);\n throw e;\n } finally {\n dbrs.close();\n }\n return;\n }", "@Test\n\tpublic void checkNoElementInTableOutsideAPI() throws ParseException\n\t{\n\t\t// Table Data\n\t\tMap<String, Object> tableMap = dashboardPage.addRowDataToMap();\n\t\t// API Data\n\t\tresponsePage = new APIResponsePageObject(driver);\n\t\tMap<String, Object> apiMap = responsePage.getRateDataFromAPI();\n\t\t\n\t\t// Map that has key - values missing in tableMap that are in apiMap\n\t\tMap notInAPIMap = new HashMap<>(tableMap);\n\t\tnotInAPIMap.keySet().removeAll(apiMap.keySet());\n\t\tnotInAPIMap.values().removeAll(apiMap.values());\n\t\t\n\t\tif(notInAPIMap.size() > 1)\n\t\t{\n\t\t\terrorMessage = \"Html table is having \" + notInAPIMap.toString() + \" that are not from API\";\n\t\t\tAssert.fail(errorMessage);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAssert.assertTrue(notInAPIMap.size() == 0);\n\t\t}\n\t}", "public static void main(String[] args) throws SQLException, ClassNotFoundException {\r\n Statement s = DBConnect.connection.createStatement();\r\n String selTable1 = \"SELECT Item AS rslt, Desc1 As rslt2 FROM item_master WHERE Item = '\" + getSkuInput() + \"'\";\r\n s.execute(selTable1);\r\n ResultSet rs1 = s.getResultSet();\r\n if (rs1.next() && Integer.parseInt(rs1.getString(\"rslt\")) >= 702630 && Integer.parseInt(rs1.getString(\"rslt\")) <= 702672) {\r\n rproSKU = rs1.getString(\"rslt\");\r\n prodName = rs1.getString(\"rslt2\");\r\n // prodCost = rs1.getString(\"rslt3\");\r\n skuRslt = \"good\";\r\n } else {\r\n skuRslt = \"bad\";\r\n prodName = \"No Name Available\";\r\n }\r\n }", "static SearchResult<AccountHolder> getHolders(String no) throws RecordSearchException {\n String condition = \"AccountNo = '\" + no + \"'\";\n\n LinkedList<Record> records = AccountHolderTable.getInstance().read(condition);\n\n if (records == null || records.size() == 0) {\n throw new RecordSearchException();\n }\n\n try {\n SearchResult<AccountHolder> holders = new SearchResult<>();\n\n for (LinkedHashMap<String, Object> record : records) {\n holders.add(new AccountHolder(record));\n }\n\n return holders;\n } catch (SchemaCreationException e) {\n Logger.error(e);\n\n throw new RecordSearchException(\"Error reading records from the Database\");\n }\n }", "private boolean puedeModificarAprRepOtroUsuario(String empresa, String local, String tipoDocumento, String codigoDocumento, String codigoVistoBueno, boolean checkSeleccionado, int fila, int columna){\n boolean blnRes=false;\n String strArlVisBueDbCodEmp=\"\", strArlVisBueDbCodLoc=\"\", strArlVisBueDbCodTipDoc=\"\", strArlVisBueDbCodDoc=\"\";\n String strArlVisBueDbCodVisBue=\"\", strArlVisBueDbEstVisBue=\"\", strArlVisBueDbCodUsr=\"\";\n String strTblVisBueDbCodEmp=empresa;\n String strTblVisBueDbCodLoc=local;\n String strTblVisBueDbCodTipDoc=tipoDocumento;\n String strTblVisBueDbCodDoc=codigoDocumento;\n String strTblVisBueDbCodVisBue=codigoVistoBueno;\n boolean blnChkSel=checkSeleccionado;\n int intFil=fila;\n int intCol=columna;\n int w=0;\n //System.out.println(\"puedeModificarAprRepOtroUsuario: \" + arlDatCodVisBueDB.toString());\n try{\n for(int k=0; k<arlDatCodVisBueDB.size(); k++){\n w=0;\n strArlVisBueDbCodEmp=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_EMP_DB);\n strArlVisBueDbCodLoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_LOC_DB);\n strArlVisBueDbCodTipDoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_TIP_DOC_DB);\n strArlVisBueDbCodDoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_DOC_DB);\n strArlVisBueDbCodVisBue=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_VIS_BUE_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_VIS_BUE_DB);\n strArlVisBueDbEstVisBue=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_EST_VIS_BUE_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_EST_VIS_BUE_DB);\n strArlVisBueDbCodUsr=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_USR_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_USR_DB);\n\n if(strTblVisBueDbCodEmp.equals(strArlVisBueDbCodEmp)){\n if(strTblVisBueDbCodLoc.equals(strArlVisBueDbCodLoc)){\n if(strTblVisBueDbCodTipDoc.equals(strArlVisBueDbCodTipDoc)){\n if(strTblVisBueDbCodDoc.equals(strArlVisBueDbCodDoc)){\n if(strArlVisBueDbCodVisBue.equals(strTblVisBueDbCodVisBue)){\n if( (strArlVisBueDbEstVisBue.equals(\"A\")) || (strArlVisBueDbEstVisBue.equals(\"D\")) ){\n if(! strArlVisBueDbCodUsr.equals(\"\"+objParSis.getCodigoUsuario())){\n objTblMod.setChecked(blnChkSel, intFil, intCol);\n mostrarMsgInf(\"<HTML>El visto bueno que intenta modificar ya fue Aprobado/Reprobado por otro usuario.<BR>El otro usuario debe reversar para que ud. pueda realizar la Aprobación/Reprobación,<BR> o dicho usuario deberá modificarlo. </HTML>\");\n blnRes=true;\n break;\n }\n }\n\n }\n }\n }\n }\n }\n }\n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "@Test(timeout = 4000)\n public void test096() throws Throwable {\n jdbcConnection jdbcConnection0 = new jdbcConnection((Session) null);\n // Undeclared exception!\n try { \n DBUtil.executeQuery(\"c\", jdbcConnection0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.hsqldb.jdbc.jdbcStatement\", e);\n }\n }", "public static boolean sendingQueryCheckRow(String nameBD, String nameTable, String photo, int id_photo, String user, int id_name)\n {\n String query = \"SELECT id FROM \" + nameTable + \" WHERE \" + photo + \" = \" + id_photo + \" AND \" + user + \" = \" + id_name + \";\";\n System.out.println(query);\n boolean result = true;\n int id = -1;\n try\n {\n Connection connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/\" + nameBD, \"root\", \"dima\");\n Statement statement = connection.createStatement();\n ResultSet rs = statement.executeQuery(query);\n if (!rs.isBeforeFirst())\n {\n System.out.println(\"No data\");\n result = false;\n id = -2;\n }\n else\n {\n while(rs.next())\n {\n id = rs.getInt(1);\n System.out.println();\n }\n }\n rs.close();\n statement.close();\n connection.close();\n }\n catch (SQLException e)\n {\n System.out.println(\"Не найдено.\");\n e.printStackTrace();\n }\n\n return result;\n }", "public boolean iliskMasaSil(int kullanici_no) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n String sorgu3 = \"delete ilisk_masa from ilisk_masa where kullanici_no=\" + kullanici_no + \"\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n vb.con.close();\r\n return true;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n try {\r\n vb.con.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return false;\r\n }\r\n }", "@Test\n public void retriveByIdTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(1);\n assertNotNull(servizio,\"Should return true if return Servizio 1\");\n }", "@Override\n public boolean containsNameProfesor(String Name) {\n try {\n Entity retValue = null; \n Connection c = null;\n PreparedStatement pstmt = null;\n ResultSet rs = null;\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"SELECT * FROM persona where nombre = ?\");\n\n pstmt.setString(1, Name);\n\n rs = pstmt.executeQuery();\n\n if (rs.next()) {\n return true; \n } \n \n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n return false;\n }", "public void search() throws SQLException;", "public boolean isExist(int conId) throws AppException;", "@Test(timeout = 4000)\n public void test040() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.isQuery((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private boolean validaTerminalesLReservaLocal(int CodEmp,int CodLoc, int CodCot){\n boolean blnRes=true;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc!=null){\n stmLoc=conLoc.createStatement();\n strSql=\"\"; \n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot, a2.tx_codALt, trim(SUBSTR (UPPER(a2.tx_codalt), length(a2.tx_codalt) ,1)) as terminal \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" and a1.co_loc=\"+CodLoc+\" and a1.co_cot=\"+CodCot+\" \\n\";\n System.out.println(\"validaTerminalesLReservaLocal... \"+ strSql);\n rstLoc = stmLoc.executeQuery(strSql);\n while(rstLoc.next()){\n if(rstLoc.getString(\"terminal\").equals(\"L\")){\n blnRes=false;\n }\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(null, e);\n blnRes=false;\n }\n return blnRes;\n }", "@Test(timeout = 4000)\n public void test042() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.innerJoin(\"lx<:FnA<j|x 3)\", (String[]) null, \"|$D1C%ID/XH,\", \"0Wp5dC9\", (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private boolean insertarTablaRelacionadas(java.sql.Connection conn,int intCodEmp, int intCodLoc,int intCodTipDoc,int intCodDoc,int intCodCot){\r\n java.sql.Statement stmLoc;\r\n java.sql.ResultSet rstLocFacVen,rstLocIng; \r\n boolean blnRes = true;\r\n try{\r\n if(conn!=null){\r\n stmLoc = conn.createStatement();\r\n arlDatFacVen = new ArrayList();\r\n arlDatIngGen = new ArrayList();\r\n \r\n strSql=\"\";\r\n strSql+=\" SELECT a2.co_emp, a2.co_loc, a2.co_tipDoc, a2.co_doc,a3.co_reg, a3.co_itm, ABS(a3.nd_can) as nd_can \\n\";\r\n strSql+=\" FROM( \\n\";\r\n strSql+=\" SELECT co_empRelCabMovInv, co_locRelCabMovInv, co_tipDocRelCabMovInv, co_docRelCabMovInv \\n\";\r\n strSql+=\" FROM tbm_cabSegMovInv \\n\";\r\n strSql+=\" WHERE co_empRelCabMovInv=\"+intCodEmp+\" AND co_locRelCabMovInv=\"+intCodLoc+\" AND \\n\";\r\n strSql+=\" co_tipDocRelCabMovInv=\"+intCodTipDoc+\" AND co_docRelCabMovInv=\"+intCodDoc+\" \\n\";\r\n strSql+=\" ) as a1 \\n\";\r\n strSql+=\" INNER JOIN tbm_cabMovInv as a2 ON (a1.co_empRelCabMovInv=a2.co_emp AND a1.co_locRelCabMovInv=a2.co_loc AND \\n\";\r\n strSql+=\" a1.co_tipDocRelCabMovInv=a2.co_tipDoc AND a1.co_docRelCabMovInv=a2.co_doc ) \\n\";\r\n strSql+=\" INNER JOIN tbm_detMovInv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_loc=a3.co_loc AND a2.co_tipDoc=a3.co_tipDoc AND a2.co_doc=a3.co_doc) \\n\";\r\n System.out.println(\"insertarTablaRelacionadas... \"+strSql);\r\n rstLocFacVen = stmLoc.executeQuery(strSql);\r\n while(rstLocFacVen.next()){\r\n arlRegFacVen = new ArrayList();\r\n arlRegFacVen.add(INT_ARL_COD_EMP_REL, rstLocFacVen.getInt(\"co_emp\"));\r\n arlRegFacVen.add(INT_ARL_COD_LOC_REL, rstLocFacVen.getInt(\"co_loc\"));\r\n arlRegFacVen.add(INT_ARL_COD_TIP_DOC_REL, rstLocFacVen.getInt(\"co_tipDoc\"));\r\n arlRegFacVen.add(INT_ARL_COD_DOC_REL, rstLocFacVen.getInt(\"co_doc\"));\r\n arlRegFacVen.add(INT_ARL_COD_REG_REL_AUX, rstLocFacVen.getInt(\"co_reg\"));\r\n arlRegFacVen.add(INT_ARL_COD_ITM_REL, rstLocFacVen.getInt(\"co_itm\"));\r\n arlRegFacVen.add(INT_ARL_CAN_REL, rstLocFacVen.getDouble(\"nd_can\"));\r\n arlRegFacVen.add(INT_ARL_COD_CAN_UTI, 0.00);\r\n arlDatFacVen.add(arlRegFacVen); \r\n }\r\n rstLocFacVen.close();\r\n rstLocFacVen=null;\r\n\r\n strSql=\"\";\r\n strSql+=\" SELECT a1.co_empRelCabMovInv, a1.co_locRelCabMovInv, a1.co_tipDocRelCabMovInv, \\n\";\r\n strSql+=\" a1.co_docRelCabMovInv,a3.co_reg as co_regRel, a3.co_itm, a3.nd_can \\n\";\r\n strSql+=\" FROM tbm_cabSegMovInv as a1 \\n\";\r\n strSql+=\" INNER JOIN tbm_cabMovInv as a2 ON (a1.co_empRelCabMovInv=a2.co_emp AND a1.co_locRelCabMovInv=a2.co_loc AND \\n\";\r\n strSql+=\" a1.co_tipDocRelCabMovInv=a2.co_tipDoc AND a1.co_docRelCabMovInv=a2.co_doc) \\n\";\r\n strSql+=\" INNER JOIN tbm_detMovInv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_loc=a3.co_loc AND a2.co_tipDoc=a3.co_tipDoc AND a2.co_doc=a3.co_doc) \\n\";\r\n strSql+=\" RIGHT JOIN tbr_detMovInv as a5 ON (a2.co_emp=a5.co_empRel AND a2.co_loc=a5.co_locRel AND a2.co_tipDoc=a5.co_tipDocRel AND a2.co_doc=a5.co_docRel) \\n\";\r\n strSql+=\" WHERE a1.co_seg=(select co_seg from tbm_cabSegMovInv \\n\";\r\n strSql+=\" where co_empRelCabCotVen=\"+intCodEmp+\" and co_locRelCabCotVen=\"+intCodLoc+\" \\n\";\r\n strSql+=\" and co_cotRelCabCotVen=\"+intCodCot+\" GROUP BY co_seg ) and a3.nd_can > 0 \\n \";\r\n strSql+=\" GROUP BY a1.co_empRelCabMovInv, a1.co_locRelCabMovInv, a1.co_tipDocRelCabMovInv, \";\r\n strSql+=\" a1.co_docRelCabMovInv,a3.co_reg , a2.co_cli, a3.co_itm, a3.nd_can \";\r\n strSql+=\" ORDER BY a3.nd_can DESC \";\r\n System.out.println(\"insertarTablaRelacionadas 2 ... \"+strSql);\r\n rstLocIng = stmLoc.executeQuery(strSql);\r\n while(rstLocIng.next()){\r\n arlRegIngGen = new ArrayList();\r\n arlRegIngGen.add(INT_ARL_COD_EMP_REL, rstLocIng.getInt(\"co_empRelCabMovInv\"));\r\n arlRegIngGen.add(INT_ARL_COD_LOC_REL, rstLocIng.getInt(\"co_locRelCabMovInv\"));\r\n arlRegIngGen.add(INT_ARL_COD_TIP_DOC_REL, rstLocIng.getInt(\"co_tipDocRelCabMovInv\"));\r\n arlRegIngGen.add(INT_ARL_COD_DOC_REL, rstLocIng.getInt(\"co_docRelCabMovInv\"));\r\n arlRegIngGen.add(INT_ARL_COD_REG_REL_AUX, rstLocIng.getInt(\"co_regRel\"));\r\n arlRegIngGen.add(INT_ARL_COD_ITM_REL, rstLocIng.getInt(\"co_itm\"));\r\n arlRegIngGen.add(INT_ARL_CAN_REL, rstLocIng.getDouble(\"nd_can\"));\r\n arlRegIngGen.add(INT_ARL_COD_CAN_UTI, 0.00);\r\n arlDatIngGen.add(arlRegIngGen); \r\n }\r\n rstLocIng.close();\r\n rstLocIng=null;\r\n \r\n String strIng=\"\";\r\n for(int i=0;i<arlDatFacVen.size();i++){\r\n for(int b=0;b<arlDatIngGen.size();b++){\r\n if(objUti.getIntValueAt(arlDatFacVen, i, INT_ARL_COD_ITM_REL)==objUti.getIntValueAt(arlDatIngGen, b, INT_ARL_COD_ITM_REL)){\r\n if(objUti.getDoubleValueAt(arlDatIngGen, b, INT_ARL_CAN_REL)>objUti.getDoubleValueAt(arlDatIngGen, b, INT_ARL_COD_CAN_UTI)){\r\n strSql=\"\";\r\n strSql+=\" INSERT INTO tbr_detMovInv(co_emp,co_loc,co_tipdoc,co_doc,co_reg,st_reg, \\n\";\r\n strSql+=\" co_emprel,co_locrel,co_tipdocrel,co_docrel,co_regrel) \\n\";\r\n strSql+=\" VALUES (\"+objUti.getIntValueAt(arlDatFacVen, i, INT_ARL_COD_EMP_REL)+\",\";\r\n strSql+=\" \"+objUti.getIntValueAt(arlDatFacVen, i, INT_ARL_COD_LOC_REL)+\",\" ;\r\n strSql+=\" \"+objUti.getIntValueAt(arlDatFacVen, i, INT_ARL_COD_TIP_DOC_REL)+\",\";\r\n strSql+=\" \"+objUti.getIntValueAt(arlDatFacVen, i, INT_ARL_COD_DOC_REL)+\",\";\r\n strSql+=\" \"+objUti.getIntValueAt(arlDatFacVen, i, INT_ARL_COD_REG_REL_AUX)+\",'A', \\n\";\r\n strSql+=\" \"+objUti.getIntValueAt(arlDatIngGen, b, INT_ARL_COD_EMP_REL)+\",\";\r\n strSql+=\" \"+objUti.getIntValueAt(arlDatIngGen, b, INT_ARL_COD_LOC_REL)+\",\";\r\n strSql+=\" \"+objUti.getIntValueAt(arlDatIngGen, b, INT_ARL_COD_TIP_DOC_REL)+\",\"; \r\n strSql+=\" \"+objUti.getIntValueAt(arlDatIngGen, b, INT_ARL_COD_DOC_REL)+\",\";\r\n strSql+=\" \"+objUti.getIntValueAt(arlDatIngGen, b, INT_ARL_COD_REG_REL_AUX)+\");\";\r\n strIng+=strSql;\r\n if(objUti.getDoubleValueAt(arlDatFacVen, i, INT_ARL_CAN_REL)<=objUti.getDoubleValueAt(arlDatIngGen, b, INT_ARL_CAN_REL)){\r\n // FACTURA 5 INGRESO 10 // le sumo lo de la factura\r\n objUti.setDoubleValueAt(arlDatIngGen, b, INT_ARL_COD_CAN_UTI, (objUti.getDoubleValueAt(arlDatIngGen, b, INT_ARL_COD_CAN_UTI)+objUti.getDoubleValueAt(arlDatFacVen, i, INT_ARL_CAN_REL)));\r\n }\r\n else{\r\n //factura 10 ing 4// le sumo el ingreso\r\n objUti.setDoubleValueAt(arlDatIngGen, b, INT_ARL_COD_CAN_UTI, (objUti.getDoubleValueAt(arlDatIngGen, b, INT_ARL_COD_CAN_UTI)+objUti.getDoubleValueAt(arlDatIngGen, b, INT_ARL_CAN_REL)));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n System.out.println(\"insertarTablaRelacionadas: \\n\" + strIng);\r\n stmLoc.executeUpdate(strIng);\r\n \r\n stmLoc.close();\r\n stmLoc=null;\r\n }\r\n }\r\n catch (SQLException Evt) {\r\n blnRes = false;\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n } \r\n catch (Exception Evt) {\r\n blnRes = false;\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n }\r\n return blnRes;\r\n }", "public int IsExistNomComptePers(String nomGroupe) throws SQLException{\n\t\t\tString req =\"Select count(*) from Groupe where NomGroupe= ?\";\n\t\t\tPreparedStatement ps=DBConfig.getInstance().getConn().prepareStatement(req);\n\t\t\tps.setString(1,nomGroupe);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\trs.next();\n\t\t\treturn rs.getInt(1);\t\n\t\t\t\n\t\t}", "public void fillTableFindByName(DefaultTableModel model_search){\n\t\tCashier cashierAllProductsByName = new Cashier();\r\n\t\tproductByLike = new Vector<Product>();\r\n\t\t\r\n\t\t//Remove rows from table\r\n\t\tfor (int i = model_search.getRowCount()-1; i >= 0; --i) {\r\n\t\t\tmodel_search.removeRow(i);\r\n\t\t}\r\n\t\t//Getting all products\r\n\t\tcashierAllProductsByName.getAllProductsByName(productByLike);\r\n\t\tif(productByLike.size() > 0){\r\n\t\t\tfor(int i = 0; i < productByLike.size(); i++){\r\n\t\t\t\tif(productBySearch.size() > 0){\r\n\t\t\t\t\tfor(int j = 0; j < productBySearch.size(); j++){\r\n\t\t\t\t\t\tif(productByLike.get(i).getID() == productBySearch.get(j).getID()){\r\n\t\t\t\t\t\t\tproductByLike.get(i).setQuantity(productBySearch.get(j).getQuantity());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t//No match\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t//Printing it in the outside loop, the value doesn't alter here, values that alter will and will print them outside\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\ttxtpnsearch_2.setText(\"No product was found in inventory.\");\r\n\t\t}\r\n\t\tif(productByLike.size() > 0){\r\n\t\t\tfor(int k = 0; k < productByLike.size(); k++){\r\n\t\t\t\tmodel_search.addRow(new Object[]{k+1,productByLike.get(k).getName(),productByLike.get(k).getDescription(),productByLike.get(k).getQuantity(),productByLike.get(k).getSalePrice(),productByLike.get(k).getNotes()});\r\n\t\t\t}\r\n\t\t}\r\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 }", "@Test(timeout = 4000)\n public void test004() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String string0 = SQLUtil.renderValue(defaultDBTable0);\n assertNull(string0);\n }", "private boolean isTableExist(String tableName){\n\t\tboolean isExist = false;\n\n\t\tCursor cursor = null;\n\t\ttry {\n\t\t\tcursor = dbReadable.rawQuery(\"select count(*) from \"+ tableName, null);\n\t\t\tisExist = true;\n\t\t} catch (Exception e) {\n\t\t\tisExist = false;\n\t\t} finally {\n\t\t\tif(cursor != null)\n\t\t\t\tcursor.close();\n\t\t}\n\t\t\n\t\treturn isExist;\n\t}", "@Test(timeout = 4000)\n public void test048() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.getStatement((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test059() throws Throwable {\n DBUtil.assertAllDbResourcesClosed(false);\n DBCatalog dBCatalog0 = new DBCatalog();\n // Undeclared exception!\n try { \n dBCatalog0.getTable(\"uJr'z\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Table 'uJr'z'\n //\n verifyException(\"org.databene.jdbacl.model.DBCatalog\", e);\n }\n }", "@Override\n public boolean checkExistId(int id) throws Exception {\n Connection con = null;\n ResultSet rs = null;\n PreparedStatement ps = null;\n try {\n String query = \"select id from digital where id like ?\";\n con = getConnection();\n ps = con.prepareCall(query);\n ps.setString(1, \"%\" + id + \"%\");\n rs = ps.executeQuery();\n int count = 0;\n while (rs.next()) {\n count = rs.getInt(1);\n }\n return count != 0;\n } catch (Exception e) {\n throw e;\n } finally {\n // close ResultSet, PrepareStatement, Connection\n closeResultSet(rs);\n closePrepareStateMent(ps);\n closeConnection(con);\n }\n }", "private boolean generarEgresoMercaderiaReservada(java.sql.Connection conExt, int CodEmp,int CodLoc,int CodCot){\n boolean blnRes=false;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n ArrayList arlResDat, arlResReg;\n try{\n if(conExt!=null){\n stmLoc=conExt.createStatement();\n arlResDat = new ArrayList();\n strSql=\"\";\n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot, a2.co_reg, a2.co_itm, a2.co_bod, a2.nd_can, \\n\";\n strSql+=\" CASE WHEN a3.nd_cosUni IS NULL THEN 0 ELSE a3.nd_cosUni END as nd_cosUni,a4.co_seg \";\n strSql+=\" ,a2.tx_nomItm \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" INNER JOIN tbm_cabSegMovInv as a4 ON (a1.co_emp=a4.co_empRelCabCotVen AND a1.co_loc=a4.co_locRelCabCotVen AND \\n\";\n strSql+=\" a1.co_cot=a4.co_cotRelCabCotVen) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" and a1.co_loc=\"+CodLoc+\" and a1.co_cot=\"+CodCot+\" and a3.st_ser='N' \\n\";\n strSql+=\" ORDER BY a1.co_emp, a1.co_loc, a1.co_cot, a2.co_reg \\n\";\n System.out.println(\"generarEgresoMercaderiaReservada \" + strSql);\n rstLoc = stmLoc.executeQuery(strSql);\n while(rstLoc.next()){\n arlResReg = new ArrayList();\n arlResReg.add(INT_ARL_DAT_COD_EMP, rstLoc.getInt(\"co_emp\"));\n arlResReg.add(INT_ARL_DAT_COD_LOC, rstLoc.getInt(\"co_loc\"));\n arlResReg.add(INT_ARL_DAT_COD_BOD_EMP, rstLoc.getInt(\"co_bod\"));\n arlResReg.add(INT_ARL_DAT_COD_ITM_EMP, rstLoc.getInt(\"co_itm\"));\n arlResReg.add(INT_ARL_DAT_CAN, rstLoc.getDouble(\"nd_can\"));\n arlResReg.add(INT_ARL_DAT_COS_UNI, rstLoc.getDouble(\"nd_cosUni\"));\n arlResReg.add(INT_ARL_DAT_COD_SEG, rstLoc.getInt(\"co_seg\"));\n arlResReg.add(INT_ARL_DAT_COD_REG, rstLoc.getInt(\"co_reg\"));\n arlResReg.add(INT_ARL_DAT_NOM_ITM, rstLoc.getString(\"tx_nomItm\"));\n arlResDat.add(arlResReg);\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n if(!arlResDat.isEmpty()){\n ZafGenDocIngEgrInvRes objGenDocIngEgrInvRes = new ZafGenDocIngEgrInvRes(objParSis,this);\n if(objGenDocIngEgrInvRes.GenerarDocumentoIngresoEgresoReservas(conExt, datFecAux, arlResDat, 1)){\n blnRes=true;\n }\n }\n }\n }\n catch (java.sql.SQLException e) { \n blnRes = false;\n objUti.mostrarMsgErr_F1(this, e); \n }\n catch (Exception Evt) {\n blnRes = false;\n objUti.mostrarMsgErr_F1(this, Evt);\n }\n return blnRes;\n }", "public boolean checkTable(int layerId)\n\n {\n boolean isAvailable = false;\n try {\n\n //This statement will fetch all tables available in database.\n\n ResultSet rs1 = conn.getMetaData().getTables(null, null, null, null);\n while (rs1.next()) {\n\n String ld = rs1.getString(\"TABLE_NAME\");\n\n //This statement will extract digits from table names.\n if(!(ld.equals(\"PurgeTable\")||ld.equals(\"UserToCertMap\"))){\n String intValue = ld.replaceAll(\"[^0-9]\", \"\");\n int v;\n if (intValue != null) {\n v = Integer.parseInt(intValue);\n if (v == layerId) {\n isAvailable = true;\n }\n }\n }\n /* String intValue = ld.replaceAll(\"[^0-9]\", \"\");\n int v;\n if (intValue != null) {\n v = Integer.parseInt(intValue);\n if (v == layerId) {\n isAvailable = true;\n }\n }\n //This statement will compare layerid with digits of table names.*/\n\n }\n rs1.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n return isAvailable;\n }", "@Test(timeout = 4000)\n public void test038() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.isQuery((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n\tpublic void testGetObjectByID() throws SQLException\n\t{\n\t\tInventoryItem nail = new Nail(\"asdf\",5,5,5.0,20);\n\t\tResultSet rs = DatabaseGateway.getObjectByID(\"Nail\", nail.id);\n\t\tif(rs.next())\n\t\t{\n\t\t\tassertEquals(rs.getInt(\"id\"),1);\n\t\t\tassertEquals(rs.getInt(\"ManufacturerID\"),5);\n\t\t\tassertEquals(rs.getInt(\"Price\"),5);\n\t\t\tassertEquals(rs.getString(\"UPC\"),\"asdf\");\n\t\t\tassertTrue(rs.getDouble(\"Length\") == 5.0);\n\t\t\tassertEquals(rs.getInt(\"NumberInBox\"), 20);\n\t\t}\n\t}", "boolean materialExistInDB(int materialID) throws SQLException;", "@Test(timeout = 4000)\n public void test065() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.querySingleRow(\")\", (Connection) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public DatiBancari findByPrimaryKey(DatiBancariPk pk) throws DatiBancariDaoException;", "@Test(timeout = 4000)\n public void test022() throws Throwable {\n ErrorMessages errorMessages0 = new ErrorMessages();\n try { \n DBUtil.parseAndSimplifyResultSet(errorMessages0);\n fail(\"Expecting exception: SQLException\");\n \n } catch(SQLException e) {\n //\n // getObject\n //\n verifyException(\"org.apache.derby.vti.VTITemplate\", e);\n }\n }", "public void Excepti() throws Exception{ \n throw new Exception(\"El dato especificado NO existe en la lista!!!\"); \n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test073() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.isQuery((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }" ]
[ "0.6567767", "0.6092123", "0.59458727", "0.57712024", "0.5757312", "0.55114", "0.5308313", "0.52615124", "0.525964", "0.5241388", "0.5227394", "0.5210384", "0.51936233", "0.5173392", "0.5170402", "0.5122953", "0.509099", "0.50821793", "0.5075317", "0.50671643", "0.5055093", "0.5044627", "0.5019097", "0.50132346", "0.49918246", "0.4990174", "0.4980264", "0.49554333", "0.49492243", "0.49481192", "0.49380723", "0.4916054", "0.49132243", "0.49064755", "0.4897845", "0.48962644", "0.48892882", "0.4880516", "0.48741505", "0.4863791", "0.48631293", "0.4859766", "0.48550013", "0.48350784", "0.4834781", "0.48277286", "0.4813764", "0.4801737", "0.47996753", "0.4795044", "0.4788315", "0.47876206", "0.4787451", "0.47815838", "0.4776024", "0.47742024", "0.4771586", "0.4768824", "0.47622257", "0.47601646", "0.47575843", "0.47496405", "0.47478887", "0.47417298", "0.47411028", "0.47383142", "0.47378707", "0.4729973", "0.47297922", "0.47281334", "0.4727116", "0.47258106", "0.47228292", "0.47186226", "0.47179383", "0.47153372", "0.47150728", "0.47143978", "0.4713677", "0.47099972", "0.47082475", "0.47007307", "0.46983564", "0.46951336", "0.46926472", "0.468882", "0.4688819", "0.46887082", "0.4687631", "0.46872446", "0.4685628", "0.46799502", "0.46772322", "0.46765855", "0.46751168", "0.467287", "0.46709898", "0.46695286", "0.46693832", "0.46693194" ]
0.6360282
1
/ caller of this method must ensure that isDBValid = true & RS cursor points to the intended row never ret false
public boolean flushResultSet(ResultSet rs, boolean flushNoInduk) throws SQLException { if(flushNoInduk) rs.updateString(noIndukColName, noInduk); if(currentLevel != null) currentLevel.flushResultSet(rs, currentLevelColName); if (biodata != null) biodata.flushResultSet(rs); if(tanggalMasuk != null) tanggalMasuk.flushResultSet(rs, tanggalMasukColName); if(tanggalLulus != null) tanggalLulus.flushResultSet(rs, tanggalLulusColName); if(gelombang != null) rs.updateString(gelombangColName, gelombang.toString()); if(totalIuran > 0) rs.updateFloat(totalIuranColName, totalIuran); if(statusPendaftaran != null) rs.updateString(statusPendaftaranColName, statusPendaftaran.toString()); if(lastUpdateDate != null) lastUpdateDate.flushResultSet(rs, lastUpdateDateColName); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void verifyCursorPosition(long expectedCurrentRow) throws SQLException {\n\t\tif (verifyCursorPosition) {\n\t\t\tif (expectedCurrentRow != this.rs.getRow()) {\n\t\t\t\tthrow new InvalidDataAccessResourceUsageException(\"Unexpected cursor position change.\");\n\t\t\t}\n\t\t}\n\t}", "@Nullable\n\tprotected abstract T readCursor(ResultSet rs, int currentRow) throws SQLException;", "public boolean checkRowDBVNode(ResultSet rs){\n\t\ttry{\n\t\t\twhile(rs.next()){\n\t\t\t\tif(rs.getString(\"id\").equals(id))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}catch(SQLException e){\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn true;\n\t}", "private boolean isCursorValid(Cursor cursor) {\n if (cursor.isClosed() || cursor.isBeforeFirst() || cursor.isAfterLast()) {\n return false;\n }\n return true;\n }", "boolean isRowValid(int record_index) throws IOException;", "@Override\n public boolean isOpen() {\n return rows != null;\n }", "private boolean inDatabase() {\r\n \t\treturn inDatabase(0, null);\r\n \t}", "@Override\n\tpublic void onPostExecute(boolean isValidCursor)\n\t{\n\t\t\n\t}", "@Override\n public boolean isValid(int timeout) throws SQLException\n {\n return !isClosed;\n }", "private boolean addRecordsToList(EntityCursor<RepTestData> cursor) \n throws DatabaseException {\n\n if (isReverseRead) {\n RepTestData data = cursor.last(null);\n if (data == null) {\n return true;\n } else {\n list.add(data);\n while ((data = cursor.prev(null)) != null) {\n list.add(data);\n }\n }\n } else {\n RepTestData data = cursor.first(null);\n if (data == null) {\n return true;\n } else {\n list.add(data);\n while ((data = cursor.next(null)) != null) {\n list.add(data);\n }\n }\n }\n\n return false;\n }", "public boolean rowUpdated() throws SQLException {\n\n try {\n debugCodeCall(\"rowUpdated\");\n return false;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "private void validate() {\n for (DBRow row : rows) {\n for (DBColumn column : columns) {\n Cell cell = Cell.at(row, column);\n DBValue value = values.get(cell);\n notNull(value,\"Cell \" + cell);\n }\n }\n }", "private boolean _loadInsertRecord(String oldFieldNames[], String rowValues[], \n DBLoadValidator validator, boolean insertRecord, boolean overwriteExisting)\n throws DBException, SQLException, IOException\n {\n\n /* row values DBLoadValidator */\n if ((validator != null) && !validator.validateValues(rowValues)) {\n // -- update/insertion failed validation\n return false;\n }\n\n /* create record key/values */\n DBRecordKey<?> dbRcdKey = this.createKey(); // may throw DBException\n DBFieldValues dbKeyVals = dbRcdKey.getKeyValues();\n DBFieldValues dbFldVals = dbRcdKey.getFieldValues();\n DBRecord<?> dbRcd = dbRcdKey.getDBRecord(); // does not reload record\n\n /* parse all field values */\n boolean addedField = false;\n Set<String> fieldNameList = new HashSet<String>();\n for (int i = 0; i < oldFieldNames.length; i++) {\n String fieldName = oldFieldNames[i];\n DBField dbFld = this.getField(fieldName);\n if (dbFld != null) {\n // -- column exists\n boolean priKey = dbFld.isPrimaryKey();\n DBFieldValues dbVals = priKey? dbKeyVals : dbFldVals;\n // -- column value\n String rowVal = ((i < rowValues.length) && !rowValues[i].equals(\"\\\\N\"))? rowValues[i] : null;\n Object objVal = dbFld.parseStringValue(rowVal);\n // -- set value\n boolean didSet = dbVals._setFieldValue(dbFld, objVal);\n if (!didSet) {\n Print.logError(\"Invalid field type: %s [%s]\", fieldName, StringTools.className(objVal));\n } else\n if (priKey) {\n // -- skip primary key update\n } else {\n fieldNameList.add(fieldName);\n }\n addedField = true;\n } else {\n // -- column does not exist in defined table (will be dropped)\n }\n }\n\n /* skip record insert/update? */\n if (!insertRecord) {\n // -- do not insert/update\n return false;\n }\n\n /* update/insert */\n if (dbRcdKey.exists()) {\n\n /* disallow overwrite? */\n if (!overwriteExisting) {\n // -- Record already exists, and we don't have permission to overwrite the record\n return false;\n }\n\n /* remove fields which should not be updated */\n fieldNameList.remove(DBRecord.FLD_creationTime);\n fieldNameList.remove(DBRecord.FLD_creationMillis);\n\n /* nothing to update? */\n if (fieldNameList.isEmpty()) {\n // -- invalid record\n throw new DBException(\"No fields to update\");\n }\n\n /* insert */\n if (validator != null) {\n if (!validator.validateUpdate(dbRcd,fieldNameList)) {\n return false; // failed validation\n }\n dbRcd.update(fieldNameList);\n validator.recordDidUpdate(dbRcd,fieldNameList);\n } else {\n dbRcd.update(fieldNameList);\n }\n\n } else {\n\n /* nothing to insert?\n if (!addedField) {\n throw new DBException(\"No fields to insert\");\n }\n */\n\n /* insert */\n if (validator != null) {\n if (!validator.validateInsert(dbRcd)) {\n return false; // failed validation\n }\n dbRcd.insert();\n validator.recordDidInsert(dbRcd);\n } else {\n dbRcd.insert();\n }\n\n }\n return true;\n\n }", "DBCursor execute();", "public boolean validateInteraction (String idPatient){\n\n Cursor cursor = null;\n String query = \"\";\n String id = \"\";\n boolean value = false;\n\n InteractionDbHelper interactionDbHelper = new InteractionDbHelper(context);\n SQLiteDatabase db = interactionDbHelper.getReadableDatabase();\n\n query = \"SELECT testCode FROM \" + InteractionDbContract.InteractionEntry.TABLE_NAME;\n query = query + \" WHERE idPatient = \" + idPatient;\n\n try{\n\n cursor = db.rawQuery(query,null);\n\n if (cursor.moveToFirst()) {\n do {\n value = true;\n } while(cursor.moveToNext());\n }\n\n\n }catch (Exception e){\n e.printStackTrace();\n }finally{\n if (cursor != null)\n cursor.close();\n db.close();\n }\n\n\n return value;\n }", "private void checkClosedResultSet() {\n if(closed) {\n throw new IllegalStateException(\"Resultset is already closed\");\n }\n }", "protected abstract E handleRow(ResultSet rs) throws SQLException;", "public int maDBCursorNext(int cursorHandle)\n \t{\n \t\tif (!hasCursor(cursorHandle))\n \t\t{\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \n \t\ttry\n \t\t{\n \t\t\tif (getCursor(cursorHandle).next())\n \t\t\t{\n \t\t\t\treturn MA_DB_OK;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\treturn MA_DB_NO_ROW;\n \t\t\t}\n \t\t}\n \t\tcatch (SQLiteException ex)\n \t\t{\n \t\t\tlogStackTrace(ex);\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \t}", "@Override\n public boolean SearchSQL() {\n\n /*\n appunto su query.next()\n inizialmente query.next è posto prima della prima riga\n alla prima chiaata si posiziona sulla prima row\n alla seconda chiamata si posiziona sulla seconda row e cosi via\n */\n\n boolean controllo = false;\n\n openConnection();\n\n String sql =\"select user,pass,vol_o_cand from pass where user='\"+userInserito+\"'\";\n ResultSet query = selectQuery(sql);\n\n try {\n\n if(query.next()){\n\n String pass = query.getString(\"pass\");\n\n if(pass.equals(passInserita)) {\n controllo = true;\n volocand = query.getString(\"vol_o_cand\");\n }\n\n }\n\n\n }catch(SQLException se){\n se.printStackTrace();\n }finally{\n closeConnection();\n }\n\n\n return controllo;\n\n }", "@Override\r\n\t\tpublic boolean isValid(int timeout) throws SQLException {\n\t\t\treturn false;\r\n\t\t}", "boolean materialExistInDB(int materialID) throws SQLException;", "public boolean next() throws SQLException {\n\n try {\n debugCodeCall(\"next\");\n checkClosed();\n return nextRow();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "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 checkDb() {\n\t\t\n\t\tint userId = Auth.getCurrentUser().getId();\n\t\tString sql = \"select id from PersonalDetails where id='\"+userId+\"'\";\n\t\tint gotId;\n\t\t//connectToDb();\n\t\t\n\t\ttry(Connection conn = myDb;\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tResultSet rs = stmt.executeQuery(sql)){\n\t\t\tgotId = rs.getInt(\"id\");\n\t\t}catch(SQLException e){\n\t\t\t\n\t\t\tmyDb = null;\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(gotId == userId) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\t//return false;\n\t\t\treturn false;\n\t\t}\n\n\t}", "public boolean check(String name){\n SQLiteDatabase db=this.getWritableDatabase();\n Cursor cursor = null;\n String sql =\"SELECT 1 FROM \"+TABLE_NAME+\" WHERE \" + COL32 + \"='\" + name + \"'\";\n cursor= db.rawQuery(sql,null);\n //Log(\"Cursor Count : \" + cursor.getCount());\n\n if(cursor.getCount()>0){\n cursor.close();\n return false;\n }else{\n cursor.close();\n return true;\n }\n //cursor.close();\n }", "public boolean updateResultSet(ResultSet rs) throws SQLException, KasirException{\r\n if(!isDBValid())\r\n throw new KasirException(KasirException.Tipe.DB_INVALID, this);\r\n \r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n return flushResultSet(rs, false);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this);\r\n }", "default boolean checkDbObj(Object object) {\n return false;\n }", "final void checkEnsure() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (this.conn == null || this.conn.isClosed()) {\r\n\t\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (--this.loops < 0 || this.date < System.currentTimeMillis()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (this.databaseType == ConnectionHolder.DT_UNKNOWN) {\r\n\t\t\t\tthis.databaseType = this.conn.getMetaData().getDatabaseProductName().toUpperCase().indexOf(\"ORACLE\") == -1\r\n\t\t\t\t\t? ConnectionHolder.DT_NORMAL\r\n\t\t\t\t\t: ConnectionHolder.DT_ORACLE;\r\n\t\t\t}\r\n\t\t\ttry (final Statement st = this.conn.createStatement()) {\r\n\t\t\t\t/** Do not use it here, may be unsupported? */\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst.setQueryTimeout(10);\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tst.execute(\r\n\t\t\t\t\t\tthis.databaseType == ConnectionHolder.DT_ORACLE\r\n\t\t\t\t\t\t\t? \"SELECT 5 FROM DUAL\"\r\n\t\t\t\t\t\t\t: \"SELECT 5\");\r\n\t\t\t}\r\n\t\t} catch (final SQLException e) {\r\n\t\t\tif (this.conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t}\r\n\t}", "@Override\n\tprotected boolean isRowOkToExecute(final TableItem tableItem)\n\t{\n\n\t\tif(super.isRowOkToExecute(tableItem))\n\t\t{\n\t\t\tsetRObjectId(tableItem.getText(getAttributes().indexOf(\n\t\t\t\tIPersistentObject.R_OBJECT_ID) + 1));\n\t\t\tif(isValidIdValue(getRObjectId(), true))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean insertResultSet(ResultSet rs) throws SQLException, KasirException{\r\n if(isInsertDBValid())\r\n return flushResultSet(rs, true);\r\n else\r\n throw new KasirException(KasirException.Tipe.DB_INVALID, this);\r\n }", "@Override\n\tpublic boolean close() throws SQLException {\n\t\treturn false;\n\t}", "private boolean triggerValidation()\r\n {\r\n System.out.println(\"*** Validation row : \" + selRow + \" col : \" + selColumn + \" ***\") ;\r\n /*\r\n * using the colIndex u can get the column bean for that column and then depending the\r\n * datatype of the column u apply appropriate validation rules\r\n */\r\n Object newValue = ((CoeusTextField)txtCell).getText();\r\n\r\n if (!tableStructureBeanPCDR.isIdAutoGenerated()\r\n && (selColumn == tableStructureBeanPCDR.getPrimaryKeyIndex(0)))\r\n {\r\n if (checkDependency(selRow, \"\"))\r\n {\r\n if(!CheckUniqueId(newValue.toString(), selRow, selColumn))\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"chkPKeyUniqVal_exceptionCode.2401\");\r\n\r\n CoeusOptionPane.showInfoDialog(msg);\r\n //after failure of checking, make sure selecting the failed row\r\n\r\n return false; //fail in uniqueid check\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }\r\n else\r\n {\r\n return false;//fail in dependency check\r\n }\r\n\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n\r\n\r\n }", "private boolean guardarAutorizacionReserva(){\n java.sql.Connection conLoc;\n boolean blnRes=true;\n try{\n lblMsgSis.setText(\"Guardando datos...\");\n objCfgSer.cargaDatosIpHostServicios(0, intCodSer);\n pgrSis.setIndeterminate(true);\n int intNumFil=objTblMod.getRowCountTrue(), intCodEmp, intCodLoc, intCodCot;\n for (int i=0; i<intNumFil;i++){\n if (objUti.parseString(objTblMod.getValueAt(i,0)).equals(\"M\")){ \n intCodEmp=Integer.parseInt(tblDat.getValueAt(i,INT_TBL_DAT_COD_EMP).toString() );\n intCodLoc=Integer.parseInt(tblDat.getValueAt(i,INT_TBL_DAT_COD_LOC).toString() );\n intCodCot=Integer.parseInt(tblDat.getValueAt(i,INT_TBL_DAT_COD_COT).toString() );\n if(objTblMod.isChecked(i, INT_TBL_DAT_CHK_AUTORIZAR)){\n if(validaStock(intCodEmp, intCodLoc, intCodCot)){\n if(validaControlesCxC(intCodEmp, intCodLoc, intCodCot)){\n if(validaDatosAutorizacion(i,intCodEmp, intCodLoc,intCodCot)){\n // AUTORIZACION\n if(tblDat.getValueAt(i, INT_TBL_DAT_STR_TIP_RES_INV).toString().equals(\"F\")){\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n conLoc.setAutoCommit(false);\n if(objDatItm.modificaItemTerminalOcupado(intCodEmp, intCodLoc, intCodCot)){\n if(guardarAutorizacionFacturacionAutomatica(conLoc,i,intCodEmp,intCodLoc,intCodCot)){\n conLoc.commit(); \n objGenOD.imprimirOdxRes(conLoc, getCodigoSeguimiento(conLoc,intCodEmp,intCodLoc,intCodCot), objCfgSer.getIpHost());\n blnCotVen=true;\n }else{\n blnRes=false;\n conLoc.rollback();\n blnCotVen=false;\n }\n }else{\n blnRes=false;\n conLoc.rollback();\n blnCotVen=false;\n }\n conLoc.close();\n conLoc=null; \n }\n }\n else if(tblDat.getValueAt(i,INT_TBL_DAT_STR_TIP_RES_INV).toString().equals(\"R\")){\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n conLoc.setAutoCommit(false);\n if(guardarAutorizacionReservaEmpresa(conLoc,i ,intCodEmp,intCodLoc, intCodCot)){\n conLoc.commit();\n objGenOD.imprimirOdxRes(conLoc, getCodigoSeguimiento(conLoc,intCodEmp,intCodLoc,intCodCot), objCfgSer.getIpHost());\n }\n else{\n blnRes=false;\n conLoc.rollback();\n }\n conLoc.close();\n conLoc=null; \n }\n }\n }\n }\n else{\n blnRes=false;\n }\n }\n else{\n blnRes=false;\n }\n }else if(objTblMod.isChecked(i,INT_TBL_DAT_CHK_DENEGAR)){\n /* DENEGAR */\n if(revisarCotizacionPendiente(intCodEmp,intCodLoc,intCodCot)){\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n conLoc.setAutoCommit(false);\n if(cambiarEstadoCotizacionDenegada(conLoc,intCodEmp,intCodLoc,intCodCot)){\n conLoc.commit();\n enviarCorreoSolicitudDenegada(intCodEmp,intCodLoc,intCodCot);\n }\n else{\n conLoc.rollback();\n }\n }\n conLoc.close();\n conLoc=null;\n }\n else{\n MensajeInf(\"La cotizacion \"+intCodCot+\" no se puede denegar, ya ha sido autorizada. Debe solicitar cancelacion. \");\n }\n }\n blnRes=false;\n blnGenSolTra=false;\n }\n }\n pgrSis.setIndeterminate(false);\n \n if(!blnIsCotVen){\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n cargarDetReg(conLoc);\n conLoc.close();\n conLoc=null;\n }\n blnRes=true;\n }\n catch (java.sql.SQLException e) { \n objUti.mostrarMsgErr_F1(this, e); \n }\n catch(Exception Evt){ \n objUti.mostrarMsgErr_F1(this, Evt);\n } \n return blnRes;\n }", "public boolean isBeforeFirst() throws SQLException {\n/* 151 */ return (this.currentPositionInEntireResult < 0);\n/* */ }", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "public static void test()\n\t{\n\t Environment myDbEnvironment = null;\n\t Database myDatabase = null;\n\n\t /* OPENING DB */\n\n\t // Open Database Environment or if not, create one.\n\t EnvironmentConfig envConfig = new EnvironmentConfig();\n\t envConfig.setAllowCreate(true);\n\t myDbEnvironment = new Environment(new File(\"db/\"), envConfig);\n\n\t // Open Database or if not, create one.\n\t DatabaseConfig dbConfig = new DatabaseConfig();\n\t dbConfig.setAllowCreate(true);\n\t dbConfig.setSortedDuplicates(true);\n\t myDatabase = myDbEnvironment.openDatabase(null, \"schema\", dbConfig);\n\n\t Cursor cursor = null;\n\t /* GET <K,V > FROM DB */\n\t DatabaseEntry foundKey = new DatabaseEntry();\n\t DatabaseEntry foundData = new DatabaseEntry();\n\n\t cursor = myDatabase.openCursor(null, null);\n\t cursor.getFirst(foundKey, foundData, LockMode.DEFAULT);\n\n\t do {\n\t try {\n\t String keyString = new String(foundKey.getData(), \"UTF-8\");\n\t String dataString = new String(foundData.getData(), \"UTF-8\");\n\t System.out.println(\"<\" + keyString + \", \" + dataString + \">\");\n\t } catch (UnsupportedEncodingException e) {\n\t e.printStackTrace();\n\t }\n\t } while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS);\n\t if (cursor != null) cursor.close();\n\t System.out.println(\"-----\");\n\t \n\t if (myDatabase != null) myDatabase.close();\n\t if (myDbEnvironment != null) myDbEnvironment.close();\n\t}", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.prepareStatement((Connection) null, \"Expected exactly one row, found more.\", true);\n fail(\"Expecting exception: IllegalStateException\");\n \n } catch(IllegalStateException e) {\n //\n // Tried to mutate a database with read-only settings: Expected exactly one row, found more.\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public boolean rowInserted() throws SQLException {\n\n try {\n debugCodeCall(\"rowInserted\");\n return false;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public boolean last() throws SQLException {\n\n try {\n debugCodeCall(\"last\");\n checkClosed();\n return absolute(-1);\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "private boolean insertaTbrCtaTipDocUsrMod(){\n boolean blnRes=true;\n String strColVec=\"\";\n int w=0;\n String strColTbl=\"\";\n String strCodUsrGrp=\"\";\n int intCodCta=0;\n String strInsCtaUsr=\"\";\n try{\n if(con!=null){\n strInsCtaUsr=\"\";\n stm=con.createStatement();\n for(int i=0; i<objTblModPlaCta.getRowCountTrue(); i++){\n if(objTblModPlaCta.getValueAt(i, INT_TBL_PLA_CTA_LIN)==\"M\"){\n for( int j=(numColModIni); j<=numColModFinGlb; j++ ){\n strColVec=strVecDat[w][2]==null?\"\":strVecDat[w][2];\n strColTbl=\"\"+j;\n while( !(strColVec.equals(\"\")) ){\n if(strColVec.toString().equals(strColTbl)){\n if(objTblModPlaCta.isChecked(i, j)){\n strCodUsrGrp=strVecDat[w][0]==null?\"\":strVecDat[w][0];\n intCodCta=Integer.parseInt(\"\"+objTblModPlaCta.getValueAt(i, INT_TBL_PLA_CTA_COD_CTA));\n \n strSQL=\"\";\n strSQL+=\"INSERT INTO tbr_ctatipdocusr(\";\n strSQL+=\" co_emp, co_loc, co_tipdoc, co_usr, co_cta)\";\n strSQL+=\" VALUES (\";\n strSQL+=\"\" + objParSis.getCodigoEmpresa() + \",\";\n strSQL+=\" \" + objParSis.getCodigoLocal() + \",\";\n strSQL+=\" \" + txtCodTipDoc.getText() + \",\";\n strSQL+=\" \" + strCodUsrGrp + \",\";\n strSQL+=\" \" + intCodCta + \"\";\n strSQL+=\" );\";\n strInsCtaUsr+=strSQL;\n \n }\n }\n w++;\n strColVec=strVecDat[w][2]==null?\"\":strVecDat[w][2];\n }\n w=0;\n } \n }\n }\n System.out.println(\"SQL: \" + strInsCtaUsr);\n stm.executeUpdate(strInsCtaUsr);\n stm.close();\n stm=null;\n }\n }\n catch (java.sql.SQLException e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n catch (Exception e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "boolean execute() throws SQLException;", "public boolean fetchNext(Transaction trans, DatasetCursor cursor,\n DBObject obj, Filter filter, boolean forUpdate)\n throws StorageException, LockConflict {\n Rowid rowid = cursor.getRowid();\n int index = rowid.getIndex();\n\n while (true) {\n ++index;\n\n if (index < 0 || index >= dir.getCount())\n return false;\n\n rowid.setIndex((short) index);\n\n if (_read(trans, obj, index, forUpdate, filter))\n return true;\n }\n }", "@Override\n public boolean isCurrent() { return cursor != null; }", "public boolean isFirst() throws SQLException {\n/* 208 */ return (this.currentPositionInEntireResult == 0);\n/* */ }", "private boolean setNextObject() {\n while (iterator.hasNext()) {\n final int row = iterator.next();\n if (!rowIsDeleted(row)) {\n rowNumber = row;\n nextRowSet = true;\n return true;\n }\n }\n return false;\n }", "public void refreshRow() throws SQLException {\n\n try {\n debugCodeCall(\"refreshRow\");\n checkClosed();\n if (insertRow != null) { throw Message.getSQLException(ErrorCode.NO_DATA_AVAILABLE); }\n checkOnValidRow();\n patchCurrentRow(getUpdatableRow().readRow(result.currentRow()));\n updateRow = null;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "private boolean shouldExecuteDbFirst() throws ServiceException {\n DbSearchConstraints.Leaf top = getTopLeafConstraint();\n if (top.convId > 0 || !top.itemIds.isEmpty()) {\n return true;\n }\n\n if (luceneOp != null && luceneOp.shouldExecuteDbFirst()) {\n return true;\n }\n\n return constraints.tryDbFirst(context.getMailbox());\n }", "public boolean EditUser(String lastCMND, User u){\n String sql = \"SELECT * FROM user WHERE cmnd=\"+lastCMND;\n ConnectDB c = new ConnectDB();\n conn = c.getConnection();\n try {\n Statement stmt = conn.createStatement(\n ResultSet.TYPE_SCROLL_INSENSITIVE,\n ResultSet.CONCUR_UPDATABLE);\n// ps = conn.prepareStatement(sql);\n// ps.setString(1, u.getCmnd());\n// ps.setString(2, u.getFullName());\n// ps.setInt(3, u.getPhone());\n// ps.setString(4, u.getAddress());\n// ps.setString(5, u.getAvt());\n// ps.setString(6, lastCMND);\n rs = stmt.executeQuery(sql);\n System.err.println(rs);\n while(rs.next()){\n rs.updateString(\"cmnd\", u.getCmnd());\n rs.updateString(\"fullname\", u.getFullName());\n rs.updateInt(\"phone\", u.getPhone());\n rs.updateString(\"address\", u.getAddress());\n rs.updateString(\"avt\", u.getAvt());\n rs.updateRow();\n \n }\n return true;\n// if (ps.executeUpdate() > 0) {\n// return true;\n// } else {\n// return false;\n// }\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n \n }", "private boolean validaItemsServicio(int CodEmp, int CodLoc, int CodCot){\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n boolean blnRes=true;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc != null) {\n stmLoc=conLoc.createStatement();\n strSql=\"\";\n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" AND a1.co_loc=\"+CodLoc+\" AND a1.co_cot=\"+CodCot+\" AND (a3.st_ser='S' OR a3.st_ser='T' OR a3.st_ser='O') \\n\";\n rstLoc=stmLoc.executeQuery(strSql);\n if(rstLoc.next()){\n blnRes=false;\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n }\n conLoc.close();\n conLoc=null;\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false;\n }\n return blnRes;\n }", "private boolean validaTerminalesLReservaLocal(int CodEmp,int CodLoc, int CodCot){\n boolean blnRes=true;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc!=null){\n stmLoc=conLoc.createStatement();\n strSql=\"\"; \n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot, a2.tx_codALt, trim(SUBSTR (UPPER(a2.tx_codalt), length(a2.tx_codalt) ,1)) as terminal \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" and a1.co_loc=\"+CodLoc+\" and a1.co_cot=\"+CodCot+\" \\n\";\n System.out.println(\"validaTerminalesLReservaLocal... \"+ strSql);\n rstLoc = stmLoc.executeQuery(strSql);\n while(rstLoc.next()){\n if(rstLoc.getString(\"terminal\").equals(\"L\")){\n blnRes=false;\n }\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(null, e);\n blnRes=false;\n }\n return blnRes;\n }", "@Test\n public void selectStatementSuccessful() throws SQLException {\n assertNotNull(testConnection.selectStatement(con, \"SELECT * FROM Employees;\"));\n assertNull(testConnection.selectStatement(con, \"SELECT * FROM Emp;\"));\n\n //Test if RS is empty\n assertTrue(testConnection.selectStatement(con, \"SELECT * FROM Employees\").next());\n assertFalse(testConnection.selectStatement(con, \"SELECT * FROM Employees WHERE email='x'\").next());\n }", "public boolean checkDbStructure(){\n\t\tboolean isStructureOk = false;\n\t\t\n\t\ttry {\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Description, Version from \" + mDbName + \".\" + TABLE_AREA);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Area_ID, Route_ID from \" + mDbName + \".\" + TABLE_AREA_HAS_ROUTES);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Ticket_ID, Name, StartName, EndName from \" + mDbName + \".\" + TABLE_ROUTE);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Route_ID, Station_ID, Position from \" + mDbName + \".\" + TABLE_ROUTE_HAS_STATIONS);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Abbreviation, Latitude, Longitude from \" + mDbName + \".\" + TABLE_STATION);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Icon, Is_Superior from \" + mDbName + \".\" + TABLE_TICKET);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tisStructureOk = true;\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t\tisStructureOk = false;\n\t\t}\n\t\t\n\t\treturn isStructureOk;\n\t}", "public boolean first() throws SQLException {\n\n try {\n debugCodeCall(\"first\");\n checkClosed();\n if (result.getRowId() < 0) { return nextRow(); }\n resetResult();\n return nextRow();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "protected boolean check(CrawlDatum datum) {\n if (datum.getStatus() != expectedDbStatus)\n return false;\n return true;\n }", "public boolean hasNext() throws SQLException {\n/* 285 */ if (this.fetchedRows != null && this.fetchedRows.size() == 0) {\n/* 286 */ return false;\n/* */ }\n/* */ \n/* 289 */ if (this.owner != null && this.owner.owningStatement != null) {\n/* 290 */ int maxRows = this.owner.owningStatement.maxRows;\n/* */ \n/* 292 */ if (maxRows != -1 && this.currentPositionInEntireResult + 1 > maxRows) {\n/* 293 */ return false;\n/* */ }\n/* */ } \n/* */ \n/* 297 */ if (this.currentPositionInEntireResult != -1) {\n/* */ \n/* 299 */ if (this.currentPositionInFetchedRows < this.fetchedRows.size() - 1)\n/* 300 */ return true; \n/* 301 */ if (this.currentPositionInFetchedRows == this.fetchedRows.size() && this.lastRowFetched) {\n/* 302 */ return false;\n/* */ }\n/* */ \n/* 305 */ fetchMoreRows();\n/* */ \n/* 307 */ return (this.fetchedRows.size() > 0);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 313 */ fetchMoreRows();\n/* */ \n/* 315 */ return (this.fetchedRows.size() > 0);\n/* */ }", "@Test\n public void testSelectSpecificRowThatDoesNotExist() throws SQLException {\n // Arrange\n CommitStructure commit = getSampleCommit();\n String commitID = commit.getCommitID() + \"A\";\n // Act\n mysqlDatabase.insertCommitToDatabase(commit);\n CommitStructure commits = mysqlDatabase.selectSpecificRow(commitID);\n // Assert\n assertNull(commits);\n }", "@Override\r\n\tprotected boolean isValidTable(final ResultSet resultSet) throws SQLException {\r\n\t\treturn !resultSet.getString(3).contains(\"BIN$\");\r\n\t}", "@Override\n\tprotected Object[] readCursor(ResultSet rs, int currentRow)\n\t\t\tthrows SQLException {\n\t\treturn super.readCursor(rs, currentRow);\n\t}", "public boolean isBeforeFirst() throws SQLException {\n\n try {\n debugCodeCall(\"isBeforeFirst\");\n checkClosed();\n return result.getRowId() < 0;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "protected void checkRow(int row) {\n\tif (row < 0 || row >= rows) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at row=\"+row);\n}", "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 }", "@Override\r\n public Boolean moreRecords()\r\n {\r\n Boolean blnRet = false;\r\n try\r\n {\r\n blnRet = dbRecordset.next();\r\n }\r\n catch (Exception e)\r\n {\r\n blnRet = false;\r\n }\r\n return blnRet; // only one RETURN in each function!\r\n }", "private boolean isValid() {\n\t\treturn proposalTable != null && !proposalTable.isDisposed();\n\t}", "public static void AddBooking(Booking booking){\n \n \n try (Connection connection = DbConnector.connectToDb();\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n ResultSet resultSet = statement.executeQuery(\"SELECT * FROM booking\")){\n \n resultSet.moveToInsertRow();\n resultSet.updateInt(\"BookingNumber\", booking.getBookingNumber());\n resultSet.updateString(\"FlightNumber\", booking.getFlightNumber());\n resultSet.updateDouble(\"Price\", booking.getPrice());\n resultSet.updateString(\"CabinClass\", booking.getCabinClass());\n resultSet.updateInt(\"Quantity\", booking.getQuantity());\n resultSet.updateInt(\"Insurance\", booking.getInsurance());\n resultSet.insertRow();\n \n \n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n \n \n \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 boolean isValid(int timeout) throws SQLException {\n log.debug(() -> logEntry(\"isValid (%d)\", timeout));\n\n boolean isValid = true;\n\n log.debug(() -> logExit(\"isValid\", isValid));\n return isValid;\n }", "@Override\n public int getResultSetHoldability() throws SQLException {\n return 0;\n }", "@Override\r\n\tpublic boolean evaluate(RowSet rs) {\n\t\treturn false;\r\n\t}", "public boolean checkIfThisHBRecordIsInTheDB()\n\t{\n\t\treturn checkIfThisRecordIsInTheDB(getWhereConditionBaseOnIdRecord());\n\t}", "@Override\r\n\tprotected boolean isValidView(final ResultSet resultSet) throws SQLException {\r\n\t\treturn !resultSet.getString(3).contains(\"BIN$\");\r\n\t}", "static public void validateCursor(ContentValues expectedValues, Cursor valueCursor)\n {\n Set<Map.Entry<String,Object>> valueSet = expectedValues.valueSet();\n\n for(Map.Entry<String, Object> entry : valueSet)\n {\n String columnName = entry.getKey();\n int idx = valueCursor.getColumnIndex(columnName);\n assertFalse( -1 == idx );\n String expectedValue = entry.getValue().toString();\n assertEquals(expectedValue, valueCursor.getString(idx));\n }\n\n }", "private boolean saveData()\r\n {\n if (tableDataValid())\r\n {\r\n // get the modified rows\r\n Vector vecModifiedRows = getModifiedRows() ;\r\n if (vecModifiedRows != null)\r\n {\r\n System.out.println(\"obtd modified rows successfuly\") ;\r\n }\r\n\r\n HashMap hashStoredProcedure = (HashMap)tableStructureBeanPCDR.getHashStoredProceduresForThisTable();\r\n if(hashStoredProcedure == null)\r\n System.out.println(\"hashStoredProcedure == null\");\r\n //Get the update stored procedure associated witht this table.\r\n StoredProcedureBean updateStoredProcedure =\r\n (StoredProcedureBean)hashStoredProcedure.get(new Integer(1));\r\n\r\n RequestTxnBean requestTxnBean = new RequestTxnBean();\r\n requestTxnBean.setAction(\"MODIFY_DATA\");\r\n requestTxnBean.setStoredProcedureBean(updateStoredProcedure);\r\n requestTxnBean.setRowsToModify(vecModifiedRows) ;\r\n\r\n // the servlet will return if the saving process was successful or not\r\n Boolean success = (Boolean)getDataFromServlet(requestTxnBean) ;\r\n if (success == null) // Error while saving data\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"saveFail_exceptionCode.1102\");\r\n\r\n CoeusOptionPane.showInfoDialog(msg);\r\n return false;\r\n }\r\n else\r\n {//Data Saved Successfully\r\n saveRequired = false;\r\n return true;\r\n }\r\n\r\n }// end if data validation\r\n else\r\n {\r\n return false;\r\n }\r\n }", "public XQValue bornAgain() {\n try {\n rset.beforeFirst();\n }\n catch (SQLException e) { }\t// just try\n return new RawResult(rset); \n }", "@Override\n\tpublic boolean isPoolable() throws SQLException {\n\t\treturn false;\n\t}", "private void checkAndThrowReceivedEndqryrm() {\n // If we are in a split row, and before sending CNTQRY, check whether an ENDQRYRM\n // has been received.\n // TODO: check for ENDQRYRM before throwing exception\n throw new IllegalStateException(\"SQLState.NET_QUERY_PROCESSING_TERMINATED\");\n// if (!netResultSet_.openOnServer_) {\n// SQLException SQLException = null;\n// int sqlcode = Utils.getSqlcodeFromSqlca(\n// netResultSet_.queryTerminatingSqlca_);\n//\n// if (sqlcode < 0) {\n// SQLException = new SQLException(agent_.logWriter_, netResultSet_.queryTerminatingSqlca_);\n// } else {\n// SQLException = new SQLException(agent_.logWriter_,\n// new ClientMessageId(SQLState.NET_QUERY_PROCESSING_TERMINATED));\n// }\n// try {\n// netResultSet_.closeX(); // the auto commit logic is in closeX()\n// } catch (SQLException e) {\n// SQLException.setNextException(e);\n// }\n// throw SQLException;\n// }\n }", "public boolean isPoolable() throws SQLException {\n return currentPreparedStatement.isPoolable();\n }", "private boolean crearRecurso(int codigoCiclo, int codigoPlan, int codigoMeta, int codigoRecurso, String estado, String usuarioInsercion) {\n/* */ try {\n/* 513 */ String s = \"select estado from cal_plan_recursos_meta r where r.codigo_ciclo=\" + codigoCiclo + \" and r.codigo_plan=\" + codigoPlan + \" and r.codigo_meta=\" + codigoMeta + \" and r.codigo_recurso=\" + codigoRecurso;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 520 */ this.dat.parseSql(s);\n/* 521 */ this.rs = this.dat.getResultSet();\n/* 522 */ if (this.rs.next()) {\n/* 523 */ s = \"update cal_plan_recursos_meta set \";\n/* 524 */ s = s + \" estado='\" + estado + \"',\";\n/* 525 */ s = s + \" fecha_modificacion=\" + Utilidades.getFechaBD() + \",\";\n/* 526 */ s = s + \" usuario_modificacion='\" + usuarioInsercion + \"'\";\n/* 527 */ s = s + \" where \";\n/* 528 */ s = s + \" codigo_ciclo=\" + codigoCiclo;\n/* 529 */ s = s + \" and codigo_plan=\" + codigoPlan;\n/* 530 */ s = s + \" and codigo_meta=\" + codigoMeta;\n/* 531 */ s = s + \" and codigo_recurso=\" + codigoRecurso;\n/* */ } else {\n/* */ \n/* 534 */ s = \"insert into cal_plan_recursos_meta (codigo_ciclo,codigo_plan,codigo_meta,codigo_recurso,estado,fecha_insercion,usuario_insercion) values (\" + codigoCiclo + \",\" + \"\" + codigoPlan + \",\" + \"\" + codigoMeta + \",\" + \"\" + codigoRecurso + \",\" + \"'\" + estado + \"',\" + Utilidades.getFechaBD() + \",\" + \"'\" + usuarioInsercion + \"'\" + \")\";\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 552 */ return this.dat.executeUpdate(s);\n/* */ \n/* */ }\n/* 555 */ catch (Exception e) {\n/* 556 */ e.printStackTrace();\n/* 557 */ Utilidades.writeError(\"CalMetasDAO:crearRegistro\", e);\n/* */ \n/* 559 */ return false;\n/* */ } \n/* */ }", "public String checkUser(String id, String pass) throws SQLException {\n String result = \"three\";\n int count = 0;\n Log.i(TAG + \"credentials\", id + pass);\n SQLiteDatabase db = dbHelper.getReadableDatabase();\n // Cursor cursor = db.rawQuery(\"Select * from \" + Database.userTable, null);\n\n Cursor cursor = db.rawQuery(\"Select * from \"+Database.userTable , null);//+\" where \"+Database.userId+\" = ?\",new String[] {\"\" +id} );\n Log.i(TAG + \"count\", cursor.getCount() + \"\" + id + pass);\n if(cursor.moveToFirst()){\n //password = 6, priviledges = 7\n do {\n Log.i(\"pass\", cursor.getString(5) + cursor.getString(0));\n if (cursor.getString(0).equals(id)) {\n if(cursor.getString(5).equals(pass) ) {\n db.close();\n result = cursor.getString(6);\n return result;\n }else{\n result = \"pass\";\n return result;\n }\n\n }\n }while (cursor.moveToNext());\n // }else\n // return \"three\";\n }\n Log.i(TAG +\"after cursor\", \"No data\");\n db.close();\n return result;\n }", "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}", "protected void commit()\n\t{\n\t\t_Status = DBRowStatus.Unchanged;\n\t}", "public boolean execute( ) throws OdaException\n \t{\n \t\tlogger.logp( java.util.logging.Level.FINE,\n \t\t\t\tStatement.class.getName( ),\n \t\t\t\t\"execute\",\n \t\t\t\t\"Statement.execute( )\" );\n \t\tassertNotNull( preStat );\n \t\ttry\n \t\t{\n \t\t\tif ( maxrows >= 0 && !maxRowsUpToDate )\n \t\t\t{\n \t\t\t\tpreStat.setMaxRows( maxrows );\n \t\t\t\tmaxRowsUpToDate = true;\n \t\t\t}\n \t\t\t/* redirect the call to JDBC preparedStatement.execute() */\n \t\t\treturn preStat.execute( );\n \t\t}\n \t\tcatch ( SQLException e )\n \t\t{\n \t\t\tthrow new JDBCException( ResourceConstants.QUERY_EXECUTE_FAIL, e );\n \t\t}\n \t}", "public boolean isBeforeFirst() throws SQLException\n {\n return m_rs.isBeforeFirst();\n }", "@Override\n\tpublic boolean hasNext() {\n\t\tthis.res = new Row();\n\t\ttry{\n\t\t\twhile(index < dataCopy.size()){\n\t\t\t\tdata2 = dataCopy.get(index++);\t\t\t\t\t\t\t\n\t\t\t\tif(whereExp != null && !eval1.eval(whereExp).toBool()) continue;\t\n\t\t\t\t\n\t\t\t\tTableContainer.orderByData.add(new Row());\n\t\t\t\tfor(PrimitiveValue v : data2.rowList)\n\t\t\t\t\tTableContainer.orderByData.get(count).rowList.add(v);\t\n\t\t\t\tcount++;\n\t\t\t\n\t\t\t\t/*if the query is SELECT * FROM R*/\n\t\t\t\tif(flag2){\n\t\t\t\t\tres = data2;\n\t\t\t\t}else{\n\t\t\t\t\t/*if it is the regular query*/\n\t\t\t\t\tfor (int i = 0; i < itemLen; i++) res.rowList.add(eval1.eval((selectItemsExpression.get(i))));\n\t\t\t\t}\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}", "public boolean first() throws SQLException\n {\n return m_rs.first();\n }", "public XQValue bornAgain() {\n try {\n rset.beforeFirst();\n }\n catch (SQLException e) { }\t// just try\n return new Result(rset); \n }", "private boolean validaInsert(Entity e) throws SQLException {\r\n stmt = conn.createStatement();\r\n String sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(0) + \"= \" + e.getCell(0).getValue();\r\n if (e.getTableName().equals(\"Contato\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(3) + \"= '\" + String.valueOf(e.getCell(3).getValue()) + \"' and \" + e.getColumnName(1) + \"= '\" + String.valueOf(e.getCell(1).getValue()) + \"';\";\r\n\r\n }\r\n if (e.getTableName().equals(\"Telefone\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(2) + \"= '\" + String.valueOf(e.getCell(2).getValue()) + \"' and \" + e.getColumnName(1) + \"= '\" + String.valueOf(e.getCell(1).getValue()) + \"' and \" + e.getColumnName(3) + \"= '\" + String.valueOf(e.getCell(3).getValue()) + \"';\";\r\n\r\n }\r\n if (e.getTableName().equals(\"Solicitacoes\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(6) + \"= '\" + String.valueOf(e.getCell(6).getValue()) + \"' and \" + e.getColumnName(7) + \"= '\" + String.valueOf(e.getCell(7).getValue()) + \"';\";\r\n\r\n }\r\n System.out.println(sql);\r\n rs = stmt.executeQuery(sql);\r\n if (rs.next()) {\r\n stmt.close();\r\n rs.close();\r\n return false;\r\n }\r\n stmt.close();\r\n rs.close();\r\n return true;\r\n\r\n }", "@Override\n public long readBatchData() throws SQLException {\n return (-1);\n }", "public boolean checkForAbsenceInDB(Absence absence) throws SQLException {\n int studentKey = absence.getStudentKey();\n java.sql.Date sqlDate = java.sql.Date.valueOf(absence.getDate()); // converts LocalDate date to sqlDate\n try(Connection con = dbc.getConnection()){\n String SQLStmt = \"SELECT * FROM ABSENCE WHERE StudentKey = '\" + studentKey + \"' AND DATE = '\" + sqlDate+\"';\";\n Statement stmt = con.createStatement();\n ResultSet rs = stmt.executeQuery(SQLStmt);\n while(rs.next())\n {\n return true; // Absence found\n }\n }\n return false; // No Absence found\n }", "public void load2() throws Exception {\n String query = \"select * from catalog_snapshot where item_id = \" + item_id + \" and facility_id = '\" + facility_id + \"'\";\n query += \" and fac_item_id = '\" + this.fac_item_id + \"'\";\n DBResultSet dbrs = null;\n ResultSet rs = null;\n try {\n dbrs = db.doQuery(query);\n rs = dbrs.getResultSet();\n if (rs.next()) {\n setItemId( (int) rs.getInt(\"ITEM_ID\"));\n setFacItemId(rs.getString(\"FAC_ITEM_ID\"));\n setMaterialDesc(rs.getString(\"MATERIAL_DESC\"));\n setGrade(rs.getString(\"GRADE\"));\n setMfgDesc(rs.getString(\"MFG_DESC\"));\n setPartSize( (float) rs.getFloat(\"PART_SIZE\"));\n setSizeUnit(rs.getString(\"SIZE_UNIT\"));\n setPkgStyle(rs.getString(\"PKG_STYLE\"));\n setType(rs.getString(\"TYPE\"));\n setPrice(BothHelpObjs.makeBlankFromNull(rs.getString(\"PRICE\")));\n setShelfLife( (float) rs.getFloat(\"SHELF_LIFE\"));\n setShelfLifeUnit(rs.getString(\"SHELF_LIFE_UNIT\"));\n setUseage(rs.getString(\"USEAGE\"));\n setUseageUnit(rs.getString(\"USEAGE_UNIT\"));\n setApprovalStatus(rs.getString(\"APPROVAL_STATUS\"));\n setPersonnelId( (int) rs.getInt(\"PERSONNEL_ID\"));\n setUserGroupId(rs.getString(\"USER_GROUP_ID\"));\n setApplication(rs.getString(\"APPLICATION\"));\n setFacilityId(rs.getString(\"FACILITY_ID\"));\n setMsdsOn(rs.getString(\"MSDS_ON_LINE\"));\n setSpecOn(rs.getString(\"SPEC_ON_LINE\"));\n setMatId( (int) rs.getInt(\"MATERIAL_ID\"));\n setSpecId(rs.getString(\"SPEC_ID\"));\n setMfgPartNum(rs.getString(\"MFG_PART_NO\"));\n\n //trong 3-27-01\n setCaseQty(BothHelpObjs.makeZeroFromNull(rs.getString(\"CASE_QTY\")));\n }\n } catch (Exception e) {\n e.printStackTrace();\n HelpObjs.monitor(1,\n \"Error object(\" + this.getClass().getName() + \"): \" + e.getMessage(), null);\n throw e;\n } finally {\n dbrs.close();\n }\n return;\n }", "@Override\n\tpublic boolean isPoolable()\n\t\tthrows SQLException {\n return false;\n }", "public boolean isFirst() throws SQLException {\n\n try {\n debugCodeCall(\"isFirst\");\n checkClosed();\n int row = result.getRowId();\n return row == 0 && row < result.getRowCount();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "private boolean puedeModificarAprRepOtroUsuario(String empresa, String local, String tipoDocumento, String codigoDocumento, String codigoVistoBueno, boolean checkSeleccionado, int fila, int columna){\n boolean blnRes=false;\n String strArlVisBueDbCodEmp=\"\", strArlVisBueDbCodLoc=\"\", strArlVisBueDbCodTipDoc=\"\", strArlVisBueDbCodDoc=\"\";\n String strArlVisBueDbCodVisBue=\"\", strArlVisBueDbEstVisBue=\"\", strArlVisBueDbCodUsr=\"\";\n String strTblVisBueDbCodEmp=empresa;\n String strTblVisBueDbCodLoc=local;\n String strTblVisBueDbCodTipDoc=tipoDocumento;\n String strTblVisBueDbCodDoc=codigoDocumento;\n String strTblVisBueDbCodVisBue=codigoVistoBueno;\n boolean blnChkSel=checkSeleccionado;\n int intFil=fila;\n int intCol=columna;\n int w=0;\n //System.out.println(\"puedeModificarAprRepOtroUsuario: \" + arlDatCodVisBueDB.toString());\n try{\n for(int k=0; k<arlDatCodVisBueDB.size(); k++){\n w=0;\n strArlVisBueDbCodEmp=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_EMP_DB);\n strArlVisBueDbCodLoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_LOC_DB);\n strArlVisBueDbCodTipDoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_TIP_DOC_DB);\n strArlVisBueDbCodDoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_DOC_DB);\n strArlVisBueDbCodVisBue=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_VIS_BUE_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_VIS_BUE_DB);\n strArlVisBueDbEstVisBue=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_EST_VIS_BUE_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_EST_VIS_BUE_DB);\n strArlVisBueDbCodUsr=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_USR_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_USR_DB);\n\n if(strTblVisBueDbCodEmp.equals(strArlVisBueDbCodEmp)){\n if(strTblVisBueDbCodLoc.equals(strArlVisBueDbCodLoc)){\n if(strTblVisBueDbCodTipDoc.equals(strArlVisBueDbCodTipDoc)){\n if(strTblVisBueDbCodDoc.equals(strArlVisBueDbCodDoc)){\n if(strArlVisBueDbCodVisBue.equals(strTblVisBueDbCodVisBue)){\n if( (strArlVisBueDbEstVisBue.equals(\"A\")) || (strArlVisBueDbEstVisBue.equals(\"D\")) ){\n if(! strArlVisBueDbCodUsr.equals(\"\"+objParSis.getCodigoUsuario())){\n objTblMod.setChecked(blnChkSel, intFil, intCol);\n mostrarMsgInf(\"<HTML>El visto bueno que intenta modificar ya fue Aprobado/Reprobado por otro usuario.<BR>El otro usuario debe reversar para que ud. pueda realizar la Aprobación/Reprobación,<BR> o dicho usuario deberá modificarlo. </HTML>\");\n blnRes=true;\n break;\n }\n }\n\n }\n }\n }\n }\n }\n }\n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "@Override\r\n\tpublic boolean isReady() {\n\t\tResultSetDTO dto = mongoManager.fetchAndUpdateAvailableToRead(previousCollectionName);\r\n\t\t\r\n\t\tlogger.info(\"ready to start a new transaction? : [\"+(dto.isNotEmpty()?\"Yes\":\"No\")+\"], fetch size : \"+dto.getBatchRowsSize());\r\n\t\tif(dto.isNotEmpty()){\r\n\t\t\t\r\n\t\t\tnextBatchRows = dto.getBatchRows();\r\n\t\t\tcollectionName = dto.getCollectionName();\r\n\t\t\tpreviousCollectionName = collectionName;\r\n//\t\t\tlong idletime = 1 * 1000;\r\n//\t\t\tlogger.info(\"sleeping(has data)... idle time:\"+idletime+\" ms\");\r\n//\t\t\tUtils.sleep(idletime);\r\n\t\t\tlogger.debug(\"received data, prepare to sleep for a while...\");\r\n\t\t\tUtil.sleepForawhile(3 * 1000);\r\n\t\t\treturn true;\r\n\t\t} else{ //sleep while there is no data found\r\n\t\t\tlogger.warn(\"no data found, sleeping...\");\r\n\t\t\tUtil.sleepForawhile(6 * 1000);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n//\t\treturn mongoManager.getAvailableToRead(nextRead) > 0;\r\n\t}", "@Override\r\n\t\tpublic boolean isReadOnly() throws SQLException {\n\t\t\treturn false;\r\n\t\t}", "@Override\n\tprotected boolean isOkToExecute()\n\t{\n\n\t\tif((super.isOkToExecute())\n\t\t\t&& isColumAvailable(IPersistentObject.R_OBJECT_ID))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\tMessageView.getInstance().addMessage(\n\t\t\tConnectionView.getInstance().getSelectedConnection().getTag()\n\t\t\t\t+ \" No '\" + IPersistentObject.R_OBJECT_ID //$NON-NLS-1$\n\t\t\t\t+ \"' column found.\"); //$NON-NLS-1$\n\t\treturn false;\n\t}", "@Override\n public boolean isClosed() throws SQLException {\n return false;\n }", "@Test(timeout = 4000)\n public void test46() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n PipedReader pipedReader0 = new PipedReader();\n Boolean boolean0 = Boolean.FALSE;\n SQLUtil.isQuery(\"selectntowrong c|ck\");\n Boolean.valueOf(true);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"selectntowrong c|ck\");\n // Undeclared exception!\n try { \n defaultDBTable0.getUniqueConstraint(\"^h=wZ>:9%}Pj6(#%M\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "protected void checkScrollability() throws HibernateException {\n \t\t// Allows various loaders (ok mainly the QueryLoader :) to check\n \t\t// whether scrolling of their result set should be allowed.\n \t\t//\n \t\t// By default it is allowed.\n \t\treturn;\n \t}", "@Override\r\n\t\tpublic boolean isClosed() throws SQLException {\n\t\t\treturn false;\r\n\t\t}", "private void moveCursorToRow(int row) {\n\t\ttry {\n\t\t\tint count = 0;\n\t\t\twhile (row != count && rs.next()) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tcatch (SQLException se) {\n\t\t\tthrow getExceptionTranslator().translate(\"Attempted to move ResultSet to last committed row\", getSql(), se);\n\t\t}\n\t}" ]
[ "0.631763", "0.6228026", "0.609012", "0.60830003", "0.59658855", "0.5965686", "0.5916377", "0.5906782", "0.58755434", "0.58221483", "0.58203644", "0.58198947", "0.5806018", "0.57981604", "0.578471", "0.5670544", "0.56679153", "0.5665379", "0.56433165", "0.56081843", "0.5588963", "0.558835", "0.5556112", "0.5546113", "0.5537137", "0.5524172", "0.55227345", "0.55166554", "0.5512315", "0.5512272", "0.550988", "0.5501834", "0.550026", "0.54966897", "0.5484152", "0.54744935", "0.547265", "0.54616815", "0.54600453", "0.5451533", "0.5447998", "0.5444458", "0.5439826", "0.54268944", "0.5408529", "0.5407978", "0.54070383", "0.5402979", "0.53927773", "0.53918207", "0.5389456", "0.5381686", "0.5381589", "0.53789693", "0.53710204", "0.53696835", "0.5360086", "0.5357719", "0.5352105", "0.5338298", "0.53309995", "0.53230345", "0.53192306", "0.5315361", "0.5310649", "0.5310649", "0.530112", "0.5300434", "0.5295945", "0.5289722", "0.5278198", "0.5265161", "0.5264918", "0.52637285", "0.52539873", "0.52537763", "0.52527595", "0.52513915", "0.524827", "0.5244337", "0.5241367", "0.5233473", "0.5232736", "0.52297497", "0.52157754", "0.52105767", "0.5209573", "0.5197432", "0.5196725", "0.5194815", "0.519076", "0.5183808", "0.51808673", "0.5180797", "0.5178566", "0.51779807", "0.5174708", "0.5173913", "0.51705956", "0.51631844", "0.51578695" ]
0.0
-1
/ caller of this method must ensure that RS cursor is at the insert row & that no existing row has the same noInduk & call rs.insertRow() when all done throws KasirException(DB_INVALID, this) if isInsertDBValid = false never ret false
public boolean insertResultSet(ResultSet rs) throws SQLException, KasirException{ if(isInsertDBValid()) return flushResultSet(rs, true); else throw new KasirException(KasirException.Tipe.DB_INVALID, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean insertDB(String qryExp, RequestBox rBox) throws Exception {\n\t\t\n\t\tConnection conn = null;\n\t\tconn = DBConnect.getDBConnection(\"TPI_TRIBON\");\n\t\tconn.setAutoCommit(false);\n\t\t\n PreparedStatement \tpstmt \t\t= null;\n int \t\t\t\tisOk \t\t= 0;\n int \t\t\t\tisAllOk \t= 1;\n boolean\t\t\t\trtn\t\t\t= true;\n String \t\t\t\tquery \t\t= \"\";\n try {\n \t\n \t\n \tquery = getQuery(qryExp,rBox);\n \t\t\tArrayList list = (ArrayList)rBox.getObject(\"ExcelList\");\n \t\t\tHashMap dbox = null;\n \t\t\t\n \tfor(int i = 0; i < list.size(); i++){ \t\t\n \t\tdbox = (HashMap)list.get(i); \t\t\n \t\tpstmt = conn.prepareStatement(query.toString());\n \t\t\n \t\tpstmt.setString(1, (String)dbox.get(\"test1\"));\n \t\tpstmt.setString(2, (String)dbox.get(\"test2\"));\n \t\tpstmt.setString(3, (String)dbox.get(\"test3\"));\n \t\tpstmt.setString(4, (String)dbox.get(\"test4\"));\n \t\tpstmt.setString(5, (String)dbox.get(\"test5\"));\n \t\tpstmt.setString(6, (String)dbox.get(\"test6\"));\n \t\tpstmt.setString(7, (String)dbox.get(\"test7\"));\n \t\t\n \t\t isOk = pstmt.executeUpdate();\n \t\t \n \t\t //한개라도 실패한다면 실패\n \t\t if(isOk < 0){\n \t\t \tisAllOk = 0;\n \t\t }\n \t}\n \t\n\t\t //결과 성공 여부 결정\n\t\t if(isAllOk != 1){\n\t\t \trBox.put(\"errorMsg\", \"Data Error!\");\n\t\t \trtn = false;\n\t\t \tconn.rollback();\n\t\t }else{\n\t\t \trBox.put(\"successMsg\", \"Success Data Insert!\");\n\t\t \trtn = true;\n\t\t \tconn.commit();\n\t\t\t}\n }\n catch ( Exception ex ) { \n \trtn = false;\n \tex.printStackTrace();\n }\n finally {\n if ( conn != null ) { try { conn.close(); } catch ( Exception e ) { } }\n if ( pstmt != null ) { try { pstmt.close(); } catch ( Exception e ) { } }\n }\n\t\t\n\t\treturn rtn;\n\t}", "private boolean insert()throws Exception{\n String query = \"INSERT INTO \" + tableName + \" VALUES(?, ?, ?)\";\n PreparedStatement pstm = this.con.prepareStatement(query);\n\n pstm.setObject(1, Name.getText().trim());\n pstm.setObject(2, City.getText().trim());\n pstm.setObject(3, Phone.getText().trim());\n\n int result = pstm.executeUpdate();\n\n return (result > 0);\n }", "private boolean insertaTbrCtaTipDocUsrMod(){\n boolean blnRes=true;\n String strColVec=\"\";\n int w=0;\n String strColTbl=\"\";\n String strCodUsrGrp=\"\";\n int intCodCta=0;\n String strInsCtaUsr=\"\";\n try{\n if(con!=null){\n strInsCtaUsr=\"\";\n stm=con.createStatement();\n for(int i=0; i<objTblModPlaCta.getRowCountTrue(); i++){\n if(objTblModPlaCta.getValueAt(i, INT_TBL_PLA_CTA_LIN)==\"M\"){\n for( int j=(numColModIni); j<=numColModFinGlb; j++ ){\n strColVec=strVecDat[w][2]==null?\"\":strVecDat[w][2];\n strColTbl=\"\"+j;\n while( !(strColVec.equals(\"\")) ){\n if(strColVec.toString().equals(strColTbl)){\n if(objTblModPlaCta.isChecked(i, j)){\n strCodUsrGrp=strVecDat[w][0]==null?\"\":strVecDat[w][0];\n intCodCta=Integer.parseInt(\"\"+objTblModPlaCta.getValueAt(i, INT_TBL_PLA_CTA_COD_CTA));\n \n strSQL=\"\";\n strSQL+=\"INSERT INTO tbr_ctatipdocusr(\";\n strSQL+=\" co_emp, co_loc, co_tipdoc, co_usr, co_cta)\";\n strSQL+=\" VALUES (\";\n strSQL+=\"\" + objParSis.getCodigoEmpresa() + \",\";\n strSQL+=\" \" + objParSis.getCodigoLocal() + \",\";\n strSQL+=\" \" + txtCodTipDoc.getText() + \",\";\n strSQL+=\" \" + strCodUsrGrp + \",\";\n strSQL+=\" \" + intCodCta + \"\";\n strSQL+=\" );\";\n strInsCtaUsr+=strSQL;\n \n }\n }\n w++;\n strColVec=strVecDat[w][2]==null?\"\":strVecDat[w][2];\n }\n w=0;\n } \n }\n }\n System.out.println(\"SQL: \" + strInsCtaUsr);\n stm.executeUpdate(strInsCtaUsr);\n stm.close();\n stm=null;\n }\n }\n catch (java.sql.SQLException e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n catch (Exception e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "public boolean insert(Object KV_pair,String avd) // making this also synchronized -- bad idea -- raja may 8\n {\n \t/**\n \t * lock the DB when inserting -- query also uses this -- \n \t * To keep Query section from querying \n \t */\n \t \n\t\tsynchronized (_DBWRITE_Lock)\n\t\t{\n\t\t\tlong rowID = 0l;\n\t\t\tContentValues newValues = null;\n\t\t\tif(KV_pair instanceof String[])\n\t\t\t{\n\t\t\t\tnewValues = new ContentValues();\n\t\t\t\tString[] KV = (String[])KV_pair;\n\t\t\t\tnewValues.put(KEY_FIELD,(String)KV[0]);\n\t\t\t\tnewValues.put(VALUE_FIELD,(String)KV[1]);\n\t\t\t\t// insert or replace -- handle that\n\t\t\t\trowID = sqliteDB.insert(tableName, \"\", newValues);\n\t\t\t\t/*if(rowID < 0)\n\t\t\t\t{\n\t\t\t\t\trowID = sqliteDB.replace(tableName, \"\", newValues);\n\t\t\t\t}*/\n\t\t\t\t Log.v(\"window_shopper\", \"ins:\"+KV[0]+\"::\"+KV[1]+\" --- \"+rowID); // notify user debug statement\n\t\t\t}\n\t\t\telse if(KV_pair instanceof Hashtable) // when recovery happens !! FIXME -- RAJA\n\t\t\t{\n\t\t\t\tHashtable<String, String> values = (Hashtable<String, String>)KV_pair;\n\t\t\t\tSet<String> keys = values.keySet();\n\t\t\t\tfor(String key : keys)\n\t\t\t\t{\n\t\t\t\t\tnewValues = new ContentValues();\n\t\t\t\t\tnewValues.put(KEY_FIELD,key);\n\t\t\t\t\tnewValues.put(VALUE_FIELD,values.get(key));\n\t\t\t\t\trowID = sqliteDB.insert(tableName, \"\", newValues);\n\t\t\t\t\t// replace only if from predecessor\n\t\t\t\t\t/*if(rowID < 0) \n\t\t\t\t\t{\n\t\t\t\t\t\trowID = sqliteDB.replace(tableName, \"\", newValues);\n\t\t\t\t\t}*/\n\t\t\t\t\tLog.v(\"window_shopper\", \"ins:\"+key+\"::\"+values.get(key)+\" --- \"+rowID); // notify user debug statement\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(rowID < 0)\n\t {\n\t \tLog.e(\"window_shopper\"+\" insert\",\"INSERT FAIL\");\n\t \treturn false; //FIXME-- interpretation problems\n\t }\n\t return true;\n\t\t}\n\t}", "public void insert() throws SQLException;", "public boolean insertDB(String qryExp, RequestBox rBox) throws Exception {\n\t\treturn false;\n\t}", "public void insert() throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tgetBackground();\n\t\ttry { myData.record.save(background.getClient()); }\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}", "public boolean insertKvData( KlDbConnection con ) {\n\t\tDataElement cur=null;\n\t\ttry {\n\t\t\tfor ( DataElement e : data) {\n\t\t\t\tcur=e;\n\t\t\t\tif( e.isValid() )\n\t\t\t\t\tcon.insertKvData( e.stationid, e.obstime, e.typeid, e.paramid,\n\t\t\t\t\t\t\t e.sensor, e.level, e.original, e.corrected, e.tbtime,\n\t\t\t\t\t\t\t e.useinfo, e.controlinfo, e.cfailed);\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (SQLException ex) {\n\t\t\tSystem.out.println(\"FAILED: (INSERT): \" + cur.stationid+\", \" +\n\t\t cur.obstime+\", \" + cur.typeid + \", \" +\n\t\t\t\t\t cur.paramid + \", \" + cur.sensor +\", \"\n\t\t\t\t\t + cur.level + \". Reason: \" + ex.getMessage() );\n\t\t\tex.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean rowInserted() throws SQLException {\n\n try {\n debugCodeCall(\"rowInserted\");\n return false;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Override\n\tpublic boolean insert(String sql) {\n\t\treturn false;\n\t}", "public boolean inserRow(String Title, String Artist, String category, int sellingPrice) {\n try {\n resultSet.moveToInsertRow();\n resultSet.updateString(Main.Title, Title);\n resultSet.updateString(Main.Artist, Artist);\n resultSet.updateString(Main.category, category);\n resultSet.updateInt(Main.sellingPrice, sellingPrice);\n resultSet.insertRow();\n resultSet.moveToCurrentRow();\n fireTableDataChanged();\n return true;\n } catch (SQLException e) {\n System.out.println(\"error adding row\");\n System.out.println(e);\n return false;\n }\n\n }", "public void insertRow() throws SQLException\n {\n m_rs.insertRow();\n }", "public void insertRow() throws SQLException {\n\n try {\n debugCodeCall(\"insertRow\");\n checkClosed();\n if (insertRow == null) { throw Message.getSQLException(ErrorCode.NOT_ON_UPDATABLE_ROW); }\n getUpdatableRow().insertRow(insertRow);\n insertRow = null;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public void insert() throws SQLException {\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n\n int check = BusinessFacade.getInstance().checkIDinDB(this.productRelation.getID(),\n this.post.getID(), \"goods\", \"product_type_id\", \"post_id\");\n if (check == -1){\n stmtIn.executeUpdate(\"INSERT INTO ngaccount.goods (goods_id , product_type_id, post_id) \" +\n \"VALUES ('\" + this.goodID + \"', '\" + this.productRelation.getID() +\n \"', '\" + this.post.getID() + \"');\");\n }\n }", "public int insertAutrepcm(String rEpcm_Num, String rEpcm_Name, String rEpcm_Jobid, String rEpcm_Pgm,\r\n String rEpcm_Type, String rEpcm_Pgtyp, String rEpcm_Pgstl, String rEpcm_Prntp) throws ClassNotFoundException, SQLException {\r\n int results =-1;\r\n // SQL query insert\r\n String sql = \"INSERT INTO AUTREPCM VALUES (?,?,?,?,?,?,?,?,?,?)\";\r\n try {\r\n dbCon.psmt = dbCon.getConnect().prepareStatement(sql);\r\n dbCon.psmt.setString(1, rEpcm_Num);\r\n dbCon.psmt.setString(2, rEpcm_Name);\r\n dbCon.psmt.setString(3, rEpcm_Jobid);\r\n dbCon.psmt.setString(4, rEpcm_Pgm);\r\n dbCon.psmt.setString(5, rEpcm_Type);\r\n dbCon.psmt.setString(6, rEpcm_Pgtyp);\r\n dbCon.psmt.setString(7, rEpcm_Pgstl);\r\n dbCon.psmt.setString(8, rEpcm_Prntp);\r\n dbCon.psmt.setString(9, \"\");\r\n dbCon.psmt.setString(10, \"\");\r\n results = dbCon.psmt.executeUpdate();\r\n \r\n \r\n } catch (SQLException e) {\r\n // Call Log4j for logging\r\n StackTraceElement stackTraceElement[] = e.getStackTrace();\r\n for (int i = 0; i < stackTraceElement.length; i++) {\r\n lg.warn(stackTraceElement[i].getClassName());\r\n lg.warn(stackTraceElement[i].getFileName());\r\n lg.warn(stackTraceElement[i].getLineNumber());\r\n lg.warn(stackTraceElement[i].getMethodName());\r\n }\r\n \r\n throw new SQLException();\r\n \r\n } finally {\r\n if (dbCon.psmt != null && dbCon.getConnect() != null) {\r\n try {\r\n dbCon.psmt.close();\r\n dbCon.getConnect().close();\r\n\r\n } catch (SQLException e) {\r\n lg.warn(\"The PreparedStatement or Connection not close \");\r\n }\r\n } else {\r\n // do something\r\n }\r\n }\r\n if(results == -1) {\r\n lg.warn(\"method insertAutrepcm(): insert fail\");\r\n }\r\n return results;\r\n }", "public void moveToInsertRow() throws SQLException\n {\n m_rs.moveToInsertRow();\n }", "void insert(BnesBrowsingHis record) throws SQLException;", "public boolean insertRow(String Title, String Artist, String category, int sellingPrice) {\n try {\n resultSet.moveToInsertRow();\n resultSet.updateString(Main.Title, Title);\n resultSet.updateString(Main.Artist, Artist);\n resultSet.updateString(Main.category, category);\n resultSet.updateInt(Main.sellingPrice, sellingPrice);\n resultSet.insertRow();\n resultSet.moveToCurrentRow();\n fireTableDataChanged();\n return true;\n } catch (SQLException e) {\n System.out.println(\"Error adding row\");\n System.out.println(e);\n return false;\n }\n\n }", "@Override\n public boolean insert(Transaksi transaksi) {\n try {\n String query = \"INSERT INTO transaksi (id, tgl_transaksi) VALUES (?, ?)\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ps.setString(1, transaksi.getId());\n ps.setString(2, transaksi.getTglTransaksi());\n\n if (ps.executeUpdate() > 0) {\n return true;\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "private boolean insertarDetFac(Connection conn,java.sql.ResultSet rstExt, int intCodSeg) {\r\n boolean blnRes = false;\r\n boolean blnActPreDes = false;\r\n Statement stmLoc, stmLocIns, stmLoc01;\r\n String strSqlIns = \"\", strUpdateFacPar=\"\";\r\n String str_MerIEFisBod = \"S\",strMerIngEgr=\"S\";\r\n String strEstFisBod = \"\";\r\n int intCodItm = 0;\r\n int intCodBod = 0;\r\n int intEstIns = 0;\r\n int intEstInsGuia = 0;\r\n int intControl = 0;\r\n int intControlTbr = 0;\r\n int intColActPre = 0;\r\n double dlbCanMov = 0.00;\r\n double dlbcostouni = 0.00;\r\n double bldcostot = 0.00;\r\n double dbl_canConIE = 0.00;\r\n double dblCanPen=0.00, dblCanNunRec=0.00; /* JM */\r\n boolean blnEstItmGenGuia = true; // true = genera guia el item false = no gerena guia el item\r\n String items[][] = null;\r\n double subtot = 0.00;\r\n //int cantReg=0;\r\n double canRegPend = 0, canItmPend = 0;\r\n java.sql.ResultSet rstDetCot,rstLoc01;\r\n int i=1;\r\n boolean blnIsSer=false;\r\n int intCodEmpCot,intCodLocCot,intCodCot,intCodRegCot,intCodItmCot,intCodBodCot,intCodPrv,intCodBodCom;\r\n String strCodAlt,strCodAlt2,strNomItm,strIvaVen,strTraAutTot,strEstSer,strDesUni,strStSer=\"\"; \r\n double dblCanCot,dblColActPreCot,dblPorDesVenMax,dblPreUni,dblPorDes,dblPreCom,dblPorDesPreCom,dblCanEgrBod=0.00,dblCanTot;\r\n \r\n BigDecimal bgdCanItm;\r\n BigDecimal bgdPreItm;\r\n BigDecimal bgdValDesItm;\r\n BigDecimal bgdPorDesItm;\r\n BigDecimal bgdTotItm=BigDecimal.ZERO;\r\n \r\n try {\r\n stmLoc = conn.createStatement();\r\n stmLoc01 = conn.createStatement();\r\n StringBuffer stbins = new StringBuffer(); //VARIABLE TIPO BUFFER\r\n \r\n\r\n strSql=\"\";\r\n strSql+=\" SELECT a1.*,a2.st_ser, a3.tx_desCor as tx_desUni \\n \";\r\n strSql+=\" FROM tbm_detCotVen as a1 \\n\";\r\n strSql+=\" INNER JOIN tbm_inv as a2 ON (a1.co_emp=a2.co_emp AND a1.co_itm=a2.co_itm) \\n\";\r\n strSql+=\" LEFT OUTER JOIN tbm_var as a3 ON (a2.co_uni=a3.co_reg)\";\r\n strSql+=\" WHERE a1.co_emp=\"+rstExt.getString(\"co_emp\")+ \" AND \";\r\n strSql+=\" a1.co_loc=\"+rstExt.getString(\"co_loc\")+\" AND a1.co_cot=\"+rstExt.getString(\"co_cot\");\r\n strSql+=\" AND a1.nd_canPenFac > 0 \";\r\n System.out.println(\"insertarDetFac\" + strSql);\r\n rstDetCot=stmLoc.executeQuery(strSql);\r\n \r\n while(rstDetCot.next()){\r\n intCodEmpCot=rstDetCot.getInt(\"co_emp\");intCodLocCot=rstDetCot.getInt(\"co_loc\");\r\n intCodCot=rstDetCot.getInt(\"co_cot\");intCodRegCot=rstDetCot.getInt(\"co_reg\");\r\n intCodItmCot=rstDetCot.getInt(\"co_itm\");strCodAlt=rstDetCot.getString(\"tx_codAlt\");\r\n strCodAlt2=rstDetCot.getString(\"tx_codAlt2\");strNomItm=rstDetCot.getString(\"tx_nomItm\");\r\n intCodBodCot=rstDetCot.getInt(\"co_bod\"); \r\n /* JM: 2018/Oct/12 Modificaciones para facturas parciales */ \r\n //dblCanCot=rstDetCot.getDouble(\"nd_can\");\r\n /* JM: 2018/Oct/12 Modificaciones para facturas parciales */\r\n dblColActPreCot=rstDetCot.getDouble(\"nd_preUniVenLis\");dblPorDesVenMax=rstDetCot.getDouble(\"nd_porDesVenMax\");\r\n dblPreUni=rstDetCot.getDouble(\"nd_preUni\");dblPorDes=rstDetCot.getDouble(\"nd_porDes\");\r\n strIvaVen=rstDetCot.getString(\"st_ivaVen\");dblPreCom=rstDetCot.getDouble(\"nd_preCom\");\r\n dblPorDesPreCom=rstDetCot.getDouble(\"nd_porDesPreCom\");intCodPrv=rstDetCot.getInt(\"co_prv\");\r\n intCodBodCom=rstDetCot.getInt(\"co_bodCom\");strTraAutTot=rstDetCot.getString(\"st_traAutTot\");\r\n strEstSer=rstDetCot.getString(\"st_ser\");strDesUni=rstDetCot.getString(\"tx_desUni\");\r\n /* JM: 2018/Oct/12 Modificaciones para facturas parciales */\r\n// System.out.println(\"FACTURA PARCIAL estado\" + rstExt.getString(\"st_solFacPar\") );\r\n if(rstExt.getString(\"st_solFacPar\")!=null){ \r\n if(rstExt.getString(\"st_solFacPar\").equals(\"S\")){\r\n// strSQL+=\" detCot.nd_canFac, detCot.nd_canCan, detCot.nd_canPenFac \";\r\n dblCanCot= rstDetCot.getDouble(\"nd_canPenFac\");\r\n strUpdateFacPar+=\"; UPDATE tbm_detCotVen SET nd_canPenFac= (CASE WHEN nd_canPenFac IS NULL THEN 0 ELSE nd_canPenFac END - \"+dblCanCot+\"), \";\r\n strUpdateFacPar+=\" nd_canFac= ( CASE WHEN nd_canFac IS NULL THEN 0 ELSE nd_canFac END + \"+dblCanCot+\" ) \";\r\n strUpdateFacPar+=\" WHERE co_emp=\"+rstExt.getString(\"co_emp\")+\" AND co_loc=\"+rstExt.getString(\"co_loc\")+\" AND \";\r\n strUpdateFacPar+=\" co_cot=\"+rstExt.getString(\"co_cot\")+\" AND co_reg=\"+rstDetCot.getInt(\"co_reg\")+\" ; \"; \r\n }\r\n else{\r\n dblCanCot=rstDetCot.getDouble(\"nd_can\");\r\n }\r\n }\r\n else{\r\n dblCanCot=rstDetCot.getDouble(\"nd_can\");\r\n }\r\n /* JM: 2018/Oct/12 Modificaciones para facturas parciales */\r\n bgdCanItm=BigDecimal.valueOf(dblCanCot) ;\r\n bgdPreItm=BigDecimal.valueOf(dblPreUni) ;\r\n bgdPorDesItm=BigDecimal.valueOf(dblPorDes) ;\r\n \r\n //DESCUENTO\r\n bgdValDesItm = bgdPorDesItm.multiply((bgdCanItm.multiply(bgdPreItm))); \r\n bgdValDesItm = bgdValDesItm.divide(new BigDecimal(\"100\"),objParSis.getDecimalesBaseDatos(),BigDecimal.ROUND_HALF_UP);\r\n ///TOTAL\r\n bgdTotItm=objUti.redondearBigDecimal((bgdCanItm.multiply(bgdPreItm)).subtract(bgdValDesItm), objParSis.getDecimalesMostrar()); \r\n dblCanTot = bgdTotItm.doubleValue();\r\n \r\n //SUM( ROUND( ROUND( a1.nd_preUni* a1.nd_can,2) - ROUND( (a1.nd_preUni* a1.nd_can)*a1.nd_porDes/100,2 ) ,2)) as subtotal\r\n //dblCanTot=objUti.redondear( (dblPreUni*dblCanCot) - ((dblPreUni*dblCanCot) * (dblPorDes/100)),2 ); // JM 1/Feb/2017\r\n \r\n if(dblCanTot>0){ // SI ES POSITIVO\r\n dblCanTot=dblCanTot*-1;\r\n }\r\n \r\n blnEstItmGenGuia = true;\r\n \r\n intCodBod = intCodBodCot;\r\n intCodItm = intCodItmCot;\r\n dlbCanMov = dblCanCot;\r\n //dbl_canConIE = dlbCanMov; JM 8Jul2016\r\n dblCanPen=dlbCanMov*-1;\r\n //dblCanEgrBod=dlbCanMov*-1;\r\n\r\n if (intControl != 0) {\r\n GLO_strArreItm = GLO_strArreItm + \",\";\r\n }\r\n GLO_strArreItm = GLO_strArreItm + String.valueOf(intCodItm);\r\n intControl++;\r\n /**\r\n * ********* VERFIFICA SI EL ITEM IE MER FIS BOD ***********************\r\n */\r\n strEstFisBod = (rstDetCot.getString(\"st_ser\")== null ? \"\" : rstDetCot.getString(\"st_ser\"));\r\n str_MerIEFisBod = \"N\";\r\n /**\r\n * ********* VERFIFICA SI EL ITEM ES DE SERVICIO ***********************\r\n */\r\n strSql = \"SELECT st_meringegrfisbod, tx_natdoc FROM tbm_cabtipdoc WHERE co_emp=\"+rstExt.getString(\"co_emp\")+\" \"\r\n + \" and co_loc=\" +rstExt.getString(\"co_loc\")+ \" and co_tipDoc=\" + intCodTipDocFacEle;\r\n rstLoc01 = stmLoc01.executeQuery(strSql);\r\n if (rstLoc01.next()) {\r\n strMerIngEgr = rstLoc01.getString(\"st_meringegrfisbod\");\r\n }\r\n\r\n rstLoc01.close();\r\n rstLoc01=null;//JM 4/Jul/2016\r\n \r\n if (strEstFisBod.equals(\"N\")) { \r\n if (strMerIngEgr.equals(\"S\")) { // SI LA EMPRESA NECESITA CONFIRMAR EGRESOS\r\n str_MerIEFisBod = \"S\";\r\n // dbl_canConIE = 0; //JM 8/Jul/2016\r\n }\r\n }\r\n\r\n /*JoseMario 10/Jun/2016 Si no se confirma*/\r\n if(str_MerIEFisBod.equals(\"N\")){\r\n //dblCanNunRec=dlbCanMov*-1; //JM 8/JUL/2016\r\n dblCanEgrBod=0.00;\r\n //dblCanPen=0.00;\r\n }\r\n \r\n \r\n /**\r\n * *********************** FIN DE VERIFICA ITEM DE\r\n * SERVICIO ******************************************************\r\n */\r\n /**\r\n * ********* VERFIFICA SI EL ITEM ES DE TRANSPORTE ***********************\r\n */\r\n if (strEstFisBod.trim().equalsIgnoreCase(\"T\")) { // no es de servicio.\r\n blnEstItmGenGuia = false;\r\n }\r\n /**\r\n * *********************** FIN DE VERIFICA ITEM DE\r\n * TRANSPORTE ******************************************************\r\n */;\r\n dlbCanMov = dlbCanMov * -1;\r\n dlbcostouni = objInvItm.getCostoItm(conn, rstExt.getInt(\"co_emp\"), intCodItm);\r\n bldcostot = (dlbcostouni * dlbCanMov);\r\n bldcostot = (bldcostot * -1);\r\n if (intEstIns > 0) {\r\n stbins.append(\" UNION ALL \");\r\n }\r\n if (strEstSer.equals(\"N\")) {\r\n strConfInv = \"P\";\r\n }\r\n if (strConfInv.equals(\"P\")) {\r\n if (strMerIngEgr.equals(\"N\")) {\r\n strConfInv = \"F\";\r\n }\r\n }\r\n /* JM New 6/Agos/2016 */\r\n String strItmSer=\"\";\r\n String strCadena = \"SELECT st_ser FROM tbm_inv WHERE co_emp=\"+rstExt.getInt(\"co_emp\")+\" \";\r\n strCadena+=\" AND co_itm=\"+intCodItmCot ;\r\n System.out.println(\"SERVICIO \" + strCadena);\r\n rstLoc01 = stmLoc01.executeQuery(strCadena);\r\n if(rstLoc01.next()){\r\n strItmSer=rstLoc01.getString(\"st_ser\");\r\n blnIsSer=rstLoc01.getString(\"st_ser\").equals(\"N\")?false:true;\r\n }\r\n rstLoc01.close();\r\n rstLoc01=null;\r\n \r\n \r\n String strTerminal=strCodAlt.substring(strCodAlt.length()-1);\r\n int intBodGrp = intBodGrp(rstExt.getInt(\"co_emp\"), intCodBod);\r\n String strCfgCon = objUti.getCfgConfirma(jifCnt, objParSis, objParSis.getCodigoEmpresaGrupo(), intBodGrp, strTerminal); \r\n if(strCfgCon.equals(\"S\") && blnIsSer==false){\r\n if(strCodAlt.substring(strCodAlt.length()-1).equals(\"L\") && intBodGrp==15){\r\n if(obtenerSt_merIngEgrFisBodOC(conn, intCodSeg,rstExt.getInt(\"co_emp\") ,intCodItmCot)){\r\n dblCanPen=dlbCanMov;\r\n dblCanEgrBod = dblCanPen;\r\n }else{\r\n dblCanPen=0.00;\r\n dblCanEgrBod=0.00;\r\n str_MerIEFisBod=\"A\";\r\n }\r\n }\r\n else{\r\n dblCanPen=dlbCanMov;\r\n dblCanEgrBod = dblCanPen;\r\n \r\n }\r\n }\r\n else{\r\n dblCanPen=0.00;\r\n dblCanEgrBod=0.00;\r\n str_MerIEFisBod=\"A\";\r\n }\r\n \r\n \r\n if(strItmSer.equals(\"S\")){\r\n System.out.println(\"servicio xD\");\r\n dblCanPen=dlbCanMov;\r\n str_MerIEFisBod=\"S\";\r\n }\r\n /* JM 26/Sep/2017 */\r\n \r\n /* JM 6/Agos/2016 */\r\n \r\n \r\n stbins.append(\"SELECT \"+rstExt.getString(\"co_emp\") + \",\" + rstExt.getString(\"co_loc\")+\",\"+intCodTipDocFacEle+\",\"+intCodDoc + \",\"+intCodRegCot+\",'\"\r\n +strCodAlt+ \"','\" +strCodAlt2+ \"',\"+intCodItmCot+ \",\"+intCodItmCot+ \",\"\r\n + objUti.codificar(strNomItm) + \",'\"+strDesUni+ \"',\"+intCodBod + \",\"\r\n + dlbCanMov + \",\"\r\n + objUti.redondear(dblCanTot, intNumDec) + \", \" \r\n + dlbcostouni + \", 0 , \"\r\n + objUti.redondear(dblPreUni, 4) + \", \"\r\n + objUti.redondear(dblPorDes, 2) + \", '\"\r\n + (strIvaVen) + \"' \"\r\n + \",\" + bldcostot + \",'I', '\" + str_MerIEFisBod + \"', \" + dbl_canConIE + \", \"\r\n + objInvItm.getIntDatoValidado(dblColActPreCot) + \", \" /* PRECIO EN LA COTIZACION */\r\n + ((blnActPreDes) ? \"\" + Glo_dlbMaxDes : objInvItm.getIntDatoValidado(dblPorDesVenMax)) + \", \"\r\n + \" 1,\" +dblCanNunRec+\",\"+(dblCanPen) +\",\"\r\n + (strIvaVen.equals(\"S\")?dblPorIva:0) + \",\"\r\n + (strIvaVen.equals(\"S\")?0:dblCanTot) + \",\"\r\n + (strIvaVen.equals(\"S\")?dblCanTot:0) + \" \"\r\n );\r\n \r\n intEstIns = 1; \r\n }\r\n \r\n if (intEstIns == 1) {\r\n strSqlIns += \" ; INSERT INTO tbm_detMovInv(co_emp, co_loc, co_tipdoc , co_doc, co_reg, \" ; //CAMPOS PrimayKey\r\n strSqlIns+=\" tx_codAlt, tx_codAlt2, co_itm, co_itmact, tx_nomItm, tx_unimed, \";//<==Campos que aparecen en la parte superior del 1er Tab\r\n strSqlIns+=\" co_bod, nd_can,nd_tot, nd_cosUnigrp,nd_costot, nd_preUni, nd_porDes, st_ivaCom \" ;//<==Campos que aparecen en la parte inferior del 1er Tab\r\n strSqlIns+=\",nd_costotgrp , st_regrep, st_meringegrfisbod , nd_cancon, nd_preunivenlis, nd_pordesvenmax , ne_numfil,nd_canNunRec,nd_canPen, \" ;\r\n strSqlIns+=\" nd_porIva,nd_basImpIvaCer,nd_basImpIvaGra \";\r\n strSqlIns+=\" )\"+ stbins.toString();\r\n strSqlIns+=\" \"+strUpdateFacPar;\r\n\r\n }\r\n\r\n if (conn != null) {\r\n stmLocIns = conn.createStatement();\r\n System.out.println(\"insertarDetFac \\n\" +strSqlIns);\r\n stmLocIns.executeUpdate(strSqlIns);\r\n \r\n stmLocIns.close();\r\n stmLocIns = null;\r\n }\r\n stmLoc01.close();\r\n stmLoc01=null;\r\n stmLoc.close();\r\n stmLoc = null;\r\n stbins = null;\r\n \r\n\r\n blnRes = true;\r\n } catch (SQLException Evt) {\r\n blnRes = false;\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n } catch (Exception Evt) {\r\n blnRes = false;\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n }\r\n return blnRes;\r\n }", "private boolean validaInsert(Entity e) throws SQLException {\r\n stmt = conn.createStatement();\r\n String sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(0) + \"= \" + e.getCell(0).getValue();\r\n if (e.getTableName().equals(\"Contato\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(3) + \"= '\" + String.valueOf(e.getCell(3).getValue()) + \"' and \" + e.getColumnName(1) + \"= '\" + String.valueOf(e.getCell(1).getValue()) + \"';\";\r\n\r\n }\r\n if (e.getTableName().equals(\"Telefone\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(2) + \"= '\" + String.valueOf(e.getCell(2).getValue()) + \"' and \" + e.getColumnName(1) + \"= '\" + String.valueOf(e.getCell(1).getValue()) + \"' and \" + e.getColumnName(3) + \"= '\" + String.valueOf(e.getCell(3).getValue()) + \"';\";\r\n\r\n }\r\n if (e.getTableName().equals(\"Solicitacoes\")) {\r\n sql = \"select * from \" + e.getTableName() + \" where \" + e.getColumnName(6) + \"= '\" + String.valueOf(e.getCell(6).getValue()) + \"' and \" + e.getColumnName(7) + \"= '\" + String.valueOf(e.getCell(7).getValue()) + \"';\";\r\n\r\n }\r\n System.out.println(sql);\r\n rs = stmt.executeQuery(sql);\r\n if (rs.next()) {\r\n stmt.close();\r\n rs.close();\r\n return false;\r\n }\r\n stmt.close();\r\n rs.close();\r\n return true;\r\n\r\n }", "@Override\n\tpublic boolean insert() {\n\t\tif(num==null||name==null||email==null||phone==null||project==0||school==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tString format=\"INSERT INTO tc_student(num,name,email,phone,degree,project,school,is_cap) values ('%s','%s','%s','%s',%d,%d,%d,%d)\";\n\t\tString sql=String.format(format, num,name,email,phone,degree,project,school,is_cap);\n\t\t//System.out.println(sql);\n\t\treturn mysql.execute(sql);\n\t\t}", "boolean hasInsert();", "public static void insertProduct(Product product){\n\n Connection myConnection = ConnectionFactory.getConnection();\n PreparedStatement insertStatement = null;\n ResultSet rs = null;\n\n int afterId = verify(product);\n int cantitate = 0;\n if(afterId == -1) {//----------daca nu exista deja in tabel\n\n try {\n insertStatement = myConnection.prepareStatement(insertStatementString, Statement.RETURN_GENERATED_KEYS);\n insertStatement.setInt(1, product.getId());\n insertStatement.setInt(2, product.getCantitate());\n insertStatement.setString(3, product.getDenumire());\n insertStatement.setDouble(4, product.getPret());\n insertStatement.setInt(5, 0);\n\n int rowsAffected = insertStatement.executeUpdate();\n\n rs = insertStatement.getGeneratedKeys();\n\n System.out.println(\"(\" + rowsAffected + \") rows affected\");\n\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n else{//---------------daca deja exista updatam canntitatea\n try {\n myConnection = ConnectionFactory.getConnection();\n insertStatement = myConnection.prepareStatement(\"Select * from product where id = \" + afterId);\n insertStatement.executeQuery();\n rs = insertStatement.getResultSet();\n if(rs.next()){\n cantitate = rs.getInt(2);\n }\n myConnection = ConnectionFactory.getConnection();\n insertStatement = myConnection.prepareStatement(updateQuantityString, Statement.RETURN_GENERATED_KEYS);\n insertStatement.setInt(1, product.getCantitate() + cantitate);\n insertStatement.setInt(2, afterId);\n int rowsAffected = insertStatement.executeUpdate();\n System.out.println(\"(\" + rowsAffected + \") rows affected\");\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }\n\n }", "@Test\n public void testInsertingValidValues() throws SQLException {\n CommitStructure commit = getSampleCommit();\n MysqlDatabase mysqlDatabase = new MysqlDatabase(connection);\n assertTrue(mysqlDatabase.insertCommitToDatabase(commit));\n }", "int insert(Assist_table record);", "@Override\n\tpublic boolean insertOne(finalDataBean t) throws Exception {\n\t\treturn false;\n\t}", "public void moveToInsertRow() throws SQLException {\n\n try {\n debugCodeCall(\"moveToInsertRow\");\n checkClosed();\n insertRow = new Value[columnCount];\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Override\n\tpublic void insert() {\n\t\tSystem.out.println(\"Mysql DB 서버에 접속해서 등록을 하다.\");\n\t}", "public boolean addBike(Bike bike, DockingStation dock){\n String dateTimeNow = new SimpleDateFormat(TIME_FORMAT).format(Calendar.getInstance().getTime());\n \tint bikeId = 1;\n \tdouble latitude;\n \tdouble longitude;\n double chargingLvl;\n try(Connection con = DatabaseConnector.getConnection();\n PreparedStatement ps = con.prepareStatement(INSERT);\n PreparedStatement ps2 = con.prepareStatement(INSERT_DATA);\n PreparedStatement ps3 = con.prepareStatement(BIKE_ID_TYPE + bike.getTypeId());\n ResultSet rs = ps3.executeQuery()){\n \n con.setAutoCommit(false);\n \n if(rs.next()){\n int maxBikeId = rs.getInt(cBikeID);\n if(maxBikeId == 0){\n bikeId = bike.getTypeId() * 1000;\n }else{\n bikeId += maxBikeId;\n }\n }else{\n return false;\n }\n\n ps.setInt(1, bikeId);\n ps.setDate(2, bike.getSqlDate());\n ps.setDouble(3, bike.getPrice());\n ps.setString(4, bike.getMake());\n ps.setInt(5, bike.getTypeId());\n if(bike.getStationId() == 0){\n ps.setNull(6, INTEGER);\n }else{\n ps.setInt(6, bike.getStationId());\n }\n \n if (dock != null){\n latitude = dock.getCoordinateLat();\n longitude = dock.getCoordinateLng();\n chargingLvl = 100;\n ps.setInt(6, dock.getStationId());\n }else if(bike.getBikeData() != null){\n latitude = bike.getBikeData().getLatitude();\n longitude = bike.getBikeData().getLongitude();\n chargingLvl = bike.getBikeData().getChargingLvl();\n }else{ //If there's no selected dock or data input for the bike\n latitude = 63.434903; // The latitude & longitude of the \"company\"\n longitude = 10.402521;\n chargingLvl = 100;\n }\n ps2.setInt(1, bikeId);\n ps2.setString(2, dateTimeNow);\n ps2.setDouble(3,latitude);\n ps2.setDouble(4, longitude);\n ps2.setDouble(5, chargingLvl);\n ps2.setNull(6, INTEGER);\n\n ps.executeUpdate();\n ps2.executeUpdate();\n con.commit();\n con.setAutoCommit(true);\n return true;\n }catch(Exception e){\n System.out.println(\"Exception: \" + e);\n }\n return false;\n }", "private boolean _loadInsertRecord(String oldFieldNames[], String rowValues[], \n DBLoadValidator validator, boolean insertRecord, boolean overwriteExisting)\n throws DBException, SQLException, IOException\n {\n\n /* row values DBLoadValidator */\n if ((validator != null) && !validator.validateValues(rowValues)) {\n // -- update/insertion failed validation\n return false;\n }\n\n /* create record key/values */\n DBRecordKey<?> dbRcdKey = this.createKey(); // may throw DBException\n DBFieldValues dbKeyVals = dbRcdKey.getKeyValues();\n DBFieldValues dbFldVals = dbRcdKey.getFieldValues();\n DBRecord<?> dbRcd = dbRcdKey.getDBRecord(); // does not reload record\n\n /* parse all field values */\n boolean addedField = false;\n Set<String> fieldNameList = new HashSet<String>();\n for (int i = 0; i < oldFieldNames.length; i++) {\n String fieldName = oldFieldNames[i];\n DBField dbFld = this.getField(fieldName);\n if (dbFld != null) {\n // -- column exists\n boolean priKey = dbFld.isPrimaryKey();\n DBFieldValues dbVals = priKey? dbKeyVals : dbFldVals;\n // -- column value\n String rowVal = ((i < rowValues.length) && !rowValues[i].equals(\"\\\\N\"))? rowValues[i] : null;\n Object objVal = dbFld.parseStringValue(rowVal);\n // -- set value\n boolean didSet = dbVals._setFieldValue(dbFld, objVal);\n if (!didSet) {\n Print.logError(\"Invalid field type: %s [%s]\", fieldName, StringTools.className(objVal));\n } else\n if (priKey) {\n // -- skip primary key update\n } else {\n fieldNameList.add(fieldName);\n }\n addedField = true;\n } else {\n // -- column does not exist in defined table (will be dropped)\n }\n }\n\n /* skip record insert/update? */\n if (!insertRecord) {\n // -- do not insert/update\n return false;\n }\n\n /* update/insert */\n if (dbRcdKey.exists()) {\n\n /* disallow overwrite? */\n if (!overwriteExisting) {\n // -- Record already exists, and we don't have permission to overwrite the record\n return false;\n }\n\n /* remove fields which should not be updated */\n fieldNameList.remove(DBRecord.FLD_creationTime);\n fieldNameList.remove(DBRecord.FLD_creationMillis);\n\n /* nothing to update? */\n if (fieldNameList.isEmpty()) {\n // -- invalid record\n throw new DBException(\"No fields to update\");\n }\n\n /* insert */\n if (validator != null) {\n if (!validator.validateUpdate(dbRcd,fieldNameList)) {\n return false; // failed validation\n }\n dbRcd.update(fieldNameList);\n validator.recordDidUpdate(dbRcd,fieldNameList);\n } else {\n dbRcd.update(fieldNameList);\n }\n\n } else {\n\n /* nothing to insert?\n if (!addedField) {\n throw new DBException(\"No fields to insert\");\n }\n */\n\n /* insert */\n if (validator != null) {\n if (!validator.validateInsert(dbRcd)) {\n return false; // failed validation\n }\n dbRcd.insert();\n validator.recordDidInsert(dbRcd);\n } else {\n dbRcd.insert();\n }\n\n }\n return true;\n\n }", "public String insert() {\n \n //loading the driver\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch (Exception e) {\n e.printStackTrace();\n return \"Internal Error\";\n }\n\n //database variables\n final String db = \"jdbc:mysql://mis-sql.uhcl.edu/dingorkarj2620\";\n Connection con = null;\n Statement st = null;\n ResultSet rs = null;\n try {\n\n //connecting database\n con = DriverManager.getConnection(db, \"dingorkarj2620\", \"1289968\");\n st = con.createStatement();\n\n rs = st.executeQuery(\"select * from nextitemnumber\");\n if (rs.next()) {\n i.setI_id(rs.getInt(1));\n }\n\n //calling method to update status of the item\n updateStatus();\n\n //insert data into item\n st.executeUpdate(\"insert into item values (\" + i.getI_id() + \",\" + super.id + \", '\" + i.getI_type() + \"','\" + i.getI_title() + \"','\" + i.getI_description() + \"',\" + i.getI_price() + \",\" + i.getI_min() + \",\" + i.getI_max() + \",0,'\" + i.getI_status() + \"',\" + i.isI_featured() + \", '\" + i.getI_category() + \"', '\" + i.getI_img() + \"')\");\n st.executeUpdate(\"update nextitemnumber set next_i_id = \" + (i.getI_id() + 1));\n\n return \"insert_successful.xhtml\";\n\n } catch (SQLException e) {\n e.printStackTrace();\n return \"insert_fail.xhtml\";\n\n } finally {\n\n try {\n con.close();\n st.close();\n\n } catch (SQLException e) {\n e.printStackTrace();\n return \"insert_fail.xhtml\";\n }\n }\n }", "private void insertarImpresora() throws SQLException {\n String vCodigoSerie = FarmaLoadCVL.getCVLCode(\"cmbSerie\", cmbSerie.getSelectedIndex());\n String vCodigoComprobante = FarmaLoadCVL.getCVLCode(\"cmbComprobante\", cmbComprobante.getSelectedIndex());\n String vCodigoModelo = cmbModelo.getSelectedItem().toString();\n String vSerieImpr = txtSerieImpr.getText();\n DBImpresoras.ingresaImpresora(FarmaVariables.vCodGrupoCia, FarmaVariables.vCodLocal, vCodigoSerie,\n vCodigoComprobante, txtDescImpresora.getText().trim(),\n txtNroComprobante.getText().trim(), txtColaImpresion.getText().trim(),\n vCodigoModelo,vSerieImpr);\n }", "void insert(GfanCodeBanner record) throws SQLException;", "void insertSelective(IrpSignInfo record) throws SQLException;", "int insertSelective(Assist_table record);", "public static int insert(Booking b)\n {\n Connection con = MyConnection.connect();\n int row_insert = 0;\n try\n {\n // Qry 1 -> Patient Booking\n String qry1 = \"insert into patient(name,phone,dob,problem) values(?,?,?,?)\";\n PreparedStatement stmt = con.prepareStatement(qry1);//query getting pre-compile\n //setting column values in student table\n \n stmt.setString(1,b.getName());\n stmt.setInt(2,b.getPhone());\n \n stmt.setString(3, b.getDob());\n stmt.setString(4, b.getProblem());\n \n row_insert = stmt.executeUpdate();\n }//try ends\n catch(Exception ex)\n {\n System.out.println(\"Insert error :\"+ex);//print error on server logs\n }//catch ends\n return row_insert;\n }", "@Override\r\n public boolean insert(Anggota anggota) {\r\n// boolean flag = false;\r\n// try {\r\n//\r\n// CallableStatement cs = connection.prepareCall(\"{ CALL insAngs(?,?) }\");\r\n// cs.setString(1, angsuranPinjam.getKdAngsuran());\r\n// cs.setString(2, angsuranPinjam.getKdAnggotaP());\r\n// cs.executeUpdate();\r\n// flag = true;\r\n// } catch (SQLException ex) {\r\n// Logger.getLogger(AnggotaDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n//\r\n// }\r\n//\r\n// return flag;\r\n\r\n boolean flag = false;\r\n try {\r\n CallableStatement cs = connection.prepareCall(\"{ CALL getAutoKDAgt(?,?,?) }\");\r\n cs.setString(1, anggota.getNmAnggota());\r\n cs.setString(2, anggota.getTelepon());\r\n cs.setString(3, anggota.getAlamat());\r\n cs.executeUpdate();\r\n flag = true;\r\n } catch (SQLException ex) {\r\n Logger.getLogger(AnggotaDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return flag;\r\n }", "void insert(IrpSignInfo record) throws SQLException;", "public void insert() throws SQLException {\r\n\t\t//SQL-Statement\r\n\r\n\t\tString sql = \"INSERT INTO \" + table +\" VALUES (\" + seq_genreID +\".nextval, ?)\";\r\n\t\tPreparedStatement stmt = DBConnection.getConnection().prepareStatement(sql);\r\n\t\tstmt.setString(1, this.getGenre());\r\n\r\n\t\tint roswInserted = stmt.executeUpdate();\r\n\t\tSystem.out.println(\"Es wurden \" +roswInserted+ \"Zeilen hinzugefügt\");\r\n\r\n\t\tsql = \"SELECT \"+seq_genreID+\".currval FROM DUAL\";\r\n\t\tstmt = DBConnection.getConnection().prepareStatement(sql);\r\n\t\tResultSet rs = stmt.executeQuery();\r\n\t\tif(rs.next())this.setGenreID(rs.getInt(1));\r\n\t\trs.close();\r\n\t\tstmt.close();\r\n\t}", "public void addCertainRow(String username, String num, String ISBN)\n {\n String insertStr;\n int tempt= (int) (Math.random()*500);\n String random=Integer.toString(tempt);\n try{\n\n insertStr=\"INSERT IGNORE INTO borrowlist (username, num, random, ISBN) VALUES(\"\n +quotate(username)+\",\"\n +quotate(num)+\",\"\n +quotate(random)+\",\"\n +quotate(ISBN)\n +\")\";\n\n stmt.executeUpdate(insertStr);\n\n } catch(Exception e){\n System.out.println(\"Error occurred in inserting data\");\n }\n return;\n }", "public static void AddBooking(Booking booking){\n \n \n try (Connection connection = DbConnector.connectToDb();\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n ResultSet resultSet = statement.executeQuery(\"SELECT * FROM booking\")){\n \n resultSet.moveToInsertRow();\n resultSet.updateInt(\"BookingNumber\", booking.getBookingNumber());\n resultSet.updateString(\"FlightNumber\", booking.getFlightNumber());\n resultSet.updateDouble(\"Price\", booking.getPrice());\n resultSet.updateString(\"CabinClass\", booking.getCabinClass());\n resultSet.updateInt(\"Quantity\", booking.getQuantity());\n resultSet.updateInt(\"Insurance\", booking.getInsurance());\n resultSet.insertRow();\n \n \n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n \n \n \n }", "private void InsertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InsertActionPerformed\n try{\n if(isEmpty())\n throw new Exception(\"Introdu toate datele!\");\n\n // if phone is frequency dont insert\n if(isExitsPhone())\n throw new Exception(\"Eroare nr telefon!\");\n\n boolean ok = insert();\n if(ok){\n Vector data = getData(\"\");\n showData(data);\n } else\n throw new Exception(\"Eroare la inserare!\");\n\n }catch(Exception e){\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n }", "private void insertPerform(){\n \tif(!verify()){\n \t\treturn;\n \t}\n \tString val=new String(\"\");\n \tval=val+\"'\"+jTextField1.getText()+\"', \"; // poNo\n \tval=val+\"'\"+\n \t\tinventorycontroller.util.DateUtil.getRawFormat(\n \t\t\t(java.util.Date)jXDatePicker1.getValue()\n \t\t)\n \t\t+\"', \"; // poDate\n \tval=val+\"'\"+vndList[jTextField2.getSelectedIndex()-1]+\"', \"; // vndNo\n \tval=val+\"'\"+jTextField3.getText()+\"', \"; // qtnNo\n \tval=val+\"'\"+\n \t\tinventorycontroller.util.DateUtil.getRawFormat(\n \t\t\t(java.util.Date)jXDatePicker2.getValue()\n \t\t)\n \t\t+\"', \"; // qtnDate\n \tval=val+\"'\"+poAmount+\"', \"; // poTotal\n \tval=val+\"'pending', \"; // poStatus\n \tval=val+\"'\"+jEditorPane1.getText()+\"' \"; // remark\n \t\n \ttry{\n \t\tdbInterface1.cmdInsert(\"poMaster\", val);\n \t\tinsertPoBomDesc();\n \t\tinsertPoDesc();\n\t \tupdateBOM();\n \t}\n \tcatch(java.sql.SQLException ex){\n \t\tSystem.out.println (ex);\n \t}\n \tresetPerform();\n }", "int insertSelective(PmKeyDbObj record);", "public boolean insertarItem53(Mgestion_resul dts) {\n \n Item53 = \"update item set cumple=?, justifi=?, aplica=? where idItem=53\";\n Ver84 = \"update verificacion set cumplimiento=? where idverificacion=84\";\n \n \n try {\n\n PreparedStatement pst = cn.prepareStatement(Item53);\n PreparedStatement pst2 = cn.prepareStatement(Ver84);\n \n \n\n pst.setString(1, dts.getI531());\n pst.setString(2, dts.getJ531());\n pst.setString(3, dts.getA531());\n \n pst2.setString(1, dts.getV531());\n \n \n int n = pst.executeUpdate();\n\n if (n != 0) {\n int n2 = pst2.executeUpdate();\n\n if (n2 != 0) {\n return true; \n\n } else {\n return false;\n }\n\n } else {\n return false;\n }\n\n } catch (Exception e) {\n JOptionPane.showConfirmDialog(null, e);\n return false;\n }\n \n}", "public boolean insert(PreparedStatement ps) {\n boolean r = false;\n try {\n r = ps.execute();\n } catch (SQLException e) {\n System.out.println(\"Erro ao executa comando SQL\");\n System.out.println(\"\\n\" + e.getStackTrace());\n }\n return r;\n }", "int insertSelective(SysCode record);", "public boolean inserisciDatiGiudice(Giudice giudice) {\n\t\tString query = \"INSERT INTO giudice(username,password,nome,cognome,codicefiscale,recapitotelefonico,numcivico,cap,via) \"\r\n\t\t\t\t+ \"VALUES(?,?,?,?,?,?,?,?,?)\"; \t\t\r\n\t\tPreparedStatement ps;\r\n\t\tconn=DBManager.startConnection();\r\n\t\ttry {\r\n\t\t\tps = conn.prepareStatement(query);\r\n\t\t\tps.setString(1, giudice.getUsername());\r\n\t\t\tps.setString(2, giudice.getPassword());\r\n\t\t\tps.setString(3, giudice.getNome());\r\n\t\t\tps.setString(4, giudice.getCognome());\r\n\t\t\tps.setString(5, giudice.getCodicefiscale());\r\n\t\t\tps.setString(6, giudice.getRecapitotelefonico());\r\n\t\t\tps.setString(7, giudice.getNumcivico());\r\n\t\t\tps.setString(8, giudice.getCap());\r\n\t\t\tps.setString(9, giudice.getVia());\r\n\t\t\tps.executeUpdate();\r\n\t\t\t//if(rs.next()) {\r\n\t\t\t//res.setUsername(rs.getString(\"username\") );\r\n\t\t\t//res.setId(rs.getString(\"id\"));\r\n\t\t\t//res.setCap(rs.getString(\"cap\"));\r\n\t\t\t//res.setVia(rs.getString(\"via\")); \r\n\t\t\t//res.setNome(rs.getString(\"nome\"));\r\n\t\t\t//res.setCognome(rs.getString(\"cognome\"));\r\n\t\t\t//res.setCodicefiscale(rs.getString(\"codicefiscale\"));\r\n\t\t\t//res.setNumcivico(rs.getString(\"numcivico\"));} \r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tDBManager.closeConnection();\r\n\t\treturn true;\r\n\t}", "int insertSelective(Prueba record);", "private boolean guardarAutorizacionReserva(){\n java.sql.Connection conLoc;\n boolean blnRes=true;\n try{\n lblMsgSis.setText(\"Guardando datos...\");\n objCfgSer.cargaDatosIpHostServicios(0, intCodSer);\n pgrSis.setIndeterminate(true);\n int intNumFil=objTblMod.getRowCountTrue(), intCodEmp, intCodLoc, intCodCot;\n for (int i=0; i<intNumFil;i++){\n if (objUti.parseString(objTblMod.getValueAt(i,0)).equals(\"M\")){ \n intCodEmp=Integer.parseInt(tblDat.getValueAt(i,INT_TBL_DAT_COD_EMP).toString() );\n intCodLoc=Integer.parseInt(tblDat.getValueAt(i,INT_TBL_DAT_COD_LOC).toString() );\n intCodCot=Integer.parseInt(tblDat.getValueAt(i,INT_TBL_DAT_COD_COT).toString() );\n if(objTblMod.isChecked(i, INT_TBL_DAT_CHK_AUTORIZAR)){\n if(validaStock(intCodEmp, intCodLoc, intCodCot)){\n if(validaControlesCxC(intCodEmp, intCodLoc, intCodCot)){\n if(validaDatosAutorizacion(i,intCodEmp, intCodLoc,intCodCot)){\n // AUTORIZACION\n if(tblDat.getValueAt(i, INT_TBL_DAT_STR_TIP_RES_INV).toString().equals(\"F\")){\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n conLoc.setAutoCommit(false);\n if(objDatItm.modificaItemTerminalOcupado(intCodEmp, intCodLoc, intCodCot)){\n if(guardarAutorizacionFacturacionAutomatica(conLoc,i,intCodEmp,intCodLoc,intCodCot)){\n conLoc.commit(); \n objGenOD.imprimirOdxRes(conLoc, getCodigoSeguimiento(conLoc,intCodEmp,intCodLoc,intCodCot), objCfgSer.getIpHost());\n blnCotVen=true;\n }else{\n blnRes=false;\n conLoc.rollback();\n blnCotVen=false;\n }\n }else{\n blnRes=false;\n conLoc.rollback();\n blnCotVen=false;\n }\n conLoc.close();\n conLoc=null; \n }\n }\n else if(tblDat.getValueAt(i,INT_TBL_DAT_STR_TIP_RES_INV).toString().equals(\"R\")){\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n conLoc.setAutoCommit(false);\n if(guardarAutorizacionReservaEmpresa(conLoc,i ,intCodEmp,intCodLoc, intCodCot)){\n conLoc.commit();\n objGenOD.imprimirOdxRes(conLoc, getCodigoSeguimiento(conLoc,intCodEmp,intCodLoc,intCodCot), objCfgSer.getIpHost());\n }\n else{\n blnRes=false;\n conLoc.rollback();\n }\n conLoc.close();\n conLoc=null; \n }\n }\n }\n }\n else{\n blnRes=false;\n }\n }\n else{\n blnRes=false;\n }\n }else if(objTblMod.isChecked(i,INT_TBL_DAT_CHK_DENEGAR)){\n /* DENEGAR */\n if(revisarCotizacionPendiente(intCodEmp,intCodLoc,intCodCot)){\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n conLoc.setAutoCommit(false);\n if(cambiarEstadoCotizacionDenegada(conLoc,intCodEmp,intCodLoc,intCodCot)){\n conLoc.commit();\n enviarCorreoSolicitudDenegada(intCodEmp,intCodLoc,intCodCot);\n }\n else{\n conLoc.rollback();\n }\n }\n conLoc.close();\n conLoc=null;\n }\n else{\n MensajeInf(\"La cotizacion \"+intCodCot+\" no se puede denegar, ya ha sido autorizada. Debe solicitar cancelacion. \");\n }\n }\n blnRes=false;\n blnGenSolTra=false;\n }\n }\n pgrSis.setIndeterminate(false);\n \n if(!blnIsCotVen){\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n cargarDetReg(conLoc);\n conLoc.close();\n conLoc=null;\n }\n blnRes=true;\n }\n catch (java.sql.SQLException e) { \n objUti.mostrarMsgErr_F1(this, e); \n }\n catch(Exception Evt){ \n objUti.mostrarMsgErr_F1(this, Evt);\n } \n return blnRes;\n }", "private boolean guardarAutorizacionReservaEmpresa(java.sql.Connection conExt, int indice, int CodEmp, int CodLoc, int CodCot){\n boolean blnRes=true;\n try{\n if(conExt!=null){\n if(moverItemsCotizacionReservaEmpresa(conExt,CodEmp, CodLoc, CodCot)){\n if(cambiarEstadoCotizacionAutorizada(conExt, CodEmp, CodLoc, CodCot,indice)){\n if(realizaMovimientoEntreEmpresas(conExt, CodEmp, CodLoc, CodCot)){\n //if(moverInvBodReservado(conLoc,intCodEmp,intCodLoc,intCodCot)){\n if(updateCotizacionProcesoSolicitaTransferenciaInventario(conExt, CodEmp, CodLoc, CodCot)){\n if(insertarCotizacionSeguimiento(conExt, CodEmp, CodLoc, CodCot)){\n if(blnGenSolTra ){\n Librerias.ZafMovIngEgrInv.ZafReaMovInv objReaMovInv = new Librerias.ZafMovIngEgrInv.ZafReaMovInv(objParSis,this ); \n Compras.ZafCom91.ZafCom91 objCom91 = new Compras.ZafCom91.ZafCom91(objParSis,1);\n arlDatSolTra = new ArrayList();\n arlDatSolTra=(objCom91.insertarSolicitudTransferenciaReservas(conExt,arlSolTraDat,CodEmp,CodLoc,CodCot));\n System.out.println(\"GeneraSolicitud\" + arlDatSolTra.toString());\n if(isSolTraInv(conExt,CodEmp,CodLoc,CodCot)){\n if(objReaMovInv.inicia(conExt, arlDat,datFecAux,arlDatSolTra,null)){\n if(modificaDetalleCotizacionCantidadesLocalesRemotasDos(conExt, CodEmp,CodLoc, CodCot)){\n System.out.println(\"OK PRESTAMOS\");\n }\n else{\n MensajeInf(\"Error al Guardar: Reservar mercaderia local\");\n System.out.println(\"GeneraSolicitud NO reservo local.....\");\n blnRes=false;\n }\n }else{\n MensajeInf(\"Error al Guardar: Prestamos entre empresas\");\n System.out.println(\"GeneraSolicitud No Genero la solicitud.....\");\n blnRes=false;\n }\n }\n else{\n MensajeInf(\"Error al Guardar: La solicitud de transferencia\");\n System.out.println(\"No Genero la solicitud.....\");\n blnRes=false;\n }\n objParSis.setCodigoMenu(intCodMnuResVenAut); // AUTORIZACIONES \n objReaMovInv = null;\n objCom91 = null;\n\n }\n else{\n /* Todo es local */\n// if(modificaDetalleCotizacionCantidadesLocalesRemotas(conExt, CodEmp, CodLoc, CodCot)){\n// System.out.println(\"OK PRESTAMOS\");\n// }\n// else{\n// MensajeInf(\"Error al Guardar: Reservar mercaderia local\");\n// System.out.println(\"GeneraSolicitud NO reservo local.....\");\n// blnRes=false;\n// }\n if(cotizacionSinSolicitudTransferencia(conExt,CodEmp,CodLoc,CodCot)){\n if(ponerItemsComoReservaLocal(conExt,CodEmp,CodLoc,CodCot)){\n System.out.println(\"generarEgresoMercaderiaReservada OK\");\n }\n else{\n MensajeInf(\"Error al Guardar: Reservar mercaderia local\");\n System.out.println(\"GeneraSolicitud NO reservo local.....\");\n blnRes=false;\n }\n }\n }\n /* Genera Egreso de reserva */\n }else{blnRes=false;MensajeInf(\"Error al Guardar: Insertando Cotizacion en el seguimiento\");}\n }\n //}\n }else{blnRes=false;MensajeInf(\"Error al Guardar: Realizando Movimiento Entre Empresas \");}\n }\n }\n }\n }\n catch(Exception Evt){ \n objUti.mostrarMsgErr_F1(this, Evt);\n blnRes=false;\n } \n return blnRes;\n }", "private int AddExcelRow(Row excelRow)\n {\n DataFormatter dataFormatter = new DataFormatter();\n int i=1;\n\n\n try {\n if (insertStatement == null)\n insertStatement =conn.prepareStatement(insertSQL);\n for(int idx =0;idx < fieldLength.size();idx++)\n {\n String cellValue =dataFormatter.formatCellValue(excelRow.getCell(idx)).trim();\n if (idx != 10) {\n\n if (ArrayUtils.contains( decimalIndex, idx ))\n {\n if (!cellValue.isEmpty()) {\n cellValue = cellValue.replaceAll(patt,\"\");\n if (cellValue.equals(\"\"))\n insertStatement.setObject(i, null, Types.DECIMAL);\n else\n insertStatement.setDouble(i, Double.parseDouble(cellValue));\n }\n else\n insertStatement.setObject(i, null, Types.DECIMAL);\n }\n else\n {\n if (!cellValue.isEmpty())\n insertStatement.setString(i, cellValue.substring(0, cellValue.length() > Integer.parseInt(fieldLength.get(idx + 1).toString()) ? Integer.parseInt(fieldLength.get(idx + 1).toString()) : cellValue.length()));\n else\n insertStatement.setObject(i, null, Types.NVARCHAR);\n }\n\n\n i = i + 1;\n }\n\n\n }\n insertStatement.setString(i, \"N\");\n i=i+1;\n insertStatement.setString(i, \"M\"+ fileId);\n insertStatement.addBatch();\n return 0;\n }\n catch (NumberFormatException numEx){\n logger.error(\"Error\",numEx);\n return -1;\n }\n catch (SQLException ex)\n {\n logger.error(\"Error\",ex);\n return -1;\n }\n finally {\n excelRow = null;\n }\n }", "public void testInsert() {\n\t\ttry {\n\t\t\tServerParameterTDG.create();\n\n\t\t\tServerParameterTDG.insert(\"paramName\", \"A description\", \"A value\");\n\t\t\ttry {\n\t\t\t\tServerParameterTDG.insert(\"paramName\", \"other description\", \"other value\");\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// paramName is primary key, no duplicates\n\t\t\t\tassertTrue(true);\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\tServerParameterTDG.drop();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\t\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tServerParameterTDG.drop();\n\t\t\t} catch (SQLException e) {\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public SqlResultInfo insertRecord(Db_table.TableEntry entry, Db_table table)\r\n {\r\n SqlResultInfo result = new SqlResultInfo(Boolean.FALSE);\r\n if(this.curConnection_ != null && entry != null && entry.containsNotNullEntry())\r\n {\r\n try{\r\n String[] buildSql = entry.buildColumnAndValueList();\r\n String query = \"insert into \" + table.getName() + buildSql[0]\r\n + \" values \" + buildSql[1] + \" ;\";\r\n \r\n \r\n Statement sm = curConnection_.createStatement();\r\n sm.executeUpdate(query);\r\n result.setSucceed();\r\n \r\n }catch(SQLException e)\r\n {\r\n result.setErrInfo(e);\r\n if(e.getClass() == SQLTimeoutException.class)\r\n {\r\n this.CurConnectionFailed();\r\n }\r\n }\r\n }\r\n else\r\n {\r\n result.setErrInfo(\"数据库无可用连接\");\r\n }\r\n return result;\r\n }", "@Override\r\n\tpublic boolean insert(Temi record) {\n\t\treturn temiMapper.insert(record)>0?true:false;\r\n\t}", "public abstract boolean insert(Log log) throws DataException;", "public boolean Insert(String tipo, String lugar, String accion, String responsable, String vencimiento,String spinnerRiesgoSeleccion,\n String spinnerSectorSeleccion, String estado, String condicionInsegura, String usuario, String imagen, String site,\n String fecha, String Lider_recorrida, String Participantes, String Categoria){\n\n SQLiteDatabase BaseDeDatos=this.getWritableDatabase();\n ContentValues values=new ContentValues();\n\n if(tipo==\"Reporte de condiciones inseguras UAC\"){\n tipo = \"UAC\";\n }else if(tipo == \"Auditoria de primera parte\"){\n tipo = \"Auditoria\";\n }else {\n tipo = \"EHSS\";\n }\n values.put(\"tipo\", tipo);\n values.put(\"site\", site);\n values.put(\"fecha\", fecha);\n String fh = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(new Date());\n values.put(\"fechaHoraCreacion\", fh);\n values.put(\"sector\",spinnerSectorSeleccion);\n values.put(\"lugar\", lugar);\n values.put(\"accion\", accion);\n values.put(\"responsable\", responsable);\n values.put(\"vencimiento\", vencimiento);\n values.put(\"riesgo\",spinnerRiesgoSeleccion);\n values.put(\"estado\",estado );\n values.put(\"condicionInsegura\", condicionInsegura);\n values.put(\"usuarioCreacion\",usuario);\n values.put(\"imagenUAC\",imagen);\n values.put(\"Lider_recorrida\",Lider_recorrida);\n values.put(\"Participantes\",Participantes);\n values.put(\"Categoria\",Categoria);\n values.put(\"syncro\", 0);\n\n boolean resultado=BaseDeDatos.insert(\"uac\",null,values)>0;\n BaseDeDatos.close();\n return resultado;\n }", "@Override\n\tpublic String insertStatement() throws Exception {\n\t\treturn null;\n\t}", "public boolean exicutionInsert(Connection con, String Query) throws SQLException {\n\t\tStatement stmt = con.createStatement();\n\t\n\t\tstmt.executeQuery(Query);\n\t\t\n\t\treturn true;\n\t\n\t}", "public boolean insert(XINT_STD_REGIS_EXAM objval) {\n String sql = \"insert into XINT_STD_REGIS_EXAM(STD_CODE,YEAR,SEMESTER,COURSE_NO,EXAM_DATE,EXAM_PERIOD,EXAM_TYPE,INSERT_DATE) \"\n + \"values(?,?,?,?,TO_DATE(?, 'dd/mm/yyyy', 'NLS_CALENDAR=''THAI BUDDHA'' NLS_DATE_LANGUAGE=THAI'),?,?,SYSDATE)\";\n\n String[] genCol = {\"STD_CODE\"};\n int chk = db.insertRc(genCol, sql, objval.getSTD_CODE(), objval.getYEAR(), objval.getSEMESTER(), objval.getCOURSE_NO(),\n objval.getEXAM_DATE(), objval.getEXAM_PERIOD(), objval.getEXAM_TYPE());\n\n try {\n if (chk > 0) {\n return true;\n } else {\n return false;\n }\n } catch (Exception e) {\n return false;\n }\n\n }", "public static long insert(Disease disease) throws Exception {\n if (OpenDentBusiness.DataConnection.DBtype == OpenDentBusiness.DatabaseType.Oracle)\n {\n disease.DiseaseNum = DbHelper.getNextOracleKey(\"disease\",\"DiseaseNum\");\n int loopcount = 0;\n while (loopcount < 100)\n {\n try\n {\n return Insert(disease, true);\n }\n catch (Oracle.DataAccess.Client.OracleException ex)\n {\n if (ex.Number == 1 && ex.Message.ToLower().Contains(\"unique constraint\") && ex.Message.ToLower().Contains(\"violated\"))\n {\n disease.DiseaseNum++;\n loopcount++;\n }\n else\n {\n throw ex;\n } \n }\n \n }\n throw new ApplicationException(\"Insert failed. Could not generate primary key.\");\n }\n else\n {\n return Insert(disease, false);\n } \n }", "int insert(SysCode record);", "void insertSelective(GfanCodeBanner record) throws SQLException;", "public int insert(Listing listing) throws SQLException;", "public void insertRow(Vector<Row> _data) {\r\n if(!validTable()){\r\n System.out.println(\"Error:Table:insertRow: table invalid, nothing done\");\r\n return;\r\n }\r\n //inserts a row and updates indexes\r\n if(_data.size() == 0){\r\n System.out.println(\"Error:Table:insertRow: data to be inserted is empty, no data inserted\");\r\n return;\r\n }\r\n if(!rows.isEmpty() && _data.elementAt(0).getData().size() != rows.get(rows.keySet().iterator().next()).getData().size()){\r\n System.out.println(\"Error:Table:insertRow: data to be inserted is a mismatched size to existing data, no data inserted\");\r\n return;\r\n }\r\n for(Row r : _data) {\r\n String key = \"\";\r\n for(int i : primKeyIndexes)\r\n key = key + r.getDataAtIndex(i);\r\n rows.put(key, r);\r\n }\r\n }", "private static void parseInsertString(String insertRowString) {\n System.out.println(\"STUB: Calling parseInsertString(String s) to process queries\");\n System.out.println(\"Parsing the string:\\\"\" + insertRowString + \"\\\"\");\n insertRowString = insertRowString.toLowerCase();\n boolean insert = true;\n String cols = insertRowString.substring(0, insertRowString.indexOf(\")\") + 1);\n String vals = insertRowString.substring(insertRowString.indexOf(\")\") + 1);\n String tableName = vals.trim().split(\" \")[0];\n String tableNamefile = tableName + \".tbl\";\n\n Matcher mcols = Pattern.compile(\"\\\\((.*?)\\\\)\").matcher(cols);\n Matcher mvals = Pattern.compile(\"\\\\((.*?)\\\\)\").matcher(vals);\n\n\n cols = mcols.find() ? mcols.group(1).trim() : \"\";\n vals = mvals.find() ? mvals.group(1).trim() : \"\";\n String columns[] = cols.split(\",\");\n String values[] = vals.split(\",\");\n columns = removeWhiteSpacesInArray(columns);\n values = removeWhiteSpacesInArray(values);\n Table table = null;\n Set colNames = columnOrdinalHelper.getKeySet(tableName);\n HashSet<String> colNullVals = new HashSet<>();\n try {\n table = new Table(tableNamefile);\n // to perform the order of the insert based on the ordinal position\n TreeMap<String, String> colOrder = new TreeMap<>();\n // to map the colunm with data\n HashMap<String, String> colVals = new HashMap<>();\n\n for (int i = 0; i < columns.length; i++) {\n //preserving the order of the columns as given to ordinal positions\n colOrder.put(columnOrdinalHelper.getProperties(tableName.concat(\".\").concat(columns[i])), columns[i]);\n //mappng column name wth value\n colVals.put(columns[i], values[i]);\n }\n long pos = checkIfTablePageHasSpace(tableNamefile, Integer.parseInt(recordLengthHelper.getProperties(tableName.concat(\".\").concat(Constant.recordLength))));\n if (pos != -1) {\n long indexTowrite = pos;\n int noOfColumns = Integer.parseInt(recordLengthHelper.getProperties(tableName.concat(\".\").concat(Constant.numberOfColumns)));\n\n for (Object s : colNames) {\n if (!colOrder.containsValue(String.valueOf(s).substring(String.valueOf(s).indexOf('.')+1))){\n colNullVals.add(String.valueOf(s));\n }\n }\n//\n//\n// }\n\n for(String s : colNullVals){\n if(columnNotNullHelper.getProperties(s)!=null){\n System.out.println(\"Column cannot be null : \"+s);\n insert = false;\n }\n break;\n }\n\n for (int i = 1; i <= noOfColumns; i++) {\n if (colOrder.containsKey(String.valueOf(i)) && insert) {\n pos = RecordFormat.writeRecordFormat(columnTypeHelper.getProperties(tableName.concat(\".\").concat(colOrder.get(String.valueOf(i)))), table, pos, colVals.get(colOrder.get(String.valueOf(i))));\n colNames.remove(tableName.concat(\".\").concat(colOrder.get(String.valueOf(i))));\n }\n }\n Iterator it = colNames.iterator();\n while (it.hasNext() && insert) {\n String colName = (String) it.next();\n String nullValue = String.valueOf(RecordFormat.getRecordFormat(columnTypeHelper.getProperties(colName)));\n pos = RecordFormat.writeRecordFormat(nullValue, table, pos, null);\n }\n table.page.updateArrOfRecLocInPageHeader((short) indexTowrite);\n table.page.updateNoOfRecInPageHeader();\n table.page.updateStartOfContent((short) indexTowrite);\n } else {\n //TODO: Splitting\n }\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n }", "public void databaseinsert() {\n\n\t\tStringBuilder sb = new StringBuilder();\n\t\tSite site = new Site(Sid.getText().toString().trim(), Scou.getText().toString().trim());\n\t\tlong rowId = dbHlp.insertDB(site);\n\t\tif (rowId != -1) {\n\t\t\tsb.append(getString(R.string.insert_success));\n\n\t\t} else {\n\n\t\t\tsb.append(getString(R.string.insert_fail));\n\t\t}\n\t\tToast.makeText(Stu_state.this, sb, Toast.LENGTH_SHORT).show();\n\t}", "public void testInsert() {\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n\r\n try {\r\n tree.insert(\"apple\");\r\n }\r\n catch (DuplicateItemException e) {\r\n assertNotNull(e);\r\n }\r\n }", "public boolean insert(String ps) {\n boolean r = false;\n try {\n getCon().createStatement().execute(ps);\n r = true;\n } catch (SQLException e) {\n System.out.println(\"Erro ao executa comando SQL \\n\"+e.getMessage());\n }\n return r;\n }", "private void inserts() {\n DBPeer.fetchTableRows();\n DBPeer.fetchTableIndexes();\n \n Map<Number160, Data> tabRows = DBPeer.getTabRows();\n\t\tMap<Number160, Data> tabIndexes = DBPeer.getTabIndexes();\n\t\t\n String tabName = null;\n Number160 tabKey = null;\n FreeBlocksHandler freeBlocks = null;\n Map<String, IndexHandler> indexHandlers = new HashMap<>();\n TableRows tr = null;\n TableIndexes ti = null;\n \n logger.trace(\"INSERT-WHOLE\", \"BEGIN\", Statement.experiment);\n \n for (Insert ins: inserts) {\n \n if (tabName == null) {\n \ttabName = ins.getTabName();\n \ttabKey = Number160.createHash(tabName);\n \tfreeBlocks = new FreeBlocksHandler(tabName);\n \ttry {\n \t\t\t\ttr = (TableRows) tabRows.get(tabKey).getObject();\n \t\t\t\tti = (TableIndexes) tabIndexes.get(tabKey).getObject();\n \t\t\t} catch (ClassNotFoundException | IOException e) {\n \t\t\t\tlogger.error(\"Data error\", e);\n \t\t\t}\n \tfor (String index: ti.getIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \tfor (String index: ti.getUnivocalIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n } else if (!tabName.equals(ins.getTabName())) {\n \t\t\ttry {\n \t\t\t\ttabRows.put(tabKey, new Data(tr));\n \t\t\ttabIndexes.put(tabKey, new Data(ti));\n \t\t\ttabName = ins.getTabName();\n \ttabKey = Number160.createHash(tabName);\n \t\t\t\ttr = (TableRows) tabRows.get(tabKey).getObject();\n \t\t\t\tti = (TableIndexes) tabIndexes.get(tabKey).getObject();\n \t\t\t\tfreeBlocks.update();\n \tfreeBlocks = new FreeBlocksHandler(tabName);\n \tindexHandlers.clear();\n \tfor (String index: ti.getIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \tfor (String index: ti.getUnivocalIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \t\t\t} catch (ClassNotFoundException | IOException e) {\n \t\t\t\tlogger.error(\"Data error\", e);\n \t\t\t}\n } \n \n ins.init(freeBlocks, indexHandlers, tr, ti);\n \n }\n \n boolean done = false;\n while (!done) {\n \tint countTrue = 0;\n \tfor (Insert ins: inserts) {\n \t\tif (ins.getDone()) {\n \t\t\tcountTrue++;\n \t\t}\n \t}\n \tif (countTrue == inserts.size()) {\n \t\tdone = true;\n \t}\n }\n \n freeBlocks.update();\n\n try {\n\t\t\ttabRows.put(tabKey, new Data(tr));\n\t\t\ttabIndexes.put(tabKey, new Data(ti));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Data error\", e);\n\t\t}\n \n DBPeer.updateTableRows();\n DBPeer.updateTableIndexes();\n \n logger.trace(\"INSERT-WHOLE\", \"END\", Statement.experiment);\n }", "private void inserirQuests(){\n try {\n methods.InsereQuestsOnBD();\n //Toast.makeText(this,\"Inseridos dados com sucesso\",Toast.LENGTH_LONG).show();\n\n }\n catch (SQLException ex){\n AlertDialog.Builder dlg = new AlertDialog.Builder(this);\n dlg.setTitle(\"Erro\");\n dlg.setMessage(ex.getMessage());\n dlg.setNeutralButton(\"OK\",null);\n dlg.show();\n }\n }", "int insert(PmKeyDbObj record);", "public boolean INSERT_DK_KHAISINH(int COQUAN_ID, int LOAI_DK_ID, DangKyKhaiSinh DKKS) throws SQLException\n\t {\n\t\t /*\n\t\t String StrSql = \"EXEC ADD_HOSO_DANGKY_KHAISINH\";\n\t\t StrSql = StrSql + \",?\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,?\" +\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,?\" + \n\t\t \t\t\t\t \",?\t,?\t,?\t,?\t,? ,?\";\n\t\t \t\t\n\t\t Connection();\n\t\t \n\t\t PreparedStatement statement = JDBCConnect.prepareStatement(StrSql);\n\t\t \n\t\t statement.setInt(1,1); //Trạng Thái: 1 là trạng thái chưa xử lý\n\t\t statement.setInt(2, COQUAN_ID);\n\t\t statement.setInt(3, LOAI_DK_ID);\n\t\t statement.setString(4, DKKS.getNguoiYeuCau().getHoVaTen());\n\t\t statement.setString(5, DKKS.getNguoiYeuCau().getCMND());\n\t\t statement.setDate(6, DKKS.getNguoiYeuCau().getNgayCap());\n\t\t statement.setString(7, DKKS.getNguoiYeuCau().getNoiCap());\n\t\t statement.setString(8, DKKS.getNguoiYeuCau().getQuocTich());\n\t\t statement.setString(9, DKKS.getNguoiYeuCau().getTP());\n\t\t statement.setString(10, DKKS.getNguoiYeuCau().getQuan());\n\t\t statement.setString(11, DKKS.getNguoiYeuCau().getPhuong());\n\t\t statement.setString(12, DKKS.getNguoiYeuCau().getDiaChi());\n\t\t statement.setString(13, DKKS.getNguoiYeuCau().getQuanHe());\n\t\t \n\t\t statement.setString(14, DKKS.getDoiTuongSinh().getHoVaTen());\n\t\t statement.setString(15, DKKS.getDoiTuongSinh().getGioiTinh());\n\t\t statement.setDate(16, DKKS.getDoiTuongSinh().getNgaySinh());\n\t\t statement.setString(17, DKKS.getDoiTuongSinh().getDanToc());\n\t\t statement.setString(18, DKKS.getDoiTuongSinh().getQuocTich());\n\t\t statement.setString(19, DKKS.getDoiTuongSinh().getTP());\n\t\t statement.setString(20, DKKS.getDoiTuongSinh().getQuan());\n\t\t statement.setString(21, DKKS.getDoiTuongSinh().getPhuong());\n\t\t statement.setString(22, DKKS.getDoiTuongSinh().getDiaChi());\n\t\t statement.setString(23, DKKS.getDoiTuongSinh().getCoSoSinhSan());\n\t\t statement.setString(24, DKKS.getDoiTuongSinh().getQuocTich_CSSS());\n\t\t statement.setString(25, DKKS.getDoiTuongSinh().getTP_CSSS());\n\t\t statement.setString(26, DKKS.getDoiTuongSinh().getQuan_CSSS());\n\t\t statement.setString(27, DKKS.getDoiTuongSinh().getPhuong_CSSS());\n\t\t statement.setString(28, DKKS.getDoiTuongSinh().getDiaChi_CSSS());\n\t\t \n\t\t statement.setString(29, DKKS.getMe().getHoVaTen());\n\t\t statement.setDate(30, DKKS.getMe().getNgaySinh());\n\t\t statement.setString(31, DKKS.getMe().getCMND());\n\t\t statement.setDate(32, DKKS.getMe().getNgayCap());\n\t\t statement.setString(33, DKKS.getMe().getNoiCap());\n\t\t statement.setString(34, DKKS.getMe().getDanToc());\n\t\t statement.setString(35, DKKS.getMe().getQuocTich());\n\t\t statement.setString(36, DKKS.getMe().getTP());\n\t\t statement.setString(37, DKKS.getMe().getQuan());\n\t\t statement.setString(38, DKKS.getMe().getPhuong());\n\t\t statement.setString(39, DKKS.getMe().getDiaChi());\n\t\t \n\t\t statement.setString(40, DKKS.getCha().getHoVaTen());\n\t\t statement.setDate(41, DKKS.getCha().getNgaySinh());\n\t\t statement.setString(42, DKKS.getCha().getCMND());\n\t\t statement.setDate(43, DKKS.getCha().getNgayCap());\n\t\t statement.setString(44, DKKS.getCha().getNoiCap());\n\t\t statement.setString(45, DKKS.getCha().getDanToc());\n\t\t statement.setString(46, DKKS.getCha().getQuocTich());\n\t\t statement.setString(47, DKKS.getCha().getTP());\n\t\t statement.setString(48, DKKS.getCha().getQuan());\n\t\t statement.setString(49, DKKS.getCha().getPhuong());\n\t\t statement.setString(50, DKKS.getCha().getDiaChi());\n\t\t \n\t\t statement.setString(51, \"Chua co\");\n\t*/\n\t \t\t\n\t\t\t Connection();\n\t\t String StrSql = \"EXEC ADD_HOSO_DANGKY_KHAISINH_NYC ?,?,?\" + \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\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\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\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\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\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\t,?\";\n\t\t \n\t\t PreparedStatement statement = JDBCConnect.prepareStatement(StrSql);\n\t\t statement.setInt(1,1); //Trạng Thái: 1 là trạng thái chưa xử lý\n\t\t statement.setInt(2, COQUAN_ID);\n\t\t statement.setInt(3, LOAI_DK_ID);\n\t\t statement.setString(4, DKKS.getNguoiYeuCau().getHoVaTen());\n\t\t statement.setString(5, DKKS.getNguoiYeuCau().getCMND());\n\t\t statement.setDate(6, DKKS.getNguoiYeuCau().getNgayCap());\n\t\t statement.setString(7, DKKS.getNguoiYeuCau().getNoiCap());\n\t\t statement.setString(8, DKKS.getNguoiYeuCau().getQuocTich());\n\t\t statement.setString(9, DKKS.getNguoiYeuCau().getTP());\n\t\t statement.setString(10, DKKS.getNguoiYeuCau().getQuan());\n\t\t statement.setString(11, DKKS.getNguoiYeuCau().getPhuong());\n\t\t statement.setString(12, DKKS.getNguoiYeuCau().getDiaChi());\n\t\t statement.setString(13, DKKS.getNguoiYeuCau().getQuanHe());\n\t\t \n\t\t statement.setString(14, DKKS.getDoiTuongSinh().getHoVaTen());\n\t\t statement.setString(15, DKKS.getDoiTuongSinh().getGioiTinh());\n\t\t statement.setDate(16, DKKS.getDoiTuongSinh().getNgaySinh());\n\t\t statement.setString(17, DKKS.getDoiTuongSinh().getDanToc());\n\t\t statement.setString(18, DKKS.getDoiTuongSinh().getQuocTich());\n\t\t statement.setString(19, DKKS.getDoiTuongSinh().getTP());\n\t\t statement.setString(20, DKKS.getDoiTuongSinh().getQuan());\n\t\t statement.setString(21, DKKS.getDoiTuongSinh().getPhuong());\n\t\t statement.setString(22, DKKS.getDoiTuongSinh().getDiaChi());\n\t\t statement.setString(23, DKKS.getDoiTuongSinh().getCoSoSinhSan());\n\t\t statement.setString(24, DKKS.getDoiTuongSinh().getQuocTich_CSSS());\n\t\t statement.setString(25, DKKS.getDoiTuongSinh().getTP_CSSS());\n\t\t statement.setString(26, DKKS.getDoiTuongSinh().getQuan_CSSS());\n\t\t statement.setString(27, DKKS.getDoiTuongSinh().getPhuong_CSSS());\n\t\t statement.setString(28, DKKS.getDoiTuongSinh().getDiaChi_CSSS());\n\t\t \n\t\t \n\t\t statement.setString(29, DKKS.getMe().getHoVaTen());\n\t\t statement.setDate(30, DKKS.getMe().getNgaySinh());\n\t\t statement.setString(31, DKKS.getMe().getCMND());\n\t\t statement.setDate(32, DKKS.getMe().getNgayCap());\n\t\t statement.setString(33, DKKS.getMe().getNoiCap());\n\t\t statement.setString(34, DKKS.getMe().getDanToc());\n\t\t statement.setString(35, DKKS.getMe().getQuocTich());\n\t\t statement.setString(36, DKKS.getMe().getTP());\n\t\t statement.setString(37, DKKS.getMe().getQuan());\n\t\t statement.setString(38, DKKS.getMe().getPhuong());\n\t\t statement.setString(39, DKKS.getMe().getDiaChi());\n\t\t \n\t\t statement.setString(40, DKKS.getCha().getHoVaTen());\n\t\t statement.setDate(41, DKKS.getCha().getNgaySinh());\n\t\t statement.setString(42, DKKS.getCha().getCMND());\n\t\t statement.setDate(43, DKKS.getCha().getNgayCap());\n\t\t statement.setString(44, DKKS.getCha().getNoiCap());\n\t\t statement.setString(45, DKKS.getCha().getDanToc());\n\t\t statement.setString(46, DKKS.getCha().getQuocTich());\n\t\t statement.setString(47, DKKS.getCha().getTP());\n\t\t statement.setString(48, DKKS.getCha().getQuan());\n\t\t statement.setString(49, DKKS.getCha().getPhuong());\n\t\t statement.setString(50, DKKS.getCha().getDiaChi());\n\t\t \n\t\t statement.setString(51, \"Chua co\");\n\t\t \n\t\t statement.executeUpdate();\n\t\t \n\t\t statement.close();\n\t\t DisConnection();\n\t\t \n\t\treturn true;\n\t }", "int insertSelective(Kaiwa record);", "public void test_ROWID_insert_select() {\r\n // ## Arrange ##\r\n VendorCheck vendorCheck = new VendorCheck();\r\n vendorCheck.setVendorCheckId(99999L);\r\n vendorCheck.setTypeOfRowid(\"123456789012345678\");\r\n\r\n // ## Act ##\r\n try {\r\n vendorCheckBhv.insert(vendorCheck);\r\n\r\n // ## Assert ##\r\n fail(\"Now unsupported\");\r\n } catch (SQLFailureException e) {\r\n // OK\r\n log(e.getMessage());\r\n }\r\n }", "@Override\n\tpublic int insert(Permis record) {\n\t\treturn 0;\n\t}", "public void testInsert2() throws Exception {\n\n DAS das = DAS.FACTORY.createDAS(getConnection());\n Command insert = das.createCommand(\"insert into COMPANY (NAME) values (?)\");\n insert.setParameter(1, \"AAA Rental\");\n insert.execute();\n\n // insert another using same command\n insert.setParameter(1, \"BBB Rental\");\n insert.execute();\n\n // Verify insert\n // Verify\n Command select = das.createCommand(\"Select ID, NAME from COMPANY\");\n DataObject root = select.executeQuery();\n\n assertEquals(5, root.getList(\"COMPANY\").size());\n\n }", "@Override\n public int insert(KlantBedrijf kb) {\n Connection connection = createConnection();\n int id = -1;\n try {\n PreparedStatement preparedStatement = connection.prepareStatement(\"INSERT INTO klant_has_bedrijf (klant_id,bedrijf_id) VALUES (?,?)\", Statement.RETURN_GENERATED_KEYS);\n preparedStatement.setInt(1, kb.getKlantId());\n preparedStatement.setInt(2, kb.getBedrijfId());\n preparedStatement.executeUpdate();\n\n ResultSet rs = preparedStatement.getGeneratedKeys();\n rs.next();\n id = rs.getInt(1);\n rs.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n closeConnection(connection);\n return id;\n }", "public void insert(TdiaryArticle obj) throws SQLException {\n\r\n\t}", "public void addCertainRow(String bookname, String ISBN, String author, String description,\n String quantity, String publisher, String category)\n {\n String insertStr;\n try{\n\n insertStr=\"INSERT IGNORE INTO material (bookname, ISBN, author, description, quantity, publisher, category) VALUES(\"\n +quotate(bookname)+\",\"\n +quotate(ISBN)+\",\"\n +quotate(author)+\",\"\n +quotate(publisher)+\",\"\n +quotate(quantity)+\",\"\n +quotate(publisher)+\",\"\n +quotate(category)\n +\")\";\n\n stmt.executeUpdate(insertStr);\n\n } catch(Exception e){\n System.out.println(\"Error occurred in inserting data\");\n }\n return;\n }", "public static int insert(Account new_emp)\n {\n String sql = \"SELECT COUNT(em_id) FROM Account\"; // tạo id mới cho employee cần thêm vào database\n try(Connection cn = new DBConnection().getCon();\n PreparedStatement st = cn.prepareStatement(sql);\n ResultSet rs = st.executeQuery();){\n \n if(rs.next()){\n int current_number_oftbEmployee = rs.getInt(1);\n \n sql = \"INSERT Account VALUES (?, ?, ?, ?, ?, ?, ?, ?)\";\n int result = 0;\n do{\n String newid = createid(\"AC\", String.valueOf(++current_number_oftbEmployee), 10);\n new_emp.setAccount_id(newid);\n\n\n\n try(PreparedStatement st2 = cn.prepareStatement(sql);){\n\n st2.setString(1, new_emp.getAccount_id());\n st2.setString(2, new_emp.getUsername());\n st2.setString(3, new_emp.getPassword());\n st2.setString(4, new_emp.getName());\n st2.setDate(5, new_emp.getBirth_day());\n st2.setString(6, new_emp.getAddress());\n st2.setString(7, new_emp.getEmail());\n st2.setString(8, new_emp.getPhone());\n\n result = st2.executeUpdate();\n }\n } while(result == 0);\n return result;\n }\n } catch (SQLException ex) {\n ex.printStackTrace();\n Logger.getLogger(AccountDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return 0;\n }", "public int checkNewRowInsert(String id){\r\n\t\treturn motorCycleDao.checkNewRowInsert(id);\r\n\t}", "int insertSelective(ItemStockDO record);", "public void insertRowToTable(Row row) throws DBAppException, PageNotLoadedException{\n\t\t//load the last page\n\t\tint indexInserted = loadPage(pageSize);\n\t\t//page is already Loaded handling\n\t\tif (indexInserted == -1)\n\t\t\tindexInserted = getPageIndexInArrayList(pageSize);\n\t\t\n\t\t//last page is full\n\t\tif (!pages_loaded.get(indexInserted).canInsertRow()){\n\t\t\tcreateNewPage();\n\t\t\tinsertRowToTable(row);\n\t\t}\n\t\t\n\t\taddRowToPage(pageSize,row);\n\t}", "Long insert(Access record);", "int insertSelective(Engine record);", "public static void insertFournisseur(Fournisseur unFournisseur ) {\n Bdd uneBdd = new Bdd(\"localhost\", \"paruline \", \"root\", \"\");\n\n String checkVille = \"CALL checkExistsCity('\" + unFournisseur.getVille() + \"','\" + unFournisseur.getCp() + \"');\";\n try {\n uneBdd.seConnecter();\n Statement unStat = uneBdd.getMaConnection().createStatement();\n\n ResultSet unRes = unStat.executeQuery(checkVille);\n\n int nb = unRes.getInt(\"nb\");\n\n if (nb == 0) {\n String ajoutVille = \"CALL InsertCity('\" + unFournisseur.getVille() + \"', '\" + unFournisseur.getCp() + \"');\";\n\n try {\n Statement unStatAjout = uneBdd.getMaConnection().createStatement();\n\n unStatAjout.executeQuery(ajoutVille);\n unStatAjout.close();\n }\n catch (SQLException e) {\n System.out.println(\"Erreur : \" + ajoutVille);\n }\n }\n\n String id = \"CALL GetCity('\" + unFournisseur.getVille() + \"', '\" + unFournisseur.getCp() + \"')\";\n\n try {\n Statement unStatId = uneBdd.getMaConnection().createStatement();\n\n ResultSet unResId = unStatId.executeQuery(id);\n\n int id_city = unResId.getInt(\"id_city\");\n\n\n\n String insertFournisseur = \"INSERT INTO fournisseur(id_city, name_f, adresse_f, phoneFour) VALUES (\" + id_city + \", '\" + unFournisseur.getNom() + \"', \" +\n \"'\" + unFournisseur.getAdresse() + \"', '\" + unFournisseur.getTelephone() + \"')\";\n\n try {\n Statement unStatFourn = uneBdd.getMaConnection().createStatement();\n unStatFourn.executeQuery(insertFournisseur);\n\n unStatFourn.close();\n }\n catch (SQLException e) {\n System.out.println(\"Erreur : \" + insertFournisseur);\n }\n\n unResId.close();\n unStatId.close();\n }\n catch (SQLException e) {\n System.out.println(\"Erreur : \" + id);\n }\n\n unRes.close();\n unStat.close();\n uneBdd.seDeConnecter();\n } catch (SQLException exp) {\n System.out.println(\"Erreur : \" + checkVille);\n }\n }", "void insert(CTipoComprobante record) throws SQLException;", "protected int insert(Object obj, Connection conn) throws SQLException {\r\n ObjectHelper helper = helperFactory.getObjectHelper(obj);\r\n return helper.insert(obj, conn);\r\n }", "int insert(Kaiwa record);", "public void testInsert() throws Exception {\n\n DAS das = DAS.FACTORY.createDAS(getConnection());\n Command insert = das.createCommand(\"insert into COMPANY (NAME) values (?)\");\n insert.setParameter(1, \"AAA Rental\");\n insert.execute();\n\n // Verify insert\n // Verify\n Command select = das.createCommand(\"Select ID, NAME from COMPANY\");\n DataObject root = select.executeQuery();\n\n assertEquals(4, root.getList(\"COMPANY\").size());\n assertTrue(root.getInt(\"COMPANY[1]/ID\") > 0);\n\n }", "void insertSelective(CTipoComprobante record) throws SQLException;", "int insert(InternalTradeEpa022016 record);", "int insertSelective(DBPublicResources record);", "int insert(TDwBzzxBzflb record);", "int insertSelective(ErpOaLicKey record);", "public static boolean\n\tinsert_Data\n\t(Activity actv, String tableName, ContentValues cv) {\n\t\t\n\t\tlong new_id;\n\t\t\n\t\tboolean res;\n\t\t\n\t\t////////////////////////////////\n\n\t\t// db\n\n\t\t////////////////////////////////\n\t\tDBUtils dbu = new DBUtils(actv, CONS.DB.dbName);\n\t\t\n\t\tSQLiteDatabase wdb = dbu.getWritableDatabase();\n\n\t\t////////////////////////////////\n\n\t\t// insertion\n\n\t\t////////////////////////////////\n\t\ttry {\n\t\t\t//\n\t\t\twdb.beginTransaction();\n\t\t\t\n\t\t\t//\n//\t\t\tContentValues cv = new ContentValues();\n//\t\t\t\n//\t\t\t// Put values\n//\t\t\tfor (int i = 0; i < cols.length; i++) {\n//\t\t\t\tcv.put(cols[i], values[i]);\n//\t\t\t}//for (int i = 0; i < columnNames.length; i++)\n\n\t\t\t// Insert data\n\t\t\tnew_id = wdb.insert(tableName, null, cv);\n\t\t\t\n\t\t\tif (new_id > 0) {\n\t\t\t\t\n\t\t\t\t// Set as successful\n\t\t\t\twdb.setTransactionSuccessful();\n\t\t\t\t\n\t\t\t\tLog.d(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t\t+ \"]\", \"data => inserted: id = \" + new_id);\n\t\t\t\t\n//\t\t\t\t// End transaction\n//\t\t\t\twdb.endTransaction();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tres = true;\n//\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tLog.d(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t\t+ \"]\", \"data => not inserted: return = \" + new_id);\n\t\t\t\t\n//\t\t\t\t// End transaction\n//\t\t\t\twdb.endTransaction();\n\t\t\t\t\n\t\t\t\tres = false;\n//\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// Log\n\t\t\tLog.e(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"Exception => \" + e.toString());\n\t\t\t\n\t\t\tres = false;\n//\t\t\treturn false;\n\t\t} finally {//try\n\n\t\t\t// End transaction\n\t\t\twdb.endTransaction();\n\n\t\t}//try\n\t\t\n\t\twdb.close();\n\t\t\n\t\treturn res;\n\t\t\n\t}", "@Override\n\tpublic void insert(RaceZipTbVo vo) throws SQLException {\n\t\t\n\t}", "int insert(AdminTab record);" ]
[ "0.67399895", "0.66892254", "0.65827906", "0.63928384", "0.6358266", "0.6330395", "0.62277406", "0.6209911", "0.6204866", "0.6190891", "0.61657065", "0.61643064", "0.6156308", "0.6144742", "0.61272025", "0.61156464", "0.60825205", "0.6074376", "0.60447705", "0.6013287", "0.59918904", "0.59783775", "0.5973131", "0.5965061", "0.59620684", "0.5944756", "0.5939709", "0.5936792", "0.59320426", "0.5929375", "0.59242994", "0.59187156", "0.5916911", "0.590891", "0.5907794", "0.59070015", "0.58963287", "0.58943486", "0.58709246", "0.58685285", "0.58599305", "0.58568543", "0.58320737", "0.58285385", "0.58258873", "0.5823734", "0.5823154", "0.5814032", "0.57993186", "0.5797922", "0.5797621", "0.57907784", "0.5790639", "0.5786884", "0.57859015", "0.5778171", "0.57774466", "0.57771415", "0.577471", "0.57742953", "0.5772388", "0.57659215", "0.5764026", "0.57607573", "0.57578623", "0.57575816", "0.5757355", "0.5752481", "0.5749867", "0.5747737", "0.5746829", "0.57406306", "0.5735718", "0.57352513", "0.57350117", "0.573422", "0.5728911", "0.5725602", "0.5725254", "0.5701716", "0.57003325", "0.5693716", "0.56893843", "0.56851614", "0.5683248", "0.5682004", "0.5681448", "0.56750613", "0.56698567", "0.56689423", "0.56591594", "0.56559205", "0.5645169", "0.56375796", "0.563375", "0.5630443", "0.5628385", "0.5627211", "0.56264406", "0.5619585" ]
0.70809174
0
/ updates without updating noInduk if noInduk is changed prior to calling this method, the new noInduk is still isn't stored throws KasirException(DB_INVALID, this) if isDBValid = false throws KasirException(ROW_NOT_FOUND, this) if no row matches never ret false
public boolean updateResultSet(ResultSet rs) throws SQLException, KasirException{ if(!isDBValid()) throw new KasirException(KasirException.Tipe.DB_INVALID, this); if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0) return flushResultSet(rs, false); else throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean updateNoInduk(String oldNoInduk) throws SQLException, KasirException{\r\n assert oldNoInduk != null;\r\n\r\n //profil.noInduk is also retrieved to check for noInduk duplication\r\n ResultSet rs = DBSR.takeResultSetByString(tableName, noIndukColName, 1, oldNoInduk, noInduk);\r\n\r\n if(updateResultSetNoInduk(rs, oldNoInduk)){\r\n rs.updateRow();\r\n return true;\r\n }else\r\n return false;\r\n }", "public boolean updateResultSetNoInduk(ResultSet rs, String oldNoInduk) throws SQLException, KasirException {\r\n assert oldNoInduk != null : \"oldNoInduk = null\";\r\n \r\n if(!isDBValid())\r\n throw new KasirException(KasirException.Tipe.DB_INVALID, this);\r\n \r\n if(noInduk.equals(oldNoInduk)){\r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n return flushResultSet(rs, false);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this);\r\n }else{\r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n throw new KasirException(KasirException.Tipe.DUPLICATE_PRIMARY_KEY, this);\r\n \r\n if(DBSR.searchRow(rs, noIndukColName, false, oldNoInduk) > 0)\r\n return flushResultSet(rs, true);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, oldNoInduk);\r\n }\r\n }", "public static boolean delete(String noInduk) throws SQLException, KasirException{\r\n return DBSR.deleteKasirO(tableName, noIndukColName, false, noInduk);\r\n }", "public boolean isDBValid(){\r\n return noInduk != null && !noInduk.isEmpty();\r\n }", "public void rubahDataProduk(){\n loadDataProduk();\n \n //uji koneksi dan eksekusi perintah\n try{\n //test koneksi\n Statement stat = (Statement) koneksi.getKoneksi().createStatement();\n \n //perintah sql untuk simpan data\n String sql = \"UPDATE barang SET nama_barang = '\"+ nama_barang +\"',\"\n + \"merk_barang = '\"+ merk_barang +\"',\"\n + \"jumlah_stok = '\"+ jumlah_stok +\"',\"\n + \"harga = '\"+ harga +\"'\" \n + \"WHERE kode_barang = '\" + kode_barang +\"'\";\n PreparedStatement p = (PreparedStatement) koneksi.getKoneksi().prepareStatement(sql);\n p.executeUpdate();\n \n //ambil data\n getDataProduk();\n }catch(SQLException err){\n JOptionPane.showMessageDialog(null, err.getMessage());\n }\n }", "public boolean addOrUpdateInternationalBanks(InternationalBankModel internationalBankDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_INTERNATIONAL_BANK_OBJECT_ID, internationalBankDetails.getInternationalBankObjectId());\n values.put(KEY_INTERNATIONAL_BANK_NAME, internationalBankDetails.getInternationalBankName());\n values.put(KEY_INTERNATIONAL_BANK_IMAGE, internationalBankDetails.getInternationalBankImage());\n values.put(KEY_INTERNATIONAL_BANK_ADDRESS, internationalBankDetails.getInternationalBankAddress());\n values.put(KEY_INTERNATIONAL_BANK_SWIFT_CODE, internationalBankDetails.getInternationalBankSwiftCode());\n values.put(KEY_INTERNATIONAL_BANK_STOCK_CODE, internationalBankDetails.getInternationalBankStockCode());\n values.put(KEY_INTERNATIONAL_BANK_DESCRIPTION, internationalBankDetails.getInternationalBankDescription());\n values.put(KEY_INTERNATIONAL_BANK_ESTABLISHED, internationalBankDetails.getInternationalBankEstablished());\n values.put(KEY_INTERNATIONAL_BANK_CONTACTS, internationalBankDetails.getInternationalBankContacts());\n values.put(KEY_INTERNATIONAL_BANK_TYPE, internationalBankDetails.getInternationalBankType());\n values.put(KEY_INTERNATIONAL_BANK_WEBSITE, internationalBankDetails.getInternationalBankWebsite());\n values.put(KEY_INTERNATIONAL_BANK_STATUS, internationalBankDetails.getInternationalBankStatus());\n values.put(KEY_INTERNATIONAL_BANK_SUMMARY, internationalBankDetails.getInternationalBankSummary());\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_INTERNATIONAL_BANKS, values, KEY_INTERNATIONAL_BANK_OBJECT_ID + \"= ?\", new String[]{internationalBankDetails.getInternationalBankObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved bank, we could probably get the Bank updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such Bank Here, insert it\n db.insertOrThrow(TABLE_BANKS, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update International banks table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }", "public boolean bookLot() {\r\n\t\tboolean bookUpdateSuccess = false;\r\n\t\t/**\r\n\t\t*\tSince connecting to database (DbConnection()) and updating data (executeUpdateParklot())\r\n\t\t* throw SQLException and throwing an exception from multiple levels again and again is not\r\n\t\t*\ta good way, so its is needed to catch the exception here.\r\n\t\t*/\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t*\tCreate a connection to the database\r\n\t\t\t*/\r\n\t\t\tDbConnection bookLotConn = new DbConnection();\r\n\t\t\t/**\r\n\t\t\t*\tupdate the data in table\r\n\t\t\t*/\r\n\t\t\tbookUpdateSuccess = bookLotConn.executeUpdateParklot(lotNo, 1);\r\n\r\n\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSystem.out.println(\"**************Error Connecting to the Database**************\");\r\n\t\t\tSqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\t//validateConn.closeDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t\treturn bookUpdateSuccess;\r\n\t}", "@Override\n public boolean update(Transaksi transaksi) {\n try {\n String query = \"UPDATE transaksi SET tgl_transaksi=? WHERE id=?\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ps.setString(1, transaksi.getTglTransaksi());\n ps.setString(2, transaksi.getId());\n\n if (ps.executeUpdate() > 0) {\n return true;\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "public boolean updateDB(String qryExp, RequestBox rBox) throws Exception {\n\t\tConnection conn = null;\n\t\tconn = DBConnect.getDBConnection(\"ERP_APPS\");\n\t\t\n\t\t\n PreparedStatement \tpstmt \t= null;\n PreparedStatement \tpstmt2 \t= null;\n PreparedStatement \tpstmt3 \t= null;\n \tboolean \t\t\trtn \t= false;\n \tint \t\t\t\tisOk = 0;\n \tint \t\t\t\tisOk2 = 0;\n \tStringBuffer\t\tquery = new StringBuffer();\n \tString query2 = \"\";\n \tString query3 = \"\";\n try \n {\n \t//ITEM Table 삭제 후 추가\n \tString itemCode = rBox.getString(\"p_itemcode\");\n \tString itemCatalog = rBox.getString(\"p_itemcatalog\");\n\t\t\tString s_itemCode[] = itemCode.split(\",\");\n \tquery.append(\"DELETE STX_TBC_ITEM \\n\");\n \tquery.append(\" WHERE 1 = 1 \\n\");\n \tif(!itemCode.equals(\"\")){\n\t\t\t\tquery.append(\" AND ITEM_CODE IN ( \");\n\t\t\t\tquery.append(\"select msi.segment1 \\n\");\n\t\t\t\tquery.append(\" from mtl_system_items_b@\"+ERP_DB+\" msi \\n\");\n\t\t\t\tquery.append(\" ,mtl_item_catalog_groups_b@\"+ERP_DB+\" micg \\n\");\n\t\t\t\tquery.append(\" ,mtl_item_categories@\"+ERP_DB+\" mic \\n\");\n\t\t\t\tquery.append(\" ,mtl_categories_b@\"+ERP_DB+\" mc \\n\");\n\t\t\t\tquery.append(\" ,stx_com_insa_user@\"+ERP_DB+\" sciu \\n\");\n\t\t\t\tquery.append(\" ,bom_inventory_components@\"+ERP_DB+\" bic \\n\");\n\t\t\t\tquery.append(\" ,bom_bill_of_materials@\"+ERP_DB+\" bbom \\n\");\n\t\t\t\tquery.append(\" ,mtl_system_items_b@\"+ERP_DB+\" msi_assy \\n\");\n\t\t\t\tquery.append(\" where msi.organization_id = msi_assy.organization_id \\n\");\n\t\t\t\tquery.append(\" and msi.item_catalog_group_id = micg.item_catalog_group_id \\n\");\n\t\t\t\tquery.append(\" and msi.organization_id = mic.organization_id \\n\");\n\t\t\t\tquery.append(\" and msi.inventory_item_id = mic.inventory_item_id \\n\");\n\t\t\t\tquery.append(\" and mic.category_set_id = 1 \\n\");\n\t\t\t\tquery.append(\" and mic.category_id = mc.category_id \\n\");\n\t\t\t\tquery.append(\" and msi.attribute2 = sciu.emp_no(+) \\n\");\n\t\t\t\tquery.append(\" and msi.inventory_item_id = bic.component_item_id \\n\");\n\t\t\t\tquery.append(\" and bic.bill_sequence_id = bbom.bill_sequence_id \\n\");\n\t\t\t\tquery.append(\" and bbom.organization_id = msi_assy.organization_id \\n\");\n\t\t\t\tquery.append(\" and bbom.assembly_item_id = msi_assy.inventory_item_id \\n\");\n\t\t\t\tquery.append(\" and msi_assy.organization_id = 82 \\n\");\n\t\t\t\tquery.append(\" and bic.IMPLEMENTATION_DATE is not null \\n\");\n\t\t\t\tquery.append(\" and bic.DISABLE_DATE is null \\n\");\n\t\t\t\tquery.append(\" and bbom.ALTERNATE_BOM_DESIGNATOR is null \\n\");\n\t\t\t\t\n\t\t\t\tquery.append(\" and ( \\n\");\n\t\t\t\t\tfor(int i=0; i < s_itemCode.length; i++ ){\n\t\t\t\t\t\tif(i != 0){\n\t\t\t\t\t\t\tquery.append(\" OR \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tquery.append(\" msi_assy.segment1 = '\"+s_itemCode[i].trim()+\"' \\n\");\n\t\t\t\t\t}\n\t\t\t\t\tquery.append(\" ) \\n\");\t\n\t\t\t\t\n\t\t\t\tfor(int i=0; i < s_itemCode.length; i++ ){\n\t\t\t\t\tquery.append(\"UNION ALL SELECT '\"+s_itemCode[i].trim()+\"' FROM DUAL \\n\");\n\t\t\t\t}\n\t\t\t\tquery.append(\") \\n\");\n \t}\n \t\n\t\t\tif(!itemCatalog.equals(\"\")){\n\t\t\t\tquery.append(\" and item_catalog = '\"+itemCatalog+\"' \\n\");\n\t\t\t}\n\t\t\t\n \t\n \tSystem.out.println(query);\n \t//삭제 실행\n \tpstmt = conn.prepareStatement(query.toString());\n \tisOk = pstmt.executeUpdate();\n \tSystem.out.println(\"삭제 성공\" + isOk);\n \t\n \t//추가 실행.\n \tquery2 = getQuery(qryExp,rBox);\n \tpstmt2 = conn.prepareStatement(query2.toString());\n \tisOk = pstmt2.executeUpdate();\n \tSystem.out.println(\"추가 성공\" + isOk);\n \t\n \t//RAW ITEM 추가 실행.\n \tquery3 = getQuery(\"rawItemInterface\",rBox);\n \tpstmt3 = conn.prepareStatement(query3.toString());\n \tisOk2 = pstmt3.executeUpdate();\n \tSystem.out.println(\"isOk2 : \" + isOk2); \t\n \t\n \t\n \tif(isOk2 > 0){\n\t \tif(!itemCode.equals(\"\")){\n\t\t\t\t\tfor(int i=0; i < s_itemCode.length; i++ ){\n\t\t\t \tCallableStatement cs = conn.prepareCall(\"{call stx_tbc_material_insert@\"+PLM_DB+\"(?,?,?)}\"); \n\t\t \t cs.setString(1,s_itemCode[i].trim()); \n\t\t \t cs.registerOutParameter(2, java.sql.Types.VARCHAR); \n\t\t \t cs.registerOutParameter(3, java.sql.Types.VARCHAR); \n\t\t \t cs.execute();\n\t\t\t\t\t}\n\t \t}\n \t}\n \t\n \t\n \tif(isOk > 0){\n \t\tconn.commit();\n \t\trBox.put(\"successMsg\", \"Success\");\n \t\trtn = true;\n \t}else{\n \t\tconn.rollback();\n \t\trBox.put(\"errorMsg\", \"Fail\");\n \t\trtn = false;\n \t}\n \t\n }\n catch ( Exception ex ) \n { \n \tconn.rollback();\n \tex.printStackTrace();\n \trBox.put(\"errorMsg\", \"Fail\");\n }\n finally \n { \n if ( conn != null ) { try { conn.close(); } catch ( Exception e ) { } }\n if ( pstmt != null ) { try { pstmt.close(); } catch ( Exception e ) { } }\n if ( pstmt2 != null ) { try { pstmt2.close(); } catch ( Exception e ) { } }\n if ( pstmt3 != null ) { try { pstmt3.close(); } catch ( Exception e ) { } }\n } \n\t\treturn rtn;\n\t}", "public boolean asignaNumeroFac(java.sql.Connection conIns, int intCodEmp,int intCodLoc, int intCodTipDocFacEle, int intCodDoc, int intCodCot) \r\n {\r\n boolean blnRes = false;\r\n java.sql.Statement stmLoc, stmLocIns;\r\n java.sql.ResultSet rstLoc;\r\n String strSql = \"\";\r\n String strSqlIns = \"\";\r\n int intNumDoc = 0;\r\n int intNumDocGuia = 0;\r\n try \r\n {\r\n if (conIns != null){\r\n stmLoc = conIns.createStatement();\r\n strSql = \"SELECT CASE WHEN (ne_ultDoc+1) IS NULL THEN 1 ELSE (ne_ultDoc+1) END AS ultnum \"\r\n + \" FROM tbm_cabTipDoc WHERE co_emp=\" +intCodEmp+ \" \"\r\n + \" AND co_loc=\" +intCodLoc+ \" AND co_tipDoc=\" + intCodTipDocFacEle;\r\n// System.out.println(\"numero \" + strSql);\r\n rstLoc = stmLoc.executeQuery(strSql);\r\n if (rstLoc.next()) {\r\n intNumDoc = rstLoc.getInt(\"ultnum\");\r\n }\r\n rstLoc.close();\r\n rstLoc = null;\r\n stmLoc.close();\r\n stmLoc = null;\r\n \r\n \r\n strSqlIns += \" UPDATE tbm_cabTipDoc SET ne_ultDoc=\" + intNumDoc + \" WHERE co_emp=\" +intCodEmp+ \" \"\r\n + \" AND co_loc=\" +intCodLoc+ \" AND co_tipDoc=\" + intCodTipDocFacEle;\r\n strSqlIns += \";UPDATE tbm_cabmovinv SET ne_numdoc=\" +intNumDoc+\", ne_numgui=\"+intNumDocGuia+\", st_reg='A' , st_imp='S' \"\r\n + \" WHERE co_emp=\" +intCodEmp+ \" AND co_loc=\" +intCodLoc+ \" AND co_tipdoc=\" + intCodTipDocFacEle + \" \"\r\n + \" AND co_doc=\" + intCodDoc + \" and st_reg not in ('I','E') AND ne_numcot=\" + intCodCot;\r\n strSqlIns += \" ; UPDATE tbm_cabdia SET tx_numdia='\" + intNumDoc + \"' WHERE co_emp=\" +intCodEmp+ \" AND co_loc=\" +intCodLoc+ \" AND co_tipdoc=\" + intCodTipDocFacEle + \" \"\r\n + \" AND co_dia=\" + intCodDoc + \" and st_reg not in ('I','E') \";\r\n System.out.println(\"asignaNumeroFac \"+strSqlIns);\r\n stmLocIns = conIns.createStatement();\r\n stmLocIns.executeUpdate(strSqlIns);\r\n stmLocIns.close();\r\n stmLocIns = null;\r\n intNumFacElec=intNumDoc;\r\n blnRes = true;\r\n }\r\n } \r\n catch (SQLException Evt) {\r\n blnRes = false;\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n } \r\n catch (Exception Evt) {\r\n blnRes = false;\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n }\r\n return blnRes;\r\n }", "@Test\n public void updateTest6() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBeach_volley(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isBeach_volley() ,\"Should return true if update Servizio\");\n }", "public boolean iliskMasaSil(int kullanici_no) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n String sorgu3 = \"delete ilisk_masa from ilisk_masa where kullanici_no=\" + kullanici_no + \"\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n vb.con.close();\r\n return true;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n try {\r\n vb.con.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return false;\r\n }\r\n }", "@Test\n public void updateTest7() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCanoa(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isCanoa() ,\"Should return true if update Servizio\");\n }", "public boolean addOrUpdateInsurance(InsuranceModel insuranceDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_INSURANCE_OBJECT_ID, insuranceDetails.getInsuranceObjectId());\n values.put(KEY_INSURANCE_NAME, insuranceDetails.getInsuranceName());\n values.put(KEY_INSURANCE_IMAGE, insuranceDetails.getInsuranceImage());\n values.put(KEY_INSURANCE_ADDRESS, insuranceDetails.getInsuranceAddress());\n values.put(KEY_INSURANCE_SWIFT_CODE, insuranceDetails.getInsuranceSwiftCode());\n values.put(KEY_INSURANCE_STOCK_CODE, insuranceDetails.getInsuranceStockCode());\n values.put(KEY_INSURANCE_DESCRIPTION, insuranceDetails.getInsuranceDescription());\n values.put(KEY_INSURANCE_ESTABLISHED, insuranceDetails.getInsuranceEstablished());\n values.put(KEY_INSURANCE_CONTACTS, insuranceDetails.getInsuranceContacts());\n values.put(KEY_INSURANCE_TYPE, insuranceDetails.getInsuranceType());\n values.put(KEY_INSURANCE_WEBSITE, insuranceDetails.getInsuranceWebsite());\n values.put(KEY_INSURANCE_STATUS, insuranceDetails.getInsuranceStatus());\n values.put(KEY_INSURANCE_SUMMARY, insuranceDetails.getInsuranceSummary());\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_INSURANCE, values, KEY_INSURANCE_OBJECT_ID + \"= ?\", new String[]{insuranceDetails.getInsuranceObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved Insurance Agency, we could probably get the Insurance updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such Insurance Here, insert it\n db.insertOrThrow(TABLE_INSURANCE, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update Insurance table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }", "public boolean updateDB(String qryExp, RequestBox rBox) throws Exception {\n\t\treturn false;\n\t}", "private void updrec() {\n\t\tsavedata();\n\t\tcontractDetail.retrieve(stateVariable.getXwordn(), stateVariable.getXwabcd());\n\t\tnmfkpinds.setPgmInd36(! lastIO.isFound());\n\t\tnmfkpinds.setPgmInd66(isLastError());\n\t\t// BR00011 Product found on Contract_Detail and NOT ERROR(CONDET)\n\t\tif (! nmfkpinds.pgmInd36() && ! nmfkpinds.pgmInd66()) {\n\t\t\trestoredata();\n\t\t\tcontractDetail.update();\n\t\t\tnmfkpinds.setPgmInd99(isLastError());\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"Y2U0007\", \"\", msgObjIdx, messages);\n\t\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t}\n\t}", "@Override\r\n\tpublic boolean update(Viaggio viaggio) {\r\n\t\tboolean result = false;\r\n\t\tif ( viaggio == null ) {\r\n\t\t\tSystem.out.println( \"update(): failed to update a null entry\");\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tPreparedStatement prep_stmt = conn.prepareStatement(update);\r\n\t\t\tprep_stmt.clearParameters();\r\n\t\t\tprep_stmt.setInt(1, viaggio.getCreatore().getId());\r\n\t\t\tprep_stmt.setString(2, viaggio.getTitolo());\r\n\t\t\tprep_stmt.setString(3, viaggio.getDestinazione());\r\n\t\t\tprep_stmt.setString(4, viaggio.getDescrizione());\r\n\t\t\tprep_stmt.setString(5, viaggio.getLingua());\r\n\t\t\tprep_stmt.setInt(6, viaggio.getBudget());\r\n\t\t\tprep_stmt.setString(7, viaggio.getLuogopartenza());\r\n\t\t\tprep_stmt.setInt(8, viaggio.getStato().ordinal());\r\n\t\t\tprep_stmt.setDate(9, viaggio.getDatainizio());\r\n\t\t\tprep_stmt.setDate(10, viaggio.getDatafine());\r\n\t\t\tprep_stmt.setString(11, viaggio.getImmaginiProfilo());\t\t\t\r\n\t\t\tprep_stmt.setInt(12, viaggio.getIdViaggio());\r\n\t\t\tint esito;\r\n\t\t\tesito=prep_stmt.executeUpdate();\r\n\t\t\tprep_stmt.close();\r\n\t\t\tif(esito>=0) {\r\n\t\t\t\tSystem.out.println(\"Ho aggiornato il viaggio con id \"+ viaggio.getIdViaggio());\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\"ERRORE: non ho potuto aggiornare il viaggio con id \"+ viaggio.getIdViaggio());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(\"insert(): failed to update entry: \"+e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\ttry {\r\n\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void updateDataBuku(){\n String sql = \"UPDATE buku SET judulBuku = '\"+getJudulBuku()+\"'\"\n + \",pengarang = '\"+getPengarang()+\"'\"\n + \",penerbit = '\"+getPenerbit()+\"'\"\n + \",tahun = '\"+getTahun()+\"'\"\n + \",stok = '\"+getStok()+\"' WHERE idBuku = '\"+getIdBuku()+\"'\";\n \n try {\n //inisialisasi preparedstatmen\n PreparedStatement eksekusi = koneksi. getKoneksi().prepareStatement(sql);\n eksekusi.execute();\n \n //pemberitahuan jika data berhasil di simpan\n JOptionPane.showMessageDialog(null,\"Data Berhasil Disimpan\");\n } catch (SQLException ex) {\n //Logger.getLogger(modelPelanggan.class.getName()).log(Level.SEVERE, null, ex);\n JOptionPane.showMessageDialog(null, \"Data Gagal Disimpan \\n\"+ex);\n }\n }", "public boolean iliskMutfakSil(int kullanici_no) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n String sorgu3 = \"delete iliski_mutfak from iliski_mutfak where kullanici_no=\" + kullanici_no + \"\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n vb.con.close();\r\n return true;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n return false;\r\n }\r\n }", "@Test\r\n public void testUpdate() throws Exception {\r\n System.out.println(\"update\");\r\n Bureau obj = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n BureauDAO instance = new BureauDAO();\r\n instance.setConnection(dbConnect);\r\n obj = instance.create(obj);\r\n obj.setSigle(\"Test2\");\r\n //etc\r\n obj.setTel(\"000000001\");\r\n //etc\r\n Bureau expResult=obj;\r\n Bureau result = instance.update(obj);\r\n assertEquals(expResult.getSigle(), result.getSigle());\r\n //etc\r\n assertEquals(expResult.getTel(), result.getTel());\r\n //etc\r\n instance.delete(obj);\r\n //TODO verifier que si met à jour vers un doublé sigle-tel déjà existant, on a une exception\r\n }", "@Test\n public void updateTest3() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setRistorante(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isRistorante() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest4() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setAnimazione(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isAnimazione() ,\"Should return true if update Servizio\");\n }", "private void updateNutritionRecord(Context ctx, ResultSet rs) throws SQLException, ParseException {\r\n Date timestamp = ctx.getTimestamp(\"date\", \"time\");\r\n String item = ctx.getParameter(\"item\");\r\n String source = ctx.getParameter(\"source\");\r\n String quantity = ctx.getParameter(\"quantity\");\r\n String abv = ctx.getParameter(\"abv\");\r\n \r\n if (rs.next()) {\r\n if (ctx.getAppDb().getProtocol().equalsIgnoreCase(\"sqlserver\")) {\r\n rs.moveToCurrentRow();\r\n rs.updateString(\"Quantity\", quantity);\r\n\r\n if (abv.length() != 0) rs.updateString(\"ABV\", abv);\r\n \r\n rs.updateRow(); \r\n } else {\r\n SQLUpdateBuilder sql = ctx.getUpdateBuilder(\"NutritionRecord\");\r\n \r\n sql.addField(\"Quantity\", quantity);\r\n \r\n if (abv.length() != 0) sql.addField(\"ABV\", abv);\r\n \r\n sql.addAnd(\"Timestamp\", \"=\", timestamp);\r\n sql.addAnd(\"Item\", \"=\", item);\r\n sql.addAnd(\"Source\", \"=\", source);\r\n executeUpdate(ctx, sql);\r\n }\r\n } else {\r\n rs.moveToInsertRow();\r\n rs.updateString(\"Timestamp\", ctx.getDbTimestamp(timestamp));\r\n rs.updateString(\"Item\", ctx.getParameter(\"item\"));\r\n rs.updateString(\"Source\", ctx.getParameter(\"source\"));\r\n rs.updateString(\"Quantity\", quantity);\r\n rs.updateString(\"IsComposite\", ctx.getParameter(\"simple\").equalsIgnoreCase(\"c\") ? \"Y\" : \"N\");\r\n\r\n if (abv.length() != 0) rs.updateString(\"ABV\", abv);\r\n \r\n rs.insertRow();\r\n }\r\n }", "@Override\n\tpublic int updateByPrimaryKey(Checkingin record) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic boolean update(String sql) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean updateSQL(String sql, Connection con) {\n\t\treturn false;\r\n\t}", "@Test\n public void updateTest1() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCabina(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isCabina() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest2() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBar(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isBar() ,\"Should return true if update Servizio\");\n }", "int updateByPrimaryKey(Drug_OutWarehouse record);", "@Test\n public void updateTest14() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBeach_volley(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isBeach_volley() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest5() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setWifi(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isWifi() ,\"Should return true if update Servizio\");\n }", "public void perbaruiDataKategori(){\n loadDataKategori();\n \n //uji koneksi dan eksekusi perintah\n try{\n //test koneksi\n Statement stat = (Statement) koneksiDB.getKoneksi().createStatement();\n \n //perintah sql untuk simpan data\n String sql = \"UPDATE tbl_kembali SET nm_kategori = '\"+ nmKategori +\"',\"\n + \"ala_kategori = '\"+ alaKategori +\"',\"\n + \"no_kategori = '\"+ noKategori +\"',\"\n + \"kame_kategori = '\"+ kameKategori +\"',\"\n + \"kd_kategori = '\"+ kdKategori +\"',\"\n + \"sewa_kategori = '\"+ sewaKategori +\"',\"\n + \"kembali_kategori = '\"+ lamKategori +\"'\"\n + \"WHERE lambat_kategori = '\" + lambatKategori +\"'\";\n PreparedStatement p = (PreparedStatement) koneksiDB.getKoneksi().prepareStatement(sql);\n p.executeUpdate();\n \n //ambil data\n getDataKategori();\n }catch(SQLException err){\n JOptionPane.showMessageDialog(null, err.getMessage());\n }\n }", "private void exeDELLIC(int P_intROWNO) \n\t\t{ \n\t\t\ttry\n\t\t\t{\n\t\t\t M_strSQLQRY = \"UPDATE SA_SWTRN SET\";\t\n\t\t\t\tM_strSQLQRY +=\" SWT_STSFL='X'\";\t\n\t\t\t\tM_strSQLQRY +=\" where SWT_SFTCD='\"+txtSFTCD.getText()+\"'\";\n\t\t\t\tM_strSQLQRY +=\" AND SWT_SRLNO='\"+txtSRLNO.getText().toString()+\"'\";\n\t\t\t\t//M_strSQLQRY += \" AND SWT_SYSTP = '\"+tblLICDL.getValueAt(P_intROWNO,TB1_SYSTP).toString().trim()+\"' \";\n\t\t\t\tM_strSQLQRY += \" AND SWT_SFTCT = '\"+hstSFTCT.get(cmbSFTCT.getSelectedItem().toString())+\"'\";\n\t\t\t\tM_strSQLQRY += \" AND SWT_LICNO='\"+tblLICDL.getValueAt(P_intROWNO,TB1_LICNO).toString()+\"'\";\n\t\t\t\tM_strSQLQRY += \" AND SWT_LICTP='\"+hstLICTP.get(cmbLICTP.getSelectedItem().toString())+\"'\";\n\t\t\t\tcl_dat.M_flgLCUPD_pbst = true;\n\t\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY ,\"setLCLUPD\");\n\t\t\t\t//System.out.println(\">>>Delete2>>\"+M_strSQLQRY);\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception L_EX)\n\t\t\t{\n\t\t setMSG(L_EX,\"exeDELLIC()\");\t\t\n\t\t\t}\n\t\t}", "public boolean insertarItem53(Mgestion_resul dts) {\n \n Item53 = \"update item set cumple=?, justifi=?, aplica=? where idItem=53\";\n Ver84 = \"update verificacion set cumplimiento=? where idverificacion=84\";\n \n \n try {\n\n PreparedStatement pst = cn.prepareStatement(Item53);\n PreparedStatement pst2 = cn.prepareStatement(Ver84);\n \n \n\n pst.setString(1, dts.getI531());\n pst.setString(2, dts.getJ531());\n pst.setString(3, dts.getA531());\n \n pst2.setString(1, dts.getV531());\n \n \n int n = pst.executeUpdate();\n\n if (n != 0) {\n int n2 = pst2.executeUpdate();\n\n if (n2 != 0) {\n return true; \n\n } else {\n return false;\n }\n\n } else {\n return false;\n }\n\n } catch (Exception e) {\n JOptionPane.showConfirmDialog(null, e);\n return false;\n }\n \n}", "int updateByPrimaryKeySelective(GoodsPo record);", "@Test\n public void updateTest8() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCanoa(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isCanoa() ,\"Should return true if update Servizio\");\n }", "public boolean editBike(Bike bike){//Edits the desired bike with matching bikeId\n if(!findBike(bike.getBikeId())){\n return false;\n //Bike_ID not registered in database, can't edit what's not there\n }else{\n try(Connection con = DatabaseConnector.getConnection();\n PreparedStatement ps = con.prepareStatement(EDIT)){\n \n ps.setDate(1, bike.getSqlDate());\n ps.setDouble(2, bike.getPrice());\n ps.setString(3, bike.getMake());\n ps.setInt(4,bike.getTypeId());\n if(bike.getStationId() == 0){\n ps.setNull(5, INTEGER);\n }else{\n ps.setInt(5, bike.getStationId());\n }\n ps.setInt(6, bike.getBikeId());\n ps.executeUpdate();\n return true;\n }catch(Exception e){\n System.out.println(\"Exception: \" + e);\n }\n }\n return false;\n }", "private void updateDatabase() {\n\n Database db = new Database();\n \n ArrayList<Order> orderArr = new ArrayList<>();\n orderArr = db.getPaidOrders(1);\n \n for (int i = 0; i < orderArr.size(); i++) {\n DefaultTableModel model = (DefaultTableModel) tblInvoices.getModel();\n \n boolean available = true;\n if (orderArr.get(i).getQuantity() == 0){\n available = false;\n }\n \n Object[] row = {orderArr.get(i).getOrderid(),\n orderArr.get(i).getBusinessname(), \n orderArr.get(i).getAmount(), \n orderArr.get(i).getDate()};\n model.addRow(row);\n } \n }", "public Boolean updateData(String codProduc, String nombreProduc, String precioProduc){\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"codProduc\", codProduc);\n contentValues.put(\"nombreProduc\", nombreProduc);\n contentValues.put(\"precioProduc\", precioProduc);\n\n //Verificamos el registro usando el codigo de actualizar\n Cursor cursor = db.rawQuery(\"SELECT * FROM tienda WHERE codProduc=?\", new String[]{codProduc});\n\n //Evaluamos el registro para verificar si existe\n if(cursor.getCount()>0){\n long result = db.update(\"tienda\", contentValues, \"codProduc=?\", new String[]{codProduc});\n if(result==-1){\n return false;\n }else{\n return true;\n }\n }else{\n return false;\n }\n\n }", "public boolean update(Object objekt) throws SQLException {\r\n\t\tPomagaloVO ul = (PomagaloVO) objekt;\r\n\r\n\t\tif (ul == null)\r\n\t\t\tthrow new SQLException(\"Update \" + tablica\r\n\t\t\t\t\t+ \", ulazna vrijednost je null!\");\r\n\r\n\t\t\r\n\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement ps = null;\r\n\r\n\t\ttry {\r\n\t\t\tconn = conBroker.getConnection();\r\n\r\n\t\t\tps = conn.prepareStatement(updateUpit);\r\n\r\n\t\t\tps.setString(1, ul.getNaziv());\r\n\t\t\tps.setInt(2, ul.getPoreznaSkupina().intValue());\r\n\r\n\t\t\t// 20.03.06. -asabo- dodano\r\n\t\t\tif (ul.getCijenaSPDVom() == null\r\n\t\t\t\t\t|| ul.getCijenaSPDVom().intValue() <= 0)\r\n\t\t\t\tps.setNull(3, Types.INTEGER);\r\n\t\t\telse\r\n\t\t\t\tps.setInt(3, ul.getCijenaSPDVom().intValue());\r\n\r\n\t\t\tString op = ul.getOptickoPomagalo() != null\r\n\t\t\t\t\t&& ul.getOptickoPomagalo().booleanValue() ? DA : NE;\r\n\r\n\t\t\tps.setString(4, op);\r\n\r\n\t\t\tps.setTimestamp(5, new Timestamp(System.currentTimeMillis()));\r\n\t\t\tps.setInt(6, 1);\r\n\t\t\t\r\n\t\t\tps.setString(7, ul.getSifraArtikla());\r\n\r\n\t\t\tint kom = ps.executeUpdate();\r\n\r\n\t\t\tboolean updated = kom == 1;\r\n\t\t\tif (!updated)\r\n\t\t\t\t{}\r\n\t\t\telse\r\n\t\t\t\tclearFromCache(ul.getSifraArtikla());\r\n\r\n\t\t\treturn updated;\r\n\t\t}\r\n\t\t// -asabo- NEMA CATCH-anja! - sve ide pozivatelju...\r\n\t\tfinally {\r\n\t\t\ttry {\r\n\t\t\t\tif (ps != null)\r\n\t\t\t\t\tps.close();\r\n\t\t\t} catch (SQLException e1) {\r\n\t\t\t}\r\n\t\t\tconBroker.freeConnection(conn);\r\n\t\t}// finally\r\n\t}", "public void updateIscrizione() throws SQLException {\r\n\r\n\t\tPreparedStatement pstmt = null;\r\n\r\n\t\ttry {\r\n\t\t\tpstmt = con.prepareStatement(STATEMENT);\r\n\t\t\t\r\n\t\t\tArray sql = con.createArrayOf(\"boolean\", i.getDisponibilita());\r\n\t\t\t\r\n\t\t\tpstmt.setArray(1, sql);\r\n\t\t\tpstmt.setString(2, i.getGiocatore());\r\n\t\t\tpstmt.setInt(3, 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}", "public boolean insert(Object KV_pair,String avd) // making this also synchronized -- bad idea -- raja may 8\n {\n \t/**\n \t * lock the DB when inserting -- query also uses this -- \n \t * To keep Query section from querying \n \t */\n \t \n\t\tsynchronized (_DBWRITE_Lock)\n\t\t{\n\t\t\tlong rowID = 0l;\n\t\t\tContentValues newValues = null;\n\t\t\tif(KV_pair instanceof String[])\n\t\t\t{\n\t\t\t\tnewValues = new ContentValues();\n\t\t\t\tString[] KV = (String[])KV_pair;\n\t\t\t\tnewValues.put(KEY_FIELD,(String)KV[0]);\n\t\t\t\tnewValues.put(VALUE_FIELD,(String)KV[1]);\n\t\t\t\t// insert or replace -- handle that\n\t\t\t\trowID = sqliteDB.insert(tableName, \"\", newValues);\n\t\t\t\t/*if(rowID < 0)\n\t\t\t\t{\n\t\t\t\t\trowID = sqliteDB.replace(tableName, \"\", newValues);\n\t\t\t\t}*/\n\t\t\t\t Log.v(\"window_shopper\", \"ins:\"+KV[0]+\"::\"+KV[1]+\" --- \"+rowID); // notify user debug statement\n\t\t\t}\n\t\t\telse if(KV_pair instanceof Hashtable) // when recovery happens !! FIXME -- RAJA\n\t\t\t{\n\t\t\t\tHashtable<String, String> values = (Hashtable<String, String>)KV_pair;\n\t\t\t\tSet<String> keys = values.keySet();\n\t\t\t\tfor(String key : keys)\n\t\t\t\t{\n\t\t\t\t\tnewValues = new ContentValues();\n\t\t\t\t\tnewValues.put(KEY_FIELD,key);\n\t\t\t\t\tnewValues.put(VALUE_FIELD,values.get(key));\n\t\t\t\t\trowID = sqliteDB.insert(tableName, \"\", newValues);\n\t\t\t\t\t// replace only if from predecessor\n\t\t\t\t\t/*if(rowID < 0) \n\t\t\t\t\t{\n\t\t\t\t\t\trowID = sqliteDB.replace(tableName, \"\", newValues);\n\t\t\t\t\t}*/\n\t\t\t\t\tLog.v(\"window_shopper\", \"ins:\"+key+\"::\"+values.get(key)+\" --- \"+rowID); // notify user debug statement\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(rowID < 0)\n\t {\n\t \tLog.e(\"window_shopper\"+\" insert\",\"INSERT FAIL\");\n\t \treturn false; //FIXME-- interpretation problems\n\t }\n\t return true;\n\t\t}\n\t}", "private void updISTRN() \n\t{\n\t\ttry\n\t\t{\n\t\t\tM_strSQLQRY = \"Update FG_ISTRN set \";\n\t\t\tM_strSQLQRY += \"IST_STSFL = '1',\";\n\t\t\tM_strSQLQRY += \"IST_TRNFL = '0',\";\n\t\t\tM_strSQLQRY += \"IST_LUSBY = '\"+cl_dat.M_strUSRCD_pbst+\"',\";\n\t\t\tM_strSQLQRY += \"IST_LUPDT = '\"+M_fmtDBDAT.format(M_fmtLCDAT.parse(cl_dat.M_strLOGDT_pbst ))+\"'\";\n\t\t\tM_strSQLQRY += \" where ist_CMPCD = '\"+cl_dat.M_strCMPCD_pbst+\"' and ist_wrhtp = '\"+strWRHTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_isstp = '\"+strISSTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_issno = '\"+txtISSNO.getText().toString() .trim() +\"'\";\n\t\t\tM_strSQLQRY += \" and ist_prdcd = '\"+strPRDCD+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_prdtp = '\"+strPRDTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_lotno = '\"+strLOTNO+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_rclno = '\"+strRCLNO+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_pkgtp = '\"+strPKGTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_mnlcd = '\"+strMNLCD+\"'\";\n\t\t\t\n\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY,\"setLCLUPD\");\n\t\t\t//System.out.println(\"update fgistrn table :\"+M_strSQLQRY);\n\t\t\t\n\t\t}catch(Exception L_EX)\n\t\t{\n\t\t\tsetMSG(L_EX,\"updISTRN\");\n\t\t}\n\t}", "public boolean updateBill(Bill bill){\n\t\tTraveller trav = bill.getItems().traveller();\n\t\twhile(trav.hasNext()){\n\t\t\tItem item = (Item) trav.next();\n\t\t\tString selectQuery = \"select qty from stock where item_name = ? and expire_date = ? and category = ?\"\n\t\t\t\t\t+ \" and price = ?;\";\n\t\t\ttry(PreparedStatement preStmt = connection.prepareStatement(selectQuery)){\n\t\t\t\tpreStmt.setString(1, item.getName());\n\t\t\t\tpreStmt.setDate(2, item.getExpireDate());\n\t\t\t\tpreStmt.setString(3, item.getCategory());\n\t\t\t\tpreStmt.setFloat(4, item.getPrice());\n\t\t\t\tResultSet result= preStmt.executeQuery(selectQuery);\n\t\t\t\tif(result.first()){\n\t\t\t\t\tint oldQty = result.getInt(1);\n\t\t\t\t\tItem itemClone = item.clone();\n\t\t\t\t\titemClone.setQuantity(oldQty - item.getQuantity());\n\t\t\t\t\tupdateDB(itemClone);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(\"No item found on stock\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}catch(SQLException exp){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Error in Stock table processing: \"+exp.getMessage());\n\t\t\t\texp.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean saveDown() {\n if (\n cashFlow == null ||\n cashFlow.getDetail() == null ||\n cashFlow.getDetail().isEmpty()\n ) {\n System.out.println(\"invalid model store\");\n return false;\n }\n boolean cashFlowSaveResult = CashFlow.save(cashFlow);\n\n // save cash flow failure case\n if (!cashFlowSaveResult) {\n System.out.println(\"query false\");\n return false;\n }\n\n // get owe per provider\n boolean owe_log = true;\n int pointer = 0;\n final Map<String, Integer> providerIndex = new HashMap<>();\n final int nrow = cashFlow.getDetail().size();\n final int[] owe = new int[nrow];\n for (Payable p: cashFlow.getDetail()) {\n String prvId = p.getProviderId();\n if (providerIndex.containsKey(prvId)) {\n owe[ providerIndex.get(prvId) ] += p.getPrice();\n } else {\n providerIndex.put(prvId, pointer);\n owe[ pointer ] = p.getPrice();\n pointer++;\n }\n }\n for (String k: providerIndex.keySet()) {\n owe_log = owe_log &&\n db.send(\"UPDATE NhaCungCap SET NoPhaiTra = NoPhaiTra + \"\n + owe[ providerIndex.get(k) ]\n + \" WHERE MaNCC = \" + k);\n }\n if (!owe_log) {\n System.out.println(\"update own false\");\n }\n return owe_log;\n }", "public UpdateIscrizioneDatabase(final Connection con, final Iscrizione i) {\r\n\t\tthis.con = con;\r\n\t\tthis.i = i;\r\n\t}", "public boolean iliskiMutfakEkleme(int kullanici_no, int urun_kodu) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n String sorgu3 = \"insert into iliski_mutfak (kullanici_no, urun_kodu) values (\" + kullanici_no + \", \" + urun_kodu + \")\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n vb.con.close();\r\n ps.close();\r\n return true;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n return false;\r\n }\r\n }", "public void update() throws SQLException {\n int check = BusinessFacade.getInstance().checkIDinDB(this.productRelation.getID(),\n this.post.getID(), \"goods\", \"product_type_id\", \"post_id\");\n int safeCheck = BusinessFacade.getInstance().checkChildsIDinDB(this.goodID,\n this.order.getID(), \"orders\", \"goods_id\", \"orders_id\");\n\n if (check != -1 && safeCheck == -1) {\n if (check != this.goodID) {\n int oldGoodID = this.goodID;\n this.goodID = check;\n this.order.update();\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n\n stmtIn.executeUpdate(\"DELETE FROM ngaccount.goods WHERE goods.goods_id = \" +\n oldGoodID + \" LIMIT 1;\");\n }\n } else if (check != -1 && safeCheck != -1) {\n this.goodID = check;\n } else if (check == -1 && safeCheck == -1) {\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n stmtIn.executeUpdate(\"UPDATE ngaccount.goods SET product_type_id = \" +\n this.productRelation.getID() + \", post_id = \" + this.post.getID() +\n \" WHERE goods.goods_id = \" + this.goodID);\n } else {\n this.goodID = BusinessFacade.getInstance().lastIDInDB(\"product_type\") + 1;\n this.insert();\n }\n }", "public boolean addOrUpdateInvestmentBanks(InvestmentBankModel investmentBankDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_INVESTMENT_BANK_OBJECT_ID, investmentBankDetails.getInvestmentBankObjectId());\n values.put(KEY_INVESTMENT_BANK_NAME, investmentBankDetails.getInvestmentBankName());\n values.put(KEY_INVESTMENT_BANK_IMAGE, investmentBankDetails.getInvestmentBankImage());\n values.put(KEY_INVESTMENT_BANK_ADDRESS, investmentBankDetails.getInvestmentBankAddress());\n values.put(KEY_INVESTMENT_BANK_SWIFT_CODE, investmentBankDetails.getInvestmentBankSwiftCode());\n values.put(KEY_INVESTMENT_BANK_STOCK_CODE, investmentBankDetails.getInvestmentBankStockCode());\n values.put(KEY_INVESTMENT_BANK_DESCRIPTION, investmentBankDetails.getInvestmentBankDescription());\n values.put(KEY_INVESTMENT_BANK_ESTABLISHED, investmentBankDetails.getInvestmentBankEstablished());\n values.put(KEY_INVESTMENT_BANK_CONTACTS, investmentBankDetails.getInvestmentBankContacts());\n values.put(KEY_INVESTMENT_BANK_TYPE, investmentBankDetails.getInvestmentBankType());\n values.put(KEY_INVESTMENT_BANK_WEBSITE, investmentBankDetails.getInvestmentBankWebsite());\n values.put(KEY_INVESTMENT_BANK_STATUS, investmentBankDetails.getInvestmentBankStatus());\n values.put(KEY_INVESTMENT_BANK_SUMMARY, investmentBankDetails.getInvestmentBankSummary());\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_INVESTMENT_BANKS, values, KEY_INVESTMENT_BANK_OBJECT_ID + \"= ?\", new String[]{investmentBankDetails.getInvestmentBankObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved InvestmentBank, we could probably get the InvestmentBank updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such InvestmentBank Here, insert it\n db.insertOrThrow(TABLE_INVESTMENT_BANKS, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update banks table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }", "public boolean iliskMasaEkleme(int masa_no, int kullanici_no) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n String sorgu3 = \"insert into ilisk_masa (kullanici_no, masa_no) values (\" + kullanici_no + \", \" + masa_no + \")\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n vb.con.close();\r\n ps.close();\r\n \r\n return true;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n return false;\r\n }\r\n }", "public boolean addOrUpdateBanks(BankModel bankDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_BANK_OBJECT_ID, bankDetails.getBankObjectId());\n values.put(KEY_BANK_NAME, bankDetails.getBankName());\n values.put(KEY_BANK_IMAGE, bankDetails.getBankImage());\n values.put(KEY_BANK_ADDRESS, bankDetails.getBankAddress());\n values.put(KEY_BANK_SWIFT_CODE, bankDetails.getBankSwiftCode());\n values.put(KEY_BANK_STOCK_CODE, bankDetails.getBankStockCode());\n values.put(KEY_BANK_DESCRIPTION, bankDetails.getBankDescription());\n values.put(KEY_BANK_ESTABLISHED, bankDetails.getBankEstablished());\n values.put(KEY_BANK_CONTACTS, bankDetails.getBankContacts());\n values.put(KEY_BANK_TYPE, bankDetails.getBankType());\n values.put(KEY_BANK_WEBSITE, bankDetails.getBankWebsite());\n values.put(KEY_BANK_STATUS, bankDetails.getBankStatus());\n values.put(KEY_BANK_SUMMARY, bankDetails.getBankSummary());\n values.put(KEY_BANK_PRODUCTS, bankDetails.getBankProducts());\n\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_BANKS, values, KEY_BANK_OBJECT_ID + \"= ?\", new String[]{bankDetails.getBankObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved bank, we could probably get the Bank updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such Bank Here, insert it\n db.insertOrThrow(TABLE_BANKS, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update banks table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }", "int updateByPrimaryKeySelective(Goods record);", "int updateByPrimaryKeySelective(Goods record);", "@Override\n\tpublic void update_in_DB() throws CouponSiteMsg \n\t{\n\t\t\n\t}", "int updateByPrimaryKey(Disproduct record);", "int updateByPrimaryKeySelective(Drug_OutWarehouse record);", "public boolean addOrUpdateForexBureau(ForexBureauModel forexBureauDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_FOREX_BUREAU_OBJECT_ID, forexBureauDetails.getForexBureauObjectId());\n values.put(KEY_FOREX_BUREAU_NAME, forexBureauDetails.getForexBureauName());\n values.put(KEY_FOREX_BUREAU_IMAGE, forexBureauDetails.getForexBureauImage());\n values.put(KEY_FOREX_BUREAU_ADDRESS, forexBureauDetails.getForexBureauAddress());\n values.put(KEY_FOREX_BUREAU_SWIFT_CODE, forexBureauDetails.getForexBureauSwiftCode());\n values.put(KEY_FOREX_BUREAU_STOCK_CODE, forexBureauDetails.getForexBureauStockCode());\n values.put(KEY_FOREX_BUREAU_DESCRIPTION, forexBureauDetails.getForexBureauDescription());\n values.put(KEY_FOREX_BUREAU_ESTABLISHED, forexBureauDetails.getForexBureauEstablished());\n values.put(KEY_FOREX_BUREAU_CONTACTS, forexBureauDetails.getForexBureauContacts());\n values.put(KEY_FOREX_BUREAU_TYPE, forexBureauDetails.getForexBureauType());\n values.put(KEY_FOREX_BUREAU_WEBSITE, forexBureauDetails.getForexBureauWebsite());\n values.put(KEY_FOREX_BUREAU_STATUS, forexBureauDetails.getForexBureauStatus());\n values.put(KEY_FOREX_BUREAU_SUMMARY, forexBureauDetails.getForexBureauSummary());\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_FOREX_BUREAUS, values, KEY_FOREX_BUREAU_OBJECT_ID + \"= ?\", new String[]{forexBureauDetails.getForexBureauObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved forex Bureau, we could probably get the Forex Bureau updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such Forex Bureau Here, insert it\n db.insertOrThrow(TABLE_FOREX_BUREAUS, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update Forex Bureaus table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }", "@Override\n\tpublic void update(StockDataRecord bo) throws SQLException {\n\t\t\n\t}", "public int update() {\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tsaveIHave();\n\t\t\t} catch(Exception e) {\n\t\t\t\tSystem.out.println(\"Save failed\");\n\t\t\t}\n\t\t\tclose();\n\t\t\tFileUtils.copyURLToFile(dbURL, dbFile);\n\t\t\tinit();\n\t\t\taddIHaveTagColumns();\n\t\t\tloadIHave();\n\t\t\treturn 1;\n\t\t} catch(UnknownHostException | SocketException e) {\n\t\t\ttry {\n\t\t\t\tclose();\n\t\t\t\tinit();\n\t\t\t} catch (Exception e1) {\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t\treturn 0;\n\t\t} catch(Exception e) {\n\t\t\ttry {\n\t\t\t\tclose();\n\t\t\t\tinit();\n\t\t\t} catch (Exception e1) {\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\t}", "@Test\n public void updateTest9() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCabina(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isCabina() ,\"Should return true if update Servizio\");\n }", "@Override\r\n\tpublic boolean updatetdfy(Tuanbiao tuanbiao) throws Exception {\n\t\t String sql = \"update tuanbiao set kxsm=?,zhanghaoid=?,yfk=?,khmc=?,yushoutime=?,yingshou=?,huilvID=?,beizhu=? where id=?\";\r\n\t\t int rs=this.update(sql,tuanbiao.getKxsm(), tuanbiao.getZhanghaoid(),tuanbiao.getYfk(), tuanbiao.getKhmc(), tuanbiao.getYushoutime(),tuanbiao.getYingshou(), tuanbiao.getHuilvID(), tuanbiao.getBeizhu(),tuanbiao.getId());\r\n\t\t return rs>0;\r\n\t}", "private String liburuaUpdateEskaeraPrestatu(LiburuDetaileak pLibDetaileak, String pIsbn){\n\n String izenburu = pLibDetaileak.getIzena();\n int orriKop = pLibDetaileak.getOrriKop();\n String argitaletxe = pLibDetaileak.getArgitaletxeak()[0];\n String irudia = pLibDetaileak.getIrudiaIzena();\n\n String query = \"update liburuak \" +\n \"set \" +\n \"izenburu = \\\"\"+izenburu+\"\\\", \" +\n \"argitaletxe = \\\"\"+argitaletxe+\"\\\", \" +\n \"orriKop = \"+orriKop+\", \" +\n \"irudia = \\\"\"+irudia+\"\\\" \" +\n \"where isbn = \\\"\" +pIsbn+\"\\\";\";\n\n return query;\n }", "public boolean addOrUpdateMicroFinance(MicroFinanceModel microFinanceDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_MICRO_FINANCE_OBJECT_ID, microFinanceDetails.getMicroFinanceObjectId());\n values.put(KEY_MICRO_FINANCE_NAME, microFinanceDetails.getMicroFinanceName());\n values.put(KEY_MICRO_FINANCE_IMAGE, microFinanceDetails.getMicroFinanceImage());\n values.put(KEY_MICRO_FINANCE_ADDRESS, microFinanceDetails.getMicroFinanceAddress());\n values.put(KEY_MICRO_FINANCE_SWIFT_CODE, microFinanceDetails.getMicroFinanceSwiftCode());\n values.put(KEY_MICRO_FINANCE_STOCK_CODE, microFinanceDetails.getMicroFinanceStockCode());\n values.put(KEY_MICRO_FINANCE_DESCRIPTION, microFinanceDetails.getMicroFinanceDescription());\n values.put(KEY_MICRO_FINANCE_ESTABLISHED, microFinanceDetails.getMicroFinanceEstablished());\n values.put(KEY_MICRO_FINANCE_CONTACTS, microFinanceDetails.getMicroFinanceContacts());\n values.put(KEY_MICRO_FINANCE_TYPE, microFinanceDetails.getMicroFinanceType());\n values.put(KEY_MICRO_FINANCE_WEBSITE, microFinanceDetails.getMicroFinanceWebsite());\n values.put(KEY_MICRO_FINANCE_STATUS, microFinanceDetails.getMicroFinanceStatus());\n values.put(KEY_MICRO_FINANCE_SUMMARY, microFinanceDetails.getMicroFinanceSummary());\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_MICRO_FINANCE, values, KEY_MICRO_FINANCE_OBJECT_ID + \"= ?\", new String[]{microFinanceDetails.getMicroFinanceObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved MicroFinance, we could probably get the MicroFinance updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such MicroFinance Here, insert it\n db.insertOrThrow(TABLE_MICRO_FINANCE, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update banks table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }", "int updateByPrimaryKey(GoodsPo record);", "public boolean isDbToUpdate() {\n\t\treturn !(this.properties.getProperty(SoundLooperProperties.KEY_DB_TO_UPDATE, \"0\").equals(\"0\"));\n\t}", "int updateByPrimaryKey(Goods record);", "int updateByPrimaryKey(Goods record);", "int updateByPrimaryKeySelective(DashboardGoods record);", "public void save()throws Exception{\n if(!pname1.getText().isEmpty() && !qty1.getText().isEmpty() && !prc1.getText().isEmpty() && !rsp1.getText().isEmpty() ){\r\n s_notif1.setId(\"hide\");\r\n ArrayList<Product> ar = new ArrayList<>();\r\n com.mysql.jdbc.Connection conn = db.getConnection();\r\n Statement stm = conn.createStatement();\r\n int rs = stm.executeUpdate(\"UPDATE products SET \"\r\n + \"name='\"+pname1.getText()+\"', \"\r\n + \"qty='\"+qty1.getText()+\"', \"\r\n + \"price='\"+prc1.getText()+\"',\"\r\n + \"re_stock_point='\"+rsp1.getText()+\"' WHERE ID ='\"+S_ID+\"';\");\r\n if(rs > 0){\r\n s_notif1.setId(\"show\");\r\n }\r\n }\r\n loadData();\r\n }", "@Test\n public void updateTest13() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setWifi(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true , servizio.isWifi() ,\"Should return true if update Servizio\");\n }", "private void actualizarStock(String codBarras) throws SQLException {\n\n }", "@Override\n\tpublic boolean updateStock(int quant) {\n\t\treturn false;\n\t}", "public boolean hapusdata (String nama){\n return data.delete(nama_table, kolom1+\"=\\\"\"+nama+\"\\\"\",null)>0;\n }", "private void updateSuiteItems(String rowDatas, CustomSuite newCustomSuite) {\n List<SuiteItem> suiteItems = newCustomSuite.suiteItems;\n //创建一个List容器记录原来的 明细ID\n List<Long> itemIds = new ArrayList<>();\n for (SuiteItem suiteItem : suiteItems) {\n if(!suiteItem.deleted)\n itemIds.add(suiteItem.id);\n }\n\n String[] rowData = rowDatas.split(\";\");\n SuiteItem suiteItem;\n CustomStockItem customStockItem;\n for (String data : rowData) {\n String[] datas = data.split(\",\");\n if (datas.length > 1) {\n long id = Long.valueOf(datas[0]);\n if (id != 0) {\n if(itemIds.contains(id)){\n //update\n suiteItem = suiteItemRepository.findOne(id);\n if (datas[2].equals(\"true\")) {\n suiteItem.times = -1;\n } else {\n suiteItem.times = Integer.valueOf(datas[3]);\n }\n suiteItem.cost = Double.valueOf(datas[4]);\n itemIds.remove(id);//更新一个后 从Id集合中移除\n }\n } else {\n //新增\n\n customStockItem = customStockItemRepository.findOne(Long.valueOf(datas[1]));\n\n List<SuiteItem> isHasOne = suiteItemRepository.findBySkuItemAndCostAndDeleted(customStockItem, Double.valueOf(datas[4]), true);\n if(isHasOne != null && isHasOne.size()>0 ){\n isHasOne.get(0).deleted = false;\n if (datas[2].equals(\"true\")) {\n isHasOne.get(0).times = -1;\n } else {\n isHasOne.get(0).times = Integer.valueOf(datas[3]);\n }\n }else{\n suiteItem = new SuiteItem();\n suiteItem.skuItem = customStockItem;\n if (datas[2].equals(\"true\")) {\n suiteItem.times = -1;\n } else {\n suiteItem.times = Integer.valueOf(datas[3]);\n }\n suiteItem.cost = Double.valueOf(datas[4]);\n suiteItems.add(suiteItem);\n suiteItemRepository.save(suiteItem);\n }\n }\n }\n }\n //rowData操作完成\n for (Long itemId : itemIds) {\n SuiteItem deleteOne = suiteItemRepository.findOne(itemId);\n deleteOne.deleted = true;\n }\n// return suiteItems;\n }", "public boolean addBike(Bike bike, DockingStation dock){\n String dateTimeNow = new SimpleDateFormat(TIME_FORMAT).format(Calendar.getInstance().getTime());\n \tint bikeId = 1;\n \tdouble latitude;\n \tdouble longitude;\n double chargingLvl;\n try(Connection con = DatabaseConnector.getConnection();\n PreparedStatement ps = con.prepareStatement(INSERT);\n PreparedStatement ps2 = con.prepareStatement(INSERT_DATA);\n PreparedStatement ps3 = con.prepareStatement(BIKE_ID_TYPE + bike.getTypeId());\n ResultSet rs = ps3.executeQuery()){\n \n con.setAutoCommit(false);\n \n if(rs.next()){\n int maxBikeId = rs.getInt(cBikeID);\n if(maxBikeId == 0){\n bikeId = bike.getTypeId() * 1000;\n }else{\n bikeId += maxBikeId;\n }\n }else{\n return false;\n }\n\n ps.setInt(1, bikeId);\n ps.setDate(2, bike.getSqlDate());\n ps.setDouble(3, bike.getPrice());\n ps.setString(4, bike.getMake());\n ps.setInt(5, bike.getTypeId());\n if(bike.getStationId() == 0){\n ps.setNull(6, INTEGER);\n }else{\n ps.setInt(6, bike.getStationId());\n }\n \n if (dock != null){\n latitude = dock.getCoordinateLat();\n longitude = dock.getCoordinateLng();\n chargingLvl = 100;\n ps.setInt(6, dock.getStationId());\n }else if(bike.getBikeData() != null){\n latitude = bike.getBikeData().getLatitude();\n longitude = bike.getBikeData().getLongitude();\n chargingLvl = bike.getBikeData().getChargingLvl();\n }else{ //If there's no selected dock or data input for the bike\n latitude = 63.434903; // The latitude & longitude of the \"company\"\n longitude = 10.402521;\n chargingLvl = 100;\n }\n ps2.setInt(1, bikeId);\n ps2.setString(2, dateTimeNow);\n ps2.setDouble(3,latitude);\n ps2.setDouble(4, longitude);\n ps2.setDouble(5, chargingLvl);\n ps2.setNull(6, INTEGER);\n\n ps.executeUpdate();\n ps2.executeUpdate();\n con.commit();\n con.setAutoCommit(true);\n return true;\n }catch(Exception e){\n System.out.println(\"Exception: \" + e);\n }\n return false;\n }", "public boolean updateData_SI_all_V2(SI si) {\n\t\t// TODO Auto-generated method stub\n\t\t/***************************************\n\t\t * Build value set\n\t\t ***************************************/\n\t\tContentValues cv = new ContentValues();\n\t\t\n\t\t/*\n\t\t//\t0\t\t1\t\t2\n\t\t\"store\", \"name\", \"price\",\n\t\t//\t3\t\t4\t\t\t5\n\t\t\"genre\", \"yomi\", android.provider.BaseColumns._ID, \n\t\t//\t6\t\t\t7\t\t\t\t8\n\t\t\"created_at\", \"updated_at\", \"posted_at\"\n\t\t*/\n\t\t\n\t\tcv.put(CONS.DB.cols_SI_full[0], si.getStore());\n\t\tcv.put(CONS.DB.cols_SI_full[1], si.getName());\n\t\tcv.put(CONS.DB.cols_SI_full[2], si.getPrice());\n\t\tcv.put(CONS.DB.cols_SI_full[3], si.getGenre());\n\t\tcv.put(CONS.DB.cols_SI_full[4], si.getYomi());\n\t\t\n\t\tcv.put(CONS.DB.cols_SI_full[6], si.getCreated_at());\n\t\tcv.put(CONS.DB.cols_SI_full[7], si.getModified_at());\n\t\tcv.put(CONS.DB.cols_SI_full[8], si.getPosted_at());\n\t\t\n\t\t/***************************************\n\t\t * Setup db\n\t\t ***************************************/\n\t\tSQLiteDatabase wdb = this.getWritableDatabase();\n\t\t\n\t\ttry {\n\t\t\t//\n\t\t\twdb.beginTransaction();\n\t\t\t\n//\t\t\t//\n//\t\t\tContentValues cv = new ContentValues();\n//\t\t\t\n//\t\t\t// Put values\n//\t\t\tfor (int i = 0; i < cols.length; i++) {\n//\t\t\t\tcv.put(cols[i], values[i]);\n//\t\t\t}//for (int i = 0; i < columnNames.length; i++)\n\t\t\t\n\t\t\t// Insert data\n//\t\t\tlong res = wdb.insert(CONS.DBAdmin.tableName, null, cv);\n\t\t\tlong res = wdb.update(\n\t\t\t\t\tCONS.DB.tableName,\n\t\t\t\t\tcv,\n\t\t\t\t\tandroid.provider.BaseColumns._ID + \" = ?\",\n\t\t\t\t\tnew String[]{String.valueOf(si.getId())});\n\t\t\t\n\t\t\tif (res < 1) {\n\t\t\t\t\n\t\t\t\t// Log\n\t\t\t\tLog.d(\"DBUtils.java\"\n\t\t\t\t\t\t+ \"[\"\n\t\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2]\n\t\t\t\t\t\t\t.getLineNumber()\n\t\t\t\t\t\t\t+ \":\"\n\t\t\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2]\n\t\t\t\t\t\t\t\t\t.getMethodName() + \"]\",\n\t\t\t\t\t\t\"Update => Returned less than 1\");\n\t\t\t\t\n\t\t\t\twdb.close();\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t// Set as successful\n\t\t\twdb.setTransactionSuccessful();\n\t\t\t\n\t\t\t// End transaction\n\t\t\twdb.endTransaction();\n\t\t\t\n\t\t\t// Log\n\t\t\tLog.d(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \":\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t\t+ \"]\", \"Update => Successful\");\n\t\t\t\n\t\t\twdb.close();\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// Log\n\t\t\tLog.e(\"DBUtils.java\" + \"[\"\n\t\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t\t+ \"]\", \"Exception => \" + e.toString());\n\t\t\t\n\t\t\twdb.close();\n\t\t\t\n\t\t\treturn false;\n\t\t\t\n\t\t}//try\n\t\t\n\t}", "private void addOrUpdate() {\n try {\n Stokdigudang s = new Stokdigudang();\n if (!tableStok.getSelectionModel().isSelectionEmpty()) {\n s.setIDBarang(listStok.get(row).getIDBarang());\n }\n s.setNamaBarang(tfNama.getText());\n s.setHarga(new Integer(tfHarga.getText()));\n s.setStok((int) spJumlah.getValue());\n s.setBrand(tfBrand.getText());\n s.setIDKategori((Kategorimotor) cbKategori.getSelectedItem());\n s.setIDSupplier((Supplier) cbSupplier.getSelectedItem());\n s.setTanggalDidapat(dateChooser.getDate());\n\n daoStok.addOrUpdateStok(s);\n JOptionPane.showMessageDialog(this, \"Data berhasil disimpan!\");\n showAllDataStok();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"Data gagal disimpan!\");\n }\n }", "public int actualizarCRN_update(SicaCRN crn) {\n if (conectado) {\n\n try {\n PreparedStatement p = Conexion.prepareStatement(\n \"INSERT INTO `crn`(`usuario`, `materia`, `crn`, `anio`, `ciclo`) \"\n + \"SELECT ?, ?, ?, YEAR(NOW()), CURRENT_CICLO() \"\n + \"FROM dual \"\n + \"WHERE NOT EXISTS (SELECT * FROM `crn` \"\n + \"WHERE `crn` = ? AND `usuario` = ? \"\n + \"AND `anio` = YEAR(NOW()) AND `ciclo` = CURRENT_CICLO()) LIMIT 1 ;\"\n );\n\n p.setInt(1, crn.getUsuario());\n p.setString(2, crn.getMateria());\n p.setInt(3, crn.getCrn());\n p.setInt(4, crn.getCrn());\n p.setInt(5, crn.getUsuario());\n\n Logy.m(\"Se insertara si no existe un CRN: \" + crn.getCrn());\n Logy.m(p.toString());\n\n PreparedStatement p2 = Conexion.prepareStatement(\n \"UPDATE `checador`.`crn` SET `usuario` = ?, `materia` = ?, \"\n + \"`crn` = ?, `anio` = YEAR(NOW()), `ciclo` = CURRENT_CICLO() \"\n + \"WHERE `crn` = ? AND `usuario` = ? AND `anio` = YEAR(NOW()) AND `ciclo` = CURRENT_CICLO() ;\"\n );\n\n p2.setInt(1, crn.getUsuario());\n p2.setString(2, crn.getMateria());\n p2.setInt(3, crn.getCrn());\n p2.setInt(4, crn.getCrn());\n p2.setInt(5, crn.getUsuario());\n\n Logy.m(\"Se hara update de crn: \" + crn.getCrn());\n Logy.m(p2.toString());\n\n int r = p.executeUpdate();\n int r2 = p2.executeUpdate();\n\n return r + r2;\n } catch (SQLException e) {\n Logy.me(\"\" + e.getLocalizedMessage() + \" \" + e.getMessage());\n Sincronizador.setOk(false);\n Sincronizador.setDetalles(Sincronizador.getDetalles() + \"error update CRNS en DB, \");\n return 0;\n }\n } else {\n Logy.me(\"Error!!! no ha establecido previamente una conexion a la DB\");\n return 0;\n }\n }", "public boolean MasaSil(int masa_no) throws SQLException {\n baglanti vb = new baglanti();\r\n\r\n try {\r\n vb.baglan();\r\n } catch (Exception e) {\r\n System.out.println(\"Bağlantı sağlanamadı\" + e);\r\n }\r\n try {\r\n String sorgu3 = \"DELETE m,i FROM masalar m LEFT JOIN ilisk_masa i ON m.masa_no=i.masa_no WHERE m.masa_no=\" + masa_no + \"\";\r\n\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n\r\n return true;\r\n } catch (Exception e) {\r\n System.out.println(e);\r\n return false;\r\n }\r\n finally{\r\n vb.con.close();\r\n }\r\n }", "private void edit() {\n if (String.valueOf(tgl_pengobatanField.getText()).equals(null)\n || String.valueOf(waktu_pengobatanField.getText()).equals(null)) {\n Toast.makeText(getApplicationContext(),\n \"Ada Yang Belum Terisi\", Toast.LENGTH_SHORT).show();\n } else {\n SQLite.update(Integer.parseInt(idField.getText().toString().trim()),nama_pasien2,nama_dokter2, tgl_pengobatanField.getText().toString().trim(),waktu_pengobatanField.getText().toString(),\n keluhan_pasienField.getText().toString().trim(),hasil_diagnosaField.getText().toString().trim(),\n biayaField.getText().toString().trim());\n blank();\n finish();\n }\n }", "int updateByPrimaryKeySelective(UserPonumberGoods record);", "int updateByPrimaryKey(Notifiction record);", "int updateByPrimaryKeySelective(BnesBrowsingHis record) throws SQLException;", "private boolean puedeModificarAprRepOtroUsuario(String empresa, String local, String tipoDocumento, String codigoDocumento, String codigoVistoBueno, boolean checkSeleccionado, int fila, int columna){\n boolean blnRes=false;\n String strArlVisBueDbCodEmp=\"\", strArlVisBueDbCodLoc=\"\", strArlVisBueDbCodTipDoc=\"\", strArlVisBueDbCodDoc=\"\";\n String strArlVisBueDbCodVisBue=\"\", strArlVisBueDbEstVisBue=\"\", strArlVisBueDbCodUsr=\"\";\n String strTblVisBueDbCodEmp=empresa;\n String strTblVisBueDbCodLoc=local;\n String strTblVisBueDbCodTipDoc=tipoDocumento;\n String strTblVisBueDbCodDoc=codigoDocumento;\n String strTblVisBueDbCodVisBue=codigoVistoBueno;\n boolean blnChkSel=checkSeleccionado;\n int intFil=fila;\n int intCol=columna;\n int w=0;\n //System.out.println(\"puedeModificarAprRepOtroUsuario: \" + arlDatCodVisBueDB.toString());\n try{\n for(int k=0; k<arlDatCodVisBueDB.size(); k++){\n w=0;\n strArlVisBueDbCodEmp=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_EMP_DB);\n strArlVisBueDbCodLoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_LOC_DB);\n strArlVisBueDbCodTipDoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_TIP_DOC_DB);\n strArlVisBueDbCodDoc=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_DOC_DB);\n strArlVisBueDbCodVisBue=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_VIS_BUE_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_VIS_BUE_DB);\n strArlVisBueDbEstVisBue=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_EST_VIS_BUE_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_EST_VIS_BUE_DB);\n strArlVisBueDbCodUsr=objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_USR_DB)==null?\"\":objUti.getStringValueAt(arlDatCodVisBueDB, k, INT_ARL_VIS_BUE_DB_COD_USR_DB);\n\n if(strTblVisBueDbCodEmp.equals(strArlVisBueDbCodEmp)){\n if(strTblVisBueDbCodLoc.equals(strArlVisBueDbCodLoc)){\n if(strTblVisBueDbCodTipDoc.equals(strArlVisBueDbCodTipDoc)){\n if(strTblVisBueDbCodDoc.equals(strArlVisBueDbCodDoc)){\n if(strArlVisBueDbCodVisBue.equals(strTblVisBueDbCodVisBue)){\n if( (strArlVisBueDbEstVisBue.equals(\"A\")) || (strArlVisBueDbEstVisBue.equals(\"D\")) ){\n if(! strArlVisBueDbCodUsr.equals(\"\"+objParSis.getCodigoUsuario())){\n objTblMod.setChecked(blnChkSel, intFil, intCol);\n mostrarMsgInf(\"<HTML>El visto bueno que intenta modificar ya fue Aprobado/Reprobado por otro usuario.<BR>El otro usuario debe reversar para que ud. pueda realizar la Aprobación/Reprobación,<BR> o dicho usuario deberá modificarlo. </HTML>\");\n blnRes=true;\n break;\n }\n }\n\n }\n }\n }\n }\n }\n }\n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "@Test\n public void updateTest10() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBar(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isBar() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest11() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setRistorante(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isRistorante() ,\"Should return true if update Servizio\");\n }", "private void updIVTRN()\n\t{ \n\t\ttry{\n\t\t\tM_strSQLQRY = \"Update mr_ivtrn set\";\n\t\t\tM_strSQLQRY += \" IVT_LADQT = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_LODDT = null,\";\n\t\t\tM_strSQLQRY += \" IVT_INVQT = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_INVPK = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_STSFL = 'A',\";\n\t\t\tM_strSQLQRY += \" IVT_LUSBY = '\"+cl_dat.M_strUSRCD_pbst+\"',\";\n\t\t\tM_strSQLQRY += \" IVT_LUPDT = '\"+M_fmtDBDAT.format(M_fmtLCDAT.parse(cl_dat.M_strLOGDT_pbst))+\"'\";\n\t\t\tM_strSQLQRY += \" where IVT_CMPCD = '\"+cl_dat.M_strCMPCD_pbst+\"' and IVT_MKTTP = '\"+txtTRNTP.getText() .toString() .trim()+\"'\";\n\t\t\tM_strSQLQRY += \" and IVT_LADNO = '\"+txtISSNO.getText().toString().trim() +\"'\";\n\t\t\t\n\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY,\"setLCLUPD\");\n\t\t\t//System.out.println(\"update Ivtrn table :\"+M_strSQLQRY);\n\t\t\t\n\t\t}catch(Exception L_EX){\n\t\t\tsetMSG(L_EX,\"updIVTRN\");\n\t\t}\n\t}", "private void updateDB() {\n }", "int updateByPrimaryKey(BnesBrowsingHis record) throws SQLException;", "@Test\n public void updateTest12() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setAnimazione(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isAnimazione() ,\"Should return true if update Servizio\");\n }", "int updateByPrimaryKeySelective(ItemStockDO record);", "int updateByPrimaryKeySelective(NeeqCompanyAccountingFirmOnline record);", "private void jbtnModifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnModifActionPerformed\n if(isNumeric() == true){ \n String sReq = \"from Offre Where Off_Etablissement = '\"+sEtablissementId+\"' And Off_TypeChambre = '\"+sChambresId+\"'\";\n Query q = jfPrincipal.getSession().createQuery(sReq);\n Offre unOffre = (Offre) q.uniqueResult();\n unOffre.setOffNbchambres(Byte.parseByte(jtxtModif.getText()));\n Transaction tx = jfPrincipal.getSession().beginTransaction();\n tx.commit();\n jfPrincipal.getSession().update (unOffre);\n chargeTable(sEtablissementId);\n }\n else{\n JOptionPane.showMessageDialog(null, \"La valeur saisie pour la quantité doit être un chiffre\");\n }\n }", "int updateByPrimaryKey(DashboardGoods record);", "public boolean updateData(DataPegawai updatedatapegawai) {\n\t\tBoolean booleans = false;\n\t\t\n\t\tDataPegawai datapegawai = new DataPegawai();\n\t\tdatapegawai.setTanggal_masuk(new Date());\n\t\tSimpleDateFormat date = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\t\tString dates = date.format(datapegawai.getTanggal_masuk());\n\t\t\n\n\t\ttry {\n\t\t\t// Mengisi Query\n\t\t\tString query = \"UPDATE `Karyawan` SET `Nama`=?, `Golongan`=?, `Gaji_Perbulan`=?, `Tanggal_Masuk`=? WHERE `ID`=?\";\n\t\t\t// prepare Statment\n\t\t\tPreparedStatement preparedstatement = (PreparedStatement) conn.prepareStatement(query);\n\t\t\tpreparedstatement.setString(1, updatedatapegawai.getNama());\n\t\t\tpreparedstatement.setString(2, updatedatapegawai.getGolongan());\n\t\t\tpreparedstatement.setInt(3, updatedatapegawai.getGaji_perbulan());\n\t\t\tpreparedstatement.setString(4, dates);\n\t\t\tpreparedstatement.setInt(5, updatedatapegawai.getId());\n\n\t\t\t// eksekusi prepare statment\n\t\t\tpreparedstatement.execute();\n\t\t\tbooleans = true;\n\t\t\t// preparedstatement.close();\n\t\t\tconn.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.print(\"Ada yang salah Dalam Fungsi Mengupdate Data\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn booleans;\n\t}", "public void save(Connection con) \n throws qdbException\n {\n try{\n // Don't need to save options if default values is used\n if(dpo_default)\n return; \n \n PreparedStatement stmt = con.prepareStatement(\n \" SELECT dpo_res_id from DisplayOption WHERE \" \n + \" dpo_res_id = ? AND dpo_res_type = ? \"\n + \" dpo_res_subtype = ? AND dpo_view = ? \");\n \n \n ResultSet rs = stmt.executeQuery();\n String SQL = new String();\n // record exists , do update\n if (rs.next()) {\n SQL = \" UPDATE DisplayOption SET \"\n + \" dpo_icon_ind = ? \"\n + \" ,dpo_title_ind = ? \"\n + \" ,dpo_lan_ind = ? \"\n + \" ,dpo_desc_ind = ? \"\n + \" ,dpo_instruct_ind = ? \"\n + \" ,dpo_eff_start_datetime_ind = ? \"\n + \" ,dpo_eff_end_datetime_ind = ? \"\n + \" ,dpo_difficutly_ind = ? \"\n + \" ,dpo_time_limit_ind = ? \"\n + \" ,dpo_suggested_time_ind = ? \"\n + \" ,dpo_duration_ind = ? \" \n + \" ,dpo_max_score_ind = ? \"\n + \" ,dpo_pass_score_ind = ? \"\n + \" ,dpo_pgr_start_datetime_ind = ? \"\n + \" ,dpo_pgr_complete_datetime_ind = ? \"\n + \" ,dpo_pgr_last_acc_datetime_ind = ? \"\n + \" ,dpo_pgr_attempt_nbr_ind = ? \"\n + \" ,dpo_max_usr_attempt_ind = ? \"\n + \" ,dpo_instructor_ind = ? \"\n + \" ,dpo_organization_ind = ? \"\n + \" ,dpo_moderator_ind = ? \"\n + \" ,dpo_evt_datetime_ind = ? \"\n + \" ,dpo_evt_venue_ind = ? \"\n + \" ,dpo_status_ind = ? \"\n + \" WHERE \"\n + \" dpo_res_id = ? \" \n + \" AND dpo_res_type = ? \" \n + \" AND dpo_res_subtype = ? \" \n + \" AND dpo_view = ? \";\n // no record exists, do insert\n }else {\n SQL = \" INSERT INTO DisplayOption \"\n + \" (dpo_icon_ind \"\n + \" ,dpo_title_ind \"\n + \" ,dpo_lan_ind \"\n + \" ,dpo_desc_ind \"\n + \" ,dpo_instruct_ind \"\n + \" ,dpo_eff_start_datetime_ind \"\n + \" ,dpo_eff_end_datetime_ind \"\n + \" ,dpo_difficulty_ind \"\n + \" ,dpo_time_limit_ind \"\n + \" ,dpo_suggested_time_ind \"\n + \" ,dpo_duration_ind \"\n + \" ,dpo_max_score_ind \"\n + \" ,dpo_pass_score_ind \"\n + \" ,dpo_pgr_start_datetime_ind \"\n + \" ,dpo_pgr_complete_datetime_ind \"\n + \" ,dpo_pgr_last_acc_datetime_ind \"\n + \" ,dpo_pgr_attempt_nbr_ind \"\n + \" ,dpo_max_usr_attempt_ind \"\n + \" ,dpo_instructor_ind \"\n + \" ,dpo_organization_ind \"\n + \" ,dpo_moderator_ind \"\n + \" ,dpo_evt_datetime_ind \"\n + \" ,dpo_evt_venue_ind \"\n + \" ,dpo_status_ind \"\n + \" ,dpo_res_id \" \n + \" ,dpo_res_type \"\n + \" ,dpo_res_subtype \"\n + \" ,dpo_view ) \"\n\n + \" VALUES (?,?,?,?,?, \"\n + \" ?,?,?,?,?, \"\n + \" ?,?,?,?,?, \"\n + \" ?,?,?,?,?, \"\n + \" ?,?,?,?,?,?) \"; \n }\n\n stmt = con.prepareStatement(SQL);\n \n stmt.setLong(5, dpo_res_id);\n stmt.setString(6, dpo_res_type);\n stmt.setString(7, dpo_res_subtype);\n stmt.setString(8, dpo_view);\n stmt.setBoolean(9, dpo_icon_ind);\n stmt.setBoolean(10, dpo_title_ind);\n stmt.setBoolean(11, dpo_lan_ind);\n stmt.setBoolean(12, dpo_desc_ind);\n stmt.setBoolean(13, dpo_instruct_ind);\n stmt.setBoolean(14, dpo_eff_start_datetime_ind);\n stmt.setBoolean(15, dpo_eff_end_datetime_ind);\n stmt.setBoolean(16, dpo_difficulty_ind);\n stmt.setBoolean(17, dpo_time_limit_ind);\n stmt.setBoolean(18, dpo_suggested_time_ind);\n stmt.setBoolean(19, dpo_duration_ind);\n stmt.setBoolean(20, dpo_max_score_ind);\n stmt.setBoolean(21, dpo_pass_score_ind);\n stmt.setBoolean(22, dpo_pgr_start_datetime_ind);\n stmt.setBoolean(23, dpo_pgr_complete_datetime_ind);\n stmt.setBoolean(24, dpo_pgr_last_acc_datetime_ind);\n stmt.setBoolean(25, dpo_pgr_attempt_nbr_ind);\n stmt.setBoolean(26, dpo_max_usr_attempt_ind);\n stmt.setBoolean(27, dpo_instructor_ind);\n stmt.setBoolean(28, dpo_organization_ind);\n stmt.setBoolean(29, dpo_moderator_ind);\n stmt.setBoolean(30, dpo_evt_datetime_ind);\n stmt.setBoolean(31, dpo_evt_venue_ind);\n stmt.setBoolean(32, dpo_status_ind);\n\n stmt.setLong(1, dpo_res_id);\n stmt.setString(2, dpo_res_type);\n stmt.setString(3, dpo_res_subtype);\n stmt.setString(4, dpo_view);\n \n if (stmt.executeUpdate() != 1) {\n stmt.close();\n con.rollback();\n throw new qdbException(\"Failed to save display option.\"); \n }\n stmt.close(); \n } catch(SQLException e) {\n throw new qdbException(\"SQL Error: \" + e.getMessage()); \n }\n }", "public static Profil select(String noInduk) throws SQLException, KasirException{\r\n assert noInduk != null && !noInduk.isEmpty() : \"selectProfil(String, String, String noInduk = null)\";\r\n\r\n return select(noIndukColName, false, noInduk);\r\n }", "void loadWeather() {\n\n // existing station's weather records are never updated.\n // why not?????\n\n// if (!\"\".equals(stationId) && !stationIgnore) {\n if (!stationExists && !weather.isNullRecord()) {\n\n if (!weatherIsLoaded) {\n\n // is there a weather record?\n// int count = weather.getRecCnt(\n// MrnWeather.STATION_ID + \"=\" + stationId);\n\n// if (count == 0) {\n\n // insert weather record\n weather.setStationId(stationId);\n if (dbg3) System.out.println(\"<br>loadWeather: put weather = \" + weather);\n try {\n weather.put();\n } catch(Exception e) {\n System.err.println(\"loadWeather: put weather = \" + weather);\n System.err.println(\"loadWeather: put sql = \" + weather.getInsStr());\n e.printStackTrace();\n } // try-catch\n\n weatherCount++;\n\n// } else {\n//\n// // update weather record\n// MrnWeather whereWeather = new MrnWeather(stationId);\n// whereWeather.upd(weather);\n//\n// } // if (weatherRecordCount == 0)\n//\n weatherIsLoaded = true;\n } // if (!weather.isNullRecord())\n\n } // if (!stationExists && !weather.isNullRecord())\n// } // if (!\"\".equals(stationId) && !stationIgnore)\n\n weather = new MrnWeather();\n\n }", "private boolean markNodHijos(String nodPadSel){\n boolean blnRes=true;\n Connection conNodHij;\n Statement stmNodHij;\n ResultSet rstNodHij;\n String strNodPadSel=nodPadSel==null?\"\":nodPadSel;\n arlDatNodHij.clear();\n try{\n conNodHij=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if(conNodHij!=null){\n stmNodHij=conNodHij.createStatement();\n strSQL=\"\";\n strSQL+=\" SELECT a1.co_emp, a1.co_cta, a1.tx_codCta, a1.ne_pad\";\n strSQL+=\" FROM tbm_plaCta AS a1\";\n strSQL+=\" WHERE a1.co_emp=\" + objParSis.getCodigoEmpresa() + \"\";\n strSQL+=\" AND a1.tx_codCta like('\" + objTblModPlaCta.getValueAt(tblDatPlaCta.getSelectedRow(), INT_TBL_PLA_CTA_NUM_CTA) + \"%')\";\n strSQL+=\" ORDER BY a1.tx_codCta\";\n\n rstNodHij=stmNodHij.executeQuery(strSQL);\n while(rstNodHij.next()){\n arlRegNodHij=new ArrayList();\n arlRegNodHij.add(INT_ARL_COD_EMP, \"\" + rstNodHij.getString(\"co_emp\"));\n arlRegNodHij.add(INT_ARL_COD_CTA_SEL, \"\" + rstNodHij.getString(\"ne_pad\"));\n arlRegNodHij.add(INT_ARL_COD_CTA_HIJ, \"\" + rstNodHij.getString(\"co_cta\"));\n arlDatNodHij.add(arlRegNodHij);\n }\n conNodHij.close();\n conNodHij=null;\n stmNodHij.close();\n stmNodHij=null;\n rstNodHij.close();\n rstNodHij=null;\n }\n }\n catch(java.sql.SQLException e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n catch(Exception e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "public boolean updateArticulo(){\n Articulo art = actualizarArticulo();\n if(art==null) {\n return false;\n }else{\n DaoArticulo daoArticulo = new DaoArticulo(getApplicationContext(), Constants.ACTUALIZAR_ARTICULO, position);\n daoArticulo.actualizarArticulo(art);\n return true;\n }\n }" ]
[ "0.7790531", "0.7056909", "0.61059535", "0.5978394", "0.57220584", "0.5666216", "0.56629574", "0.5600221", "0.55152583", "0.5506018", "0.5487219", "0.5436778", "0.5417349", "0.5407668", "0.5397259", "0.5395893", "0.5395337", "0.53896236", "0.534632", "0.5332142", "0.5324764", "0.5323266", "0.5320678", "0.53177947", "0.5313089", "0.5302302", "0.5298406", "0.52708507", "0.5256683", "0.5254536", "0.52540094", "0.52537006", "0.5251883", "0.5250751", "0.5230755", "0.52300483", "0.5226729", "0.5226169", "0.5221578", "0.52211004", "0.52187437", "0.5212976", "0.5210611", "0.5208186", "0.51985216", "0.51983577", "0.5194225", "0.51935685", "0.5187177", "0.5182317", "0.5176898", "0.5174841", "0.5174841", "0.5172987", "0.5168158", "0.5165773", "0.51622576", "0.51593715", "0.5158173", "0.5153914", "0.5153267", "0.51499784", "0.5141676", "0.5136183", "0.51294595", "0.5126658", "0.5126658", "0.5124547", "0.5118205", "0.5111691", "0.51109433", "0.5106205", "0.5099558", "0.50993973", "0.50977415", "0.50944513", "0.5087624", "0.508697", "0.50865215", "0.5083341", "0.50810313", "0.5071129", "0.5068451", "0.5068022", "0.5063739", "0.5063736", "0.50622934", "0.5062275", "0.5051705", "0.5044674", "0.50363046", "0.5031344", "0.5030184", "0.50266844", "0.5019918", "0.5019402", "0.50187546", "0.50179756", "0.5014097", "0.50124353" ]
0.5993668
3
/ updates including noInduk. if oldNoInduk.equals(noInduk) = true, then it's the same as flushResultSet(rs) oldNoInduk may not be null throws KasirException(DB_INVALID, this) if isDBValid = false throws KasirException(ROW_NOT_FOUND, this/oldNoInduk) if no row matches throws KasirException(DUPLICATE_PRIMARY_KEY, this) if the new noInduk has already existed in db never ret false
public boolean updateResultSetNoInduk(ResultSet rs, String oldNoInduk) throws SQLException, KasirException { assert oldNoInduk != null : "oldNoInduk = null"; if(!isDBValid()) throw new KasirException(KasirException.Tipe.DB_INVALID, this); if(noInduk.equals(oldNoInduk)){ if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0) return flushResultSet(rs, false); else throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this); }else{ if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0) throw new KasirException(KasirException.Tipe.DUPLICATE_PRIMARY_KEY, this); if(DBSR.searchRow(rs, noIndukColName, false, oldNoInduk) > 0) return flushResultSet(rs, true); else throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, oldNoInduk); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean updateNoInduk(String oldNoInduk) throws SQLException, KasirException{\r\n assert oldNoInduk != null;\r\n\r\n //profil.noInduk is also retrieved to check for noInduk duplication\r\n ResultSet rs = DBSR.takeResultSetByString(tableName, noIndukColName, 1, oldNoInduk, noInduk);\r\n\r\n if(updateResultSetNoInduk(rs, oldNoInduk)){\r\n rs.updateRow();\r\n return true;\r\n }else\r\n return false;\r\n }", "public boolean updateResultSet(ResultSet rs) throws SQLException, KasirException{\r\n if(!isDBValid())\r\n throw new KasirException(KasirException.Tipe.DB_INVALID, this);\r\n \r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n return flushResultSet(rs, false);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this);\r\n }", "public boolean asignaNumeroFac(java.sql.Connection conIns, int intCodEmp,int intCodLoc, int intCodTipDocFacEle, int intCodDoc, int intCodCot) \r\n {\r\n boolean blnRes = false;\r\n java.sql.Statement stmLoc, stmLocIns;\r\n java.sql.ResultSet rstLoc;\r\n String strSql = \"\";\r\n String strSqlIns = \"\";\r\n int intNumDoc = 0;\r\n int intNumDocGuia = 0;\r\n try \r\n {\r\n if (conIns != null){\r\n stmLoc = conIns.createStatement();\r\n strSql = \"SELECT CASE WHEN (ne_ultDoc+1) IS NULL THEN 1 ELSE (ne_ultDoc+1) END AS ultnum \"\r\n + \" FROM tbm_cabTipDoc WHERE co_emp=\" +intCodEmp+ \" \"\r\n + \" AND co_loc=\" +intCodLoc+ \" AND co_tipDoc=\" + intCodTipDocFacEle;\r\n// System.out.println(\"numero \" + strSql);\r\n rstLoc = stmLoc.executeQuery(strSql);\r\n if (rstLoc.next()) {\r\n intNumDoc = rstLoc.getInt(\"ultnum\");\r\n }\r\n rstLoc.close();\r\n rstLoc = null;\r\n stmLoc.close();\r\n stmLoc = null;\r\n \r\n \r\n strSqlIns += \" UPDATE tbm_cabTipDoc SET ne_ultDoc=\" + intNumDoc + \" WHERE co_emp=\" +intCodEmp+ \" \"\r\n + \" AND co_loc=\" +intCodLoc+ \" AND co_tipDoc=\" + intCodTipDocFacEle;\r\n strSqlIns += \";UPDATE tbm_cabmovinv SET ne_numdoc=\" +intNumDoc+\", ne_numgui=\"+intNumDocGuia+\", st_reg='A' , st_imp='S' \"\r\n + \" WHERE co_emp=\" +intCodEmp+ \" AND co_loc=\" +intCodLoc+ \" AND co_tipdoc=\" + intCodTipDocFacEle + \" \"\r\n + \" AND co_doc=\" + intCodDoc + \" and st_reg not in ('I','E') AND ne_numcot=\" + intCodCot;\r\n strSqlIns += \" ; UPDATE tbm_cabdia SET tx_numdia='\" + intNumDoc + \"' WHERE co_emp=\" +intCodEmp+ \" AND co_loc=\" +intCodLoc+ \" AND co_tipdoc=\" + intCodTipDocFacEle + \" \"\r\n + \" AND co_dia=\" + intCodDoc + \" and st_reg not in ('I','E') \";\r\n System.out.println(\"asignaNumeroFac \"+strSqlIns);\r\n stmLocIns = conIns.createStatement();\r\n stmLocIns.executeUpdate(strSqlIns);\r\n stmLocIns.close();\r\n stmLocIns = null;\r\n intNumFacElec=intNumDoc;\r\n blnRes = true;\r\n }\r\n } \r\n catch (SQLException Evt) {\r\n blnRes = false;\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n } \r\n catch (Exception Evt) {\r\n blnRes = false;\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n }\r\n return blnRes;\r\n }", "@Override\r\n\tpublic boolean update(Viaggio viaggio) {\r\n\t\tboolean result = false;\r\n\t\tif ( viaggio == null ) {\r\n\t\t\tSystem.out.println( \"update(): failed to update a null entry\");\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tPreparedStatement prep_stmt = conn.prepareStatement(update);\r\n\t\t\tprep_stmt.clearParameters();\r\n\t\t\tprep_stmt.setInt(1, viaggio.getCreatore().getId());\r\n\t\t\tprep_stmt.setString(2, viaggio.getTitolo());\r\n\t\t\tprep_stmt.setString(3, viaggio.getDestinazione());\r\n\t\t\tprep_stmt.setString(4, viaggio.getDescrizione());\r\n\t\t\tprep_stmt.setString(5, viaggio.getLingua());\r\n\t\t\tprep_stmt.setInt(6, viaggio.getBudget());\r\n\t\t\tprep_stmt.setString(7, viaggio.getLuogopartenza());\r\n\t\t\tprep_stmt.setInt(8, viaggio.getStato().ordinal());\r\n\t\t\tprep_stmt.setDate(9, viaggio.getDatainizio());\r\n\t\t\tprep_stmt.setDate(10, viaggio.getDatafine());\r\n\t\t\tprep_stmt.setString(11, viaggio.getImmaginiProfilo());\t\t\t\r\n\t\t\tprep_stmt.setInt(12, viaggio.getIdViaggio());\r\n\t\t\tint esito;\r\n\t\t\tesito=prep_stmt.executeUpdate();\r\n\t\t\tprep_stmt.close();\r\n\t\t\tif(esito>=0) {\r\n\t\t\t\tSystem.out.println(\"Ho aggiornato il viaggio con id \"+ viaggio.getIdViaggio());\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\"ERRORE: non ho potuto aggiornare il viaggio con id \"+ viaggio.getIdViaggio());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(\"insert(): failed to update entry: \"+e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\ttry {\r\n\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "@Override\n\tpublic boolean update(String sql) {\n\t\treturn false;\n\t}", "@Test\n public void updateTest6() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBeach_volley(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isBeach_volley() ,\"Should return true if update Servizio\");\n }", "public boolean bookLot() {\r\n\t\tboolean bookUpdateSuccess = false;\r\n\t\t/**\r\n\t\t*\tSince connecting to database (DbConnection()) and updating data (executeUpdateParklot())\r\n\t\t* throw SQLException and throwing an exception from multiple levels again and again is not\r\n\t\t*\ta good way, so its is needed to catch the exception here.\r\n\t\t*/\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t*\tCreate a connection to the database\r\n\t\t\t*/\r\n\t\t\tDbConnection bookLotConn = new DbConnection();\r\n\t\t\t/**\r\n\t\t\t*\tupdate the data in table\r\n\t\t\t*/\r\n\t\t\tbookUpdateSuccess = bookLotConn.executeUpdateParklot(lotNo, 1);\r\n\r\n\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSystem.out.println(\"**************Error Connecting to the Database**************\");\r\n\t\t\tSqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\t//validateConn.closeDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t\treturn bookUpdateSuccess;\r\n\t}", "@Override\n public boolean update(Transaksi transaksi) {\n try {\n String query = \"UPDATE transaksi SET tgl_transaksi=? WHERE id=?\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ps.setString(1, transaksi.getTglTransaksi());\n ps.setString(2, transaksi.getId());\n\n if (ps.executeUpdate() > 0) {\n return true;\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "@Override\r\n\tpublic boolean updateSQL(String sql, Connection con) {\n\t\treturn false;\r\n\t}", "public boolean flushResultSet(ResultSet rs, boolean flushNoInduk) throws SQLException {\r\n if(flushNoInduk)\r\n rs.updateString(noIndukColName, noInduk);\r\n if(currentLevel != null)\r\n currentLevel.flushResultSet(rs, currentLevelColName);\r\n if (biodata != null)\r\n biodata.flushResultSet(rs);\r\n if(tanggalMasuk != null)\r\n tanggalMasuk.flushResultSet(rs, tanggalMasukColName);\r\n if(tanggalLulus != null)\r\n tanggalLulus.flushResultSet(rs, tanggalLulusColName);\r\n if(gelombang != null)\r\n rs.updateString(gelombangColName, gelombang.toString());\r\n if(totalIuran > 0)\r\n rs.updateFloat(totalIuranColName, totalIuran);\r\n if(statusPendaftaran != null)\r\n rs.updateString(statusPendaftaranColName, statusPendaftaran.toString());\r\n if(lastUpdateDate != null)\r\n lastUpdateDate.flushResultSet(rs, lastUpdateDateColName);\r\n return true;\r\n }", "public int actualizarCRN_update(SicaCRN crn) {\n if (conectado) {\n\n try {\n PreparedStatement p = Conexion.prepareStatement(\n \"INSERT INTO `crn`(`usuario`, `materia`, `crn`, `anio`, `ciclo`) \"\n + \"SELECT ?, ?, ?, YEAR(NOW()), CURRENT_CICLO() \"\n + \"FROM dual \"\n + \"WHERE NOT EXISTS (SELECT * FROM `crn` \"\n + \"WHERE `crn` = ? AND `usuario` = ? \"\n + \"AND `anio` = YEAR(NOW()) AND `ciclo` = CURRENT_CICLO()) LIMIT 1 ;\"\n );\n\n p.setInt(1, crn.getUsuario());\n p.setString(2, crn.getMateria());\n p.setInt(3, crn.getCrn());\n p.setInt(4, crn.getCrn());\n p.setInt(5, crn.getUsuario());\n\n Logy.m(\"Se insertara si no existe un CRN: \" + crn.getCrn());\n Logy.m(p.toString());\n\n PreparedStatement p2 = Conexion.prepareStatement(\n \"UPDATE `checador`.`crn` SET `usuario` = ?, `materia` = ?, \"\n + \"`crn` = ?, `anio` = YEAR(NOW()), `ciclo` = CURRENT_CICLO() \"\n + \"WHERE `crn` = ? AND `usuario` = ? AND `anio` = YEAR(NOW()) AND `ciclo` = CURRENT_CICLO() ;\"\n );\n\n p2.setInt(1, crn.getUsuario());\n p2.setString(2, crn.getMateria());\n p2.setInt(3, crn.getCrn());\n p2.setInt(4, crn.getCrn());\n p2.setInt(5, crn.getUsuario());\n\n Logy.m(\"Se hara update de crn: \" + crn.getCrn());\n Logy.m(p2.toString());\n\n int r = p.executeUpdate();\n int r2 = p2.executeUpdate();\n\n return r + r2;\n } catch (SQLException e) {\n Logy.me(\"\" + e.getLocalizedMessage() + \" \" + e.getMessage());\n Sincronizador.setOk(false);\n Sincronizador.setDetalles(Sincronizador.getDetalles() + \"error update CRNS en DB, \");\n return 0;\n }\n } else {\n Logy.me(\"Error!!! no ha establecido previamente una conexion a la DB\");\n return 0;\n }\n }", "private void updateNutritionRecord(Context ctx, ResultSet rs) throws SQLException, ParseException {\r\n Date timestamp = ctx.getTimestamp(\"date\", \"time\");\r\n String item = ctx.getParameter(\"item\");\r\n String source = ctx.getParameter(\"source\");\r\n String quantity = ctx.getParameter(\"quantity\");\r\n String abv = ctx.getParameter(\"abv\");\r\n \r\n if (rs.next()) {\r\n if (ctx.getAppDb().getProtocol().equalsIgnoreCase(\"sqlserver\")) {\r\n rs.moveToCurrentRow();\r\n rs.updateString(\"Quantity\", quantity);\r\n\r\n if (abv.length() != 0) rs.updateString(\"ABV\", abv);\r\n \r\n rs.updateRow(); \r\n } else {\r\n SQLUpdateBuilder sql = ctx.getUpdateBuilder(\"NutritionRecord\");\r\n \r\n sql.addField(\"Quantity\", quantity);\r\n \r\n if (abv.length() != 0) sql.addField(\"ABV\", abv);\r\n \r\n sql.addAnd(\"Timestamp\", \"=\", timestamp);\r\n sql.addAnd(\"Item\", \"=\", item);\r\n sql.addAnd(\"Source\", \"=\", source);\r\n executeUpdate(ctx, sql);\r\n }\r\n } else {\r\n rs.moveToInsertRow();\r\n rs.updateString(\"Timestamp\", ctx.getDbTimestamp(timestamp));\r\n rs.updateString(\"Item\", ctx.getParameter(\"item\"));\r\n rs.updateString(\"Source\", ctx.getParameter(\"source\"));\r\n rs.updateString(\"Quantity\", quantity);\r\n rs.updateString(\"IsComposite\", ctx.getParameter(\"simple\").equalsIgnoreCase(\"c\") ? \"Y\" : \"N\");\r\n\r\n if (abv.length() != 0) rs.updateString(\"ABV\", abv);\r\n \r\n rs.insertRow();\r\n }\r\n }", "@Override\r\n\tpublic boolean updatetdfy(Tuanbiao tuanbiao) throws Exception {\n\t\t String sql = \"update tuanbiao set kxsm=?,zhanghaoid=?,yfk=?,khmc=?,yushoutime=?,yingshou=?,huilvID=?,beizhu=? where id=?\";\r\n\t\t int rs=this.update(sql,tuanbiao.getKxsm(), tuanbiao.getZhanghaoid(),tuanbiao.getYfk(), tuanbiao.getKhmc(), tuanbiao.getYushoutime(),tuanbiao.getYingshou(), tuanbiao.getHuilvID(), tuanbiao.getBeizhu(),tuanbiao.getId());\r\n\t\t return rs>0;\r\n\t}", "@Test\n public void updateTest7() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCanoa(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isCanoa() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest3() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setRistorante(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isRistorante() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest1() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCabina(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isCabina() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest2() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBar(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isBar() ,\"Should return true if update Servizio\");\n }", "@Override\n\tpublic void update(StockDataRecord bo) throws SQLException {\n\t\t\n\t}", "@Override\n\tpublic int updateByPrimaryKey(Checkingin record) {\n\t\treturn 0;\n\t}", "@Test\n public void updateTest4() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setAnimazione(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isAnimazione() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest14() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBeach_volley(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isBeach_volley() ,\"Should return true if update Servizio\");\n }", "public boolean addOrUpdateInsurance(InsuranceModel insuranceDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_INSURANCE_OBJECT_ID, insuranceDetails.getInsuranceObjectId());\n values.put(KEY_INSURANCE_NAME, insuranceDetails.getInsuranceName());\n values.put(KEY_INSURANCE_IMAGE, insuranceDetails.getInsuranceImage());\n values.put(KEY_INSURANCE_ADDRESS, insuranceDetails.getInsuranceAddress());\n values.put(KEY_INSURANCE_SWIFT_CODE, insuranceDetails.getInsuranceSwiftCode());\n values.put(KEY_INSURANCE_STOCK_CODE, insuranceDetails.getInsuranceStockCode());\n values.put(KEY_INSURANCE_DESCRIPTION, insuranceDetails.getInsuranceDescription());\n values.put(KEY_INSURANCE_ESTABLISHED, insuranceDetails.getInsuranceEstablished());\n values.put(KEY_INSURANCE_CONTACTS, insuranceDetails.getInsuranceContacts());\n values.put(KEY_INSURANCE_TYPE, insuranceDetails.getInsuranceType());\n values.put(KEY_INSURANCE_WEBSITE, insuranceDetails.getInsuranceWebsite());\n values.put(KEY_INSURANCE_STATUS, insuranceDetails.getInsuranceStatus());\n values.put(KEY_INSURANCE_SUMMARY, insuranceDetails.getInsuranceSummary());\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_INSURANCE, values, KEY_INSURANCE_OBJECT_ID + \"= ?\", new String[]{insuranceDetails.getInsuranceObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved Insurance Agency, we could probably get the Insurance updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such Insurance Here, insert it\n db.insertOrThrow(TABLE_INSURANCE, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update Insurance table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }", "@Test\n public void updateTest9() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCabina(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isCabina() ,\"Should return true if update Servizio\");\n }", "@Override\r\n public boolean update(Pontuacao pontuacao) {\r\n Connection conexao = mysql.getConnection();\r\n try {\r\n PreparedStatement stm = conexao.prepareStatement(updateSQL);\r\n\r\n stm.setString(1, pontuacao.getData());\r\n stm.setInt(2, pontuacao.getP_rodada());\r\n stm.setInt(3, pontuacao.getS_rodada());\r\n stm.setInt(4, pontuacao.getT_rodada());\r\n stm.setInt(5, pontuacao.getTotal());\r\n stm.setInt(6, pontuacao.getIdcodigo());\r\n\r\n int registros = stm.executeUpdate();\r\n\r\n return registros > 0 ? true : false;\r\n\r\n } catch (final SQLException ex) {\r\n System.out.println(\"Falha de conexão com a base de dados!\");\r\n ex.printStackTrace();\r\n } catch (final Exception ex) {\r\n ex.printStackTrace();\r\n } finally {\r\n try {\r\n conexao.close();\r\n } catch (final Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n return false;\r\n }", "@Test\n public void updateTest8() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCanoa(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isCanoa() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest10() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBar(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isBar() ,\"Should return true if update Servizio\");\n }", "public boolean update(Object objekt) throws SQLException {\r\n\t\tPomagaloVO ul = (PomagaloVO) objekt;\r\n\r\n\t\tif (ul == null)\r\n\t\t\tthrow new SQLException(\"Update \" + tablica\r\n\t\t\t\t\t+ \", ulazna vrijednost je null!\");\r\n\r\n\t\t\r\n\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement ps = null;\r\n\r\n\t\ttry {\r\n\t\t\tconn = conBroker.getConnection();\r\n\r\n\t\t\tps = conn.prepareStatement(updateUpit);\r\n\r\n\t\t\tps.setString(1, ul.getNaziv());\r\n\t\t\tps.setInt(2, ul.getPoreznaSkupina().intValue());\r\n\r\n\t\t\t// 20.03.06. -asabo- dodano\r\n\t\t\tif (ul.getCijenaSPDVom() == null\r\n\t\t\t\t\t|| ul.getCijenaSPDVom().intValue() <= 0)\r\n\t\t\t\tps.setNull(3, Types.INTEGER);\r\n\t\t\telse\r\n\t\t\t\tps.setInt(3, ul.getCijenaSPDVom().intValue());\r\n\r\n\t\t\tString op = ul.getOptickoPomagalo() != null\r\n\t\t\t\t\t&& ul.getOptickoPomagalo().booleanValue() ? DA : NE;\r\n\r\n\t\t\tps.setString(4, op);\r\n\r\n\t\t\tps.setTimestamp(5, new Timestamp(System.currentTimeMillis()));\r\n\t\t\tps.setInt(6, 1);\r\n\t\t\t\r\n\t\t\tps.setString(7, ul.getSifraArtikla());\r\n\r\n\t\t\tint kom = ps.executeUpdate();\r\n\r\n\t\t\tboolean updated = kom == 1;\r\n\t\t\tif (!updated)\r\n\t\t\t\t{}\r\n\t\t\telse\r\n\t\t\t\tclearFromCache(ul.getSifraArtikla());\r\n\r\n\t\t\treturn updated;\r\n\t\t}\r\n\t\t// -asabo- NEMA CATCH-anja! - sve ide pozivatelju...\r\n\t\tfinally {\r\n\t\t\ttry {\r\n\t\t\t\tif (ps != null)\r\n\t\t\t\t\tps.close();\r\n\t\t\t} catch (SQLException e1) {\r\n\t\t\t}\r\n\t\t\tconBroker.freeConnection(conn);\r\n\t\t}// finally\r\n\t}", "int updateByPrimaryKeySelective(GoodsPo record);", "public void updateIscrizione() throws SQLException {\r\n\r\n\t\tPreparedStatement pstmt = null;\r\n\r\n\t\ttry {\r\n\t\t\tpstmt = con.prepareStatement(STATEMENT);\r\n\t\t\t\r\n\t\t\tArray sql = con.createArrayOf(\"boolean\", i.getDisponibilita());\r\n\t\t\t\r\n\t\t\tpstmt.setArray(1, sql);\r\n\t\t\tpstmt.setString(2, i.getGiocatore());\r\n\t\t\tpstmt.setInt(3, 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}", "public boolean updateBill(Bill bill){\n\t\tTraveller trav = bill.getItems().traveller();\n\t\twhile(trav.hasNext()){\n\t\t\tItem item = (Item) trav.next();\n\t\t\tString selectQuery = \"select qty from stock where item_name = ? and expire_date = ? and category = ?\"\n\t\t\t\t\t+ \" and price = ?;\";\n\t\t\ttry(PreparedStatement preStmt = connection.prepareStatement(selectQuery)){\n\t\t\t\tpreStmt.setString(1, item.getName());\n\t\t\t\tpreStmt.setDate(2, item.getExpireDate());\n\t\t\t\tpreStmt.setString(3, item.getCategory());\n\t\t\t\tpreStmt.setFloat(4, item.getPrice());\n\t\t\t\tResultSet result= preStmt.executeQuery(selectQuery);\n\t\t\t\tif(result.first()){\n\t\t\t\t\tint oldQty = result.getInt(1);\n\t\t\t\t\tItem itemClone = item.clone();\n\t\t\t\t\titemClone.setQuantity(oldQty - item.getQuantity());\n\t\t\t\t\tupdateDB(itemClone);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(\"No item found on stock\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}catch(SQLException exp){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Error in Stock table processing: \"+exp.getMessage());\n\t\t\t\texp.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void update() throws SQLException {\n int check = BusinessFacade.getInstance().checkIDinDB(this.productRelation.getID(),\n this.post.getID(), \"goods\", \"product_type_id\", \"post_id\");\n int safeCheck = BusinessFacade.getInstance().checkChildsIDinDB(this.goodID,\n this.order.getID(), \"orders\", \"goods_id\", \"orders_id\");\n\n if (check != -1 && safeCheck == -1) {\n if (check != this.goodID) {\n int oldGoodID = this.goodID;\n this.goodID = check;\n this.order.update();\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n\n stmtIn.executeUpdate(\"DELETE FROM ngaccount.goods WHERE goods.goods_id = \" +\n oldGoodID + \" LIMIT 1;\");\n }\n } else if (check != -1 && safeCheck != -1) {\n this.goodID = check;\n } else if (check == -1 && safeCheck == -1) {\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n stmtIn.executeUpdate(\"UPDATE ngaccount.goods SET product_type_id = \" +\n this.productRelation.getID() + \", post_id = \" + this.post.getID() +\n \" WHERE goods.goods_id = \" + this.goodID);\n } else {\n this.goodID = BusinessFacade.getInstance().lastIDInDB(\"product_type\") + 1;\n this.insert();\n }\n }", "public boolean insertarItem53(Mgestion_resul dts) {\n \n Item53 = \"update item set cumple=?, justifi=?, aplica=? where idItem=53\";\n Ver84 = \"update verificacion set cumplimiento=? where idverificacion=84\";\n \n \n try {\n\n PreparedStatement pst = cn.prepareStatement(Item53);\n PreparedStatement pst2 = cn.prepareStatement(Ver84);\n \n \n\n pst.setString(1, dts.getI531());\n pst.setString(2, dts.getJ531());\n pst.setString(3, dts.getA531());\n \n pst2.setString(1, dts.getV531());\n \n \n int n = pst.executeUpdate();\n\n if (n != 0) {\n int n2 = pst2.executeUpdate();\n\n if (n2 != 0) {\n return true; \n\n } else {\n return false;\n }\n\n } else {\n return false;\n }\n\n } catch (Exception e) {\n JOptionPane.showConfirmDialog(null, e);\n return false;\n }\n \n}", "int updateByPrimaryKey(Goods record);", "int updateByPrimaryKey(Goods record);", "int updateByPrimaryKey(GoodsPo record);", "@Test\n public void updateTest11() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setRistorante(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isRistorante() ,\"Should return true if update Servizio\");\n }", "public static boolean delete(String noInduk) throws SQLException, KasirException{\r\n return DBSR.deleteKasirO(tableName, noIndukColName, false, noInduk);\r\n }", "public boolean addOrUpdateInternationalBanks(InternationalBankModel internationalBankDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_INTERNATIONAL_BANK_OBJECT_ID, internationalBankDetails.getInternationalBankObjectId());\n values.put(KEY_INTERNATIONAL_BANK_NAME, internationalBankDetails.getInternationalBankName());\n values.put(KEY_INTERNATIONAL_BANK_IMAGE, internationalBankDetails.getInternationalBankImage());\n values.put(KEY_INTERNATIONAL_BANK_ADDRESS, internationalBankDetails.getInternationalBankAddress());\n values.put(KEY_INTERNATIONAL_BANK_SWIFT_CODE, internationalBankDetails.getInternationalBankSwiftCode());\n values.put(KEY_INTERNATIONAL_BANK_STOCK_CODE, internationalBankDetails.getInternationalBankStockCode());\n values.put(KEY_INTERNATIONAL_BANK_DESCRIPTION, internationalBankDetails.getInternationalBankDescription());\n values.put(KEY_INTERNATIONAL_BANK_ESTABLISHED, internationalBankDetails.getInternationalBankEstablished());\n values.put(KEY_INTERNATIONAL_BANK_CONTACTS, internationalBankDetails.getInternationalBankContacts());\n values.put(KEY_INTERNATIONAL_BANK_TYPE, internationalBankDetails.getInternationalBankType());\n values.put(KEY_INTERNATIONAL_BANK_WEBSITE, internationalBankDetails.getInternationalBankWebsite());\n values.put(KEY_INTERNATIONAL_BANK_STATUS, internationalBankDetails.getInternationalBankStatus());\n values.put(KEY_INTERNATIONAL_BANK_SUMMARY, internationalBankDetails.getInternationalBankSummary());\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_INTERNATIONAL_BANKS, values, KEY_INTERNATIONAL_BANK_OBJECT_ID + \"= ?\", new String[]{internationalBankDetails.getInternationalBankObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved bank, we could probably get the Bank updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such Bank Here, insert it\n db.insertOrThrow(TABLE_BANKS, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update International banks table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }", "int updateByPrimaryKey(Drug_OutWarehouse record);", "public boolean executeUpdateParklot(int updateLotNo, int updateIsBooked) {\r\n\t\tint updationSuccess = 0;\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t*\tCreate a connection temporarily\r\n\t\t\t*/\r\n\t\t\tnew DbConnection();\r\n\r\n\t\t\tpstmt = conn.prepareStatement(UPDATE_PARKLOT_QUERY);\r\n\t\t\tpstmt.setInt(1, updateIsBooked);\r\n\t\t\tpstmt.setInt(2, updateLotNo);\r\n\t\t\tupdationSuccess = pstmt.executeUpdate();\r\n\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\tthis.closeDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t\tif (updationSuccess > 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "int updateByPrimaryKeySelective(Goods record);", "int updateByPrimaryKeySelective(Goods record);", "@Test\n public void updateTest12() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setAnimazione(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isAnimazione() ,\"Should return true if update Servizio\");\n }", "public void updateDataBuku(){\n String sql = \"UPDATE buku SET judulBuku = '\"+getJudulBuku()+\"'\"\n + \",pengarang = '\"+getPengarang()+\"'\"\n + \",penerbit = '\"+getPenerbit()+\"'\"\n + \",tahun = '\"+getTahun()+\"'\"\n + \",stok = '\"+getStok()+\"' WHERE idBuku = '\"+getIdBuku()+\"'\";\n \n try {\n //inisialisasi preparedstatmen\n PreparedStatement eksekusi = koneksi. getKoneksi().prepareStatement(sql);\n eksekusi.execute();\n \n //pemberitahuan jika data berhasil di simpan\n JOptionPane.showMessageDialog(null,\"Data Berhasil Disimpan\");\n } catch (SQLException ex) {\n //Logger.getLogger(modelPelanggan.class.getName()).log(Level.SEVERE, null, ex);\n JOptionPane.showMessageDialog(null, \"Data Gagal Disimpan \\n\"+ex);\n }\n }", "int updateByPrimaryKey(Notifiction record);", "@Override\r\n\tpublic boolean updateSQL(BaseBean sql, Connection con) {\n\t\treturn update((CurrencyDefault) sql, con);\r\n\t}", "public boolean rowUpdated() throws SQLException {\n\n try {\n debugCodeCall(\"rowUpdated\");\n return false;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "int updateByPrimaryKey(Disproduct record);", "public boolean updateDB(String qryExp, RequestBox rBox) throws Exception {\n\t\tConnection conn = null;\n\t\tconn = DBConnect.getDBConnection(\"ERP_APPS\");\n\t\t\n\t\t\n PreparedStatement \tpstmt \t= null;\n PreparedStatement \tpstmt2 \t= null;\n PreparedStatement \tpstmt3 \t= null;\n \tboolean \t\t\trtn \t= false;\n \tint \t\t\t\tisOk = 0;\n \tint \t\t\t\tisOk2 = 0;\n \tStringBuffer\t\tquery = new StringBuffer();\n \tString query2 = \"\";\n \tString query3 = \"\";\n try \n {\n \t//ITEM Table 삭제 후 추가\n \tString itemCode = rBox.getString(\"p_itemcode\");\n \tString itemCatalog = rBox.getString(\"p_itemcatalog\");\n\t\t\tString s_itemCode[] = itemCode.split(\",\");\n \tquery.append(\"DELETE STX_TBC_ITEM \\n\");\n \tquery.append(\" WHERE 1 = 1 \\n\");\n \tif(!itemCode.equals(\"\")){\n\t\t\t\tquery.append(\" AND ITEM_CODE IN ( \");\n\t\t\t\tquery.append(\"select msi.segment1 \\n\");\n\t\t\t\tquery.append(\" from mtl_system_items_b@\"+ERP_DB+\" msi \\n\");\n\t\t\t\tquery.append(\" ,mtl_item_catalog_groups_b@\"+ERP_DB+\" micg \\n\");\n\t\t\t\tquery.append(\" ,mtl_item_categories@\"+ERP_DB+\" mic \\n\");\n\t\t\t\tquery.append(\" ,mtl_categories_b@\"+ERP_DB+\" mc \\n\");\n\t\t\t\tquery.append(\" ,stx_com_insa_user@\"+ERP_DB+\" sciu \\n\");\n\t\t\t\tquery.append(\" ,bom_inventory_components@\"+ERP_DB+\" bic \\n\");\n\t\t\t\tquery.append(\" ,bom_bill_of_materials@\"+ERP_DB+\" bbom \\n\");\n\t\t\t\tquery.append(\" ,mtl_system_items_b@\"+ERP_DB+\" msi_assy \\n\");\n\t\t\t\tquery.append(\" where msi.organization_id = msi_assy.organization_id \\n\");\n\t\t\t\tquery.append(\" and msi.item_catalog_group_id = micg.item_catalog_group_id \\n\");\n\t\t\t\tquery.append(\" and msi.organization_id = mic.organization_id \\n\");\n\t\t\t\tquery.append(\" and msi.inventory_item_id = mic.inventory_item_id \\n\");\n\t\t\t\tquery.append(\" and mic.category_set_id = 1 \\n\");\n\t\t\t\tquery.append(\" and mic.category_id = mc.category_id \\n\");\n\t\t\t\tquery.append(\" and msi.attribute2 = sciu.emp_no(+) \\n\");\n\t\t\t\tquery.append(\" and msi.inventory_item_id = bic.component_item_id \\n\");\n\t\t\t\tquery.append(\" and bic.bill_sequence_id = bbom.bill_sequence_id \\n\");\n\t\t\t\tquery.append(\" and bbom.organization_id = msi_assy.organization_id \\n\");\n\t\t\t\tquery.append(\" and bbom.assembly_item_id = msi_assy.inventory_item_id \\n\");\n\t\t\t\tquery.append(\" and msi_assy.organization_id = 82 \\n\");\n\t\t\t\tquery.append(\" and bic.IMPLEMENTATION_DATE is not null \\n\");\n\t\t\t\tquery.append(\" and bic.DISABLE_DATE is null \\n\");\n\t\t\t\tquery.append(\" and bbom.ALTERNATE_BOM_DESIGNATOR is null \\n\");\n\t\t\t\t\n\t\t\t\tquery.append(\" and ( \\n\");\n\t\t\t\t\tfor(int i=0; i < s_itemCode.length; i++ ){\n\t\t\t\t\t\tif(i != 0){\n\t\t\t\t\t\t\tquery.append(\" OR \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tquery.append(\" msi_assy.segment1 = '\"+s_itemCode[i].trim()+\"' \\n\");\n\t\t\t\t\t}\n\t\t\t\t\tquery.append(\" ) \\n\");\t\n\t\t\t\t\n\t\t\t\tfor(int i=0; i < s_itemCode.length; i++ ){\n\t\t\t\t\tquery.append(\"UNION ALL SELECT '\"+s_itemCode[i].trim()+\"' FROM DUAL \\n\");\n\t\t\t\t}\n\t\t\t\tquery.append(\") \\n\");\n \t}\n \t\n\t\t\tif(!itemCatalog.equals(\"\")){\n\t\t\t\tquery.append(\" and item_catalog = '\"+itemCatalog+\"' \\n\");\n\t\t\t}\n\t\t\t\n \t\n \tSystem.out.println(query);\n \t//삭제 실행\n \tpstmt = conn.prepareStatement(query.toString());\n \tisOk = pstmt.executeUpdate();\n \tSystem.out.println(\"삭제 성공\" + isOk);\n \t\n \t//추가 실행.\n \tquery2 = getQuery(qryExp,rBox);\n \tpstmt2 = conn.prepareStatement(query2.toString());\n \tisOk = pstmt2.executeUpdate();\n \tSystem.out.println(\"추가 성공\" + isOk);\n \t\n \t//RAW ITEM 추가 실행.\n \tquery3 = getQuery(\"rawItemInterface\",rBox);\n \tpstmt3 = conn.prepareStatement(query3.toString());\n \tisOk2 = pstmt3.executeUpdate();\n \tSystem.out.println(\"isOk2 : \" + isOk2); \t\n \t\n \t\n \tif(isOk2 > 0){\n\t \tif(!itemCode.equals(\"\")){\n\t\t\t\t\tfor(int i=0; i < s_itemCode.length; i++ ){\n\t\t\t \tCallableStatement cs = conn.prepareCall(\"{call stx_tbc_material_insert@\"+PLM_DB+\"(?,?,?)}\"); \n\t\t \t cs.setString(1,s_itemCode[i].trim()); \n\t\t \t cs.registerOutParameter(2, java.sql.Types.VARCHAR); \n\t\t \t cs.registerOutParameter(3, java.sql.Types.VARCHAR); \n\t\t \t cs.execute();\n\t\t\t\t\t}\n\t \t}\n \t}\n \t\n \t\n \tif(isOk > 0){\n \t\tconn.commit();\n \t\trBox.put(\"successMsg\", \"Success\");\n \t\trtn = true;\n \t}else{\n \t\tconn.rollback();\n \t\trBox.put(\"errorMsg\", \"Fail\");\n \t\trtn = false;\n \t}\n \t\n }\n catch ( Exception ex ) \n { \n \tconn.rollback();\n \tex.printStackTrace();\n \trBox.put(\"errorMsg\", \"Fail\");\n }\n finally \n { \n if ( conn != null ) { try { conn.close(); } catch ( Exception e ) { } }\n if ( pstmt != null ) { try { pstmt.close(); } catch ( Exception e ) { } }\n if ( pstmt2 != null ) { try { pstmt2.close(); } catch ( Exception e ) { } }\n if ( pstmt3 != null ) { try { pstmt3.close(); } catch ( Exception e ) { } }\n } \n\t\treturn rtn;\n\t}", "private boolean moverInvBodReservado(java.sql.Connection conExt,int intCodEmp,int intCodLoc,int intCodCot){\n boolean blnRes=false, blnIns=true;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n double dblCanDis=0.00, dblCanSolRes=0.00;\n String strIns=\"\";\n try{\n if(conExt!=null){\n stmLoc = conExt.createStatement();\n strSql=\"\";\n strSql+=\" SELECT a1.co_emp,a1.co_loc,a1.co_cot,a1.co_reg,a1.nd_canAut, a2.co_emp as co_empInvBod,a2.co_bod as co_bodInvBod,a2.co_itm,a2.nd_stkAct, \\n\";\n strSql+=\" CASE WHEN a2.nd_canDis IS NULL THEN 0 ELSE a2.nd_canDis END as nd_canDis \\n\";\n strSql+=\" FROM tbm_pedOtrBodCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_invBod as a2 ON (a1.co_empRel=a2.co_emp AND a1.co_bodRel=a2.co_bod AND a1.co_itmRel=a2.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+intCodEmp+\" AND a1.co_loc=\"+intCodLoc+\" AND a1.co_cot=\"+intCodCot+\" \\n\";\n System.out.println(\"moverInvBodReservado: \\n\" + strSql);\n rstLoc = stmLoc.executeQuery(strSql);\n while(rstLoc.next()){\n dblCanDis = rstLoc.getDouble(\"nd_canDis\");\n dblCanSolRes = rstLoc.getDouble(\"nd_canAut\");\n if(dblCanSolRes<=dblCanDis){\n strSql=\"\";\n strSql+=\" UPDATE tbm_invBod SET nd_canDis=(nd_canDis-\"+dblCanSolRes+\"), nd_canRes=((CASE WHEN nd_canRes IS NULL THEN 0 ELSE nd_canRes END) + \" + dblCanSolRes+\") \";\n strSql+=\" WHERE co_emp=\"+rstLoc.getInt(\"co_empInvBod\")+\" AND co_bod=\"+rstLoc.getInt(\"co_bodInvBod\");\n strSql+=\" AND co_itm=\"+rstLoc.getInt(\"co_itm\")+\";\\n\";\n strIns+=strSql;\n }else{\n blnIns=false;\n System.out.println(\"NO DISPONIBLE \" + rstLoc.getInt(\"co_itm\"));\n //return false; CONTENEDOR PARA MOSTRAR ITEMS DE PROBLEMAS\n }\n }\n rstLoc.close();\n rstLoc=null;\n \n if(blnIns){\n System.out.println(\"moverInvBodReservado: \" + strIns);\n stmLoc.executeUpdate(strIns);\n blnRes=true;\n }\n else{\n blnRes=false;\n }\n stmLoc.close();\n stmLoc=null;\n\t\n \n }\n }\n catch (java.sql.SQLException e) { \n objUti.mostrarMsgErr_F1(this, e); \n }\n catch(Exception Evt){ \n objUti.mostrarMsgErr_F1(this, Evt);\n } \n return blnRes;\n }", "@Override\n\tpublic boolean update(Goods goods) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean updateBook(long ISBN, int price) {\n\t\tif (searchBook(ISBN).getISBN() == ISBN) {\r\n\t\t\ttransactionTemplate.setReadOnly(false);\r\n\t\treturn transactionTemplate.execute(new TransactionCallback<Boolean>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic Boolean doInTransaction(TransactionStatus status) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttry {\r\n\t\t\t\r\n\t\t\t\t\t\tint rows = bookDAO.updateBook(ISBN, price);\r\n\t\t\t\t\t\tif (rows > 0)\r\n\t\t\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t} catch (Exception exception) {\r\n\t\t\t\t\tstatus.setRollbackOnly();\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "int updateByPrimaryKeySelective(UserPonumberGoods record);", "public void rubahDataProduk(){\n loadDataProduk();\n \n //uji koneksi dan eksekusi perintah\n try{\n //test koneksi\n Statement stat = (Statement) koneksi.getKoneksi().createStatement();\n \n //perintah sql untuk simpan data\n String sql = \"UPDATE barang SET nama_barang = '\"+ nama_barang +\"',\"\n + \"merk_barang = '\"+ merk_barang +\"',\"\n + \"jumlah_stok = '\"+ jumlah_stok +\"',\"\n + \"harga = '\"+ harga +\"'\" \n + \"WHERE kode_barang = '\" + kode_barang +\"'\";\n PreparedStatement p = (PreparedStatement) koneksi.getKoneksi().prepareStatement(sql);\n p.executeUpdate();\n \n //ambil data\n getDataProduk();\n }catch(SQLException err){\n JOptionPane.showMessageDialog(null, err.getMessage());\n }\n }", "int updateByPrimaryKey(BnesBrowsingHis record) throws SQLException;", "public static Boolean updateData(String query){\n int affectedRow = 0;\n connect();\n try{\n Statement stm = conn.createStatement();\n affectedRow = stm.executeUpdate(query);\n }catch(Exception e) {\n System.out.println(e.getMessage());\n }\n disconnect();\n if(affectedRow == 0)\n return false;\n else\n return true;\n }", "private void updISTRN() \n\t{\n\t\ttry\n\t\t{\n\t\t\tM_strSQLQRY = \"Update FG_ISTRN set \";\n\t\t\tM_strSQLQRY += \"IST_STSFL = '1',\";\n\t\t\tM_strSQLQRY += \"IST_TRNFL = '0',\";\n\t\t\tM_strSQLQRY += \"IST_LUSBY = '\"+cl_dat.M_strUSRCD_pbst+\"',\";\n\t\t\tM_strSQLQRY += \"IST_LUPDT = '\"+M_fmtDBDAT.format(M_fmtLCDAT.parse(cl_dat.M_strLOGDT_pbst ))+\"'\";\n\t\t\tM_strSQLQRY += \" where ist_CMPCD = '\"+cl_dat.M_strCMPCD_pbst+\"' and ist_wrhtp = '\"+strWRHTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_isstp = '\"+strISSTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_issno = '\"+txtISSNO.getText().toString() .trim() +\"'\";\n\t\t\tM_strSQLQRY += \" and ist_prdcd = '\"+strPRDCD+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_prdtp = '\"+strPRDTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_lotno = '\"+strLOTNO+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_rclno = '\"+strRCLNO+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_pkgtp = '\"+strPKGTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_mnlcd = '\"+strMNLCD+\"'\";\n\t\t\t\n\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY,\"setLCLUPD\");\n\t\t\t//System.out.println(\"update fgistrn table :\"+M_strSQLQRY);\n\t\t\t\n\t\t}catch(Exception L_EX)\n\t\t{\n\t\t\tsetMSG(L_EX,\"updISTRN\");\n\t\t}\n\t}", "public Boolean updateData(String codProduc, String nombreProduc, String precioProduc){\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"codProduc\", codProduc);\n contentValues.put(\"nombreProduc\", nombreProduc);\n contentValues.put(\"precioProduc\", precioProduc);\n\n //Verificamos el registro usando el codigo de actualizar\n Cursor cursor = db.rawQuery(\"SELECT * FROM tienda WHERE codProduc=?\", new String[]{codProduc});\n\n //Evaluamos el registro para verificar si existe\n if(cursor.getCount()>0){\n long result = db.update(\"tienda\", contentValues, \"codProduc=?\", new String[]{codProduc});\n if(result==-1){\n return false;\n }else{\n return true;\n }\n }else{\n return false;\n }\n\n }", "int updateByPrimaryKey(UserPonumberGoods record);", "int updateByPrimaryKey(ItemStockDO record);", "int updateByPrimaryKey(ItemStockDO record);", "@Test\r\n public void testUpdate() throws Exception {\r\n System.out.println(\"update\");\r\n Bureau obj = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n BureauDAO instance = new BureauDAO();\r\n instance.setConnection(dbConnect);\r\n obj = instance.create(obj);\r\n obj.setSigle(\"Test2\");\r\n //etc\r\n obj.setTel(\"000000001\");\r\n //etc\r\n Bureau expResult=obj;\r\n Bureau result = instance.update(obj);\r\n assertEquals(expResult.getSigle(), result.getSigle());\r\n //etc\r\n assertEquals(expResult.getTel(), result.getTel());\r\n //etc\r\n instance.delete(obj);\r\n //TODO verifier que si met à jour vers un doublé sigle-tel déjà existant, on a une exception\r\n }", "@Override\n\tpublic int update(Object obj) throws SQLException {\n\t\treturn 0;\n\t}", "@Override\n\tpublic boolean updateStock(int quant) {\n\t\treturn false;\n\t}", "@Test\n public void updateTest5() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setWifi(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isWifi() ,\"Should return true if update Servizio\");\n }", "int updateByPrimaryKeySelective(ItemStockDO record);", "public boolean updateDB(String qryExp, RequestBox rBox) throws Exception {\n\t\treturn false;\n\t}", "int updateByPrimaryKeySelective(DashboardGoods record);", "int updateByPrimaryKeySelective(Drug_OutWarehouse record);", "@Override\r\n\tpublic int update(Trolley trolley) {\n\t\tint rows = -1;\r\n\t\tString updSql = \"UPDATE trolley SET buy_num = '\" + trolley.getBuyNum() + \"' WHERE id= '\" + trolley.getId()\r\n\t\t\t\t+ \"'\";\r\n\t\trows = conn.executeUpdate(updSql);\r\n\t\tconn.close();\r\n\t\treturn rows;\r\n\t}", "int updateByPrimaryKeySelective(NeeqCompanyAccountingFirmOnline record);", "private boolean update() {\r\n\t\ttry {\r\n\t\t\tif (_session != null) {\r\n\t\t\t\tlong usrid = _session.getUsrID();\r\n\t\t\t\tJSONObject result = new JSONObject();\r\n\t\t\t\tresult.put(\"usrid\", usrid);\r\n\t\t\t\taddData(result);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tsetError(e);\r\n\t\t}\r\n\t\tsetError(Transaction.NO_SESSION_ERROR);\r\n\t\treturn false;\r\n\t}", "private boolean cambiarEstadoCotizacionDenegada(java.sql.Connection conExt,int intCodEmp,int intCodLoc,int intCodCot){\n boolean blnRes=false;\n java.sql.Statement stmLoc;\n try{\n if(conExt!=null){\n stmLoc = conExt.createStatement();\n strSql=\"\";\n strSql+=\" UPDATE tbm_cabCotVen SET st_autSolResInv='D',st_solResInv='C',co_usrIngAutSolResInv=\"+objParSis.getCodigoUsuario()+\",fe_autSolResInv=CURRENT_TIMESTAMP, \\n\";\n strSql+=\" tx_comIngAutSolResInv=\"+objUti.codificar(objParSis.getNombreComputadoraConDirIP(), 0)+\" \\n\";\n strSql+=\" WHERE co_emp=\"+intCodEmp+\" AND co_loc=\"+intCodLoc+\" AND co_cot=\"+intCodCot+\"; \";\n stmLoc.executeUpdate(strSql);\n stmLoc.close();\n stmLoc=null;\n blnRes=true;\n }\n }\n catch (java.sql.SQLException e) { \n objUti.mostrarMsgErr_F1(this, e); \n }\n catch(Exception Evt){ \n objUti.mostrarMsgErr_F1(this, Evt);\n } \n return blnRes;\n }", "int updateByPrimaryKey(Nutrition record);", "@Override\r\n\tpublic void update() throws SQLException {\n\r\n\t}", "private void updIVTRN()\n\t{ \n\t\ttry{\n\t\t\tM_strSQLQRY = \"Update mr_ivtrn set\";\n\t\t\tM_strSQLQRY += \" IVT_LADQT = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_LODDT = null,\";\n\t\t\tM_strSQLQRY += \" IVT_INVQT = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_INVPK = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_STSFL = 'A',\";\n\t\t\tM_strSQLQRY += \" IVT_LUSBY = '\"+cl_dat.M_strUSRCD_pbst+\"',\";\n\t\t\tM_strSQLQRY += \" IVT_LUPDT = '\"+M_fmtDBDAT.format(M_fmtLCDAT.parse(cl_dat.M_strLOGDT_pbst))+\"'\";\n\t\t\tM_strSQLQRY += \" where IVT_CMPCD = '\"+cl_dat.M_strCMPCD_pbst+\"' and IVT_MKTTP = '\"+txtTRNTP.getText() .toString() .trim()+\"'\";\n\t\t\tM_strSQLQRY += \" and IVT_LADNO = '\"+txtISSNO.getText().toString().trim() +\"'\";\n\t\t\t\n\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY,\"setLCLUPD\");\n\t\t\t//System.out.println(\"update Ivtrn table :\"+M_strSQLQRY);\n\t\t\t\n\t\t}catch(Exception L_EX){\n\t\t\tsetMSG(L_EX,\"updIVTRN\");\n\t\t}\n\t}", "private void exeDELLIC(int P_intROWNO) \n\t\t{ \n\t\t\ttry\n\t\t\t{\n\t\t\t M_strSQLQRY = \"UPDATE SA_SWTRN SET\";\t\n\t\t\t\tM_strSQLQRY +=\" SWT_STSFL='X'\";\t\n\t\t\t\tM_strSQLQRY +=\" where SWT_SFTCD='\"+txtSFTCD.getText()+\"'\";\n\t\t\t\tM_strSQLQRY +=\" AND SWT_SRLNO='\"+txtSRLNO.getText().toString()+\"'\";\n\t\t\t\t//M_strSQLQRY += \" AND SWT_SYSTP = '\"+tblLICDL.getValueAt(P_intROWNO,TB1_SYSTP).toString().trim()+\"' \";\n\t\t\t\tM_strSQLQRY += \" AND SWT_SFTCT = '\"+hstSFTCT.get(cmbSFTCT.getSelectedItem().toString())+\"'\";\n\t\t\t\tM_strSQLQRY += \" AND SWT_LICNO='\"+tblLICDL.getValueAt(P_intROWNO,TB1_LICNO).toString()+\"'\";\n\t\t\t\tM_strSQLQRY += \" AND SWT_LICTP='\"+hstLICTP.get(cmbLICTP.getSelectedItem().toString())+\"'\";\n\t\t\t\tcl_dat.M_flgLCUPD_pbst = true;\n\t\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY ,\"setLCLUPD\");\n\t\t\t\t//System.out.println(\">>>Delete2>>\"+M_strSQLQRY);\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception L_EX)\n\t\t\t{\n\t\t setMSG(L_EX,\"exeDELLIC()\");\t\t\n\t\t\t}\n\t\t}", "public void updateCantByName(int nr, String nume) {\n\t\tConnection connection = null;\n\t\tPreparedStatement st = null;\n\t\tString query = updateQuery(\"cantitate\", \"nume\");\n\t\ttry {\n\t\t\tconnection = ConnectionFactory.createCon();\n\t\t\tst = connection.prepareStatement(query);\n\t\t\tst.setInt(1, nr);\n\t\t\tst.setString(2, nume);\n\t\t\tst.executeUpdate();\n\t\t}catch(SQLException e) {\n\t\t\tLOGGER.fine(type.getName() + \"DAO:deleteByName\" + e.getMessage());\n\t\t}\n\t}", "int updateByPrimaryKey(NeeqCompanyAccountingFirmOnline record);", "int updateByPrimaryKeySelective(BnesBrowsingHis record) throws SQLException;", "int updateByPrimaryKey(DashboardGoods record);", "private void jbtnModifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnModifActionPerformed\n if(isNumeric() == true){ \n String sReq = \"from Offre Where Off_Etablissement = '\"+sEtablissementId+\"' And Off_TypeChambre = '\"+sChambresId+\"'\";\n Query q = jfPrincipal.getSession().createQuery(sReq);\n Offre unOffre = (Offre) q.uniqueResult();\n unOffre.setOffNbchambres(Byte.parseByte(jtxtModif.getText()));\n Transaction tx = jfPrincipal.getSession().beginTransaction();\n tx.commit();\n jfPrincipal.getSession().update (unOffre);\n chargeTable(sEtablissementId);\n }\n else{\n JOptionPane.showMessageDialog(null, \"La valeur saisie pour la quantité doit être un chiffre\");\n }\n }", "int updateByPrimaryKeySelective(Notifiction record);", "@Test\n public void updateTest13() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setWifi(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true , servizio.isWifi() ,\"Should return true if update Servizio\");\n }", "public boolean updateData(DataPegawai updatedatapegawai) {\n\t\tBoolean booleans = false;\n\t\t\n\t\tDataPegawai datapegawai = new DataPegawai();\n\t\tdatapegawai.setTanggal_masuk(new Date());\n\t\tSimpleDateFormat date = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\t\tString dates = date.format(datapegawai.getTanggal_masuk());\n\t\t\n\n\t\ttry {\n\t\t\t// Mengisi Query\n\t\t\tString query = \"UPDATE `Karyawan` SET `Nama`=?, `Golongan`=?, `Gaji_Perbulan`=?, `Tanggal_Masuk`=? WHERE `ID`=?\";\n\t\t\t// prepare Statment\n\t\t\tPreparedStatement preparedstatement = (PreparedStatement) conn.prepareStatement(query);\n\t\t\tpreparedstatement.setString(1, updatedatapegawai.getNama());\n\t\t\tpreparedstatement.setString(2, updatedatapegawai.getGolongan());\n\t\t\tpreparedstatement.setInt(3, updatedatapegawai.getGaji_perbulan());\n\t\t\tpreparedstatement.setString(4, dates);\n\t\t\tpreparedstatement.setInt(5, updatedatapegawai.getId());\n\n\t\t\t// eksekusi prepare statment\n\t\t\tpreparedstatement.execute();\n\t\t\tbooleans = true;\n\t\t\t// preparedstatement.close();\n\t\t\tconn.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.print(\"Ada yang salah Dalam Fungsi Mengupdate Data\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn booleans;\n\t}", "private void updrec() {\n\t\tsavedata();\n\t\tcontractDetail.retrieve(stateVariable.getXwordn(), stateVariable.getXwabcd());\n\t\tnmfkpinds.setPgmInd36(! lastIO.isFound());\n\t\tnmfkpinds.setPgmInd66(isLastError());\n\t\t// BR00011 Product found on Contract_Detail and NOT ERROR(CONDET)\n\t\tif (! nmfkpinds.pgmInd36() && ! nmfkpinds.pgmInd66()) {\n\t\t\trestoredata();\n\t\t\tcontractDetail.update();\n\t\t\tnmfkpinds.setPgmInd99(isLastError());\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"Y2U0007\", \"\", msgObjIdx, messages);\n\t\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t}\n\t}", "int updateByPrimaryKey(Kaiwa record);", "int updateByPrimaryKey(CTipoComprobante record) throws SQLException;", "int updateByPrimaryKeySelective(Nutrition record);", "Integer update(final String sql);", "@Update({\n \"update SALEORDERDETAIL\",\n \"set MID = #{mid,jdbcType=VARCHAR},\",\n \"MNAME = #{mname,jdbcType=VARCHAR},\",\n \"STANDARD = #{standard,jdbcType=VARCHAR},\",\n \"UNITID = #{unitid,jdbcType=VARCHAR},\",\n \"UNITNAME = #{unitname,jdbcType=VARCHAR},\",\n \"NUM = #{num,jdbcType=DECIMAL},\",\n \"BEFOREDISCOUNT = #{beforediscount,jdbcType=DECIMAL},\",\n \"DISCOUNT = #{discount,jdbcType=DECIMAL},\",\n \"PRICE = #{price,jdbcType=DECIMAL},\",\n \"TOTALPRICE = #{totalprice,jdbcType=DECIMAL},\",\n \"TAXRATE = #{taxrate,jdbcType=DECIMAL},\",\n \"TOTALTAX = #{totaltax,jdbcType=DECIMAL},\",\n \"TOTALMONEY = #{totalmoney,jdbcType=DECIMAL},\",\n \"BEFOREOUT = #{beforeout,jdbcType=DECIMAL},\",\n \"ESTIMATEDATE = #{estimatedate,jdbcType=TIMESTAMP},\",\n \"LEFTNUM = #{leftnum,jdbcType=DECIMAL},\",\n \"ISGIFT = #{isgift,jdbcType=DECIMAL},\",\n \"FROMBILLTYPE = #{frombilltype,jdbcType=DECIMAL},\",\n \"FROMBILLID = #{frombillid,jdbcType=VARCHAR}\",\n \"where SOID = #{soid,jdbcType=VARCHAR}\",\n \"and LINENO = #{lineno,jdbcType=DECIMAL}\"\n })\n int updateByPrimaryKey(Saleorderdetail record);", "@Override\n public boolean updateSharingProduct(SharingProduct sharingProduct) {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n ResultSet result = null;\n \n try {\n connection = MySQLDAOFactory.createConnection();\n preparedStatement = connection.prepareStatement(Update_Query);\n preparedStatement.setString(1, sharingProduct.getEmail());\n preparedStatement.setInt(2, sharingProduct.getPID());\n preparedStatement.execute();\n \n return true;\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n try {\n result.close();\n } catch (Exception rse) {\n rse.printStackTrace();\n }\n try {\n preparedStatement.close();\n } catch (Exception sse) {\n sse.printStackTrace();\n }\n try {\n connection.close();\n } catch (Exception cse) {\n cse.printStackTrace();\n }\n }\n \n return false;\n }", "int executeUpdate() throws SQLException;", "int updateByPrimaryKey(Prueba record);", "int updateByPrimaryKey(ParkCurrent record);", "public int actualizarHorariosCRN_update(SicaHorarioCRN h) {\n if (conectado) {\n\n try {\n PreparedStatement p = Conexion.prepareStatement(\n \"INSERT INTO `horarioscrn`(`crn`, `bloque`, `dia`, `hora`, `duracion`, `aula`, `anio`, `ciclo`) \"\n + \"SELECT ?, ?, ?, ?, ?, ?, YEAR(NOW()), CURRENT_CICLO() \"\n + \"FROM dual \"\n + \"WHERE NOT EXISTS (SELECT * FROM `horarioscrn` \"\n + \"WHERE `crn` = ? AND `bloque` = ? \"\n + \"AND `dia` = ? AND `hora` = ? \"\n + \"AND `anio` = YEAR(NOW()) AND `ciclo` = CURRENT_CICLO() ) LIMIT 1 ;\"\n );\n\n p.setInt(1, h.getCrn());\n p.setInt(2, 0);\n p.setString(3, h.getDia());\n p.setString(4, h.getHora());\n p.setString(5, h.getDuracion());\n p.setString(6, h.getAula());\n p.setInt(7, h.getCrn());\n p.setInt(8, 0);\n p.setString(9, h.getDia());\n p.setString(10, h.getHora());\n\n Logy.m(\"Se insertara si no existe un horarioCRN: \" + h.getCrn());\n Logy.m(p.toString());\n\n PreparedStatement p2 = Conexion.prepareStatement(\n \"UPDATE `checador`.`horarioscrn` \"\n + \"SET `crn` = ?, `bloque` = ?, `dia` = ?, \"\n + \"`hora` = ?, `duracion` = ?, \"\n + \"`aula` = ?, `anio` = YEAR(NOW()), `ciclo` = CURRENT_CICLO() \"\n + \"WHERE `horarioscrn`.`crn` = ? AND `horarioscrn`.`bloque` = ? \"\n + \"AND `horarioscrn`.`dia` = ? AND `horarioscrn`.`hora` = ? \"\n + \"AND `horarioscrn`.`anio` = YEAR(NOW()) AND `horarioscrn`.`ciclo` = CURRENT_CICLO();\"\n );\n\n p2.setInt(1, h.getCrn());\n p2.setInt(2, 0);\n p2.setString(3, h.getDia());\n p2.setString(4, h.getHora());\n p2.setString(5, h.getDuracion());\n p2.setString(6, h.getAula());\n\n p2.setInt(7, h.getCrn());\n p2.setInt(8, 0);\n p2.setString(9, h.getDia());\n p2.setString(10, h.getHora());\n\n Logy.m(\"Se hara update de horarioCRN: \" + h.getCrn());\n Logy.m(p2.toString());\n\n int r = p.executeUpdate();\n int r2 = p2.executeUpdate();\n\n return r + r2;\n } catch (SQLException e) {\n Logy.me(\"\" + e.getLocalizedMessage() + \" \" + e.getMessage());\n Sincronizador.setOk(false);\n Sincronizador.setDetalles(Sincronizador.getDetalles() + \"error update HorarioCRNs en DB, \");\n return 0;\n }\n } else {\n Logy.me(\"Error!!! no ha establecido previamente una conexion a la DB\");\n return 0;\n }\n }", "int updateByPrimaryKeySelective(SwmsStockOutRecordDetail record);", "public UpdateIscrizioneDatabase(final Connection con, final Iscrizione i) {\r\n\t\tthis.con = con;\r\n\t\tthis.i = i;\r\n\t}", "public void updateInsurance(Insurance insurance) throws DataAccessException;", "public int updateByPK(Ware record){\n \tif(record==null||record.getWareid()==null)\n \t\treturn 0;\n\t\tint rows = super.update(\"Ware.updateByPK\", record);\n\t\t// flush cache\n\t\tCacheSynchronizer.getInstance().pubFlush(\"netTest.questionCache\", Ware.ObjectType, record.getWareid().toString());\n\t\t\t\t\n\t\treturn rows;\n }" ]
[ "0.84479547", "0.654515", "0.6057254", "0.5992945", "0.5939492", "0.5888489", "0.5878575", "0.587452", "0.58633035", "0.5856519", "0.58435005", "0.5793002", "0.57831043", "0.5743955", "0.5736017", "0.5730052", "0.5717002", "0.5713965", "0.5707193", "0.5680578", "0.56739414", "0.5637172", "0.56267846", "0.56237376", "0.562316", "0.56224287", "0.5612425", "0.5596639", "0.5594917", "0.5594486", "0.559305", "0.55915284", "0.5577637", "0.5577637", "0.55745023", "0.55685914", "0.5563499", "0.5560314", "0.5547927", "0.5545934", "0.55457217", "0.55457217", "0.55217826", "0.5517613", "0.5502224", "0.54959565", "0.5473182", "0.54650456", "0.54605776", "0.54481107", "0.5438354", "0.54332227", "0.54256135", "0.54182225", "0.5416608", "0.5416087", "0.5415029", "0.5409695", "0.54037917", "0.5399681", "0.5399681", "0.53992826", "0.5399109", "0.53771687", "0.53744715", "0.53738284", "0.53737634", "0.5369115", "0.5367626", "0.5361208", "0.53497016", "0.5348109", "0.5342265", "0.5341689", "0.53347343", "0.53340936", "0.53249574", "0.53196895", "0.5315514", "0.53150964", "0.53134304", "0.5310666", "0.5304222", "0.5302607", "0.5295673", "0.5287082", "0.5287065", "0.5276054", "0.52689004", "0.52676916", "0.52639294", "0.52593297", "0.52578753", "0.52570105", "0.5255869", "0.5255798", "0.5255501", "0.5251066", "0.52492666", "0.5244543" ]
0.8094003
1
ret empty if all vars are empty
public String asWhereClause() { LinkedList<String> whereClause = new LinkedList<>(); if (noInduk != null && !noInduk.isEmpty()) whereClause.add(noIndukColName + " LIKE '%" + noInduk + "%'"); if (currentLevel != null) whereClause.add(currentLevelColName + " LIKE '%" + currentLevel.asWhereClause() + "%'"); if (biodata != null){ String wc = biodata.asWhereClause(); if(wc != null && !wc.isEmpty()) whereClause.add(wc); } if (tanggalMasuk != null) whereClause.add(tanggalMasukColName + " LIKE '%" + tanggalMasuk.asWhereClause(true) + "%'"); if (tanggalLulus != null) whereClause.add(tanggalLulusColName + " LIKE '%" + tanggalLulus.asWhereClause(true) + "%'"); if (gelombang != null) whereClause.add(gelombangColName + " = '" + gelombang + "'"); if (statusPendaftaran != null) whereClause.add(statusPendaftaranColName + " = '" + statusPendaftaran + "'"); if (lastUpdateDate != null) whereClause.add(lastUpdateDateColName + " LIKE '%" + lastUpdateDate.asWhereClause(true) + "%'"); return whereClause.isEmpty()? "" : StringUtils.join(whereClause, " AND "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public StringSet freeVars() {\n\treturn argument.freeVars();\n }", "private boolean isParamsEmpty(String... params){\n for (String param : params) {\n if (param.isEmpty())\n return true;\n }\n return false;\n }", "private boolean isEmpty()\n {\n return dimensions.isEmpty();\n }", "AstroArg empty();", "void reset(){\n if (vars!=null){\n vars.clear();\n }\n if (gVars!=null){\n gVars.clear();\n }\n }", "public boolean isEmpty()\n\t{\n\t\tverifyParseState();\n\t\treturn values.isEmpty();\n\t}", "default Boolean isEmpty(){\n return builder().length() == 0;\n }", "public Vector freeVars() {\r\n\t\tVector v = new Vector(2, 2);\r\n\t\tVector temp = ((SimpleNode) jjtGetChild(0)).freeVars();\r\n\t\ttemp.remove(\"\");\r\n\t\tVector temp2 = ((SimpleNode) jjtGetChild(1)).freeVars();\r\n\t\ttemp2.remove(\"\");\r\n\t\tfor (Object obj : temp2) {\r\n\t\t\tif (!temp.contains(obj)) {\r\n\t\t\t\tv.add(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn v;\r\n\t}", "public boolean isEmpty()\n {\n return ( name == null ) && ( data == null ) && ( notes == null );\n }", "@Override\n public List<String> getVariables()\n {\n return null;\n }", "public void test0() {\n\t\tempty(m1);\n\t\tempty(m2);\n\t\tempty(m3);\n\t\tempty(m4);\n\t}", "private static final Object ifEmpty(Object[] objArr, AbstractC32521a aVar) {\n return objArr.length == 0 ? aVar.invoke() : objArr;\n }", "public boolean my_is_empty();", "public boolean isEmpty() {\n\t\treturn (op == null && dval == null);\n\t}", "boolean isEmpty() {\n return mapped_vms.isEmpty();\n }", "public boolean isEmptyHuh() {\n return true; \n }", "public boolean is_empty() {\n\t\treturn false;\n\t}", "public boolean empty() {\n \treturn s1.empty();\n }", "public boolean isEmpty() { return true; }", "protected boolean checkEmptyList(){\n boolean emptyArray = true;\n String empty= alertList.get(AppCSTR.FIRST_ELEMENT).get(AppCSTR.NAME);\n if(!empty.equals(\"null\") && !empty.equals(\"\")) {\n emptyArray = false;\n }\n return emptyArray;\n }", "private void checkForEmptyFields() throws EmptyTextFieldException {\n\n if (date == null || title.equals(\"\") || function.equals(\"\") || protagonist.equals(\"\")\n || source.equals(\"\") || references.equals(\"\") || description.equals(\"\")) {\n throw new EmptyTextFieldException();\n }\n }", "boolean empty();", "boolean empty();", "public boolean is_empty () {\n return is_empty;\r\n }", "protected boolean checkEmpty(String[] parameters) {\n return parameters == null || parameters.length == 0;\n }", "private boolean isAnyEmpty(){\n //get everything\n return (fname.getText().toString().trim().length() == 0)\n || (lname.getText().toString().trim().length() == 0)\n || (email.getText().toString().trim().length() == 0)\n || (password.getText().toString().trim().length() == 0);\n }", "private List<Factor> getEmpty(List<Factor> factors) {\n ArrayList<Factor> filt = new ArrayList<Factor>();\n for (Factor f : factors) {\n if (f.getVars().size() == 0) {\n filt.add(f);\n }\n }\n return filt;\n }", "public boolean empty() {\n\t\treturn input.isEmpty() && output.isEmpty();\n\t}", "public boolean empty() {\n return nums.isEmpty() && temp.isEmpty();\n }", "private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "private boolean isEmpty() {\n\t\treturn (size == 0);\n\t}", "public boolean empty() {\n return stk1.isEmpty() && stk2.isEmpty();\n }", "boolean\tisEmpty();", "boolean checkIfEmpty();", "public boolean empty();", "private List<String> returnEmptyRequiredFields(List<String> requiredFields, Object givenObject){\n return requiredFields.stream()\n .filter(x -> {\n try {\n return StringUtils.isEmpty((String) givenObject.getClass().getDeclaredField(x).get(givenObject));\n } catch (Exception e) {\n //Not going to try and scmOrganization for exceptions; if there is an exception we probably have greater issues than an empty/null field\n getLog().debug(String.format(\"Unable to ascertain if %s is null/empty\",x));\n return true;\n }\n })\n .collect(Collectors.toList());\n }", "public void clearVariables()\n {\n if(arrayListPLPDetails!=null) {\n arrayListPLPDetails.clear();\n ProductListPageAdaptorNoView.SingletonInstance().updateData(false);\n }\n }", "private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }", "@Override\n public boolean isEmpty() { return true; }", "public boolean isEmpty(){\n\t\treturn isPassable&&!containsItems()&&!containsMonster()&&tileItems.noGold();\r\n\t}", "boolean isEmpty(){\n\treturn size() == 0;\n }", "public boolean isEmpty()\n {return data == null;}", "public boolean isEmpty() {\n return values.isEmpty();\n }", "public boolean empty() {\n return One.isEmpty() && Two.isEmpty(); \n }", "default boolean isEmpty() {\n return get() == null;\n }", "public void makeEmpty();", "public void makeEmpty();", "@Override\r\n\tpublic boolean isempty() {\n\t\treturn count<=0;\r\n\t\t\r\n\t}", "private boolean isEmpty() {\n/* 547 */ return (this.filters.isEmpty() && this.maxArrayLength == Long.MAX_VALUE && this.maxDepth == Long.MAX_VALUE && this.maxReferences == Long.MAX_VALUE && this.maxStreamBytes == Long.MAX_VALUE);\n/* */ }", "private boolean isEmpty() {\n return dataSize == 0;\n }", "private boolean isEmpty() {\n/* 549 */ return (this.filters.isEmpty() && this.maxArrayLength == Long.MAX_VALUE && this.maxDepth == Long.MAX_VALUE && this.maxReferences == Long.MAX_VALUE && this.maxStreamBytes == Long.MAX_VALUE);\n/* */ }", "@Override\npublic Boolean isEmpty() {\n\treturn null;\n}", "private boolean isEmpty() {\n return (size == 0);\n }", "@Override\n\t\t\tpublic boolean isEmpty() {\n\t\t\t\treturn false;\n\t\t\t}", "public boolean isEmpty() {\n return helpers.isEmpty();\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\tboolean bandera=true;\r\n\t\tif(vector.size()>0){\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tbandera=false;\r\n\t\t}\r\n\t\treturn bandera;\r\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\r\n\r\n\t\treturn data.isEmpty();\r\n\t}", "public boolean empty() {\n return s1.isEmpty();\n }", "public boolean isEmpty() { return count == 0; }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "private boolean isEmpty() { return getSize() == 0; }", "public boolean isEmpty(){\r\n return firstExtreme==secondExtreme && ((feIncluded=='(' && seIncluded==')') || (feIncluded=='[' && seIncluded==')') || (feIncluded=='(' && seIncluded==']'));\r\n }", "public boolean empty() {\n return inSt.isEmpty() && outSt.isEmpty();\n\n }", "public boolean isEmpty() {\n\t\t\treturn properties.isEmpty();\n\t\t}", "@Override\n\t\tpublic boolean isEmpty() {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\tpublic boolean isEmpty() {\n\t\t\treturn false;\n\t\t}", "public boolean isEmpty() {\n\t\treturn members == 0;\n\t}", "public boolean isEmpty() {\n \t return size == 0;\n }", "public void clearVars() {\n setLatitude (FLOATNULL);\n setLongitude (FLOATNULL);\n setDepth (FLOATNULL);\n setTemperatureMin (FLOATNULL);\n setTemperatureMax (FLOATNULL);\n setSalinityMin (FLOATNULL);\n setSalinityMax (FLOATNULL);\n setOxygenMin (FLOATNULL);\n setOxygenMax (FLOATNULL);\n setNitrateMin (FLOATNULL);\n setNitrateMax (FLOATNULL);\n setPhosphateMin (FLOATNULL);\n setPhosphateMax (FLOATNULL);\n setSilicateMin (FLOATNULL);\n setSilicateMax (FLOATNULL);\n setChlorophyllMin (FLOATNULL);\n setChlorophyllMax (FLOATNULL);\n }", "public boolean isEmpty(){return count==0;}", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn (t==1);\r\n\t}", "public boolean isEmpty() {\n\t\t// your code here\n\t\treturn false;\n\t}", "public boolean isEmpty() {\n\t\treturn false;\r\n\t}", "boolean isEmpty() \r\n { \r\n //Write your code here \r\n if(a.length == 0) \r\n return true;\r\n return false;\r\n }", "public boolean isEmpty(){\n\t\treturn (howMany==0);\n\t}", "public boolean isEmpty() {\n return numKeys == 0;\n }", "public boolean isEmptyStepList(){ return this.step==null&&this.rest==null;}", "public boolean empty() {\n if(temp1.empty() && temp2.empty()){\n return true;\n }\n return false;\n }", "@Override\n public boolean isEmpty() {\n return false;\n }", "public boolean isEmpty() ;", "public String[] camposDivididos3(String[] vars){\r\nString[] args=vars;\r\nreturn args;\r\n}", "public void clearParams() {\n setParams((String[]) null);\n }", "public boolean empty() {\n return q1.size() == 0 && q2.size() == 0;\n }", "private void clearLocals() {\n this.map = null;\n this.inputName = null;\n }", "public Boolean isEmpty() {\n\t\tBoolean empty=true;\n\t\tif(nodes.isEmpty()==false) {\n\t\t\tempty=false;\n\t\t}\n\t\treturn empty;\n\t}", "@Override\n public boolean isEmpty()\n {\n return false;\n }", "public boolean empty() {\n return q1.isEmpty();\n }", "public boolean empty() {\n return q1.isEmpty();\n }", "public boolean empty() {\n return q1.isEmpty();\n }", "public boolean empty() {\n return q1.isEmpty();\n }", "public boolean empty() {\n return q1.isEmpty();\n }", "void empty();", "@Override\n public boolean isEmpty() {\n return size()==0;\n }", "@Override\npublic boolean isEmpty() {\n\treturn false;\n}", "public boolean isEmpty(){\n\t\tboolean ans = false;\n\t\tif (_size == 0) ans = true;\n\t\treturn ans;\n\t}" ]
[ "0.60222936", "0.5853034", "0.5768242", "0.5728989", "0.56789386", "0.5660729", "0.56605697", "0.5652071", "0.5642528", "0.5622093", "0.5528963", "0.55134076", "0.54837984", "0.54793024", "0.54767936", "0.5476435", "0.5469775", "0.54629254", "0.5439767", "0.543729", "0.54333085", "0.54267263", "0.54267263", "0.54227144", "0.5418316", "0.54168016", "0.5408903", "0.5396517", "0.5384767", "0.5377765", "0.5376622", "0.53635716", "0.5350811", "0.5344541", "0.5343499", "0.53423184", "0.5334831", "0.5333005", "0.53231835", "0.5319972", "0.53176165", "0.53015643", "0.53008586", "0.5298162", "0.5292508", "0.5287416", "0.5287416", "0.5281028", "0.5280515", "0.5273333", "0.52652997", "0.5263336", "0.52584493", "0.52535146", "0.52479327", "0.524603", "0.52427155", "0.52415544", "0.52408296", "0.52398175", "0.52398175", "0.52398175", "0.52398175", "0.52398175", "0.52398175", "0.52398175", "0.52394295", "0.5238946", "0.52276015", "0.52249193", "0.52169585", "0.52169585", "0.52162313", "0.52112377", "0.5210897", "0.52058923", "0.5203689", "0.52025986", "0.5202318", "0.5201855", "0.51974696", "0.5197382", "0.51847184", "0.5181907", "0.5174259", "0.5162863", "0.51625985", "0.51621854", "0.5161305", "0.51587516", "0.51575124", "0.5156885", "0.5151451", "0.5151451", "0.5151451", "0.5151451", "0.5151451", "0.5150617", "0.5145124", "0.51436543", "0.51436216" ]
0.0
-1
/ noInduk may not be null / empty never ret null throws KasirException(ROW_NOT_FOUND, noInduk)
public static Profil select(String noInduk) throws SQLException, KasirException{ assert noInduk != null && !noInduk.isEmpty() : "selectProfil(String, String, String noInduk = null)"; return select(noIndukColName, false, noInduk); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean delete(String noInduk) throws SQLException, KasirException{\r\n return DBSR.deleteKasirO(tableName, noIndukColName, false, noInduk);\r\n }", "public boolean updateNoInduk(String oldNoInduk) throws SQLException, KasirException{\r\n assert oldNoInduk != null;\r\n\r\n //profil.noInduk is also retrieved to check for noInduk duplication\r\n ResultSet rs = DBSR.takeResultSetByString(tableName, noIndukColName, 1, oldNoInduk, noInduk);\r\n\r\n if(updateResultSetNoInduk(rs, oldNoInduk)){\r\n rs.updateRow();\r\n return true;\r\n }else\r\n return false;\r\n }", "public static Profil fromResultSet(ResultSet rs, String noInduk) throws SQLException, KasirException {\r\n assert noInduk != null && !noInduk.isEmpty() : \"fromResultSet(ResultSet, String noInduk = null / empty)\";\r\n \r\n return fromResultSet(rs, noIndukColName, false, noInduk);\r\n }", "public boolean updateResultSetNoInduk(ResultSet rs, String oldNoInduk) throws SQLException, KasirException {\r\n assert oldNoInduk != null : \"oldNoInduk = null\";\r\n \r\n if(!isDBValid())\r\n throw new KasirException(KasirException.Tipe.DB_INVALID, this);\r\n \r\n if(noInduk.equals(oldNoInduk)){\r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n return flushResultSet(rs, false);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, this);\r\n }else{\r\n if(DBSR.searchRow(rs, noIndukColName, false, noInduk) > 0)\r\n throw new KasirException(KasirException.Tipe.DUPLICATE_PRIMARY_KEY, this);\r\n \r\n if(DBSR.searchRow(rs, noIndukColName, false, oldNoInduk) > 0)\r\n return flushResultSet(rs, true);\r\n else\r\n throw new KasirException(KasirException.Tipe.ROW_NOT_FOUND, oldNoInduk);\r\n }\r\n }", "public void okFind()\n {\n ASPManager mgr = getASPManager();\n\n trans.clear();\n q = trans.addQuery(headblk);\n q.addWhereCondition(\"WO_NO<(SELECT Number_Serie_API.Get_Last_Wo_Number FROM DUAL) AND CONTRACT IN(SELECT User_Allowed_Site_API.Authorized(CONTRACT) FROM DUAL)\");\n q.addWhereCondition(\"CONNECTION_TYPE_DB = 'EQUIPMENT'\");\n q.includeMeta(\"ALL\");\n\n // nimhlk - Begin\n if (mgr.dataTransfered())\n {\n ASPBuffer retBuffer = mgr.getTransferedData();\n if (retBuffer.itemExists(\"WO_NO\"))\n {\n String ret_wo_no = retBuffer.getValue(\"WO_NO\");\n q.addWhereCondition(\"WO_NO = ?\");\n q.addParameter(\"WO_NO\",ret_wo_no);\n }\n else\n q.addOrCondition(mgr.getTransferedData());\n }\n // nimhlk - End\n\n mgr.querySubmit(trans,headblk);\n\n if (headset.countRows() == 0)\n {\n mgr.showAlert(mgr.translate(\"PCMWACTIVESEPARATENODATA: No data found.\"));\n headset.clear();\n }\n if (headset.countRows() == 1)\n {\n lay.setLayoutMode(lay.SINGLE_LAYOUT);\n }\n mgr.createSearchURL(headblk);\n }", "@Override\n\tpublic String getQueryDeExiste(Onibus entidade) {\n\t\treturn null;\n\t}", "public void okFindITEM1()\n {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPQuery q;\n int headrowno;\n\n q = trans.addQuery(hse_safety_eque_ldger_1_blk);\n q.addWhereCondition(\"PROJ_NO = ? AND ID = ?\");\n q.addParameter(\"PROJ_NO\", headset.getValue(\"PROJ_NO\"));\n q.addParameter(\"ID\", headset.getValue(\"ID\"));\n q.includeMeta(\"ALL\");\n headrowno = headset.getCurrentRowNo();\n mgr.querySubmit(trans,hse_safety_eque_ldger_1_blk);\n headset.goTo(headrowno);\n }", "public boolean isDBValid(){\r\n return noInduk != null && !noInduk.isEmpty();\r\n }", "@Test\n\tpublic void testFindProductSkuByGuidWithNullReturn() {\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(Collections.emptyList()));\n\t\t\t}\n\t\t});\n\t\tassertNull(this.importGuidHelper.findProductSkuByGuid(NON_EXIST_GUID));\n\t}", "@Test\n public void sucheKategorienNull() throws Exception {\n System.out.println(\"suche Kategorien Null\");\n SaalKey saal = null;\n List<Kategorie> expResult = null;\n List<Kategorie> result = SaalHelper.sucheKategorien(saal);\n assertEquals(expResult, result);\n \n }", "@Test\n public void whenNoPricesForVendor_ThenAnEmptyResponseIsReturned() {\n getByInstrumentId(\"unknown\").isEqualTo(new Price[] {});\n }", "public boolean hapusdata (String nama){\n return data.delete(nama_table, kolom1+\"=\\\"\"+nama+\"\\\"\",null)>0;\n }", "public static Map<String,Profil> selectS(Set<String> noInduks) throws SQLException, KasirException{\r\n ResultSet rs;\r\n Map<String,Profil> noIndukProfil;\r\n if(noInduks == null){\r\n rs = DBSR.takeResultSetByStringColl(tableName, noIndukColName, -1, null);\r\n\r\n noIndukProfil = new HashMap<>(DBSR.rowCountRS(rs)); \r\n rs.beforeFirst();\r\n while(rs.next()){\r\n Profil p = Profil.fromResultSet(rs);\r\n noIndukProfil.put(p.noInduk, p);\r\n }\r\n }else{\r\n Set<String> validNoInduk = new HashSet<>(CollectionUtils.subtract(noInduks, Arrays.asList(null, \"\")));\r\n rs = DBSR.takeResultSetByStringColl(tableName, noIndukColName, -1, validNoInduk);\r\n\r\n noIndukProfil = new HashMap<>(validNoInduk.size()); \r\n for(String noInduk : validNoInduk){\r\n try{\r\n noIndukProfil.put(noInduk, Profil.fromResultSet(rs, noInduk));\r\n }catch(KasirException e){\r\n noIndukProfil.put(noInduk, null);\r\n }\r\n }\r\n }\r\n\r\n return noIndukProfil;\r\n }", "@Test\n void searchProduct() {\n List<DummyProduct> L1= store.SearchProduct(\"computer\",null,-1,-1);\n assertTrue(L1.get(0).getProductName().equals(\"computer\"));\n\n List<DummyProduct> L2= store.SearchProduct(null,\"Technology\",-1,-1);\n assertTrue(L2.get(0).getCategory().equals(\"Technology\")&&L2.get(1).getCategory().equals(\"Technology\"));\n\n List<DummyProduct> L3= store.SearchProduct(null,null,0,50);\n assertTrue(L3.get(0).getProductName().equals(\"MakeUp\"));\n\n List<DummyProduct> L4= store.SearchProduct(null,\"Fun\",0,50);\n assertTrue(L4.isEmpty());\n }", "@Test(expected = BadEntry.class)\r\n\tpublic void testConsultItemWithNullTitle() throws BadEntry{\r\n\t\tsn.consultItems(null);\r\n\t}", "public void testNamaPNSYangSkepnyaDiterbitkanOlehPresiden(){\n\t\tSkppPegawai objskp =new SkppPegawai();\n\n\t\tJSONArray data = objskp.getNamaPNSYangSkepnyaDiterbitkanOlehPresiden(); \n\n\t\tshowData(data,\"nip\",\"nama\",\"tanggal_lahir\",\"tanggal_berhenti\",\"pangkat\",\"masa_kerja\",\"penerbit\");\n\t}", "@Test\n\tpublic void testFindBrandByGuidWithNullReturn() {\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(Collections.emptyList()));\n\t\t\t}\n\t\t});\n\t\tassertNull(this.importGuidHelper.findBrandByGuidAndCatalogGuid(NON_EXIST_GUID, CATALOG_CODE));\n\t}", "public void rubahDataProduk(){\n loadDataProduk();\n \n //uji koneksi dan eksekusi perintah\n try{\n //test koneksi\n Statement stat = (Statement) koneksi.getKoneksi().createStatement();\n \n //perintah sql untuk simpan data\n String sql = \"UPDATE barang SET nama_barang = '\"+ nama_barang +\"',\"\n + \"merk_barang = '\"+ merk_barang +\"',\"\n + \"jumlah_stok = '\"+ jumlah_stok +\"',\"\n + \"harga = '\"+ harga +\"'\" \n + \"WHERE kode_barang = '\" + kode_barang +\"'\";\n PreparedStatement p = (PreparedStatement) koneksi.getKoneksi().prepareStatement(sql);\n p.executeUpdate();\n \n //ambil data\n getDataProduk();\n }catch(SQLException err){\n JOptionPane.showMessageDialog(null, err.getMessage());\n }\n }", "public boolean searchItem(Connection conn, int item_no) {\r\n\t\ttry {\r\n\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\tResultSet rset = stmt.executeQuery(\"select item_no, description from item_XXXX where item_no=\" + item_no);\r\n\t\t\tif (rset.isBeforeFirst())\r\n\t\t\t\treturn true;\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n public void testReadNegativeItemIsNull() throws Exception{\n String name = null;\n itemDao.read(name);\n }", "@Override\n\tpublic MahasiswaModel getById(String nik) throws SQLException {\n\t\tgetByidStatement.setString(1, nik);\n\t\tResultSet rs = getByidStatement.executeQuery();\n\t\tif(rs.next()){\n\t\t\tMahasiswaModel mhs = new MahasiswaModel();\n\t\t\tmhs.setNik(rs.getString(\"nik\"));\n\t\t\tmhs.setNama(rs.getString(\"nama\"));\n\t\t\tmhs.setKelas(rs.getString(\"kelas\"));\n\t\t\tmhs.setJurusan(rs.getString(\"jurusan\"));\n\t\t\treturn mhs;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public int Kullanicino_Bul(String kullanici_adi) throws SQLException {\n baglanti vb = new baglanti();\r\n try {\r\n \r\n vb.baglan();\r\n int kullanicino = 0;\r\n String sorgu = \"select kullanici_no from kullanicilar where kullanici_adi='\" + kullanici_adi + \"';\";\r\n\r\n ps = vb.con.prepareStatement(sorgu);\r\n\r\n rs = ps.executeQuery(sorgu);\r\n while (rs.next()) {\r\n kullanicino = rs.getInt(1);\r\n }\r\n return kullanicino;\r\n\r\n } catch (Exception e) {\r\n Logger.getLogger(siparis.class.getName()).log(Level.SEVERE, null, e);\r\n return 0;\r\n }\r\n finally{\r\n vb.con.close();\r\n }\r\n }", "private void fetchUnknownBirdsCodes(Session session) {\n QAQCMain.log.info(\"Getting the birds with unknown code\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.speciesCode, species.site.siteCode from Species as species \"\n + \"where not exists (from RefBirds as ref where ref.refBirdsCode like species.speciesCode) \"\n + \"and species.speciesGroup like 'B'\"\n + \"order by species.speciesCode ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n Object[] columnNames = {\"Site\", \"Birds Code\"};\n model.setColumnIdentifiers(columnNames);\n updateNumResults(i);\n }", "public void Excepti() throws Exception{ \n throw new Exception(\"El dato especificado NO existe en la lista!!!\"); \n }", "public ArrayList<Product> getMissingProduct(){\r\n\t\tString sql=\"SELECT Barcode FROM ProductTable WHERE (Quantity_In_Store+Quantity_In_storeroom)<=\"\r\n\t\t\t\t+ \"(Average_Sales_Per_Day*Delivery_Time)\";\r\n\t\tArrayList<Product> products = new ArrayList<>();\r\n\t\t try (Connection conn = this.connect();\r\n\t Statement stmt = conn.createStatement();\r\n\t ResultSet rs = stmt.executeQuery(sql)){\r\n\t\t\t while(rs.next()){\r\n\t\t\t\t products.add(getProductByID(rs.getInt(\"Barcode\")));\r\n\t\t\t }\r\n\t\t }\r\n\t\t catch (SQLException e) {\r\n\t\t\t System.out.println(\"getMissingProduct: \"+e.getMessage());\r\n\t\t\t return null;\r\n\t\t }\r\n\t\treturn products;\r\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void onGetBookCartItemsFail() {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "@Test\n\tpublic void checkNoElementInTableOutsideAPI() throws ParseException\n\t{\n\t\t// Table Data\n\t\tMap<String, Object> tableMap = dashboardPage.addRowDataToMap();\n\t\t// API Data\n\t\tresponsePage = new APIResponsePageObject(driver);\n\t\tMap<String, Object> apiMap = responsePage.getRateDataFromAPI();\n\t\t\n\t\t// Map that has key - values missing in tableMap that are in apiMap\n\t\tMap notInAPIMap = new HashMap<>(tableMap);\n\t\tnotInAPIMap.keySet().removeAll(apiMap.keySet());\n\t\tnotInAPIMap.values().removeAll(apiMap.values());\n\t\t\n\t\tif(notInAPIMap.size() > 1)\n\t\t{\n\t\t\terrorMessage = \"Html table is having \" + notInAPIMap.toString() + \" that are not from API\";\n\t\t\tAssert.fail(errorMessage);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAssert.assertTrue(notInAPIMap.size() == 0);\n\t\t}\n\t}", "@Test\n public void testGetByKeyEmpty() throws Exception {\n thrown.expect(ProductNotFoundException.class);\n thrown.expectMessage(\"Product with key \" + this.product.getKey() + \" not found!\");\n\n when(repository.findByKey(this.product.getKey())).thenReturn(Optional.empty());\n service.getByKey(this.product.getKey());\n }", "public boolean fHalamanPelanggan(HttpSession vFSesi) {\n boolean vKeluaran = false;\n \n try{\n String vID = vFSesi.getAttribute(\"sesIDPub\").toString();\n String vSandi = vFSesi.getAttribute(\"sesSandiPUb\").toString();\n String vEmailDB = \"\";\n String vSandiDB = \"\";\n\n //String vKeluaran = \"fHalamanAdmin -> ID: \" + vID + \" & sandi: \" + vSandi;\n /* mencocokkan data session dengan basisdata */\n /* mengambil data nama dan sandi */\n ClsOperasiBasisdataOri oOpsBasisdata = new ClsOperasiBasisdataOri();\n\n /* \n String vFNamaBerkasKonf,\n String vFNamaBd,\n String vFNamaTabel,\n String[] vFArrNamaKolom,\n String vFKolomUrut,\n String vFJenisUrut,\n String[] vFOffset\n */\n\n ResultSet vHasil = oOpsBasisdata.fArrAmbilDataDbKondisi(\"\",\"\", \n \"tb_pelanggan\", \n new String[]{\"email\",\"sandi\"}, \n new String[]{\"email\"},\n \"nomor\", \n \"\", new String[]{\"0\",\"1\"},\"=\");\n\n /* keluaran permintaan */\n while(vHasil.next()){\n vEmailDB = vHasil.getString(\"email\");\n vSandiDB = vHasil.getString(\"sandi\");\n }\t\t\t\n \n System.out.println(vID + \"#\" + vEmailDB + \"#\" + \"#\" + vSandi + \"#\" + vSandiDB);\n /* mencocokkan data */\n if (vID != null && vEmailDB !=null && vSandi != null && vSandiDB != null) {\n \n /* sebelum divalidasi */\n /* apabila data POST sesuai dgn data dalam tabel basisdata: lupa password jadi di NOT */\n if(vID.equals(vEmailDB) && vSandi.equals(vSandiDB)){\n vKeluaran = true;\n }\n }\n }catch(SQLException | DOMException e){\n /* pencatatan sistem */\n if(ClsKonf.vKonfCatatSistem == true){\n String vNamaKelas = \"ClsPelanggan.java\";\n String vNamaMetode = \"fHalamanPelanggan\";\n String vCatatan = vNamaKelas + \"#\" + vNamaMetode + \"#\" + e.toString();\n /* obyek catat */\n ClsCatat oCatat = new ClsCatat();\n oCatat.fCatatSistem(ClsKonf.vKonfCatatKeOutput, \n ClsKonf.vKonfCatatKeBD, \n ClsKonf.vKonfCatatKeBerkas, \n vCatatan);\n }\n }\n \n /* debug nilai id dan password */\n //System.out.println(\"Belum divalidasi : \" + vID + \" = \" + vNamaDB + \" & \" + vSandi + \" = \" + vSandiDB);\n /* nilai keluaran */\n return vKeluaran;\n }", "private boolean validaItemsServicio(int CodEmp, int CodLoc, int CodCot){\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n boolean blnRes=true;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc != null) {\n stmLoc=conLoc.createStatement();\n strSql=\"\";\n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" AND a1.co_loc=\"+CodLoc+\" AND a1.co_cot=\"+CodCot+\" AND (a3.st_ser='S' OR a3.st_ser='T' OR a3.st_ser='O') \\n\";\n rstLoc=stmLoc.executeQuery(strSql);\n if(rstLoc.next()){\n blnRes=false;\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n }\n conLoc.close();\n conLoc=null;\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false;\n }\n return blnRes;\n }", "public void tiepTucNhap() {\n\t\tlog.info(\"-----tiepTucNhap()-----\");\n\t\tlog.info(String.format(\"-----index: %s\", updateItem));\n\t\t\n\t\tlog.info(\"tonkhoMa:\"+tonkhoMa);\n\t\tlog.info(\"xuat:\"+xuat);\n\t\tlog.info(\"dmtMa:\"+dmtMa);\n\t\tlog.info(\"updateItem:\"+updateItem);\n\t\tlog.info(\"tonkho:\"+tonkho);\n\n\t\tif (xuat == null || xuat.equals(\"\") || tonkho == null || tonkho.equals(\"\")){\n\t\t\treturn;\n\t\t}\n\t\t \n\t\tif (\"\".equals(tonkhoMa) && tonkhoMa == null) {\n\t\t\tlog.info(\"-----tonkho ma is null.\");\n\t\t} else {\n\t\t\tlog.info(String.format(\"-----tonkho ma: %s\", tonkhoMa));\n\t\t\tTonKho tk = null;\n\t\t\t\n\t\t\tTonKhoDelegate tkDelegate;\n\t\t\ttry {\n\t\t\t\ttkDelegate = TonKhoDelegate.getInstance();\n\t\t\t\t\n\t\t\t\ttk = tkDelegate.find(Integer.valueOf(tonkhoMa));\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tCtTraKho ctx = new CtTraKho();\n\t\t\t\n\t\t\tDouble slXuat = new Double(\"0\");\n\t\t\tfor (int i = 0; i < listCtKhoLeTraEx.size(); i++) {\n\t\t\t\tCtTraKho ctxk = listCtKhoLeTraEx.get(i).getCtTraKho();\n\t\t\t\tif (malk.equals(ctxk.getCttrakhoMalk())) {\n\t\t\t\t\tlog.info(\"-----malk \" + malk);\n\t\t\t\t\tslXuat += ctxk.getCttrakhoSoluong();\n\t\t\t\t\tupdateItem = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tslXuat += Double.valueOf(xuat);\n\t\t\tctx.setCttrakhoSoluong(slXuat);\n\t\t\tCtTraKhoExt ctxEx = createCtXuatKho(ctx, tk);\n\t\t\tlog.info(\"-----xuat: \" + slXuat);\n\t\t\t\n\t\t\tif (updateItem.equals(-1)) {\n\t\t\t\tlog.info(\"-----them moi ct\");\n\t\t\t\tlistCtKhoLeTraEx.add(ctxEx);\n\t\t\t} else {\n\t\t\t\tlog.info(\"-----Cap nhat ct-----\");\n\t\t\t\tif (tk != null) {\n\t\t\t\t\tlistCtKhoLeTraEx.set(updateItem, ctxEx);\n\t\t\t\t} else {\n\t\t\t\t\tFacesMessages.instance().add(IConstantsRes.PHIEUXUATKHO_TK_NULL, dmtMa);\n\t\t\t\t}\n\n\t\t\t\tlog.info(String.format(\"-----update ct: %s\", ctx.getCttrakhoThutu()));\n\t\t\t}\n\n\t\t\tcount = listCtKhoLeTraEx.size();\n\t\t\tlog.info(String.format(\"-----listCtXuatKho: %s\", listCtKhoLeTraEx.size()));\n\t\t\ttonkhoMa = \"\";\n\t\t\tdmtMa = \"\";\n\t\t\ttonkho = new Double(0);\n\t\t\txuat = new Double(0);\n\t\t\tupdateItem = -1;\n\t\t}\n\t\ttinhTien();\n\t}", "public boolean iliskMasaSil(int kullanici_no) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n String sorgu3 = \"delete ilisk_masa from ilisk_masa where kullanici_no=\" + kullanici_no + \"\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n vb.con.close();\r\n return true;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n try {\r\n vb.con.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return false;\r\n }\r\n }", "public Vector addJumMhsYgSudahHeregistrasi(Vector vListInfoKelas) {\n\n \t/*\n \t * unreusable cuma adhock fix\n \t */\n \tif(vListInfoKelas!=null && vListInfoKelas.size()>0) {\n \t\t/*\n\t\t\t * tambah jumlah mhs perkelas ke dalam brs;\n\t\t\t */\n\t\t\tListIterator li = vListInfoKelas.listIterator();\n \t\ttry {\n \t\t\tContext initContext = new InitialContext();\n \t\t\tContext envContext = (Context)initContext.lookup(\"java:/comp/env\");\n \t\t\tds = (DataSource)envContext.lookup(\"jdbc\"+beans.setting.Constants.getDbschema());\n \t\t\tcon = ds.getConnection();\n \t\t\tstmt = con.prepareStatement(\"select NPMHS from DAFTAR_ULANG where THSMS=? and NPMHS=?\");\n \t\t\twhile(li.hasNext()) {\n \t\t\t\tString brs = (String)li.next();\n \t\t\t\t//System.out.println(\"brs=\"+brs);\n \t\t\t\tStringTokenizer st = new StringTokenizer(brs,\"$\");\n \t\t\tString kodeGabungan=st.nextToken();\n \t\t\tString idkmk1=st.nextToken();\n \t\t\tString idkur1=st.nextToken();\n \t\t\tString kdkmk1=st.nextToken();\n \t\t\tString nakmk1=st.nextToken();\n \t\t\tString thsms1=st.nextToken();\n \t\t\tString kdpst1=st.nextToken();\n \t\t\tString shift1=st.nextToken();\n \t\t\tString norutKlsPll1=st.nextToken();\n \t\t\tString initNpmInput1=st.nextToken();\n \t\t\tString latestNpmUpdate1=st.nextToken();\n \t\t\tString latesStatusInfo1=st.nextToken();\n \t\t\tString currAvailStatus1=st.nextToken();\n \t\t\tString locked1=st.nextToken();\n \t\t\tString npmdos1=st.nextToken();\n \t\t\tString nodos1=st.nextToken();\n \t\t\tString npmasdos1=st.nextToken();\n \t\t\tString noasdos1=st.nextToken();\n \t\t\tString canceled1=st.nextToken();\n \t\t\tString kodeKelas1=st.nextToken();\n \t\t\tString kodeRuang1=st.nextToken();\n \t\t\tString kodeGedung1=st.nextToken();\n \t\t\tString kodeKampus1=st.nextToken();\n \t\t\tString tknHrTime1=st.nextToken();\n \t\t\tString nmdos1=st.nextToken();\n \t\t\tString nmasdos1=st.nextToken();\n \t\t\tString enrolled1=st.nextToken();\n \t\t\tString maxEnrolled1=st.nextToken();\n \t\t\tString minEnrolled1=st.nextToken();\n \t\t\tString subKeterKdkmk1=st.nextToken();\n \t\t\tString initReqTime1=st.nextToken();\n \t\t\tString tknNpmApr1=st.nextToken();\n \t\t\tString tknAprTime1=st.nextToken();\n \t\t\tString targetTtmhs1=st.nextToken();\n \t\t\tString passed1=st.nextToken();\n \t\t\t\tString rejected1=st.nextToken();\n \t\t\t\tString konsen1=st.nextToken();\n \t\t\t\tString nmpst1=st.nextToken();\n \t\t\t\tString listNpm=st.nextToken();\n \t\t\t\tStringTokenizer st1 = new StringTokenizer(listNpm,\",\");\n \t\t\t\tString listNpmHer = null;\n \t\t\t\twhile(st1.hasMoreTokens()) {\n \t\t\t\t\tString npm = st1.nextToken();\n \t\t\t\t\tstmt.setString(1,thsms1);\n \t\t\t\t\tstmt.setString(2,npm);\n \t\t\t\t\trs = stmt.executeQuery();\n \t\t\t\t\t\n \t\t\t\t\tif(rs.next()) {\n \t\t\t\t\t\tif(listNpmHer==null) {\n \t\t\t\t\t\t\tlistNpmHer = \"\";\n \t\t\t\t\t\t}\n \t\t\t\t\t\tlistNpmHer = listNpmHer+\",\"+npm;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif(listNpmHer==null) {\n \t\t\t\t\tlistNpmHer = \"null\";\n \t\t\t\t}\n \t\t\t\tli.set(brs+\"$\"+listNpmHer);\n \t\t\t\t//System.out.println(\"listNpmHer=\"+listNpmHer);\n \t\t\t\t//System.out.println(thsms1+\"$\"+kdpst1+\"$\"+kdkmk1);\n \t\t\t\t//System.out.println(brs+\"$\"+i);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\tcatch (NamingException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\tcatch (SQLException ex) {\n \t\t\tex.printStackTrace();\n \t\t} \n \t\tfinally {\n \t\t\tif (rs!=null) try { rs.close(); } catch (Exception ignore){}\n \t\t\tif (stmt!=null) try { stmt.close(); } catch (Exception ignore){}\n \t\t\tif (con!=null) try { con.close();} catch (Exception ignore){}\n \t\t}\n \t}\n \treturn vListInfoKelas;\n }", "public List<Dishes> selectHuai(Dishes book){\n StringBuilder sql=new StringBuilder(\"select * from REAPER.\\\"Dish\\\" where \\\"cuisines\\\"='»´Ñï²Ë' \");\n //sqlÓï¾ä\n System.out.println(sql); \n List<Object> list=new ArrayList<Object>();\n if(book!=null){\n \tSystem.out.println(sql); \n if(book.getDishid()!=null){\n sql.append(\" and dishid=? \");\n System.out.println(book.getDishid()); \n list.add(book.getDishid());\n }\n }\n return dao.select(sql.toString(), list.toArray());\n }", "void checkInventoryExists() {\n\n MrnInventory[] checkInventory =\n new MrnInventory(survey.getSurveyId()).get();\n inventoryExists = false;\n if (checkInventory.length > 0) {\n inventoryExists = true;\n } // if (checkInventory.length > 0)\n\n\n }", "public void simpanDataKategori(){\n loadDataKategori();\n \n //uji koneksi dan eksekusi perintah\n try{\n //test koneksi\n Statement stat = (Statement) koneksiDB.getKoneksi().createStatement();\n \n //perintah sql untuk simpan data\n String sql = \"INSERT INTO tbl_kembali(nm_kategori, ala_kategori, no_kategori, kame_kategori, kd_kategori, sewa_kategori, kembali_kategori, lambat_kategori)\" + \"VALUES('\"+ nmKategori +\"','\"+ alaKategori +\"','\"+ noKategori +\"','\"+ kameKategori +\"','\"+ kdKategori +\"','\"+ sewaKategori +\"','\"+ lamKategori +\"','\"+ lambatKategori +\"')\";\n PreparedStatement p = (PreparedStatement) koneksiDB.getKoneksi().prepareStatement(sql);\n p.executeUpdate();\n \n //ambil data\n getDataKategori();\n }catch(SQLException err){\n JOptionPane.showMessageDialog(null, err.getMessage());\n }\n }", "public Vector addJumMhsYgSudahHeregistrasi_v1(Vector vListInfoKelas) {\n \tif(vListInfoKelas!=null && vListInfoKelas.size()>0) {\n \t\t/*\n\t\t\t * tambah jumlah mhs perkelas ke dalam brs;\n\t\t\t */\n\t\t\tListIterator li = vListInfoKelas.listIterator();\n \t\ttry {\n \t\t\tContext initContext = new InitialContext();\n \t\t\tContext envContext = (Context)initContext.lookup(\"java:/comp/env\");\n \t\t\tds = (DataSource)envContext.lookup(\"jdbc\"+beans.setting.Constants.getDbschema());\n \t\t\tcon = ds.getConnection();\n \t\t\tstmt = con.prepareStatement(\"select NPMHS from DAFTAR_ULANG where THSMS=? and NPMHS=?\");\n \t\t\twhile(li.hasNext()) {\n \t\t\t\tString brs = (String)li.next();\n \t\t\t\t//System.out.println(\"brs=\"+brs);\n \t\t\t\tStringTokenizer st = new StringTokenizer(brs,\"$\");\n \t\t\tString kodeGabungan=st.nextToken();\n \t\t\tString idkmk1=st.nextToken();\n \t\t\tString idkur1=st.nextToken();\n \t\t\tString kdkmk1=st.nextToken();\n \t\t\tString nakmk1=st.nextToken();\n \t\t\tString thsms1=st.nextToken();\n \t\t\tString kdpst1=st.nextToken();\n \t\t\tString shift1=st.nextToken();\n \t\t\tString norutKlsPll1=st.nextToken();\n \t\t\tString initNpmInput1=st.nextToken();\n \t\t\tString latestNpmUpdate1=st.nextToken();\n \t\t\tString latesStatusInfo1=st.nextToken();\n \t\t\tString currAvailStatus1=st.nextToken();\n \t\t\tString locked1=st.nextToken();\n \t\t\tString npmdos1=st.nextToken();\n \t\t\tString nodos1=st.nextToken();\n \t\t\tString npmasdos1=st.nextToken();\n \t\t\tString noasdos1=st.nextToken();\n \t\t\tString canceled1=st.nextToken();\n \t\t\tString kodeKelas1=st.nextToken();\n \t\t\tString kodeRuang1=st.nextToken();\n \t\t\tString kodeGedung1=st.nextToken();\n \t\t\tString kodeKampus1=st.nextToken();\n \t\t\tString tknHrTime1=st.nextToken();\n \t\t\tString nmdos1=st.nextToken();\n \t\t\tString nmasdos1=st.nextToken();\n \t\t\tString enrolled1=st.nextToken();\n \t\t\tString maxEnrolled1=st.nextToken();\n \t\t\tString minEnrolled1=st.nextToken();\n \t\t\tString subKeterKdkmk1=st.nextToken();\n \t\t\tString initReqTime1=st.nextToken();\n \t\t\tString tknNpmApr1=st.nextToken();\n \t\t\tString tknAprTime1=st.nextToken();\n \t\t\tString targetTtmhs1=st.nextToken();\n \t\t\tString passed1=st.nextToken();\n \t\t\t\tString rejected1=st.nextToken();\n \t\t\t\tString konsen1=st.nextToken();\n \t\t\t\tString nmpst1=st.nextToken();\n \t\t\t\tString cuid1=st.nextToken();\n \t\t\t\tString listNpm=st.nextToken();\n \t\t\t\t\n \t\t\t\t\n \t\t\t\t\n \t\t\t\t\n \t\t\t\tStringTokenizer st1 = new StringTokenizer(listNpm,\",\");\n \t\t\t\tString listNpmHer = null;\n \t\t\t\twhile(st1.hasMoreTokens()) {\n \t\t\t\t\tString npm = st1.nextToken();\n \t\t\t\t\tstmt.setString(1,thsms1);\n \t\t\t\t\tstmt.setString(2,npm);\n \t\t\t\t\trs = stmt.executeQuery();\n \t\t\t\t\t\n \t\t\t\t\tif(rs.next()) {\n \t\t\t\t\t\tif(listNpmHer==null) {\n \t\t\t\t\t\t\tlistNpmHer = \"\";\n \t\t\t\t\t\t}\n \t\t\t\t\t\tlistNpmHer = listNpmHer+\",\"+npm;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif(listNpmHer==null) {\n \t\t\t\t\tlistNpmHer = \"null\";\n \t\t\t\t}\n \t\t\t\tli.set(brs+\"$\"+listNpmHer);\n \t\t\t\t//System.out.println(\"listNpmHer=\"+listNpmHer);\n \t\t\t\t//System.out.println(thsms1+\"$\"+kdpst1+\"$\"+kdkmk1);\n \t\t\t\t//System.out.println(brs+\"$\"+i);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\tcatch (NamingException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\tcatch (SQLException ex) {\n \t\t\tex.printStackTrace();\n \t\t} \n \t\tfinally {\n \t\t\tif (rs!=null) try { rs.close(); } catch (Exception ignore){}\n \t\t\tif (stmt!=null) try { stmt.close(); } catch (Exception ignore){}\n \t\t\tif (con!=null) try { con.close();} catch (Exception ignore){}\n \t\t}\n \t}\n \treturn vListInfoKelas;\n }", "@Test\n public void getIngredient_ReturnsNull(){\n assertEquals(\"getIngredient - Returns Null\", null, testDatabase.getIngredient(Integer.MAX_VALUE));\n }", "public void testFinditemByIdWithInvalidValues() throws Exception {\n\t\ttry {\r\n\t\t\titemService.findItem(-1);\r\n\t\t\tfail(\"Object with unknonw id should not be found\");\r\n\t\t} catch (ItemNotFoundException e) {\r\n\t\t}\r\n\r\n\t\t// Finds an object with an empty identifier\r\n\t\ttry {\r\n\t\t\titemService.findItem(Long.parseLong(\"0\"));\r\n\t\t\tfail(\"Object with empty id should not be found\");\r\n\t\t} catch (ItemNotFoundException e) {\r\n\t\t}\r\n\r\n\t}", "private void getProducto(String isbn) throws UnsupportedEncodingException {\n String soql = \"SELECT ProductCode, Name FROM Product2 WHERE isActive = true AND ISBN__c = \" + isbn + \".0\";\n RestRequest restRequest = RestRequest.getRequestForQuery(getString(R.string.api_version), soql);\n\n client.sendAsync(restRequest, new AsyncRequestCallback() {\n @Override\n public void onSuccess(RestRequest request, RestResponse result) {\n try {\n sfResult = result.asJSONObject().getJSONArray(\"records\");\n\n Log.d(\"RequestResponse\", String.valueOf((sfResult != null)));\n if (sfResult != null) {\n if (sfResult.length() > 0) {\n String lineStr;\n for (int i = 0; i < sfResult.length(); i++) {\n lineStr = sfResult.getJSONObject(i).getString(\"ProductCode\") + \" - \" + sfResult.getJSONObject(i).getString(\"Name\");\n agregarProducto(lineStr, \"0\");\n }\n } else {\n makeToast(getApplicationContext(), \"No se han encontrado resultados para \" + scanResult);\n }\n }\n } catch (Exception e) {\n onError(e);\n }\n }\n\n @Override\n public void onError(Exception exception) {\n VolleyError volleyError = (VolleyError) exception;\n NetworkResponse response = volleyError.networkResponse;\n String json = new String(response.data);\n Log.e(\"RestError\", exception.toString());\n Log.e(\"RestError\", json);\n Toast.makeText(MainActivity.this,\n MainActivity.this.getString(SalesforceSDKManager.getInstance().getSalesforceR().stringGenericError(), exception.toString()),\n Toast.LENGTH_LONG).show();\n }\n });\n }", "public void testNamaPnsYangPensiunTahunIni(){\n\t\tSkppPegawai objskp =new SkppPegawai();\n\n\t\tJSONArray data = objskp.getNamaPnsYangPensiunTahunIni(); \n\n\t\tshowData_YangpensiunTahunini(data,\"nip\",\"nama\",\"tmtpensiun\");\n\t}", "public void okFindITEM1()\n {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPQuery q;\n int headrowno;\n\n q = trans.addQuery(mat_borrow_line_blk);\n q.addWhereCondition(\"PROJ_NO = ? AND BORROW_ID = ?\");\n q.addParameter(\"PROJ_NO\", headset.getValue(\"PROJ_NO\"));\n q.addParameter(\"BORROW_ID\", headset.getValue(\"BORROW_ID\"));\n q.includeMeta(\"ALL\");\n headrowno = headset.getCurrentRowNo();\n mgr.querySubmit(trans,mat_borrow_line_blk);\n headset.goTo(headrowno);\n }", "protected void handleNoRowFound()\r\n/* 37: */ throws DataAccessException\r\n/* 38: */ {\r\n/* 39: 92 */ throw new EmptyResultDataAccessException(\r\n/* 40: 93 */ \"LobStreamingResultSetExtractor did not find row in database\", 1);\r\n/* 41: */ }", "@Test(expected = SkuNotFoundException.class)\n public void getPriceNonExistentSkuThrowsException() throws SkuNotFoundException {\n\texpect(mockedDependency.getPriceBySku(BAD_SKU)).andReturn(null);\n\n\t// Set mocks into testing mode.\n\treplay(mockedDependency);\n\n\tsystemUnderTest.getPrice(BAD_SKU);\n }", "@Test\n\tpublic void noSuchElementExceptionTest( ) {\n\t\tdriver.get(\"https://practicetestautomation.com/practice-test-exceptions/\");\n\t\t\n\t\t//Click Add button\n\t\tWebElement addButtonElement = driver.findElement(By.id(\"add_btn\"));\n\t\taddButtonElement.click();\n\t\t\n\t\t// Implicit wait\n\t\tdriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));\n\t\t\n\t\t//Verify Row 2 input field is displayed\n\t\tWebElement row2Input = driver.findElement(By.xpath(\"//div[@id='row2']/input\"));\n\t\tAssert.assertTrue(row2Input.isDisplayed(), \"Row 2 is not displayed\");\n\t}", "@Test\n public void findDishesByCategoryNameNotExist() {\n\n try {\n String categoryName = \"Dessert\";\n DishSearchCriteriaTo criteria = new DishSearchCriteriaTo();\n List<CategoryEto> categories = new ArrayList<>();\n\n criteria.setCategories(categories);\n criteria.setSearchBy(\"\");\n PageRequest pageable = PageRequest.of(0, 8, Sort.by(Direction.DESC, \"price\"));\n criteria.setPageable(pageable);\n\n Page<DishCto> result = this.dishmanagement.findDishesByCategory(criteria, categoryName);\n assertThat(result).isNull();\n\n } catch (Exception e) {\n IllegalArgumentException iae = new IllegalArgumentException();\n assertThat(e.getClass()).isEqualTo(iae.getClass());\n }\n }", "public void okFindITEM1()\n {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPQuery q;\n int headrowno;\n\n q = trans.addQuery(hse_casualty_accident_line_blk);\n q.addWhereCondition(\"PROJ_NO = ? AND ID = ?\");\n q.addParameter(\"PROJ_NO\", headset.getValue(\"PROJ_NO\"));\n q.addParameter(\"ID\", headset.getValue(\"ID\"));\n q.includeMeta(\"ALL\");\n headrowno = headset.getCurrentRowNo();\n mgr.querySubmit(trans,hse_casualty_accident_line_blk);\n headset.goTo(headrowno);\n }", "private void fetchUnknownSpeciesCodes(Session session) {\n QAQCMain.log.info(\"Getting the species with unknown code\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.speciesCode, species.site.siteCode from Species as species \"\n + \"where not exists (from RefSpecies as ref where ref.refSpeciesCode like species.speciesCode) \"\n + \"and species.speciesGroup not like 'B'\"\n + \"order by species.speciesCode ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n\n Object[] columnNames = {\"Site\", \"Species Code\"};\n model.setColumnIdentifiers(columnNames);\n updateNumResults(i);\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, (String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private void getCariSemua(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.cari_semua_like(txt_kodeMK.getSelectedItem().toString(),txt_kelas.getSelectedItem().toString());\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")) {\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls, getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else{\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "private boolean checkIfExist(int klik, int x, int y){\r\n\t\tif (klik == 1){\r\n\t\t\tif (discTable[x][y].owner != 0 && discTable[x][y].owner <= 2) return true;\r\n\t\t\telse return false;\r\n\t\t}else return false;\r\n\t}", "@Test\n\tvoid existDataInDBTest2() {\n\t\tparkName = \"Tel-Aviv Park\";\n\t\tdate = new Date(120, 5, 1);\n\t\texpected = \"11 22 33 44 55 66 17 23 5 8 4 2 3 2 54 34 2 32 1 61 1 75 32 46 12 67 23 82 12 56 32 36 12 85 232 7\";\n\t\tresult = ReportsController.getReport(date, reportType, parkName);\n\n\t\tassertEquals(expected, result);\n\n\t}", "public boolean iliskiMutfakEkleme(int kullanici_no, int urun_kodu) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n String sorgu3 = \"insert into iliski_mutfak (kullanici_no, urun_kodu) values (\" + kullanici_no + \", \" + urun_kodu + \")\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n vb.con.close();\r\n ps.close();\r\n return true;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n return false;\r\n }\r\n }", "public void simpanDataBuku(){\n String sql = (\"INSERT INTO buku (judulBuku, pengarang, penerbit, tahun, stok)\" \n + \"VALUES ('\"+getJudulBuku()+\"', '\"+getPengarang()+\"', '\"+getPenerbit()+\"'\"\n + \", '\"+getTahun()+\"', '\"+getStok()+\"')\");\n \n try {\n //inisialisasi preparedstatmen\n PreparedStatement eksekusi = koneksi. getKoneksi().prepareStatement(sql);\n eksekusi.execute();\n \n //pemberitahuan jika data berhasil di simpan\n JOptionPane.showMessageDialog(null,\"Data Berhasil Disimpan\");\n } catch (SQLException ex) {\n //Logger.getLogger(modelPelanggan.class.getName()).log(Level.SEVERE, null, ex);\n JOptionPane.showMessageDialog(null, \"Data Gagal Disimpan \\n\"+ex);\n }\n }", "@Test\n public void findDishesByCategoryNameWithEmptyToken() {\n\n try {\n String categoryName = \"\";\n DishSearchCriteriaTo criteria = new DishSearchCriteriaTo();\n List<CategoryEto> categories = new ArrayList<>();\n\n criteria.setCategories(categories);\n criteria.setSearchBy(\"\");\n PageRequest pageable = PageRequest.of(0, 8, Sort.by(Direction.DESC, \"price\"));\n criteria.setPageable(pageable);\n\n Page<DishCto> result = this.dishmanagement.findDishesByCategory(criteria, categoryName);\n assertThat(result).isNull();\n\n } catch (Exception e) {\n IllegalArgumentException iae = new IllegalArgumentException();\n assertThat(e.getClass()).isEqualTo(iae.getClass());\n }\n }", "public void perbaruiDataKategori(){\n loadDataKategori();\n \n //uji koneksi dan eksekusi perintah\n try{\n //test koneksi\n Statement stat = (Statement) koneksiDB.getKoneksi().createStatement();\n \n //perintah sql untuk simpan data\n String sql = \"UPDATE tbl_kembali SET nm_kategori = '\"+ nmKategori +\"',\"\n + \"ala_kategori = '\"+ alaKategori +\"',\"\n + \"no_kategori = '\"+ noKategori +\"',\"\n + \"kame_kategori = '\"+ kameKategori +\"',\"\n + \"kd_kategori = '\"+ kdKategori +\"',\"\n + \"sewa_kategori = '\"+ sewaKategori +\"',\"\n + \"kembali_kategori = '\"+ lamKategori +\"'\"\n + \"WHERE lambat_kategori = '\" + lambatKategori +\"'\";\n PreparedStatement p = (PreparedStatement) koneksiDB.getKoneksi().prepareStatement(sql);\n p.executeUpdate();\n \n //ambil data\n getDataKategori();\n }catch(SQLException err){\n JOptionPane.showMessageDialog(null, err.getMessage());\n }\n }", "@Test(timeout = 4000)\n public void test052() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.substituteMarkers(\"Kp3\\\"j=TorK/,xrf\", (String) null, (Object) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(timeout = 4000)\n public void test006() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderWhereClause((String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseResultRow((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test\n public void sucheReihen() throws Exception {\n System.out.println(\"sucheReihen\");\n KategorieKey key = null;\n List<Reihe> expResult = null;\n List<Reihe> result = SaalHelper.sucheReihen(key);\n assertEquals(expResult, result);\n \n }", "public static void searchHdd(){\r\n try { \r\n singleton.dtm = new DefaultTableModel();\r\n singleton.dtm.setColumnIdentifiers(hdd);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n \r\n Statement stmt = singleton.conn.createStatement();\r\n ResultSet rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart\");\r\n \r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n \r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "boolean getPageNoNull();", "private void getDataKitabKuning(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Kitab Kuning\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "public void scanChecker(String[] result){\n final String code = result[1]; //(kode KA-RUH-1\n final String bahan = bahanChecker(result[1].substring(0,1)); // bahan KA/KB/DA/DB\n final String lengan = lenganChecker(result[1].substring(1,2));\n String harga = result[2]; // kode harga UHK/RUH\n\n utilities.firebaseRoot.child(\"product/\"\n +bahan+\"/\"\n +lengan+\"/\"\n +harga+\"/\"\n +code).\n addListenerForSingleValueEvent(new ValueEventListener() {\n String getQuantity = \"\";\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n for (DataSnapshot snapshot: dataSnapshot.child(\"quantityList\").getChildren()){\n getQuantity += String.valueOf(snapshot.getValue()+\" \");\n }\n Batik viewBatik = new Batik(code,dataSnapshot.child(\"name\").getValue(String.class));\n productCode.setText(viewBatik.getCode());\n productName.setText(viewBatik.getName());\n productBahan.setText(bahan);\n productType.setText(lengan);\n productQuantity.setText(getQuantity);\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }", "private void foundNonExistent() {\n\t\tstate = BridgeState.NON_EXISTENT;\n\t}", "public void setNamaKlinik(String namaKlinik) {\n this.namaKlinik = namaKlinik;\r\n }", "@Test\r\n public void testSearch() throws Exception {\r\n System.out.println(\"rechNom\");\r\n Bureau obj1 = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n Bureau obj2 = new Bureau(0,\"Test2\",\"000000001\",\"\");\r\n String nomrech = \"Test\";\r\n BureauDAO instance = new BureauDAO();\r\n instance.setConnection(dbConnect);\r\n obj1=instance.create(obj1);\r\n obj2=instance.create(obj2);\r\n \r\n \r\n String result = instance.search(nomrech);\r\n if(result.contains(obj1.getSigle())) fail(\"record introuvable \"+obj1);\r\n if(result.contains(obj2.getSigle())) fail(\"record introuvable \"+obj2);\r\n instance.delete(obj1);\r\n instance.delete(obj2);\r\n }", "@Test\n\tpublic void testConsultarUno() {\n\t\tDispositivo dispositivo = new Dispositivo();\n\t\tString referencia = \"A0021R\";\n\t\ttry {\n\t\t\tdispositivo = dispositivoBL.consultarUno(referencia);\n\t\t\tassertTrue(dispositivo != null);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic String queryLostFindGoods(String waybillNo) {\n\t\treturn null;\n\t}", "public String search(String GoodNum) {\n\t\tBillsDataService billsData;\n\t\ttry {\n\t\t\tbillsData=RMIHelper.getDataFactory().getBillsDataFactory().getNewSendingBillsData();\n\t\t\tif(!billsData.Used(GoodNum)){\n\t\t\t\treturn \"托运单号不存在\";\n\t\t\t}\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn \"\";\n\t}", "public Boolean checkBusExistedByTuyen(String Tuyen) {\n String sql = \"select exists (select * from tuyen_bus where Tuyen = ?);\";\n Object[] params = {Tuyen};\n return jdbcTemplate.queryForObject(sql, Boolean.class, params);\n }", "private boolean markNodHijos(String nodPadSel){\n boolean blnRes=true;\n Connection conNodHij;\n Statement stmNodHij;\n ResultSet rstNodHij;\n String strNodPadSel=nodPadSel==null?\"\":nodPadSel;\n arlDatNodHij.clear();\n try{\n conNodHij=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if(conNodHij!=null){\n stmNodHij=conNodHij.createStatement();\n strSQL=\"\";\n strSQL+=\" SELECT a1.co_emp, a1.co_cta, a1.tx_codCta, a1.ne_pad\";\n strSQL+=\" FROM tbm_plaCta AS a1\";\n strSQL+=\" WHERE a1.co_emp=\" + objParSis.getCodigoEmpresa() + \"\";\n strSQL+=\" AND a1.tx_codCta like('\" + objTblModPlaCta.getValueAt(tblDatPlaCta.getSelectedRow(), INT_TBL_PLA_CTA_NUM_CTA) + \"%')\";\n strSQL+=\" ORDER BY a1.tx_codCta\";\n\n rstNodHij=stmNodHij.executeQuery(strSQL);\n while(rstNodHij.next()){\n arlRegNodHij=new ArrayList();\n arlRegNodHij.add(INT_ARL_COD_EMP, \"\" + rstNodHij.getString(\"co_emp\"));\n arlRegNodHij.add(INT_ARL_COD_CTA_SEL, \"\" + rstNodHij.getString(\"ne_pad\"));\n arlRegNodHij.add(INT_ARL_COD_CTA_HIJ, \"\" + rstNodHij.getString(\"co_cta\"));\n arlDatNodHij.add(arlRegNodHij);\n }\n conNodHij.close();\n conNodHij=null;\n stmNodHij.close();\n stmNodHij=null;\n rstNodHij.close();\n rstNodHij=null;\n }\n }\n catch(java.sql.SQLException e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n catch(Exception e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "@Test\n\tpublic void testFindProductByGuidWithNullReturn() {\n\t\tstubGetBean(ContextIdNames.PRODUCT, ProductImpl.class);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(Collections.emptyList()));\n\t\t\t}\n\t\t});\n\t\tassertNull(this.importGuidHelper.findProductByGuid(NON_EXIST_GUID, true, true, true));\n\t}", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.queryAndSimplify(\"eBTux<g'kc|{F(x_]e\", (Connection) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "protected void checkNotExistingItems() {\n Item actualItem;\n //non existing items\n actualItem = mDaoToTest.getItem(mContext, -123423);\n assertNull(\"Item not null\", actualItem);\n actualItem = mDaoToTest.getItem(mContext, RainbowBaseContentProviderDao.NOT_FOUND);\n assertNull(\"Item not null\", actualItem);\n actualItem = mDaoToTest.getItem(mContext, 345823);\n assertNull(\"Item not null\", actualItem);\n }", "@Test\n public void testGetNoResult()\n {\n IHBaseTable table = new HBaseTable(MockHTable.create());\n\n Get get = new Get(Bytes.toBytes(\"totallyArbitraryRowKey\"));\n Result result = table.get(get);\n Assert.assertTrue(result.isEmpty());\n }", "@Test\n\tvoid existDataInDBTest() {\n\t\tparkName = \"Haifa Park\";\n\t\tdate = new Date(120, 2, 1);\n\t\texpected = \"1 2 3 4 5 6 1 23 2 8 9 2 3 2 4 3 2 2 1 1 1 5 32 6 12 7 23 8 12 5 32 6 12 5 23 7\";\n\t\tresult = ReportsController.getReport(date, reportType, parkName);\n\n\t\tassertEquals(expected, result);\n\n\t}", "@Test\n public void t3shouldReturnNull() {\n Invoice actual;\n when(mock.getInvoices()).thenReturn(newInvoices());\n try {\n actual = new InvoiceBook(mock, emailServiceMock)\n .getInvoiceById(mock.getInvoices().get(50).getId());\n } catch (IndexOutOfBoundsException e) {\n actual = null;\n }\n //then\n assertNull(actual);\n\n }", "@Test(expected = CTPException.class)\n public void getCaseByUPRNNotFound() throws Exception {\n\n when(dataRepo.readNonHILatestCollectionCaseByUprn(Long.toString(UPRN.getValue()), true))\n .thenReturn(Optional.empty());\n\n caseSvc.getLatestValidNonHICaseByUPRN(UPRN);\n }", "@Sql({\"/jdbc/search/gene/clean_database.sql\", \"/jdbc/search/gene/gene_autocomplete_schema.sql\", \"/jdbc/search/gene/gene_autocomplete_dataset.sql\"})\n @Test\n public void searchGene_WhenCallWithMissingData_ThenReturnEmptyList() {\n final List<String> searchGenes = searchGeneDBService.searchGene(\"wrong-data\", \"homo_sapiens\", 2);\n\n //Assert\n assertThat(searchGenes)\n .isNotNull()\n .isEmpty();\n }", "public List<PetsFound> getWorkListDisplayData(String orinNo) throws SQLException, ParseException {\n LOGGER.info(\"This is from getWorkListDisplayData..Start\" );\n List<PetsFound> petList = new ArrayList<PetsFound>();\n PetsFound pet=null;\n XqueryConstants xqueryConstants= new XqueryConstants();\n Session session = null;\n Transaction tx = null;\n \n try{\n Properties prop =PropertyLoader.getPropertyLoader(ImageConstants.LOAD_IMAGE_PROPERTY_FILE);\n session = sessionFactory.openSession();\n tx = session.beginTransaction(); \n //Hibernate provides a createSQLQuery method to let you call your native SQL statement directly. \n Query query = session.createSQLQuery(xqueryConstants.getImageManagementDetails()); \n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(100);\n \n // execute delete SQL statement\n List<Object[]> rows = query.list();\n if (rows != null) {\n \n for(Object[] row : rows){ \n \n String parentStyleORIN = row[0]!=null?row[0].toString():null;\n \n String orinNumber=row[1]!=null?row[1].toString():null;\n String entryType= row[2]!=null?row[2].toString():null;\n String vendorStyle=row[3]!=null?row[3].toString():null;\n String vendorColor=row[4]!=null?row[4].toString():null;\n String vendorColorDesc=row[5]!=null?row[5].toString():null;\n String imageStateCode=row[6] == null? \"\" : row[6].toString();\n String imageStateDesc = prop.getProperty(\"Image\"+imageStateCode);\n String imageState = imageStateDesc != null ? imageStateDesc.toString() : null;\n \n String completionDate=row[7]!=null?row[7].toString():null;\n String supplierId=row[8]!=null?row[8].toString():null;\n \n\n String petStateCode=row[9] == null? \"\" : row[9].toString();\n String petStateDesc = prop.getProperty(petStateCode);\n String petState = petStateDesc != null ? petStateDesc.toString() : null;\n \n String returnCarsFlag = row[10] == null? \"\" : row[10].toString();;\n \n pet = mapAdseDbPetsToPortal(parentStyleORIN,orinNumber,entryType,vendorColor,vendorColorDesc,imageState,completionDate,vendorStyle,pet,supplierId,returnCarsFlag); \n petList.add(pet);\n }\n } \n \n \n }catch(Exception e){\n e.printStackTrace();\n \n }\n finally\n {\n LOGGER.info(\"recordsFetched. worklistdisplayDAOimpl finally block..\" );\n session.flush();\n tx.commit();\n session.close();\n \n }\n\n LOGGER.info(\"This is from getWorkListDisplayData..End\" );\n return petList;\n\n \n }", "private void ulangiEnkripsi() {\n this.tfieldP.setText(\"P\");\n this.tfieldQ.setText(\"Q\");\n this.tfieldN.setText(\"N\");\n this.tfieldTN.setText(\"TN\");\n this.tfieldE.setText(\"E\");\n this.tfieldD.setText(\"D\");\n this.tfieldLokasidannamafilehasilenkripsi.setText(\"Lokasi & Nama File Hasil Enkripsi\");\n this.tfieldLokasidannamafileenkripsi.setText(\"Lokasi & Nama File\");\n this.fileAsli = null;\n this.pbEnkripsi.setValue(0);\n this.enkripsi.setP(null);\n this.enkripsi.setQ(null);\n this.enkripsi.setN(null);\n this.enkripsi.setTn(null);\n this.enkripsi.setE(null);\n this.enkripsi.setD(null);\n }", "@Test\r\n public void testParseCloudNullCloudQuantity() {\r\n String cloud = \"AZE015\";\r\n\r\n Cloud res = getSut().parseCloud(cloud);\r\n\r\n assertNull(res);\r\n }", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderColumnListWithTableName(\"pw?(g[&h!X$;C/\", (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n public SearchResult search_item(String keyword, int page, int rows , int search_type) throws Exception{\n return null;\n }", "@Test\n public void getRecipeByName_ReturnsNull(){\n assertEquals(\"getRecipeByName - Returns Null\", null, testDatabase.getRecipe(\"NotHere\"));\n }", "@Test\n public void testFindProductShouldThrowNotFoundWhenProductIdNotFound() throws Exception {\n when(productRepository.findOne(product.getId())).thenReturn(null);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.NOT_FOUND)\n .build());\n }", "public boolean iliskMasaEkleme(int masa_no, int kullanici_no) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n String sorgu3 = \"insert into ilisk_masa (kullanici_no, masa_no) values (\" + kullanici_no + \", \" + masa_no + \")\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n vb.con.close();\r\n ps.close();\r\n \r\n return true;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n return false;\r\n }\r\n }", "private void getRazonNoData(){\n mRazonNoData = estudioAdapter.getListaRazonNoDataSinEnviar();\n //ca.close();\n }", "@Test(priority=9)\r\n public void tu_009()\r\n {\n \t\r\n \tWebElement e5= d.findElement(By.xpath(\"html/body/div[1]/div[3]/div[1]/div[2]/form/fieldset/ol/li[1]/input\"));\r\n \te5.sendKeys(\"maggi1\");\r\n \tWebElement e6= d.findElement(By.xpath(\"html/body/div[1]/div[3]/div[1]/div[2]/form/fieldset/ol/li[3]/input[1]\"));\r\n \te6.sendKeys(\"John Smith1\");\r\n \td.findElement(By.id(\"searchBtn\")).click();\r\n \tWebElement table =d.findElement(By.id(\"resultTable\"));\r\n \t List<WebElement> cols=table.findElements(By.tagName(\"td\"));\r\n \t for(WebElement e:cols)\r\n \t {\r\n \t\t if(e.getText().equals(\"No Records Found\"))\r\n \t\t {\r\n \t\t\t Assert.assertTrue(true);\r\n \t\t\t return;\r\n \t\t\t \r\n \t\t }\r\n \t }\r\n \t Assert.assertTrue(false);\r\n \t\t \r\n }", "private void fetchUnknownOSpeciesCodes(Session session) {\n QAQCMain.log.info(\"Getting sites with other species with unknown code\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.otherSpeciesCode, species.site.siteCode from OtherSpecies as species \"\n + \"where not exists (from RefSpecies as ref where ref.refSpeciesCode like species.otherSpeciesCode) \"\n + \"and species.otherSpeciesGroup not like 'B'\"\n + \"order by species.otherSpeciesCode ASC\";\n Query q = session.createQuery(hql);\n\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n\n Object[] columnNames = {\"Site\", \"Other Species Code\"};\n model.setColumnIdentifiers(columnNames);\n\n updateNumResults(i);\n\n }", "@Test(timeout = 4000)\n public void test019() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.parseResultSet((ResultSet) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test015() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderWhereClause((String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test015() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.renderWhereClause((String[]) null, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n\tpublic boolean queryExcepSignResultByWaybillNo(String originalWaybillNo) {\n\t\treturn false;\n\t}", "@Test\n\t\tpublic void testGetElementByIdWithEmptyDbReturnsnull() throws Exception{\n\t\t\t\t\n\t\t\t// GIVEN the database is empty\n\t\t\t\n\t\t\t\t\t// WHEN we GET GET /elements/{userDomain}/{userEmail}/{elementDomain}/{elementId}\n\t\t\t\t\t// THEN an exception occurs\n\t\t\t\t\tassertThrows(Exception.class, ()->\n\t\t\t\t\t\tthis.restTemple.getForObject(\n\t\t\t\t\t\t\t\tthis.baseUrl + \"/collab/elements/{userDomain}/{userEmail}/{elementDomain}/{elementId}\", \n\t\t\t\t\t\t\t\tElementBoundary.class, \n\t\t\t\t\t\t\t\t\"userDomain\",\n\t\t\t\t\t\t\t\t\"userEmail\",\n\t\t\t\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\t\t\t\"1\"));\n\t\t\t\n\t\t}", "public static WebElement check_inqBasketCountNotMatch(Read_XLS xls, String sheetName, int rowNum, \r\n \t\tList<Boolean> testFail) throws Exception{\r\n \ttry{\r\n \t\tAdd_Log.info(\"Count beside the 'Inquiry basket' in the Global navigation is NOT tally with the number of products added.\");\r\n\t\t\tSuiteUtility.WriteResultUtility(\r\n\t\t\t\t\txls, sheetName, Constant.COL_INQ_BASKET_COUNT_MATCH, rowNum, Constant.KEYWORD_FAIL);\r\n\t\t\ttestFail.set(0, true);\r\n \t}catch(Exception e){\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "@Test\n public void getInvoiceWithNonExistentId() {\n InvoiceViewModel invoiceVM = invoiceService.getInvoice(500);\n assertNull(invoiceVM);\n }", "@Test\n\tpublic void testNotExistingProductsSearchTyped() {\n\t\tEntityManager em = emf.createEntityManager();\n\t\tList<Stock> result = null;\n\t\tem.getTransaction().begin();\n\t\ttry {\n\t\t\t// Search for mutiple stocks.\n\t\t\tTypedQuery<Stock> query = em.createNamedQuery(\"Stock.getStockByProductId\", Stock.class);\n\t\t\tresult = query.setParameter(\"productId\", \"HZ-1000\").getResultList();\n\t\t\tassertEquals(\n\t\t\t\t\t\"Search via typed query for not existing mutiple stocks: Stocks exists in database\",\n\t\t\t\t\t0, result.size());\n\t\t} finally {\n\t\t\tem.close();\n\t\t}\n\t}", "@Override\n\tpublic List<P0001VO> searchAdd() throws DataAccessException {\n\t\treturn null;\n\t}" ]
[ "0.62837714", "0.60503674", "0.5565094", "0.54666317", "0.5445909", "0.5433758", "0.54153526", "0.5346662", "0.53120875", "0.52305394", "0.51572156", "0.515668", "0.51493406", "0.50555885", "0.5034443", "0.50167793", "0.49922267", "0.49895653", "0.4988956", "0.49872586", "0.49788713", "0.4960198", "0.49445838", "0.4940233", "0.49339804", "0.49321878", "0.49042177", "0.48904574", "0.4880094", "0.48764744", "0.48759538", "0.48667392", "0.48626965", "0.48617545", "0.48614103", "0.48554", "0.48512885", "0.48503378", "0.48488113", "0.4826351", "0.48260605", "0.48210034", "0.481831", "0.4812983", "0.4809565", "0.48069206", "0.48041502", "0.4798149", "0.47949514", "0.47835037", "0.47788483", "0.4774203", "0.47738943", "0.47732487", "0.47682104", "0.4767077", "0.47660032", "0.47623023", "0.47615796", "0.47536036", "0.47446442", "0.47410324", "0.47398055", "0.47380206", "0.47378036", "0.47333968", "0.47328046", "0.4732195", "0.47274187", "0.4727296", "0.47218126", "0.47122306", "0.4708137", "0.47061738", "0.4706125", "0.47058737", "0.47024933", "0.46975753", "0.4686704", "0.4686279", "0.46849078", "0.468123", "0.46771777", "0.46768004", "0.4675736", "0.467381", "0.46731088", "0.46628395", "0.4661451", "0.46611676", "0.46576205", "0.4656479", "0.46527693", "0.46527693", "0.46507984", "0.4649959", "0.4647912", "0.46433368", "0.46426782", "0.46393582" ]
0.6213341
1
/ null / empty elts of noInduks are ignored ret all Profil if noInduks = null throws KasirException(BAD_RECORD, tableName). possible only if noInduks = null ret empty Map if (noInduks = null & table is empty) / (all elts of noInduks aren't valid (null / empty)) / noInduks.isEmpty = true ret Map. never null Map.get(noInduks[i]) = null if no row has noInduks[i] Map.size() <= noInduks.length, because duplicate elts of ids are treated as 1 map entry
public static Map<String,Profil> selectS(Set<String> noInduks) throws SQLException, KasirException{ ResultSet rs; Map<String,Profil> noIndukProfil; if(noInduks == null){ rs = DBSR.takeResultSetByStringColl(tableName, noIndukColName, -1, null); noIndukProfil = new HashMap<>(DBSR.rowCountRS(rs)); rs.beforeFirst(); while(rs.next()){ Profil p = Profil.fromResultSet(rs); noIndukProfil.put(p.noInduk, p); } }else{ Set<String> validNoInduk = new HashSet<>(CollectionUtils.subtract(noInduks, Arrays.asList(null, ""))); rs = DBSR.takeResultSetByStringColl(tableName, noIndukColName, -1, validNoInduk); noIndukProfil = new HashMap<>(validNoInduk.size()); for(String noInduk : validNoInduk){ try{ noIndukProfil.put(noInduk, Profil.fromResultSet(rs, noInduk)); }catch(KasirException e){ noIndukProfil.put(noInduk, null); } } } return noIndukProfil; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Result<Map<String, String>> getUsers(Connection c){\n PreparedStatement pstmt;\n ResultSet rst;\n Map<String, String> maps=new HashMap<String,String>(); //Maps\n try {\n pstmt = c.prepareStatement(getUserStatement);\n rst=pstmt.executeQuery();\n while(rst.next()){\n String name=rst.getString(\"name\").trim();\n String username=rst.getString(\"username\").trim();\n System.out.println(name+\",\"+username);\n System.out.println(rst.getRow());\n maps.put(username,name);\n }\n\n /* condition to check if the map/databse is empty*/\n if(!maps.isEmpty()){\n return Result.success(maps);\n }\n else{\n return Result.failure(\"There are no user for this table\");\n }\n }\n catch (SQLException e) {\n return Result.fatal(\"Unknown error\");\n }\n }", "private static Map<String,List<Integer>> getProvisionIdMapStream(Map<String,List<Integer>> nameMapIdMap,Map<String,Integer> mapIdProbIdMap){\n return null;\n }", "@Override\r\n public ParaMap index(ParaMap inMap) throws Exception {\n return null;\r\n }", "public List<Map<String, Object>> query(long tableID, String key)\r\n\t{\n\t\treturn null;\r\n\t}", "public Map<Integer, Boolean> getIsNotEmpty() throws SQLException {\n return retrieveExpected(createNativeIsNotEmptyStatement(), BOOLEAN);\n }", "private ArrayList<HashMap<String, String>> processRetrieve() {\n //Transform and Return Rows to a List of HashMaps\n try {\n if (rs == null) {\n System.out.println(\"rs is null\");\n } else {\n return rsToMaps();\n }\n } catch (SQLException ex) {\n throw new RuntimeException(ex);\n }\n return null;\n }", "@Test\n public void testTableFactoryEmpty() {\n TableController tableController = tableFactory.getTableController();\n Map<Integer, ArrayList<Table>> tableMap = tableController.getTableMap();\n // loop through the map, check that each list is empty\n for (ArrayList<Table> list : tableMap.values()) {\n assertEquals(0, list.size());\n }\n }", "@Override\n\tpublic Map<String, String> findUserInfobById(int id) {\n\t\treturn null;\n\t}", "public static Map<String, String> readIniSectionMap(Section section) {\n\t\tMap<String,String> sectionMap = new HashMap<String, String>();\n\t\tfor(String key:section.keySet()) {\n\t\t\tif(!key.equals(\"NaN\")) {\n\t\t\t\tif(section.getAll(key).size()>1) { // TODO always == 1 ???\n\t\t\t\t\tlog.warn(\"multiple entries: \"+key+\" from \"+section.getName());\n\t\t\t\t}\n\t\t\t\tsectionMap.put(key, section.get(key));\n\t\t\t} else {\n\t\t\t\tlog.warn(\"NaN key\");\n\t\t\t}\n\t\t}\n\t\treturn sectionMap;\n\t}", "public HashMap<String, String> getUpsoDetails() {\n HashMap<String, String> upso = new HashMap<String, String>();\n String selectQuery = \"SELECT * FROM \" + TABLE_UPSO;\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n // Move to first row\n cursor.moveToFirst();\n if (cursor.getCount() > 0) {\n upso.put(\"id\", cursor.getString(1));\n upso.put(\"crtfc_upso_mgt_sno\", cursor.getString(2));\n upso.put(\"upso_sno\", cursor.getString(3));\n upso.put(\"upso_nm\", cursor.getString(4));\n upso.put(\"cgg_code\", cursor.getString(5));\n upso.put(\"cgg_code_nm\", cursor.getString(6));\n upso.put(\"cob_code_nm\", cursor.getString(7));\n upso.put(\"bizcnd_code_nm\", cursor.getString(8));\n upso.put(\"owner_nm\", cursor.getString(9));\n upso.put(\"crtfc_gbn\", cursor.getString(10));\n upso.put(\"crtfc_gbn_nm\", cursor.getString(11));\n upso.put(\"crtfc_chr_nm\", cursor.getString(12));\n upso.put(\"crtfc_chr_id\", cursor.getString(13));\n upso.put(\"map_indict_yn\", cursor.getString(14));\n upso.put(\"crtfc_class\", cursor.getString(15));\n upso.put(\"y_dnts\", cursor.getString(16));\n upso.put(\"x_cnts\", cursor.getString(17));\n upso.put(\"tel_no\", cursor.getString(18));\n upso.put(\"rdn_detail_addr\", cursor.getString(19));\n upso.put(\"rdn_addr_code\", cursor.getString(20));\n upso.put(\"rdn_code_nm\", cursor.getString(21));\n upso.put(\"bizcnd_code\", cursor.getString(22));\n upso.put(\"cob_code\", cursor.getString(23));\n upso.put(\"crtfc_sno\", cursor.getString(24));\n upso.put(\"crt_time\", cursor.getString(25));\n upso.put(\"upd_time\", cursor.getString(26));\n upso.put(\"food_menu\", cursor.getString(27));\n upso.put(\"gnt_no\", cursor.getString(28));\n upso.put(\"crtfc_yn\", cursor.getString(29));\n }\n cursor.close();\n db.close();\n // return upso\n Log.d(TAG, \"Fetching upso from Sqlite: \" + upso.toString());\n\n return upso;\n }", "public List<Map<String, String>> getTable(String tableName) {\n return getTable(tableName, 1, 9999);\n\n }", "public void getOrgUnitAttributeValueMap()\n {\n orgUnitAttributeValueMap = new HashMap<Integer, String>();\n try\n {\n String query = \"SELECT org.organisationunitid, attvalue.value from attributevalue attvalue \" +\n \"INNER JOIN organisationunitattributevalues org ON org.attributevalueid = attvalue.attributevalueid \" + \n \"Where attvalue.attributeid = 1\";\n \n //System.out.println( \"data-set-Query - \" + query );\n SqlRowSet rs = jdbcTemplate.queryForRowSet( query );\n while ( rs.next() )\n {\n Integer orgUnitId = rs.getInt( 1 );\n String orgUnitAttribueValue = rs.getString( 2 );\n \n //System.out.println( orgUnitId + \" : \" + orgUnitAttribueValue );\n \n if ( orgUnitId != null && orgUnitAttribueValue != null )\n {\n orgUnitAttributeValueMap.put( orgUnitId, orgUnitAttribueValue );\n }\n }\n //return orgUnitAttributeValueMap;\n }\n catch ( Exception e )\n {\n throw new RuntimeException( \"Illegal OrgUnitIds \", e );\n }\n }", "public Map<String, String> getAllIdentifiants(){\n\t\tMap<String, String> allIdentifiants = new HashMap<String, String>();\n\t\ttry {\n\t\t\tallIdentifiants = utilisateurDAO.selectAllIdentifiants();\n\t\t} catch (DALException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn allIdentifiants;\n\t}", "public static Profil fromResultSet(ResultSet rs, String noInduk) throws SQLException, KasirException {\r\n assert noInduk != null && !noInduk.isEmpty() : \"fromResultSet(ResultSet, String noInduk = null / empty)\";\r\n \r\n return fromResultSet(rs, noIndukColName, false, noInduk);\r\n }", "private static synchronized void loadDefaults(String inTableName) \n\t\tthrows CoreServerException\n\t{\n\t\t// Do a quick check if the table has already been loaded\n\t\tMap<String, Object> defaults = allDefaultValues.get(inTableName);\n\t\t\n\t\tif (defaults != null)\n\t\t\treturn;\n\n\t\t// The defaults have not been loaded for this table yet...so load them\n\t\t(Configurator.getMainLogger()).trace(\"Entered loadDefaults for \" + inTableName);\n\n\t\tConnection connection = null;\n\t\tPreparedStatement pstmt = null;\n\t\t// Prepare an empty placeholder row\n\t\tdefaults = new Hashtable<String, Object>();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tconnection = DatabaseWrapper.getConnection();\n\n\t\t\tpstmt = connection.prepareStatement(\"select * from \" + inTableName + \" where idk = \" +\n\t\t\t\tKEY_DEFAULT_VALUES_RECORD);\n\n\t\t\tResultSet rs = pstmt.executeQuery();\n\t\t\tResultSetMetaData rsmd = rs.getMetaData();\n\t\t\tint columnCount = rsmd.getColumnCount();\n\t\t\tString columnName = null;\n\t\t\tif (rs.next())\n\t\t\t{\n\t\t\t\tint i=1;\n\n\t\t\t\t// load the row with the result set's current row's names/values\n\t\t\t\twhile (i<=columnCount)\n\t\t\t\t{\n\t\t\t\t\tcolumnName = rsmd.getColumnName(i);\n\t\t\t\t\t/*\n\t\t\t\t\t * THIS COMMENT BLOCKS OUT SCRAMBLING AT THE DEFAULTS LEVEL.\n\t\t\t\t\t// the following is a little hack... see createDatabase.sql for reasoning\n\t\t\t\t\tif (columnName.endsWith(\"idk\")) // we do this to select what to scramble or not\n\t\t\t\t\t\t\t\t\t\t\t\t // ...see the PrimaryKeyHolder class for details.\n\t\t\t\t\t\tdefaults.put(columnName, simpleScramble(rs.getLong(columnName)));\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdefaults.put(columnName, getObject(rs, rsmd, i));\n\t\t\t\t\t\t// defaults.put(columnName, rs.getObject(columnName));\n\t\t\t\t\t\t\n\t\t\t\t\t\t//System.out.println(\"Defaults: columnName: \" + columnName + \n\t\t\t\t\t\t//\t\"<-->\" + rs.getObject(columnName).getClass() + \n\t\t\t\t\t\t//\t\"<-->\" + rs.getObject(columnName));\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\tif (columnName.equals(\"idk\") ||\n\t\t\t\t\t\tcolumnName.equals(\"lockingversion\") ||\n\t\t\t\t\t\tcolumnName.equals(\"timecreated\") ||\n\t\t\t\t\t\tcolumnName.equals(\"timelastmodified\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t// don't add these fields: they should never have defaults\n\t\t\t\t\t}\n\t\t\t\t\telse if (rs.getObject(columnName) != null)\n\t\t\t\t\t\tdefaults.put(columnName, getObject(rs, rsmd, i));\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\t// place the defaults into the hashtable of all bean defaults keyed to the table name\n\t\t\t\tallDefaultValues.put(inTableName, defaults);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t(Configurator.getMainLogger()).error(\"database.NoDefaultValues\");\n\t\t\t\tthrow new CoreServerException(\"database.NoDefaultValues\");\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tallDefaultValues.remove(inTableName);\n\t\t\tif (e.getClass().equals(CoreServerException.class))\n\t\t\t\tthrow (CoreServerException) e;\n\t\t\tthrow new CoreServerException(\"defaultValues.UnableToLoadDefaults\");\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\ttry { if (pstmt != null) pstmt.close(); }\n\t\t\tcatch (Exception e) {}\n\t\t\ttry { if (connection != null) connection.close(); }\n\t\t\tcatch (Exception e) {}\t\t\t\n\t\t}\n\t}", "private Map<String, String> solutionForCNAEIsNotFull() {\r\n Map<String, String> map = new HashMap<>();\r\n map.put(this.students[0].getName(), this.schools[2].getName());\r\n map.put(this.students[1].getName(), this.schools[2].getName());\r\n map.put(this.students[2].getName(), null);\r\n map.put(this.students[3].getName(), this.schools[2].getName());\r\n return map;\r\n }", "public abstract Map<String, Protein> getProteins();", "@Override\n\tpublic boolean isEmpty() {\n\t\tif (entityType2tableName.isEmpty())\n\t\t\treturn true;\n\t\t\n\t\t// the hard way \n\t\ttry {\n\t\t\tStatement st = connection.createStatement(\n\t\t\t\t\tResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t ResultSet.CONCUR_READ_ONLY);\n\t\t\t\n\t\t\tfor (String tableName: entityType2tableName.values()) {\n\t\t\t\t//ResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\";\");\n\t\t\t\t\n\t\t\t\tResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\" LIMIT 1\");\n\t\t\t\t\n\t\t\t\tif (!set.next())\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\n\t\t} catch (SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tthrow new RuntimeException(\"Error while checking if the table is empty\",e1);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public Map<Integer, Boolean> getIsEmpty() throws SQLException {\n return retrieveExpected(createNativeIsEmptyStatement(), BOOLEAN);\n }", "public Map<String, String> dataretrivefromemployeetable() throws SQLException, ClassNotFoundException {\n\t\tClass.forName(driver);\r\n\t\t\r\n\t\t//Connection with database\r\n\t\tcon = DriverManager.getConnection(url,username,password);\r\n\t\t\r\n\t\t//create statment \t\t\r\n\t\tstm = con.createStatement();\r\n\t\t\r\n\t\t//execution of sql query and save resultset\r\n\t\trs = stm.executeQuery(mssqlstmt);\r\n\t\t\r\n\t\t//initialize map object that would be returned\r\n\t\tdata = new HashMap<>();\r\n\r\n\t\twhile (rs.next()) {\r\n\t\t\tString username = rs.getString(\"username\");\r\n\t\t\tString password = rs.getString(\"password\");\r\n\t\t\tdata.put(username, password);\r\n\t\t}\r\n\t\t\r\n\t\t//resultset closing\r\n\t\trs.close();\r\n\t\t//statement closing\r\n\t\tstm.close();\r\n\t\t//closing connection\r\n\t\tcon.close();\r\n\t\t\r\n/*\t\tdata.put(\"parveen1\", \"123\");\r\n\t\tdata.put(\"parveen2\", \"123\");\r\n\t\tdata.put(\"parveen3\", \"123\");\r\n*/\t\t\r\n\t\treturn data;\r\n\t}", "private Map<Long, List<ObligacionCoactivoDTO>> consultaObligacionesComparendo() {\n logger.debug(\"CoactivoEJB::consultaObligacionesComparendo()\");\n Map<Long, List<ObligacionCoactivoDTO>> obligacionesDeudor = new HashMap<>();\n StringBuilder consulta = new StringBuilder();\n consulta.append(\"SELECT \");\n consulta.append(\"p.id_cartera, \");\n consulta.append(\"ca.saldo_capital, \");\n consulta.append(\"ca.saldo_interes, \");\n consulta.append(\"p.numero_obligacion, \");\n consulta.append(\"p.id_deudor, \");\n consulta.append(\"p.fecha_obligacion, \");\n consulta.append(\"p.id_funcionario, \");\n consulta.append(\"p.id_cargue_coactivo, \");\n consulta.append(\"p.id_precoactivo \");\n consulta.append(\"FROM precoactivo p \");\n consulta.append(\"JOIN cartera ca on ca.id_cartera = p.id_cartera \");\n consulta.append(\"WHERE p.id_estado_precoactivo = :estadoAprobado \");\n consulta.append(\"AND p.codigo_tipo_obligacion = :tipoComparendo \");\n\n Query query = em.createNativeQuery(consulta.toString());\n query.setParameter(\"estadoAprobado\", EnumEstadoPrecoactivo.AUTORIZADO.getValue());\n query.setParameter(\"tipoComparendo\", EnumTipoObligacion.COMPARENDO.getValue());\n @SuppressWarnings({ \"unchecked\" })\n List<Object[]> lsObligacionesComparendos = Utilidades.safeList(query.getResultList());\n\n for (Object[] obligacionComparendo : lsObligacionesComparendos) {\n int i = 0;\n BigInteger idCartera = (BigInteger) obligacionComparendo[i++];\n BigDecimal saldoCapital = (BigDecimal) obligacionComparendo[i++];\n BigDecimal saldoInteres = (BigDecimal) obligacionComparendo[i++];\n String numObligacion = (String) obligacionComparendo[i++];\n Long idDeudor = ((BigInteger) obligacionComparendo[i++]).longValue();\n Date fechaObligacion = (Date) obligacionComparendo[i++];\n Integer idFuncionario = (Integer) obligacionComparendo[i++];\n Long idCargue = ((BigInteger) obligacionComparendo[i++]).longValue();\n Long idPrecoactivo = ((BigInteger) obligacionComparendo[i++]).longValue();\n\n CoactivoDTO coactivo = new CoactivoDTO();\n coactivo.setCargueCoactivo(new CargueCoactivoDTO(idCargue));\n coactivo.setFuncionario(new FuncionarioDTO(idFuncionario));\n coactivo.setPersona(new PersonaDTO(idDeudor));\n // Arma obligacion que va a entrar a coactivo\n ObligacionCoactivoDTO obligacion = new ObligacionCoactivoDTO();\n obligacion.setCodigoTipoObligacion(EnumTipoObligacion.COMPARENDO.getValue());\n obligacion.setCartera(new CarteraDTO(idCartera.longValue()));\n obligacion.setNumeroObligacion(numObligacion);\n obligacion.setCoactivo(coactivo);\n obligacion.setFechaObligacion(fechaObligacion);\n obligacion.setValorObligacion(saldoCapital);\n obligacion.setValorInteresMoratorios(saldoInteres);\n obligacion.setIdPrecoativo(idPrecoactivo);\n if (!obligacionesDeudor.containsKey(idDeudor)) {\n obligacionesDeudor.put(idDeudor, new ArrayList<ObligacionCoactivoDTO>());\n }\n obligacionesDeudor.get(idDeudor).add(obligacion);\n }\n return obligacionesDeudor;\n }", "private List<Map<String,Object>> listAccessibleMaps() {\r\n \r\n List<Map<String, Object>> accessMapData = null;\r\n \r\n ArrayList args = new ArrayList();\r\n String accessClause = userAuthoritiesProvider.getInstance().sqlRoleClause(\"allowed_usage\", \"owner_name\", args, \"read\");\r\n try {\r\n accessMapData = magicDataTpl.queryForList(\r\n \"SELECT name, title, description FROM \" + env.getProperty(\"postgres.local.mapsTable\") + \" WHERE \" + \r\n accessClause + \" ORDER BY title\", args.toArray()\r\n );\r\n /* Determine which maps the user can additionally edit and delete */\r\n ArrayList wargs = new ArrayList();\r\n List<Map<String,Object>> writeMapData = magicDataTpl.queryForList(\r\n \"SELECT name FROM \" + env.getProperty(\"postgres.local.mapsTable\") + \" WHERE \" + \r\n userAuthoritiesProvider.getInstance().sqlRoleClause(\"allowed_edit\", \"owner_name\", wargs, \"update\") + \" ORDER BY title\", wargs.toArray()\r\n );\r\n ArrayList dargs = new ArrayList();\r\n List<Map<String,Object>> deleteMapData = magicDataTpl.queryForList(\r\n \"SELECT name FROM \" + env.getProperty(\"postgres.local.mapsTable\") + \" WHERE \" + \r\n userAuthoritiesProvider.getInstance().sqlRoleClause(\"allowed_edit\", \"owner_name\", dargs, \"delete\") + \" ORDER BY title\", dargs.toArray()\r\n );\r\n for (Map<String,Object> mapData : accessMapData) {\r\n mapData.put(\"w\", \"no\");\r\n mapData.put(\"d\", \"no\");\r\n String name = (String)mapData.get(\"name\");\r\n writeMapData.stream().map((wData) -> (String)wData.get(\"name\")).filter((wName) -> (wName.equals(name))).forEachOrdered((_item) -> {\r\n mapData.put(\"w\", \"yes\");\r\n });\r\n deleteMapData.stream().map((dData) -> (String)dData.get(\"name\")).filter((dName) -> (dName.equals(name))).forEachOrdered((_item) -> {\r\n mapData.put(\"d\", \"yes\");\r\n });\r\n }\r\n } catch(DataAccessException dae) {\r\n accessMapData = new ArrayList();\r\n System.out.println(\"Failed to determine accessible maps for user, error was : \" + dae.getMessage());\r\n }\r\n return(accessMapData);\r\n }", "public static Map<String,String> getIndustriesFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_INDUSTRIES_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_INDUSTRIES_KEY);\n \t\tlog.info(\"Memcache getIndustriesFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public Map get_carrer_profile_honor_award(Connection con, int user_id,int carrer_profile_honor_award_id)\n\t{\n\t\n\t\t String honor_award_title = null, honor_award_associated_with = null, honor_award_issuer = null, honor_award_website_link = null, honor_award_instgram_link = null, honor_award_facebook_link = null, honor_award_twitter_link = null, honor_award_other_link = null,honor_award_description = null;\n\t\t Blob[] carrer_profile_honor_award_audio = null,carrer_profile_honor_award_video = null, carrer_profile_honor_award_images = null;\n\t\t Date honor_award_date = null;\n\t\t ArrayList<Object> audio= new ArrayList<Object>();\n\t\t ArrayList<Object> video= new ArrayList<Object>();\n\t\t ArrayList<Object> images= new ArrayList<Object>();\n\t\t Map carrer_profile_honor_award = new HashMap();\n\t\t \n\t\t ResultSet rs; \n\t\t PreparedStatement pst;\n\t\t\n\t\ttry {\n\t\t\tpst=con.prepareStatement(\"select honor_award_title,honor_award_associated_with,honor_award_issuer,honor_award_date,honor_award_description,honor_award_website_link,honor_award_instgram_link,honor_award_facebook_link,honor_award_twitter_link,honor_award_other_link from carrer_profile_honor_award where e_id=? and carrer_profile_honor_award_id=?\");\n\t\t\tpst.setInt(1, user_id);\n\t\t\tpst.setInt(2, carrer_profile_honor_award_id);\n\t\t\trs=pst.executeQuery();\n\t\t\twhile(rs.next()) \n\t\t\t{\n\t\t\t\thonor_award_title=rs.getString(1);\n\t\t\t\thonor_award_associated_with=rs.getString(2);\n\t\t\t\thonor_award_issuer=rs.getString(3);\n\t\t\t\thonor_award_date=rs.getDate(4);\n\t\t\t\thonor_award_description=rs.getString(5); \n\t\t\t\thonor_award_website_link=rs.getString(6);\n\t\t\t\thonor_award_instgram_link=rs.getString(7);\n\t\t\t\thonor_award_facebook_link=rs.getString(8);\n\t\t\t\thonor_award_twitter_link=rs.getString(9);\n\t\t\t\thonor_award_other_link=rs.getString(10);\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\taudio=get_carrer_profile_media(con,user_id,carrer_profile_honor_award_id,\"carrer_profile_honor_award\",\"audio\");\n\t\t\tvideo=get_carrer_profile_media(con,user_id,carrer_profile_honor_award_id,\"carrer_profile_honor_award\",\"video\");\n\t\t\timages=get_carrer_profile_media(con,user_id,carrer_profile_honor_award_id,\"carrer_profile_honor_award\",\"images\");\n\t\t\t\n\t\t\t}catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\tcarrer_profile_honor_award.put(\"honor_award_title\", honor_award_title);\n\t\tcarrer_profile_honor_award.put(\"honor_award_associated_with\", honor_award_associated_with);\n\t\tcarrer_profile_honor_award.put(\"honor_award_issuer\", honor_award_issuer);\n\t\tcarrer_profile_honor_award.put(\"honor_award_description\", honor_award_description);\n\t\tcarrer_profile_honor_award.put(\"honor_award_website_link\", honor_award_website_link);\n\t\tcarrer_profile_honor_award.put(\"honor_award_instgram_link\", honor_award_instgram_link);\n\t\tcarrer_profile_honor_award.put(\"honor_award_facebook_link\", honor_award_facebook_link);\n\t\tcarrer_profile_honor_award.put(\"honor_award_twitter_link\", honor_award_twitter_link);\n\t\tcarrer_profile_honor_award.put(\"honor_award_other_link\", honor_award_other_link);\n\t\tcarrer_profile_honor_award.put(\"audio\", audio);\n\t\tcarrer_profile_honor_award.put(\"video\", video);\n\t\tcarrer_profile_honor_award.put(\"images\", images);\n\t\t\n\t\treturn carrer_profile_honor_award;\n\t}", "public void getOrgUnitGroupNameMap()\n {\n orgUnitGroupNameMap = new HashMap<Integer, String>();\n try\n {\n String query = \"SELECT orgGrpMem.organisationunitid,orgGrp.name from orgunitgroupsetmembers orgGrpsetMem \" +\n \"INNER JOIN orgunitgroupmembers orgGrpMem ON orgGrpMem.orgunitgroupid = orgGrpsetMem.orgunitgroupid \" + \n \"INNER JOIN orgunitgroupset orgGrpSet ON orgGrpSet.orgunitgroupsetid = orgGrpsetMem.orgunitgroupsetid \" +\n \"INNER JOIN orgunitgroup orgGrp ON orgGrp.orgunitgroupid = orgGrpMem.orgunitgroupid \" + \n \"WHERE orgGrpSet.name IN ( 'Kayakalp CHC/CH/DH', 'Kayakalp PHC Bedded', 'Kayakalp PHC Non Bedded' )\";\n \n //System.out.println( \"data-set-Query - \" + query );\n SqlRowSet rs = jdbcTemplate.queryForRowSet( query );\n while ( rs.next() )\n {\n Integer orgUnitId = rs.getInt( 1 );\n String orgUnitGroupName = rs.getString( 2 );\n \n //System.out.println( orgUnitId + \" : \" + orgUnitAttribueValue );\n \n if ( orgUnitId != null && orgUnitGroupName != null )\n {\n orgUnitGroupNameMap.put( orgUnitId, orgUnitGroupName );\n }\n }\n //return orgUnitAttributeValueMap;\n }\n catch ( Exception e )\n {\n throw new RuntimeException( \"Illegal OrgUnitGroupIds \", e );\n }\n }", "@Test\n\tpublic void checkNoElementInTableOutsideAPI() throws ParseException\n\t{\n\t\t// Table Data\n\t\tMap<String, Object> tableMap = dashboardPage.addRowDataToMap();\n\t\t// API Data\n\t\tresponsePage = new APIResponsePageObject(driver);\n\t\tMap<String, Object> apiMap = responsePage.getRateDataFromAPI();\n\t\t\n\t\t// Map that has key - values missing in tableMap that are in apiMap\n\t\tMap notInAPIMap = new HashMap<>(tableMap);\n\t\tnotInAPIMap.keySet().removeAll(apiMap.keySet());\n\t\tnotInAPIMap.values().removeAll(apiMap.values());\n\t\t\n\t\tif(notInAPIMap.size() > 1)\n\t\t{\n\t\t\terrorMessage = \"Html table is having \" + notInAPIMap.toString() + \" that are not from API\";\n\t\t\tAssert.fail(errorMessage);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAssert.assertTrue(notInAPIMap.size() == 0);\n\t\t}\n\t}", "public static HashMap<Long, User> userMapInit() {\n HashMap<Long, User> userMap = new HashMap<Long, User>();\n\n\n User user = UserFactory.getNewUser(\"firstName\", \"secondName\");\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"firstN1\", \"secondN1\", \"88005553535\"));\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"first2\", \"second2\", \"890006662525\"));\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"fir3\", \"sec3\", \"72563698562\"));\n userMap.put(user.getId(), user);\n\n user = UserFactory.getNewUser(\"firstN1\", \"secondN1\");\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"sfg\", \"gdsfg\", \"88005693599\"));\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"asdfdsf\", \"secovbnd2\", \"890006662577\"));\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"bbbbb\", \"nbvnbn\", \"72563698588\"));\n userMap.put(user.getId(), user);\n\n user = UserFactory.getNewUser(\"first2\", \"second2\");\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"sfg\", \"gdsfg\", \"88005693599\"));\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"asdfdsf\", \"secovbnd2\", \"890006662577\"));\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"bb\", \"nb\", \"72563698588\"));\n userMap.put(user.getId(), user);\n\n user = UserFactory.getNewUser(\"fir3\", \"sec3\");\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"asdfdsf\", \"secovbnd2\", \"890006662577\"));\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"firstN1\", \"secondN1\", \"88005553535\"));\n user.addPhone(PhoneService.getPhoneFactory().getNewPhone(\"sfg\", \"gdsfg\", \"88005693599\"));\n userMap.put(user.getId(), user);\n\n return userMap;\n }", "List<MorePracticeClass> selectQueryNotProMng(HashMap map, RowBounds rowBounds);", "private Map<Integer,Boolean> getProductCodeMap(){\n\t\t/*\n\t\t * Preleviamo i codici prodotto attualmente registrati nel database\n\t\t */\n\t\tStatement codeSt = null;\n\t\tResultSet codeRs = null;\n\t\ttry{\n\t\t\tcodeSt = connection.createStatement();\n\t\t\tString sql = \"SELECT CODICE FROM PRODOTTO;\";\n\t\t\tcodeRs = codeSt.executeQuery(sql);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"DB issue: failed to fetch product IDs from database.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\tMap<Integer,Boolean> codeMap = new HashMap<Integer,Boolean>();\n\t\tBoolean placeHolder = new Boolean(true);\n\t\ttry{\n\t\t\twhile(codeRs.next()){\n\t\t\t\tcodeMap.put(codeRs.getInt(\"CODICE\"), placeHolder);\n\t\t\t}\n\t\t\tcodeSt.close(); // Chiude anche il ResultSet codeRs\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"ResultSet issue: failed to create the product code list.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\treturn codeMap;\n\t}", "public Map<String, String[]> getAllIdentifiantsUniques() {\n\t\tMap<String, String[]> allIdentifiantsUniques = new HashMap<>();\n\t\ttry {\n\t\t\tallIdentifiantsUniques = utilisateurDAO.selectAllIdentifiantsUniques();\n\t\t} catch (DALException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn allIdentifiantsUniques;\n\t}", "public static Map<List<Integer>, List<List<Integer>>> CollectTableInstasnces(List<List<Integer>> candidateList,\n Map<Integer,Map<List<Integer>, List<List<Integer>>>> starNeighbor,\n Map<List<Integer>, List<List<Integer>>> tableInstanceSizekSub1,\n int k){\n\n\n // [A, B]:[[1,2],[1,3]]\n // Return table instances\n Map<List<Integer>, List<List<Integer>>> tableInstances = new HashMap<>();\n\n // convert candidate to hashset\n Set<List<Integer>> candidateSet = new HashSet<>(candidateList);\n\n for(List<Integer> candidate: candidateSet){\n if (starNeighbor.containsKey(candidate.get(0))){\n\n // get remain candidate list\n List<Integer> remainCandidateElement = candidate.subList(1, k+1);\n\n // store the table instance of the current candidate\n List<List<Integer>> realCliquesAll = new ArrayList<>();\n\n // Loop hashmap\n Iterator<Map.Entry<List<Integer>, List<List<Integer>>>> itr = starNeighbor.get(candidate.get(0)).entrySet().iterator();\n while (itr.hasNext()){\n Map.Entry<List<Integer>, List<List<Integer>>> entry = itr.next();\n // put remain instance\n List<List<Integer>> tempRemain = new ArrayList<>();\n\n for (Integer feature : remainCandidateElement) {\n List<Integer> remainPoint = entry.getValue().parallelStream().filter( point ->\n point.get(0).equals(feature))\n .map(inst -> inst.get(1))\n .collect(Collectors.toList());\n\n if (!remainPoint.isEmpty()) {\n tempRemain.add(remainPoint);\n }\n }\n\n if (tempRemain.size() == k){\n // store the first instance into it\n tempRemain.add(0, Arrays.asList(entry.getKey().get(1)));\n\n // Cartesian product tempRemain based on combinatoricslib lib\n List<List<Integer>> remainFeatureInstance = MyGenerator.cartesianProductInteger(tempRemain);\n\n // Check real cliques\n List<List<Integer>> realClique = remainFeatureInstance.parallelStream().filter( row -> {\n\n return tableInstanceSizekSub1.get(remainCandidateElement).contains(row.subList(1, k+1));\n\n }).collect(Collectors.toList());\n\n if (!realClique.isEmpty()){\n realCliquesAll.addAll(realClique);\n }\n\n }\n }\n // put in table instances\n if(!realCliquesAll.isEmpty()){\n tableInstances.put(candidate, realCliquesAll);\n }\n }\n\n }\n return tableInstances;\n }", "public List getOwnerUsersList(Map map) {\n\t String currentUser = UserUtil.getCurrentPrincipalUser();\r\n\t\t List ls = (List)map.get(currentUser);\r\n//\t\t System.out.println(\"map.size()\"+currentUser) ;\r\n//\t\t System.out.println(map.size()) ;\r\n\t\treturn ls;\r\n\t}", "@Override\r\n\tpublic Map<Long, String> getUnidadesByEstructuraId(Integer estructura) {\t\t\r\n\t\tMap<Long, String> unidades = new HashMap<Long, String>();\r\n\t\tList<Map<String, Object>> rows = jdbcTemplate.queryForList(SQL_SELECT_UNIDADES_COMPETENCIA + \" where catuc.id is not null and ef.id=\"+estructura);\r\n\t\tfor(Map<String, Object> row : rows){\r\n\t\t\tunidades.put((Long)row.get(\"codigo\"), (String)row.get(\"descripcion\"));\r\n\t\t}\r\n\t\treturn unidades;\r\n\t}", "public static Profil select(String noInduk) throws SQLException, KasirException{\r\n assert noInduk != null && !noInduk.isEmpty() : \"selectProfil(String, String, String noInduk = null)\";\r\n\r\n return select(noIndukColName, false, noInduk);\r\n }", "private Map<String, Object> dealWithMap(Map<String, Object> paramMap)\n {\n Set<String> set = new HashSet<String>();\n for (String colName : defaultValColArr)\n {\n set.add(colName);\n }\n for (String colName : pkColArr)\n {\n set.add(colName);\n }\n Iterator<String> iterator = set.iterator();\n while (iterator.hasNext())\n {\n String colName = iterator.next();\n if (paramMap.get(colName) == null)\n {\n paramMap.remove(colName);\n }\n }\n return paramMap;\n }", "public List<Map<String, Object>> Listar_Cumplea˝os(String mes,\r\n String dia, String aps, String dep, String are,\r\n String sec, String pue, String fec, String edad,\r\n String ape, String mat, String nom, String tip, String num) {\r\n sql = \"SELECT * FROM RHVD_FILTRO_CUMPL_TRAB \";\r\n sql += (!aps.equals(\"\")) ? \"Where UPPER(CO_APS)='\" + aps.trim().toUpperCase() + \"'\" : \"\";\r\n sql += (!dep.equals(\"\")) ? \"Where UPPER(DEPARTAMENTO)='\" + dep.trim().toUpperCase() + \"'\" : \"\";\r\n sql += (!are.equals(\"\")) ? \"Where UPPER(AREA)='\" + are.trim().toUpperCase() + \"'\" : \"\";\r\n sql += (!sec.equals(\"\")) ? \"Where UPPER(SECCION)='\" + sec.trim().toUpperCase() + \"'\" : \"\";\r\n sql += (!pue.equals(\"\")) ? \"Where UPPER(PUESTO)='\" + pue.trim().toUpperCase() + \"'\" : \"\";\r\n //sql += (!fec.equals(\"\")) ? \"Where FECHA_NAC='\" + fec.trim() + \"'\" : \"\"; \r\n sql += (!edad.equals(\"\")) ? \"Where EDAD='\" + edad.trim() + \"'\" : \"\";\r\n sql += (!ape.equals(\"\")) ? \"Where UPPER(AP_PATERNO)='\" + ape.trim().toUpperCase() + \"'\" : \"\";\r\n sql += (!mat.equals(\"\")) ? \"Where UPPER(AP_MATERNO)='\" + mat.trim().toUpperCase() + \"'\" : \"\";\r\n sql += (!nom.equals(\"\")) ? \"Where UPPER(NO_TRABAJADOR)='\" + nom.trim().toUpperCase() + \"'\" : \"\";\r\n sql += (!tip.equals(\"\")) ? \"Where UPPER(TIPO)='\" + tip.trim().toUpperCase() + \"'\" : \"\";\r\n sql += (!num.equals(\"\")) ? \"Where NU_DOC='\" + num.trim() + \"'\" : \"\";\r\n //buscar por rango de mes de cumplea├▒os*/\r\n\r\n sql += (!mes.equals(\"\") & !mes.equals(\"13\")) ? \"where mes='\" + mes.trim() + \"' \" : \"\";\r\n sql += (!mes.equals(\"\") & mes.equals(\"13\")) ? \"\" : \"\";\r\n sql += (!dia.equals(\"\")) ? \"and dia='\" + dia.trim() + \"'\" : \"\";\r\n return jt.queryForList(sql);\r\n }", "public abstract java.util.Map<java.lang.String, java.lang.Integer> idiosyncraticEventIncidenceCountMap();", "@Override\r\n\tpublic int listCount(Map<String, Object> map) throws SQLException {\n\t\treturn 0;\r\n\t}", "public Map<Long, User> showUsers() throws UserException {\n\t\treturn null;\r\n\t}", "@Transactional\n\tpublic Map<String, InterestProfile> getInterestProfiles()\n\t{\n\t\tif ( interestProfileCache == null || interestProfileCache.isEmpty() )\n\t\t\tupdateInterestProfilesCache();\n\t\treturn interestProfileCache;\n\t}", "private void fillMap(Grid tablero) { // reads the board and fill auxiliary map\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n if (tablero.getCell(i, j) == 0) {\n Cell c = new Cell(i, j);\n ArrayList<Integer> elements = fillDomain();\n map.put(c, elements);\n } else {\n Cell c = new Cell(i, j);\n ArrayList<Integer> elements = new ArrayList<>();\n elements.add(tablero.getCell(i, j));\n map.put(c, elements);\n }\n }\n }\n }", "protected Map getProfileMap() {\n \t\t\treturn profileMap;\n \t\t}", "public static Map<String, String> getTableMap() {\n return tableMap;\n }", "@Test\n @DisplayName(\"identity map includes entry\")\n void includesTheEntry() {\n assertThat(identityMap.entryNotPresent(id), is(false));\n }", "public HashMap<Integer,Integer> recover() {\n \tHashMap<Integer,Integer> hash1 = new HashMap();\n \tint counter = 0;\n \tfor(int i = 0; i <this.r;i++) {\n \tfor(int j = 0 ; j <this.s * 2; j ++)\n \t{\n \t\tif(net[i][j].isOneSparse()) {\n \t\t\tint index = this.net[i][j].getIota()/this.net[i][j].getPhi();\n \t\t\tif(hash1.containsKey(index)) {\n \t\t\t\thash1.put(index, hash1.get(index) + this.net[i][j].getPhi());\n \t\t\t}\n \t\t\telse {\n \t\t\t\thash1.put(index,this.net[i][j].getPhi());\n \t\t\t\t\n \t\t\t}\n \t\t\tcounter++;\n \t\t\t\n \t\t}\n \t\t\n \t}\n \t}\n \tif(counter != 0 && counter < s)\n \t{\n \t\treturn hash1;\n \t\t\n \t}\n \telse\n \t{\n \t\treturn null;\n \t}\n \n }", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public static void getMapDetails(){\n\t\tmap=new HashMap<String,String>();\r\n\t map.put(getProjName(), getDevID());\r\n\t //System.out.println(\"\\n[TEST Teamwork]: \"+ map.size());\r\n\t \r\n\t // The HashMap is currently empty.\r\n\t\tif (map.isEmpty()) {\r\n\t\t System.out.println(\"It is empty\");\r\n\t\t \r\n\t\t System.out.println(\"Trying Again:\");\r\n\t\t map=new HashMap<String,String>();\r\n\t\t map.put(getProjName(), getDevID());\r\n\t\t \r\n\t\t System.out.println(map.isEmpty());\r\n\t\t}\r\n\t\t \r\n\t\t\r\n\t\t//retrieving values from map\r\n\t Set<String> keys= map.keySet();\r\n\t for(String key : keys){\r\n\t \t//System.out.println(key);\r\n\t System.out.println(key + \": \" + map.get(key));\r\n\t }\r\n\t \r\n\t //searching key on map\r\n\t //System.out.println(\"Map Value: \"+map.containsKey(toStringMap()));\r\n\t System.out.println(\"Map Value: \"+map.get(getProjName()));\r\n\t \r\n\t //searching value on map\r\n\t //System.out.println(\"Map Key: \"+map.containsValue(getDevID()));\r\n\t \r\n\t\t\t\t\t // Put keys into an ArrayList and sort it.\r\n\t\t\t\t\t\t//ArrayList<String> list = new ArrayList<String>();\r\n\t\t\t\t\t\t//list.addAll(keys);\r\n\t\t\t\t\t\t//Collections.sort(list);\r\n\t\t\t\t\r\n\t\t\t\t\t\t// Display sorted keys and their values.\r\n\t\t\t\t\t\t//for (String key : list) {\r\n\t\t\t\t\t\t// System.out.println(key + \": \" + map.get(key));\r\n\t\t\t\t\t\t//}\t\t\t \r\n\t}", "Map<String, String> findAllInMap();", "private Map<String, Object> getMapaParametrosLimpio(Reporte reporte) throws Exception {\n\t\tfor(ParametroReporte cadaParametro : reporte.getListaParametroReporte()) {\n\n\t\t\tif(getBeanReporte().getMapaParametros().get(cadaParametro.getNombreAtributo()) == null) {\n\t\t\t\tgetBeanReporte().getMapaParametros().remove(cadaParametro.getNombreAtributo());\n\t\t\t} else {\n\t\t\t\tif(cadaParametro.getTipo() == ParametroReporte.Tipo.LISTADO_SIMPLE \n\t\t\t\t\t\t&& getBeanReporte().getMapaParametros().get(cadaParametro.getNombreAtributo()).equals(\"\")) {\n\t\t\t\t\tgetBeanReporte().getMapaParametros().remove(cadaParametro.getNombreAtributo());\n\t\t\t\t} else if (cadaParametro.getTipo() == ParametroReporte.Tipo.LISTADO_MULTIPLE) {\n\t\t\t\t\t//Si es listado multiple, lo paso de arreglo de objetos a lista de String \n\t\t\t\t\tString[] arreglo = (String[]) getBeanReporte().getMapaParametros().get(cadaParametro.getNombreAtributo());\n\t\t\t\t\tgetBeanReporte().getMapaParametros().remove(cadaParametro.getNombreAtributo());\n\t\t\t\t\tif (arreglo.length > 0) {\n\t\t\t\t\t\tList<String> lista = Arrays.asList(arreglo);\n\t\t\t\t\t\tgetBeanReporte().getMapaParametros().put(cadaParametro.getNombreAtributo(), lista);\n\t\t\t\t\t}\n\t\t\t\t} else if(cadaParametro.getTipo().equals(ParametroReporte.Tipo.IMAGEN)) {\n\t\t\t\t\tUploadedFile locImage = (UploadedFile) getBeanReporte().getMapaParametros().get(cadaParametro.getNombreAtributo());\n\t\t\t\t\tif(locImage != null) {\n\t\t\t\t\t\tbyte[] imagen = locImage.getBytes();\n\t\t\t\t\t\tgetBeanReporte().getMapaParametros().remove(cadaParametro.getNombreAtributo());\n\t\t\t\t\t\tgetBeanReporte().getMapaParametros().put(cadaParametro.getNombreAtributo(), imagen);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn getBeanReporte().getMapaParametros();\n\t}", "public static Map createUserViewMap(Map fieldsMap) {\n if (!fieldsMap.isEmpty() && fieldsMap != null) {\n Map userMap = new LinkedHashMap<>();\n\n fieldsMap.forEach((k, v) -> {\n if (!StringUtils.contains((String) k, \"tablename\")) {\n userMap.put(k, v);\n }\n });\n return userMap;\n\n } else {\n return new LinkedHashMap<>();\n }\n }", "@Override\n public boolean isEmpty() {\n return map.isEmpty();\n }", "public HashMap<List<Integer>, List<Integer>> genEmptyPolicy() {\n\t\tHashMap<List<Integer>, List<Integer>> emptyPolicy = new \n\t\t\t\tHashMap<List<Integer>, List<Integer>>();\n\t\tif(ventureManager.getNumVentures() == 2) {\n\t\t\tList<Integer> nil = new ArrayList<Integer>();\n\t\t\tnil.add(0);\n\t\t\tnil.add(0);\n\t\t\tfor(List<Integer> s : states) \n\t\t\t\temptyPolicy.put(s, nil);\n\t\t}\n\t\telse {\n\t\t\tList<Integer> nil = new ArrayList<Integer>();\n\t\t\tnil.add(0);\n\t\t\tnil.add(0);\n\t\t\tnil.add(0);\n\t\t\tfor(List<Integer> s: states)\n\t\t\t\temptyPolicy.put(s, nil);\n\t\t}\n\t\treturn emptyPolicy;\n\t}", "private HashMap<String, Integer> getDataBaseCountryPop(Connection conn) {\n // SQL SELECT Query\n String SELECT_COUNTRY_POPULATION = \"SELECT cy.CountryName, SUM(c.Population) as TotalPopulation FROM City c\\n\" +\n \"JOIN State s ON c.StateId = s.StateId\\n\" +\n \"JOIN Country cy ON s.CountryId = cy.CountryId\\n\" +\n \"GROUP BY cy.CountryName\";\n\n HashMap<String, Integer> countryPopMap = new HashMap<String, Integer>();\n\n PreparedStatement statement = null;\n\n try {\n statement = conn.prepareStatement(SELECT_COUNTRY_POPULATION);\n ResultSet rs = statement.executeQuery();\n while (rs.next()) {\n String countryName = rs.getString(\"CountryName\");\n int population = rs.getInt(\"TotalPopulation\");\n countryPopMap.put(countryName, population);\n }\n conn.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n// for (String s : countryPopMap.keySet()) {\n// System.out.println(s + \" \" + countryPopMap.get(s));\n// }\n// System.out.println(\"Number of Countries in DB: \" + countryPopMap.size());\n\n return countryPopMap;\n }", "public static HashMap<String, String> getCountAllEligibilityAndApplianceStatus() {\n\t\tHashMap<String, String> map = new HashMap<>();\r\n\t\tConnection connection = Connect.getConnection();\r\n\t\ttry {\r\n\t\t\tResultSet resultSet = connection.prepareCall(\r\n\t\t\t\t\t\"{CALL count_all_eligibility_and_appliance_status}\")\r\n\t\t\t\t\t.executeQuery();\r\n\t\t\tint accepted = 0;\r\n\t\t\tint rejected = 0;\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tString status = resultSet.getString(\"t.status\");\r\n\t\t\t\tif (status != null && !status.isEmpty()) {\r\n\t\t\t\t\tif (status.equals(\"appliance_status\")) {\r\n\r\n\t\t\t\t\t\tif (resultSet.getInt(\"status\") == 0) {\r\n\t\t\t\t\t\t\tmap.put(\"Inactive\", resultSet.getInt(1) + \"\");\r\n\t\t\t\t\t\t} else if (resultSet.getInt(\"status\") == 1) {\r\n\t\t\t\t\t\t\tmap.put(\"Active\", resultSet.getInt(1) + \"\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (status.equals(\"eligibility_status\")) {\r\n\t\t\t\t\t\tif (resultSet.getInt(\"status\") == 0) {\r\n\t\t\t\t\t\t\tmap.put(\"Applied\", resultSet.getInt(1) + \"\");\r\n\t\t\t\t\t\t} else if (resultSet.getInt(\"status\") == 1\r\n\t\t\t\t\t\t\t\t|| resultSet.getInt(\"status\") == 6) {\r\n\t\t\t\t\t\t\taccepted += resultSet.getInt(1);\r\n\t\t\t\t\t\t\t// System.out.println(\"Current Accepted\r\n\t\t\t\t\t\t\t// \"+resultSet.getInt(1));\r\n\t\t\t\t\t\t\tSystem.out.println(\"Accepted : \" + accepted);\r\n\t\t\t\t\t\t\tmap.put(\"Accepted\", accepted + \"\");\r\n\t\t\t\t\t\t} else if (resultSet.getInt(\"status\") == 2\r\n\t\t\t\t\t\t\t\t|| resultSet.getInt(\"status\") == 4) {\r\n\t\t\t\t\t\t\trejected += resultSet.getInt(1);\r\n\t\t\t\t\t\t\t// System.out.println(\"Rejected : \"+rejected);\r\n\t\t\t\t\t\t\tmap.put(\"Rejected\", rejected + \"\");\r\n\t\t\t\t\t\t} else if (resultSet.getInt(\"status\") == 3) {\r\n\t\t\t\t\t\t\tmap.put(\"NotInterested\", resultSet.getInt(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\t// maps.add(map);\r\n\r\n\t\t\t}\r\n\t\t\tconnection.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn map;\r\n\t}", "Map getIDPSTDDataMap();", "public Map<Long, GrupoAtencion> getGruposAtentionGenerados(Integer accion, Long numeroProgramacion) {\n\t\tlogger.info(\" ### getGruposAtentionGenerados ### \");\n\t\t\n\t\tMap<Long, GrupoAtencion> mpGrupos = Collections.EMPTY_MAP;\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tif(accion!=null && accion.equals(ConstantBusiness.ACCION_NUEVA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos temporales \");\n\t\t\t\t\n\t\t\t\tmpGrupos.putAll(mpGruposCached);\n\t\t\t\t\n\t\t\t}else if(accion!=null && accion.equals(ConstantBusiness.ACCION_EDITA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos bd \");\n\t\t\t\tList<GrupoAtencion> grupoAtencionLíst = grupoAtencionDao.getGruposAtencionPorProgramacion(numeroProgramacion);\n\t\t\t\tList<GrupoAtencion> _grupoAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\tList<GrupoAtencionDetalle> _grupoDetalleAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (GrupoAtencion g : grupoAtencionLíst) {\n\t\t\t\t\tlogger.info(\" grupo generado :\"+g.getDescripcion());\n\t\t\t\t\t//clonando grupos \n\t\t\t\t\tlogger.info(\" ### clonando grupo : \"+g.getNumeroGrupoAtencion());\n\t\t\t\t\tGrupoAtencion grupoAtencion = (GrupoAtencion) g.clone();\n\t\t\t\t\tfor(GrupoAtencionDetalle d: g.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogger.info(\"### numero de solicitud :\"+d.getSolicitudServicio().getNumeroSolicitud());\n\t\t\t\t\t\t\n\t\t\t\t\t\t_grupoDetalleAtencionLíst.add((GrupoAtencionDetalle)d.clone());\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t_grupoAtencionLíst.add(grupoAtencion);\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\" mapeando objetos clonados \");\n\t\t\t\tfor (GrupoAtencion g : _grupoAtencionLíst) {\n\t\t\t\t\tg.setGrupoAtencionDetalles(new ArrayList<GrupoAtencionDetalle>());\n\t\t\t\t\tfor (GrupoAtencionDetalle d : _grupoDetalleAtencionLíst) {\n\t\t\t\t\t\tif( d.getGrupoAtencion()!=null && \n\t\t\t\t\t\t\t\td.getGrupoAtencion().getNumeroGrupoAtencion()==g.getNumeroGrupoAtencion()){\n\t\t\t\t\t\t\tg.getGrupoAtencionDetalles().add(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmpGrupos.put(g.getNumeroGrupoAtencion(), g);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tthis.mpGruposCached = mpGrupos;\n\t\t\t\t\n\t\t\t\tmostrarGrupos(mpGrupos);\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn mpGrupos;\n\t}", "private void doAPITest(Map<Object,Object> table) {\n\t\tint size = table.size();\n\t\tObject key, value;\n\t\t\n\t\tMap<Object,Object> clone = cloneMap(table);\n\t\t\n\t\t// retrieve values using values()\n\t\tCollection<Object> values = table.values();\n\t\t\n\t\t// retrieve keys using keySet()\n\t\tSet<Object> keySet = table.keySet();\t\t\n\t\tObject[] keySetArray = keySet.toArray();\n\t\t\n\t\tint step = 1 + random.nextInt(5);\n\t\t\n\t\tfor (int i=0; i<keySetArray.length; i=i+step)\n\t\t{\n\t\t\tkey = keySetArray[i];\n\t\t\t// retrieve value\n\t\t\tvalue = table.get(key);\n\t\t\t\n\t\t\t// assert value is in the table\n\t\t\tassertTrue(table.containsValue(value));\n\t\t\t/*\n\t\t\t * assertTrue(table.contains(value)); // Removed as not supported by the Map interface, and identical to containsValue\n\t\t\t * if value is a wrapped key then check it's equal \n\t\t\t * to the key \n\t\t\t */\n\t\t\tif (value instanceof CustomValue)\n\t\t\t{\n\t\t\t\tassertEquals(key, ((CustomValue)value).key);\n\t\t\t}\n\t\t\t\n\t\t\t// count how many occurrences of this value there are\n\t\t\tint occurrences = numberOccurrences(values, value);\n\t\t\t\n\t\t\t// find the Map.Entry\n\t\t\tSet<Map.Entry<Object, Object>> entrySet = table.entrySet();\n\t\t\tIterator<Map.Entry<Object, Object>> entrySetIterator = entrySet.iterator();\n\t\t\tMap.Entry<Object,Object> entry = null;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tentry = entrySetIterator.next();\n\t\t\t} while (!entry.getKey().equals(key));\n\t\t\t\n\t\t\t// remove from table in different ways\n\t\t\tswitch (i % 3)\n\t\t\t{\n\t\t\tcase 0:\n\t\t\t\ttable.remove(key);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tkeySet.remove(key);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\tentrySet.remove(entry);\n\t\t\t}\n\t\t\t\n\t\t\t// assert key is no longer in the table\n\t\t\tassertFalse(table.containsKey(key));\n\t\t\t// assert key is no longer in the keyset\n\t\t\tassertFalse(keySet.contains(key));\n\t\t\t// assert key is no longer in the entrySet\n\t\t\tassertFalse(entrySet.contains(entry));\n\t\t\t\n\t\t\t// assert that there's one fewer of this value in the hashtable\n\t\t\tassertEquals(occurrences, numberOccurrences(values, value) + 1);\n\t\t\t\n\t\t\t// re-insert key\n\t\t\ttable.put(key, value);\n\t\t\t\n\t\t\t// assert key is in the table\n\t\t\tassertTrue(table.containsKey(key));\n\t\t\t// assert key is in the keyset\n\t\t\tassertTrue(keySet.contains(key));\n\t\t\t// assert EntrySet is same size\n\t\t\tassertEquals(size, entrySet.size());\n\t\t}\n\t\t\n\t\t// test hashtable is the same size\n\t\tassertEquals(size, table.size());\n\t\t\n\t\t// test keySet is expected size\n\t\tassertEquals(size, keySet.size());\n\t\t\n\t\t// retrieve keys using keys()\n\t\tIterator<?> keys = table.keySet().iterator();\n\t\t\n\t\t// remove a subset of elements from the table. store in a map\n\t\tint counter = table.size() / 4;\n\t\tMap<Object,Object> map = new HashMap<Object, Object>();\n\t\twhile (keys.hasNext() && counter-- >= 0)\n\t\t{\n\t\t\tkey = keys.next();\n\t\t\tvalue = table.get(key);\n\t\t\tmap.put(key, value);\n\t\t\tkeys.remove(); // removes the most recent retrieved element\n\t\t}\n\t\t// re-add the elements using putAll\n\t\ttable.putAll(map);\n\t\t\n\t\t// test equal to copy\n\t\tassertEquals(clone, table);\n\t\t\n\t\t// clear the copy\n\t\tclone.clear();\n\t\t\n\t\t// assert size of clone is zero\n\t\tassertEquals(0, clone.size());\n\t\t\n\t\t// assert size of original is the same\n\t\tassertEquals(size, table.size());\n\t}", "public static void main(String[] args) {\n\n Map<String, Integer> stuId = new HashMap<String, Integer>(5);\n stuId.put(\"Marcon\", 132);\n stuId.put(\"Jems\", 125);\n stuId.put(\"Caleb\", null);\n System.out.println(\"Original Map: \" + stuId);\n stuId.put(\"jery\", 231);\n stuId.remove(\"Jems\");\n System.out.println(\"Updated Map: \" + stuId);\n System.out.println(stuId.keySet());\n System.out.println(stuId.values());\n\n String userName = \"codebind\";\n String password = \"fiker\";\n\n String url = \"jdbc;mysql;//localhost;3306/employees?useSSL=false\";\n String query = \"select * from students.students_detail;\";\n\n try {\n Class.forName(\"com.mysql.jdbc.Drive\");\n } catch (ClassNotFoundException e) {\n System.out.println(\"check driver\");\n e.printStackTrace();\n\n }\n }", "@Override\n\tpublic Map<String, String> toSqlMap() {\n\t\treturn null;\n\t}", "public static Map<String, Integer> getK8sObjPodsContDetails(int envId) {\n\t\tfinal java.sql.Date todayDate = new java.sql.Date(Calendar.getInstance().getTimeInMillis());;\n\t\tSession session = HibernateConfig.getSessionFactory().getCurrentSession();\n\t\tTransaction txn = session.beginTransaction();\n\t\tQuery numApisQuery = session.createQuery(HQLConstants.QUERY_GET_K8S_OBJECT_PODS);\n\t\tnumApisQuery.setParameter(\"environmentId\", envId);\n\t\tnumApisQuery.setParameter(\"statusDate\", todayDate);\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Object[]> objPodsList = numApisQuery.list();\n\t\tMap<String, Integer> mapObjPods = new HashMap<String, Integer>();\n\t\tfor (Object[] tRow : objPodsList) {\n\t\t\tmapObjPods.put((String)tRow[0], ((Integer)tRow[1]));\n\t\t}\n\t\ttxn.commit();\n\t\treturn mapObjPods;\n\t}", "public Map<String, List<Map<String, String>>> populateInnerPagesDataStructures(Map<Object, Object> map,XLS_Reader current_Suite_TC_Xls) {\n\n\t\tMap<String, List<Map<String, String>>> temp_Structure_of_InnerPagesMaps = new HashMap<>();\n\t\tList<String> innerDataIds = null;\n\t\tString sheet_name = null;\n\t\tint count;\n\t\t// Map<List<String>,List<List<String>>> map_of_list= new HashMap<>();\n\t\tinnerDataIds = new ArrayList<>();\n\t\tfor (Object key : map.keySet()) {\n\t\t\tif (((String) map.get(key)).contains(\";\")) {\n\t\t\t\tcount=0;\n\t\t\t\tString dataIds[] = ((String) map.get(key)).split(\";\");\n\t\t\t\tfor (String dataId : dataIds) {\n\t\t\t\t\tinnerDataIds.add(dataId);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tString[] sheet_tokens = dataIds[0].split(\"_\");\n\t\t\t\tsheet_name = sheet_tokens[0];\n\t\t\t\tcommon.no_of_inner_data_sets.put(sheet_name, count);\n\t\t\t\t\n\t\t\t\t//populateListOfMaps(sheet_name, innerDataIds, current_Suite_TC_Xls);\n\t\t\t\t//Populate list of inner maps data\n\t\t\t\tList<Map<String, String>> list_of_Maps = new ArrayList<>();\n\t\t\t\tMap<String, String> temp_Map = new HashMap<String, String>();\n\t\t\t\tfor (String dataID : innerDataIds) {\n\t\t\t\t\ttemp_Map = TestUtil.getTestDataSetMap_Column_String_Map(current_Suite_TC_Xls, dataID);\n\t\t\t\t\tlist_of_Maps.add(temp_Map);\n\t\t\t\t}\n\t\t\t\ttemp_Structure_of_InnerPagesMaps.put(sheet_name, list_of_Maps);\n\t\t\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tinnerDataIds.clear();\n\t\t}\n\t\t//System.out.println(common.no_of_inner_data_sets);\n\t\treturn temp_Structure_of_InnerPagesMaps;\n\t}", "public Map<MDSKey, byte[]> listKV(MDSKey startId, int limit) {\n byte[] startKey = startId.getKey();\n byte[] stopKey = Bytes.stopKeyForPrefix(startKey);\n\n Scan scan = new Scan(startKey, stopKey);\n Map<MDSKey, byte[]> map = new LinkedHashMap<>();\n try (Scanner scanner = table.scan(scan)) {\n Row next;\n while ((limit > 0) && (next = scanner.next()) != null) {\n MDSKey key = new MDSKey(next.getRow());\n byte[] value = next.get(COLUMN);\n if (value == null) {\n continue;\n }\n\n map.put(key, value);\n limit--;\n }\n }\n return map;\n }", "private Map<String,Double> getPromedioHabilidades(Cuadrilla cuadrilla){\n\t\tSystem.out.println(\"#### getPromedioHabilidades ######\");\n\t\tdouble proprod= 0, protrae= 0, prodorm = 0, prodcaa = 0;\n\t\tint cantper = 0;\n\t\tfor (CuadrillasDetalle cd : cuadrilla.getCuadrillasDetalles()) {\n\t\t\t\n\t\t\tList<TecnicoCompetenciaDetalle> tcds = \tcd.getTecnico().getTecnicoCompetenciaDetalles();\n\t\t\tfor (TecnicoCompetenciaDetalle tcd : tcds) {\n\t\t\t\tInteger codigoComp = tcd.getCompetencia().getCodigoCompetencia();\n\t\t\t\tswitch(codigoComp){\n\t\t\t\t\tcase COMPETENCIA_PRODUCTIVIDAD:\n\t\t\t\t\t\tproprod = proprod+ tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_TRABAJO_EQUIPO:\n\t\t\t\t\t\tprotrae = protrae + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_ORIENTACION_METAS:\n\t\t\t\t\t\tprodorm = prodorm + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_CALIDAD_ATENCION:\n\t\t\t\t\t\tprodcaa = prodcaa +tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcantper++;\t\t\t\n\t\t}\n\t\t\t\t\t\n\t\t// promedio de las competencias de los tenicos de cada cuadrilla\n\t\tproprod = proprod/cantper; \n\t\tprotrae = protrae/cantper;\n\t\tprodorm = prodorm/cantper;\n\t\tprodcaa = prodcaa/cantper;\n\n\t\tMap<String, Double> mpproms = new LinkedHashMap<String,Double>();\n\t\tmpproms.put(\"proprod\", proprod);\n\t\tmpproms.put(\"protrae\", protrae);\n\t\tmpproms.put(\"prodorm\", prodorm);\n\t\tmpproms.put(\"prodcaa\", prodcaa);\n\t\n\t\treturn mpproms;\n\t\t\n\t}", "private Map settingAkhir(String startDate, String endDate, int kondisi, int judulId, int pilihView) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{\n\t\tMap map = new HashMap();\n\t\t//startDate = (String) map.get(\"startDate\");\n\t\t//endDate = (String) map.get(\"endDate\");\n\t\t//int kondisi = (Integer)map.get(\"kondisi\");\n\t\t//Date mtu_tgl_trans = (Date) ((Map) ((List) map.get(\"view\")).get(0)).get(\"MU_TGL_TRANS\");\n\n\t\tList daftar;\n\t\t//map.put(\"daftar\", props.getProperty(\"subreport.uw.list_pengiriman_polis\") + \".jasper\");\n\t\tdaftar = this.uwDao.selectListPengirimanPolis(startDate, endDate, kondisi);\n\n\t\tlogger.info(\"Daftar = \" + map.get(\"daftar\"));\n\t\tmap.put(\"sdsKirimPolis\", JasperReportsUtils.convertReportData(daftar));\n\t\t//logger.info(\"Daftar = \" + map.get(\"view\"));\n\t\t//map.put(\"sdsKirimPolis\", JasperReportsUtils.convertReportData(view));\n\t\tmap.put(\"subReportDatakeys\", new String[]{\"sdsKirimPolis\"}); \n\t\t//logger.info(\"Daftar = \" + map.get(\"view\"));\n\t\treturn map;\n\t}", "@Test\n\tpublic void checkAllAPICrncyInTable() throws ParseException\n\t{\n\t\t// Table Data\n\t\tMap<String, Object> tableMap = dashboardPage.addRowDataToMap();\n\t\t// API Data\n\t\tresponsePage = new APIResponsePageObject(driver);\n\t\tMap<String, Object> apiMap = responsePage.getRateDataFromAPI();\n\t\t\n\t\t// Map that has key - values missing in tableMap that are in apiMap\n\t\tMap missingCurrenciesInTableMap = new HashMap<>(apiMap);\n\t\tmissingCurrenciesInTableMap.keySet().removeAll(tableMap.keySet());\n\t\tmissingCurrenciesInTableMap.values().removeAll(tableMap.values());\n\t\t\n\t\tif(missingCurrenciesInTableMap.size() > 1)\n\t\t{\n\t\t\terrorMessage = \"Html table is missing \" + missingCurrenciesInTableMap.toString() + \" from API\";\n\t\t\tAssert.fail(errorMessage);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tassertSame(tableMap, apiMap);\n\t\t}\n\t}", "public static Map<String,Profil> filterSelectS(Set<? extends Filter<Profil>> filters) throws SQLException, KasirException{\r\n ResultSet rs;\r\n if(filters == null)\r\n rs = DBSR.takeResultSetByFilterColl(tableName, null, -1, null);\r\n else{\r\n //remove null filters / filters with empty asWhereClause, so BAD_RECORD is only detected if filters = null\r\n //arg filters isn't modified\r\n Set<Filter<Profil>> validFilters = new HashSet<>();\r\n for(Filter<Profil> filter : filters){\r\n if(filter != null && !\"\".equals(filter.asWhereClause()))\r\n validFilters.add(filter);\r\n }\r\n rs = DBSR.takeResultSetByFilterColl(tableName, null, -1, validFilters);\r\n } \r\n\r\n Map<String,Profil> noIndukProfil = new HashMap<>(DBSR.rowCountRS(rs));\r\n while(rs.next()){\r\n Profil p = Profil.fromResultSet(rs);\r\n noIndukProfil.put(p.noInduk, p);\r\n }\r\n\r\n return noIndukProfil;\r\n }", "public boolean isEmpty(){\n\t\tfor(int i = 0; i < hashMap.length; i++){\n\t\t\tif(hashMap[i]!=null){\n\t\t\t\treturn(false);\n\t\t\t}\n\t\t}\n\t\treturn(true);\n\t}", "@Override\r\n public List<Map<String, Object>> findAllRecords(String tableName, int upperLimit) throws SQLException {\r\n List<Map<String, Object>> records = new ArrayList();\r\n String sqlQuery = (upperLimit > 0) ? \"SELECT * FROM \" + tableName + \" LIMIT \" + upperLimit : \"SELECT * FROM \" + tableName;\r\n if (connection != null) {\r\n\r\n Statement sqlStatement = connection.createStatement();\r\n ResultSet rs = sqlStatement.executeQuery(sqlQuery);\r\n ResultSetMetaData rsmd = rs.getMetaData();\r\n int columnCount = rsmd.getColumnCount();\r\n while (rs.next()) {\r\n Map<String, Object> record = new HashMap();\r\n for (int i = 1; i <= columnCount; i++) {\r\n record.put(rsmd.getColumnName(i), rs.getObject(i));\r\n }\r\n records.add(record);\r\n }\r\n } else {\r\n System.out.println(\"No connection could be established\");\r\n }\r\n return records;\r\n }", "private Map<String, Object> dealWithMap(Map<String, Object> paramMap) {\n\t\tSet<String> set = new HashSet<String>();\n\t\tfor (String colName : defaultValColArr) {\n\t\t\tset.add(colName);\n\t\t}\n\t\tfor (String colName : pkColArr) {\n\t\t\tset.add(colName);\n\t\t}\n\t\tIterator<String> iterator = set.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tString colName = iterator.next();\n\t\t\tif(paramMap.get(colName) == null) {\n\t\t\t\tparamMap.remove(colName);\n\t\t\t}\n\t\t}\n\t\treturn paramMap;\n\t}", "@Override\n\tpublic int size() {\n\t\tint tamano = 0;\n\t\tint i = 0;\n\t\tIterator it = tabla.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tit.next();\n\t\t\ttamano += tabla.get(i).keySet().size();\n\t\t\ti++;\n\t\t}\n\t\treturn tamano;\n\t}", "public abstract java.util.Map<java.lang.String, java.lang.Integer> systemicEventIncidenceCountMap();", "Map<String,Object> getClaimReserveInitValues(Map<String, Object> pars) throws SQLException;", "void populateMaps(int tableSize, PersistentCorfuTable<String, Long> table1, PersistentCorfuTable<String, Long> table2) {\n for (int i = 0; i < tableSize; i++) {\n try {\n table1.insert(String.valueOf(i), (long) i);\n table2.insert(String.valueOf(i), (long) 0);\n } catch (TrimmedException te) {\n // shouldn't happen\n te.printStackTrace();\n throw te;\n }\n }\n }", "public HashMap<String, Integer> makeEmpty() {\r\n\t\tHashMap<String, Integer> newMap = new HashMap<>();\r\n\t\tnewMap.put(new Gloom(\"Gloom\", null, 30, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Golbat(\"Golbat\", null, 28, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Growlithe(\"Growlithe\", null, 26, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Jigglypuff(\"Jigglypuff\", null, 24, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Persian(\"Persian\", null, 22, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Pidgeotto(\"Pidgeotto\", null, 20, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Pikachu(\"Pikachu\", null, 18, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Seaking(\"Seaking\", null, 16, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Staryu(\"Staryu\", null, 14, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Tentacool(\"Tentacool\", null, 12, 25, 20, 10).getName(), 0);\r\n\t\tnewMap.put(new Zubat(\"Zubat\", null, 10, 25, 20, 10).getName(), 0);\r\n\t\treturn newMap;\r\n\t}", "private HashMap getTableRow(int rowNum)\r\n {\r\n HashMap hashRow = new HashMap() ;\r\n int colTotal = codeTableModel.getColumnCount()-1;\r\n for (int colCount=0; colCount <= codeTableModel.getColumnCount()-1; colCount++)\r\n { // for each column u will build a hashmap\r\n// if (colCount == 1 )\r\n// {//sponsor name is not in update sp.\r\n// continue;\r\n// }\r\n TableColumn column = codeTableColumnModel.getColumn(colCount) ;\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n Object val = null ;\r\n // the whole idea of setting up the columnBean as the identifier is that u get to know\r\n // all abt the structure details of the column, so u can create appropriate type of object\r\n // and stick it in to the hashMap\r\n if (columnBean.getDataType().equals(\"NUMBER\"))\r\n {\r\n if (codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount) == null\r\n ||(codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount).equals(\"\")))\r\n {\r\n val = null ; //new Integer(0)\r\n }\r\n else\r\n {\r\n val = codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount);\r\n if (val instanceof ComboBoxBean)\r\n {\r\n if (((ComboBoxBean)val).getCode().equals(\"\"))// user deleted selection\r\n val = null;\r\n else\r\n val = new Integer(((ComboBoxBean)val).getCode().toString());\r\n }\r\n else\r\n {\r\n val = new Integer(val.toString()) ;\r\n }\r\n }\r\n }\r\n\r\n if (columnBean.getDataType().equals(\"VARCHAR2\"))\r\n {\r\n if (codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount)==null)\r\n {\r\n val = \"\";\r\n }\r\n else\r\n {\r\n val = codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount).toString() ;\r\n }\r\n }\r\n\r\n if (columnBean.getDataType().equals(\"DATE\"))\r\n {\r\n //coeusdev-568 start\r\n //Date today = new Date();\r\n //coeusdev-568 end\r\n if (codeTableModel.getValueAt(sorter.getIndexForRow(rowNum), codeTableModel.getColumnCount()-1).equals(\"I\")) // if itz an insert\r\n { //AV_ & AW_ will be the same for insert\r\n //coeusdev-568 start\r\n //val = new java.sql.Timestamp(today.getTime());\r\n val = CoeusUtils.getDBTimeStamp();\r\n //coeusdev-568 end\r\n }\r\n else\r\n { // for update\r\n // there will be only two dates in any table one AV_UPDATE_TIMESTAMP and the other one AW_UPDATE_TIMESTAMP\r\n if (columnBean.getQualifier().equals(\"VALUE\"))\r\n { //AV_...\r\n //coeusdev-568 start\r\n //val = new java.sql.Timestamp(today.getTime());\r\n val = CoeusUtils.getDBTimeStamp();\r\n //coeusdev-568 end\r\n }\r\n else\r\n { //AW_...\r\n val = java.sql.Timestamp.valueOf(codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount).toString()) ;\r\n }\r\n }\r\n }\r\n\r\n hashRow.put(columnBean.getColIdentifier(), val) ;\r\n } //end for\r\n return hashRow;\r\n }", "@Override\r\n\tpublic Map<String, Object> namaProdi(Integer id_univ, Integer id_fakultas, Integer id_prodi) {\n\t\treturn fakultas.namaProdi(id_univ, id_fakultas, id_prodi);\r\n\t}", "public Map<Long, ItaAttendance> findMap(PageContext page,\n\t\t\tItaAttendance condition) throws Throwable {\n\t\treturn null;\n\t}", "Map<String, Object> checkSize(Map<String, Object> rowMap) {\r\n\t\tbytesUsed += getRowSizeBytes(rowMap);\r\n\t\tif(bytesUsed > maxBytes){\r\n\t\t\tthrow new IllegalArgumentException(\"The results of this query exceeded the maximum number of allowable bytes: \"+maxBytes+\". Please try the query again with a smaller page size or limit the columns returned in the select clause.\");\r\n\t\t}\r\n\t\treturn rowMap;\r\n\t}", "public abstract Map<Integer, Station> getStationsCurrentlyWithSmSt() throws DataAccessException;", "public Map<String,Object> getGameByGameIden(String gameIden) {\n\t\tif (StringUtils.isEmpty(gameIden))\n return null;\n Map hm = new HashMap();\n String sql = \"select * from t_cgiser_game where STATE = 1 and GAMEIDEN=?\";\n String[] para = new String[1];\n para[0] = StringUtils.trim(gameIden);\n hm = userJdbcTemplate.queryForMap(sql, para);\n return hm;\n\t}", "public Map<String, String> getInformations()\n {\n\n if (userProfile == null)\n {\n return EMPTY_STRING_TO_STRING_MAP;\n }\n\n Map<String, String> infoMap = userProfile.getUserInfoMap();\n Map<String, String> filteredMap = new HashMap<String, String>();\n\n for (String key : infoMap.keySet())\n {\n if (JSR_168_P3P.contains(key))\n {\n filteredMap.put(key, infoMap.get(key));\n }\n }\n\n return Collections.unmodifiableMap(filteredMap);\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn map.isEmpty();\n\t}", "@Override\n\tpublic List<DrvUserinfo> findDrvUserInfo(String sqlId, Map<String ,Object> map) {\n\t\ttry {\n\t\t\treturn (List<DrvUserinfo>) baseDaoSupport.findForList(sqlId, map);\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\treturn null;\n\t}", "public java.util.Map<java.lang.String, java.util.ArrayList> m17238b() {\n /*\n r18 = this;\n r3 = new java.util.HashMap;\n r3.<init>();\n r4 = new java.util.ArrayList;\n r4.<init>();\n r5 = new java.util.ArrayList;\n r5.<init>();\n r0 = r18;\n r2 = r0.f20995e;\n r2.lock();\n r6 = r18.m17234d();\n r2 = \"select * from result limit 0,500\";\n r7 = 0;\n r7 = r6.rawQuery(r2, r7);\n L_0x0022:\n r2 = r7.moveToNext();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n if (r2 == 0) goto L_0x0106;\n L_0x0028:\n r2 = new org.json.JSONObject;\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r2.<init>();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r8 = \"_id\";\n r8 = r7.getColumnIndex(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r8 = r7.getInt(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"time\";\n r9 = r7.getColumnIndex(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = r7.getString(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r10 = \"code\";\n r10 = r7.getColumnIndex(r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r10 = r7.getInt(r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r11 = \"cmd_type\";\n r11 = r7.getColumnIndex(r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r11 = r7.getInt(r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r12 = \"cmd_id\";\n r12 = r7.getColumnIndex(r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r12 = r7.getInt(r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r13 = \"result\";\n r13 = r7.getColumnIndex(r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r13 = r7.getString(r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r14 = \"time\";\n r16 = java.lang.Long.parseLong(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r0 = r16;\n r2.put(r14, r0);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"error_code\";\n r2.put(r9, r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n if (r10 != 0) goto L_0x0095;\n L_0x0083:\n r9 = \"cmd_type\";\n r2.put(r9, r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"cmd_id\";\n r2.put(r9, r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"voice_to_text_result\";\n r2.put(r9, r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n L_0x0095:\n r8 = java.lang.Integer.valueOf(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r5.add(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r4.add(r2);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n goto L_0x0022;\n L_0x00a0:\n r2 = move-exception;\n r2.printStackTrace();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n goto L_0x0022;\n L_0x00a6:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n L_0x00d2:\n return r3;\n L_0x00d3:\n r2 = move-exception;\n r2.printStackTrace();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n goto L_0x0022;\n L_0x00d9:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x0106:\n r2 = \"listId\";\n r3.put(r2, r5);\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r2 = \"list\";\n r3.put(r2, r4);\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x0120:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x014d:\n r2 = move-exception;\n r7.close();\n r6.close();\n r0 = r18;\n r3 = r0.f20995e;\n r3.unlock();\n throw r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.baidu.tts.e.c.b():java.util.Map<java.lang.String, java.util.ArrayList>\");\n }", "@Override\n\tpublic List<Map<String, Object>> queryuseinfo(Employee bi, String name, String mobile, Integer start,\n\t\t\tInteger limit) throws Exception {\n\t\tStringBuffer hql = new StringBuffer(\"select u from UserInfo u where u.role = 0 and u.state = 0\");\n\t\thql=conditionuserinfo(hql,bi, name,mobile);\n\t\thql.append(\" order by u.createtime desc\");\n\t\tList<Object> lst = databaseHelper.getResultListByHql(hql.toString(),start,limit);\n\t\tList<Map<String,Object>> lstMap = new ArrayList<Map<String,Object>>();\n\t\t\n\t\tfor (Object obj : lst) {\n\t\t\tUserInfo u = (UserInfo) obj;\n\t\t\t\n\t\t\tMap<String,Object> map = new HashMap<String,Object>();\n\t\t\tmap.put(\"id\", u.getId());\n\t\t\tmap.put(\"name\", u.getNickname());\n\t\t\tmap.put(\"mobile\", u.getMobile());\n\t\t\tmap.put(\"time\", u.getCreatetime().toString());\n\t\t\tmap.put(\"balance\", u.getBalance());\n\t\t\tmap.put(\"level\", u.getLevel());\n\t\t\t\n\t\t\t//查询游戏次数\n\t\t\tStringBuffer querytotalgame = new StringBuffer(\"select count(mu.id) from MachineUserMark mu where mu.fuserinfoid = \")\n\t\t\t\t\t.append(u.getId()).append(\" and mu.type = 2\");\n\t\t\tList muList = databaseHelper.getResultListByHql(querytotalgame.toString());\n\t\t\tif(muList.size()>0){\n\t\t\tmap.put(\"totalgame\", Integer.parseInt(muList.get(0).toString()));\n\t\t\t}else{\n\t\t\t\tmap.put(\"totalgame\", \"0\");\n\t\t\t}\n\t\t\tlstMap.add(map);\n\t\t}\n\t\t\n\t\treturn lstMap;\n\t}", "public Map<String, String> getTable() {\n return map; // TODO\n }", "@Override\n\tpublic Iterable<Map<String, Object>> findAll(Iterable<Long> arg0) {\n\t\treturn null;\n\t}", "protected Map getProfileMap() {\n \t\tif (profiles != null) {\n \t\t\tMap result = (Map) profiles.get();\n \t\t\tif (result != null)\n \t\t\t\treturn result;\n \t\t}\n \t\tMap result = restore();\n \t\tif (result == null)\n \t\t\tresult = new LinkedHashMap(8);\n \t\tprofiles = new SoftReference(result);\n \t\treturn result;\n \t}", "private HashMap<String, ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData) {\n logger.trace(\"BEGIN HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)\");\n HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>();\n for (TSDBData obj : tsdbData) {\n ArrayList<String> columns = obj.getColumns();\n ArrayList<ArrayList<Object>> points = obj.getPoints();\n int clientidIndex = -1;\n int instanceidIndex = -1;\n for (int i = 0; i < columns.size(); i++) {\n if (columns.get(i).equals(\"clientId\"))\n clientidIndex = i;\n else if (columns.get(i).equals(\"instanceId\"))\n instanceidIndex = i;\n }\n for (int i = 0; i < points.size(); i++) {\n String clientId = points.get(i).get(clientidIndex).toString();\n String InstanceId = points.get(i).get(instanceidIndex).toString();\n if (!(map.containsKey(clientId))) {\n map.put(clientId, new ArrayList<String>());\n if (!(map.get(clientId).contains(InstanceId))) {\n map.get(clientId).add(InstanceId);\n }\n } else {\n if (!(map.get(clientId).contains(InstanceId))) {\n map.get(clientId).add(InstanceId);\n }\n\n }\n }\n }\n logger.trace(\"END HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)\");\n return map;\n }", "Map getIDPEXDataMap();", "public ArrayList<HashMap<String, String>> retrieve(String tableName) {\n\n //GET Qualifiing Rows from DB\n select(tableName);\n\n return this.processRetrieve();\n }", "List<Map<String, Object>> getAllItems(String tableName);", "@Override\r\n\tpublic Map<String, Object> returnData(Map<String, Object> map,Model model, HttpServletRequest request) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<?> queryExists(Map<String, Object> entityMap)\n\t\t\tthrows DataAccessException {\n\t\treturn null;\n\t}", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();", "boolean hasMapID();" ]
[ "0.5371116", "0.53335226", "0.51053214", "0.5022138", "0.50169736", "0.50048953", "0.5003408", "0.49819106", "0.49686426", "0.4964206", "0.49465245", "0.49402326", "0.49139062", "0.4891814", "0.48498073", "0.484783", "0.48372522", "0.48310068", "0.48180345", "0.47929236", "0.4789824", "0.47759074", "0.47653848", "0.47556612", "0.47459888", "0.4745959", "0.4742987", "0.47422525", "0.47367024", "0.47180346", "0.47013095", "0.4697688", "0.46779358", "0.4677395", "0.46760607", "0.4671442", "0.4669888", "0.4663844", "0.4656929", "0.46494853", "0.4641736", "0.46306467", "0.46293932", "0.46260053", "0.46190515", "0.4617817", "0.4613774", "0.46131718", "0.46117827", "0.4609184", "0.46091446", "0.4608824", "0.4599549", "0.45974115", "0.45970884", "0.4595367", "0.4565338", "0.45608398", "0.4556161", "0.45543528", "0.454993", "0.45460892", "0.45436782", "0.4541455", "0.45396677", "0.45341387", "0.45324543", "0.45315582", "0.45297417", "0.4527694", "0.45239022", "0.45185938", "0.4508378", "0.45052007", "0.4504854", "0.45047235", "0.4500516", "0.44980174", "0.4497666", "0.44900542", "0.44894886", "0.44832793", "0.44784823", "0.4472453", "0.4467959", "0.44609004", "0.44566822", "0.44540754", "0.4447763", "0.44445932", "0.4441238", "0.44341433", "0.44251525", "0.44238064", "0.44235015", "0.44235015", "0.44235015", "0.44235015", "0.44235015", "0.44235015" ]
0.67492276
0